Skip to content

Instantly share code, notes, and snippets.

View darrencauthon's full-sized avatar

Darren Cauthon darrencauthon

View GitHub Profile
##########################################
# To run:
# curl -sSL https://gist.githubusercontent.com/sirkkalap/e87cd580a47b180a7d32/raw/d9c9ebae4f5cf64eed4676e8aedac265b5a51bfa/Install-Docker-on-Linux-Mint.sh | bash -x
##########################################
# Check that HTTPS transport is available to APT
if [ ! -e /usr/lib/apt/methods/https ]; then
sudo apt-get update
sudo apt-get install -y apt-transport-https
fi
@darrencauthon
darrencauthon / AModel.cs
Last active June 3, 2016 04:56 — forked from srakowski/AModel.cs
Example of Dynamic Proxy ViewModel in C#?
using System;
namespace VMSandbox
{
class AModel
{
public DateTime Date { get; set; } = DateTime.UtcNow;
public int MyLifeForTheCodeDownloads { get; set; } = Int32.MaxValue;
}
@darrencauthon
darrencauthon / scroll.ps
Created December 10, 2015 19:40 — forked from alanstevens/scroll.ps
Mac scrolling on windows from powershell
Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 1 }
@darrencauthon
darrencauthon / install-17.0.sh
Created August 28, 2014 03:41 — forked from bryanhunter/install-r14b03.sh
Installed on Ubuntu 12.04, Erlang 17.0
apt-get -y install build-essential m4 libncurses5-dev libssh-dev unixodbc-dev libgmp3-dev libwxgtk2.8-dev libglu1-mesa-dev fop xsltproc default-jdk
apt-get -y install make
apt-get -y install libncurses5-dev
mkdir -p /src/erlang
cd /src/erlang
wget http://www.erlang.org/download/otp_src_17.0.tar.gz
tar -xvzf otp_src_17.0.tar.gz
chmod -R 777 otp_src_17.0
cd otp_src_17.0
./configure
@darrencauthon
darrencauthon / public_setters.rb
Last active August 29, 2015 13:59 — forked from djbender/public_setters.rb
public setters
def public_setters
public_methods.select { |m| m =~ /=$/ }
.reject { |m| %i(== === !=).include? m }
end
start = Date.today
stop = Date.today + 7
(start..stop).each { |x| puts x }
%h2 Registrations
.row{:"ng-controller" => "RegistrationsCtrl"}
.span6
%ul.players
%li{:"ng-repeat" => "person in registrations"}
{{person.name}}
.span6
.player-info
@darrencauthon
darrencauthon / CastleDictionaryAdapterExample.cs
Created December 11, 2012 15:52 — forked from BenHall/CastleDictionaryAdapterExample.cs
Castle Dictionary Adapter Example
using System;
using System.Configuration;
using Castle.Components.DictionaryAdapter;
using Castle.MicroKernel.Registration;
using Castle.Windsor;
using Rhino.Mocks;
namespace CastleDictionaryAdapterExample
{
class Program
@darrencauthon
darrencauthon / to_range.rb
Created November 26, 2012 14:06 — forked from jmeirow/to_range.rb
create array of ranges from array of individual values
class Array
def to_range
highs = self.select { |x| self.include?(x+1) == false }.sort_by { |x| x }
lows = self.select { |x| self.include?(x-1) == false }.sort_by { |x| x }
(0...lows.count).map { |i| lows[i]..highs[i] }
end
end
@darrencauthon
darrencauthon / gist:3709530
Created September 12, 2012 20:09 — forked from jmeirow/gist:3709453
Ruby-style enums
class DataType
[:STRING, :DATE, :UNKNOWN, :NUMERIC].each do |type|
self.instance_eval "def self.#{type};:#{type};end"
end
end