Skip to content

Instantly share code, notes, and snippets.

View drio's full-sized avatar
🐢
I don't know

David Rio Deiros drio

🐢
I don't know
View GitHub Profile
@drio
drio / launch-c2-1.md
Created December 27, 2014 18:52
Launch; Chapter 2 quote.

Either way, they have huge implications in many areas of our human experience—from politics to entertainment to medicine to interpersonal relationships. But what we’re going to focus on here is business.

@drio
drio / amy_deployment.md
Last active August 29, 2015 14:15
Amy deployment instructions

Amy's deployment

Use a newer version of python.

$ export PATH=/home/swc/drd_python/Python27/bin:$PATH

Recompile apache to support fastcgi (already done). NOTE: You can restart apache with: /scripts/restartsrv_apache.

Create a virtual host in apache: (/etc/httpd/conf/httpd.conf). You can do that

# XXX: Don't even try to understand this test suite unless you got Inception.
# And I don't mean, "kind of got it" ... I mean really, truly, deeply
# understood it.
describe 'AjaxFilters', ->
model = null
beforeEach ->
opts =
uri: 'https://api.librato.dev/v1/models'
email: "foo@bar.com"
apiToken: "abcd123"
@drio
drio / pi.markdown
Last active August 29, 2015 14:22

Notes on using a Raspberry Pi as a thermostat

Here you have some notes and comments on my experiences when setting up a raspberry pi as a thermostat.

I'll expand the document as more questions arise, but I will keep it short initially.

Materials

drio@milhouse ~ $ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
128G 5.3G 116G 5% /
/dev/sda3 99M 28M 66M 30% /boot
tmpfs 16G 0 16G 0% /dev/shm
/dev/mapper/md3000-slx
11T 1.1M 11T 1% /mnt/slx
# Read first line and order the input
l1 = File.open("./input.txt", "r").read.split[1].split(',')
# Create a struct class to hold the stats per lane
line_stats = Struct.new(:c, :d, :a, :b)
# Instantiate a stat lines with the input data
l1_stats = line_stats.new(*l1)
# Display the contents of the struct
puts l1_stats.inspect
def methods_to_lambdas(mod)
instance = Class.new { include mod }.new
mod.instance_methods(false).inject(Hash.new) { |hash, meth|
hash.update(
meth.to_sym => lambda { |*args, &block|
instance.send(meth, *args, &block)
}
)
}
end
def methods_to_lambdas(mod)
instance = Class.new { include mod }.new
mod.instance_methods(false).inject(Hash.new) { |hash, meth|
hash.update(
meth.to_sym => lambda { |*args, &block|
instance.send(meth, *args, &block)
}
)
}
end
def methods_to_lambdas(mod)
instance = Class.new { include mod }.new
mod.instance_methods(false).inject(Hash.new) { |hash, meth|
hash.update(
meth.to_sym => lambda { |*args, &block|
instance.send(meth, *args, &block)
}
)
}
end
drio@milhouse ~/tmp/pcap $ gem search --source http://ruby.mocker.org/gems --remote cap
*** REMOTE GEMS ***
WARNING: RubyGems 1.2+ index not found for:
http://ruby.mocker.org/gems/
RubyGems will revert to legacy indexes degrading performance.
Bulk updating Gem source index for: http://ruby.mocker.org/gems/
acts_as_flux_capacitor (0.6.7, 0.6.6, 0.6.5, 0.6.4, 0.6.3, 0.6.2, 0.6.1, 0.6.0, 0.5.4, 0.5.3, 0.5.2, 0.5.0)