Skip to content

Instantly share code, notes, and snippets.

View Datise's full-sized avatar

DJ Datise

  • @techomnomnom
  • satellite
View GitHub Profile
### Keybase proof
I hereby claim:
* I am datise on github.
* I am datise (https://keybase.io/datise) on keybase.
* I have a public key ASCzN6rQEnKRCfrYKtfDzRXdz3kXQCcZQHGg9ZA5nnbp3Qo
To claim this, I am signing this object:
@Datise
Datise / 0.js
Last active August 29, 2015 14:11 — forked from mayfer/0.js
// run this with "node 0.js"
console.log("Hello World");
SELECT isbn
FROM editions JOIN publishers ON (editions.publisher_id = publishers.id)
WHERE publishers.name='Random House'
SELECT isbn, book_id
FROM editions JOIN publishers ON (editions.publisher_id = publishers.id)
JOIN books ON editions.book_id = books.id
WHERE publishers.name='Random House'
SELECT editions.isbn, editions.book_id, stock.stock, stock.retail
@Datise
Datise / input_output.rb
Created November 3, 2014 19:23
File input/output
require 'rubygems'
require 'rest-client'
require 'open-uri'
DIRNAME = "vagrant"
hash = Dir.glob('../../vagrant/*/**').inject({}) do |hash, fname|
ext = File.basename(fname).split('.')[-1].to_s.downcase
hash[ext] ||= [ 0,0]
hash[ext][0] += 1
hash[ext][1] += File.size(fname)