Skip to content

Instantly share code, notes, and snippets.

View cromwellryan's full-sized avatar

Ryan Cromwell cromwellryan

View GitHub Profile
@cromwellryan
cromwellryan / clients.md
Last active December 10, 2015 20:48 — forked from defunkt/clients.md

Gist Clients

Want to create a Gist from your editor, the command line, or the Services menu? Here's how.

Editor Support

@cromwellryan
cromwellryan / .gitignore
Last active December 11, 2015 08:58
batch mixin for underscore
node_modules
[Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.Client")
[Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.Common")
$script:tpcUrl "your tpc"
function Get-ShelvsetUrl {
<#
.Synopsis
Determines the url for a TFS Shelveset.
# https://github.com/guard/guard#readme
guard 'jasmine-node', :jasmine_node_bin => File.expand_path(File.dirname(__FILE__) + "/node_modules/jasmine-node/bin/jasmine-node"), :spec_paths => ['specs'] do
# standard run the spec that changes
watch(%r{^specs/(.+)_spec\.(js\.coffee|js|coffee)})
# run the spec for the file that changed... then all
watch(%r{^(?!specs)(.+)\.(js\.coffee|js|coffee)}) { |m| "specs/#{m[1]}_spec.#{m[2]}" if File.exist?("specs/#{m[1]}_spec.#{m[2]}") }
end
@cromwellryan
cromwellryan / fizzbuzz.coffee
Last active December 14, 2015 13:18
Fizzbuzz done in F# & Coffeescript
firsthund = [1..100]
isfizz = (x) ->
x % 3 == 0
isbuzz = (x) ->
x % 5 == 0
handle = (x) ->
if isfizz(x) and isbuzz(x) then 'fizzbuzz'
@cromwellryan
cromwellryan / 10gen.repo
Last active December 16, 2015 07:28
CentOS-Base yum repo file for azure image
#/etc/yum.repos.d/10gen.repo
[10gen]
name=10gen Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64
gpgcheck=0
enabled=1
You can haz this
@cromwellryan
cromwellryan / Guardfile
Last active December 19, 2015 08:19
Guardfile for elixirc
guard 'shell', :elixirc_bin => "/usr/local/elixirc" do
watch(/(.+\.ex$)/) { |m| `elixirc #{m[0]}` }
end
guard 'shell', :elixir_bin => "/usr/local/elixir" do
watch(/(.+\.exs$)/) { |m| `elixir #{m[0]}` }
end
@cromwellryan
cromwellryan / Person.ex
Created July 4, 2013 13:46
Implementing Enumerable protocol for the Person record not doesn't seem to work. I'm running this setup which recompiles *.ex files to be made available in iex. http://cromwellhaus.com/2013/07/my-learning-elixir-erlang-setup/
defrecord Person, children: []
defimpl Enumerable, for: Person do
def count(person) do
Enum.count(person.children)
end
def member?(person, value) do
person.children.member(value)
end
defmodule Collections do
def range(start, count), do: range([], start, count)
def range(collection, _current, _count) when _count <= 0, do: collection
def range(collection, current, count) when count > 0, do: collection ++ [current | range(collection, current+1, count-1)]
end