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
namespace :db do | |
require 'uri' | |
desc "Uses heroku:config for APP to forcefully create ~/.pgpass" | |
task :create_pgpass do | |
app = ENV['APP'] || 'whatever-your-default-app-is' | |
uri = URI(`heroku config:get DATABASE_URL -a #{app}`) | |
entry = "*:5432:#{uri.path.gsub /\//, ''}:#{uri.user}:#{uri.password}" | |
`echo '#{entry}' > ~/.pgpass; chmod 0600 ~/.pgpass` | |
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
a = [5,4,1,8,7,2,6,3,5,2,3,45,1,1,3,4,99,2,3] | |
puts a.size | |
@recurse = 0 | |
def mergesort(list) | |
return list if list.size <= 1 | |
mid = list.size / 2 | |
left = list[0, mid] | |
right = list[mid, list.size] | |
@recurse = @recurse + 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
class WordCounters | |
def self.count_up_word word | |
count = 0 | |
word.each_char do |l| | |
count = l.ord + count | |
end | |
count | |
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 Lexer do | |
defmodule PIR do | |
require LexChar | |
defmacrop line(opts) do | |
quote do: elem(unquote(opts),1) | |
end | |
defmacrop file(opts) do | |
quote do: elem(unquote(opts),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
FRAME |
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
Algorithms Unlocked | |
Thomas H. Cormen | |
ISBN: 9780262518802 | |
Machine Learning | |
Kevin P. Murphy | |
ISBN: 9780262018029 | |
Introduction to Machine Learning, second edition | |
Ethem Alpaydin |
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
if (typeof(console) !== 'undefined') { | |
if ('debug' in console) { | |
console.debug('Hey, you have your debugger enabled :)'); | |
} else { | |
console.log('Hey, you have your IE debugger enabled :-/'); | |
} | |
} else { | |
var Console = Class.create(); | |
Console.prototype = { | |
initialize: function() {}, |
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 Player | |
def init(warrior) | |
@warrior = warrior | |
@low_side ||= 10 | |
@current_direction ||= :forward | |
@backsteps ||= 0 | |
@skip ||= false | |
@turn_count ||= 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
class Player | |
def init(warrior) | |
@warrior = warrior | |
@low_side ||= 10 | |
@current_direction ||= :forward | |
@backsteps ||= 0 | |
@skip ||= false | |
@turn_count ||= 0 | |
@health ||= 20 |
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
&.rotated{ | |
tr{ | |
& th:first-child div{ | |
width: 100%; | |
} | |
background: transparent; | |
height: 80px; | |
&.ie{ | |
background: lighten($body_text_color, 60%); | |
height: 20px; |
OlderNewer