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
def mult_generator limit, multiple | |
0.step(limit, multiple).to_a | |
end | |
def fizzbuzzify values_hash | |
values_hash.each_pair do |k,v| | |
v.each { |v| @answer[v-1] = k.to_s } | |
end | |
@answer |
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
var CleanUp = { | |
init: function(){ | |
this.stopTimers(); | |
this.clearSpace(); | |
this.clearAds(); | |
}, | |
stopTimers: function() { | |
for (var i = 1; i < 99999; i++) { window.clearInterval(i);} |
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
require 'nokogiri' | |
require 'httparty' | |
def next_tweet tweet_url | |
response = HTTParty.get tweet_url | |
tweet_link = Nokogiri::XML( response ).xpath( "//a/@data-expanded-url" ).first | |
p tweet_link.value unless tweet_link.nil? | |
end | |
def find_source url |
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
#!/bin/sh | |
# Summary: Sets hostnames to volume name | |
set -o errexit | |
new_name=`diskutil list | grep "2:" | awk '{print $3}'` | |
sudo scutil --set ComputerName $new_name | |
sudo scutil --set LocalHostName $new_name |
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
cd /usr/local/opt/kitout/set-host-name/ | |
unit_dir=$(cd $(dirname $0); pwd) | |
# Get this machine's mac address | |
mac_address=`ifconfig en0 | grep '\bether\b' | sed 's/.ether //'` | |
# Look up it's machine number | |
host_num=`cat $unit_dir/host-numbers-to-mac-addresses | grep '^\d' | grep $mac_address | cut -d ' ' -f 1` | |
test $host_num || { | |
echo "Skipping" |
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
### Keybase proof | |
I hereby claim: | |
* I am audibleblink on github. | |
* I am serveradmin (https://keybase.io/serveradmin) on keybase. | |
* I have a public key whose fingerprint is 787B BF72 6546 7718 7846 E543 687E F6FF F816 42CB | |
To claim this, I am signing this object: |
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
var newNew = function(constructor, args) { | |
var instance = Object.create(constructor.prototype) | |
// instance.__proto__ = constructor.prototype // Same as line above | |
instance.constructor = constructor // So that you can see who created this. | |
constructor.apply(instance, args) // Same as #call except args is an arrray with apply | |
return instance | |
} |
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
class Sudoku | |
def initialize(board_string) | |
@board = board_string.split("") | |
end | |
def solve! | |
return self if solved? | |
board.each_with_index do |cell, cell_index| | |
# next unless cell == '0' |
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
Show hidden characters
// Tested on Yosemite with Xcode6 | |
// This only works if `swift` from | |
// your shell starts the Swift REPL | |
{ | |
"cmd": ["swift", "$file"], | |
"selector": "source.swift" | |
} |
OlderNewer