Want to create a Gist from your editor, the command line, or the Services menu? Here's how.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
firsthund = [1..100] | |
isfizz = (x) -> | |
x % 3 == 0 | |
isbuzz = (x) -> | |
x % 5 == 0 | |
handle = (x) -> | |
if isfizz(x) and isbuzz(x) then 'fizzbuzz' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You can haz this |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |