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
build () { | |
local branch=$(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/') | |
local job=soundcloud_${branch}_specs_00$1 | |
local url=http://builder.soundcloud.com/view/All/job/${job}/lastBuild/consoleText | |
local cwd="\/srv\/hudson\/.jenkins\/jobs\/${job}\/workspace\/" | |
curl -s $url | sed "/\/usr\/local\/rvm\/.*/d" | sed -e "s/$cwd/.\//" | |
} |
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 self.defer op = nil, callback = nil, &blk | |
# OBSERVE that #next_tick hacks into this mechanism, so don't make any changes here | |
# without syncing there. | |
# | |
# Running with $VERBOSE set to true gives a warning unless all ivars are defined when |
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 "./compiler/crystal/**" | |
while line = gets | |
compiler = Crystal::Compiler.new | |
program = Crystal::Program.new | |
program.target_machine = compiler.target_machine | |
prelude = program.normalize(Crystal::Require.new("prelude")) |
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
# Returns all permutations of string s | |
def permutations(s) | |
# For single characters just return one solution, the character | |
if s.size <= 1 | |
[s] | |
else | |
# calculate all permutations without the first character | |
# and then iterate over each | |
permutations(s[1..-1]).flat_map do |x| | |
# for each position in permutation x |
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
# Iterator methods without blocks are called Enumerators | |
[1,2,3].each_index # => #<Enumerator: [1, 2, 3]:each_index> | |
0.upto(10) # => #<Enumerator: 0:upto(10)> | |
# You can call any Enumerable method on Enumerators | |
[1,2,3].each_index.map {|i| i + 10 } # => [10, 11, 12] | |
0.upto(10).map {|i| i + 10 } # => [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] | |
# See documentation about Enumerables |
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
import json | |
from facebookads import FacebookAdsApi | |
from facebookads.objects import Ad | |
from sys import argv | |
config_file = open('./config.json') | |
config = json.load(config_file) | |
config_file.close() | |
FacebookAdsApi.init( |
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
<!-- Facebook Pixel Code --> | |
<script> | |
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod? | |
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n; | |
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0; | |
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, | |
document,'script','//connect.facebook.net/en_US/fbevents.js'); | |
// Insert Your Facebook Pixel ID below. | |
fbq('init', 'FB_PIXEL_ID'); |
We can't make this file beautiful and searchable because it's too large.
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
id,date,price,bedrooms,bathrooms,sqft_living,sqft_lot,floors,waterfront,view,condition,grade,sqft_above,sqft_basement,yr_built,yr_renovated,zipcode,lat,long,sqft_living15,sqft_lot15 | |
"7129300520","20141013T000000",221900,3,1,1180,5650,"1",0,0,3,7,1180,0,1955,0,"98178",47.5112,-122.257,1340,5650 | |
"6414100192","20141209T000000",538000,3,2.25,2570,7242,"2",0,0,3,7,2170,400,1951,1991,"98125",47.721,-122.319,1690,7639 | |
"5631500400","20150225T000000",180000,2,1,770,10000,"1",0,0,3,6,770,0,1933,0,"98028",47.7379,-122.233,2720,8062 | |
"2487200875","20141209T000000",604000,4,3,1960,5000,"1",0,0,5,7,1050,910,1965,0,"98136",47.5208,-122.393,1360,5000 | |
"1954400510","20150218T000000",510000,3,2,1680,8080,"1",0,0,3,8,1680,0,1987,0,"98074",47.6168,-122.045,1800,7503 | |
"7237550310","20140512T000000",1.225e+006,4,4.5,5420,101930,"1",0,0,3,11,3890,1530,2001,0,"98053",47.6561,-122.005,4760,101930 | |
"1321400060","20140627T000000",257500,3,2.25,1715,6819,"2",0,0,3,7,1715,0,1995,0,"98003",47.3097,-122.327,2238,6819 | |
"2008000270","20150115T000 |
OlderNewer