Skip to content

Instantly share code, notes, and snippets.

View Demeter's full-sized avatar

demeter Demeter

  • Phoenix Arizona
  • 23:26 (UTC -07:00)
View GitHub Profile
>>> text.generate()
Bless you You are a genius. His death affects me to think differently.
Thank you Steve. I do n't come so far , limitless and unquantifiable.
You actually changed entire industries through his creative vision.
Let the world we live peacefully. This world would not be forgotten by
me , for the technology industry and the amazing songs , photos ,
communicate , what 's most complicated things " from news " email that
I understood what the launch of itunes earlier that day. While I never
had the privelage to have had an appreciation and fascination with the
world
@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

require 'net/http'
require 'uri'
RIAK = ['localhost', 8098]
run lambda { |env|
req = Rack::Request.new(env)
if req.post? && req.path == '/'
res = Net::HTTP.new(*RIAK).start do |http|
http.post('/riak/shrt', req.params['url'], { 'Content-Type' => 'text/plain' })
@23Skidoo
23Skidoo / Fibs.hs
Created June 23, 2011 18:24
Fibonacci
{-# LANGUAGE BangPatterns #-}
module Main where
zipWith' :: (t -> t1 -> a) -> [t] -> [t1] -> [a]
zipWith' f (!x:xs) (!y:ys) = f x y : zipWith' f xs ys
zipWith' _ _ _ = []
fibs :: [Integer]
fibs = 0 : 1 : zipWith' (+) fibs (tail fibs)
@igorgue
igorgue / fuck_python.py
Created June 13, 2011 15:22
Fuck Python!
# This is 4x faster:
error = " ".join(["Unknown filename:", filename])
# Than this:
error = "Unknown filename: {0}".format(filename) # My preferred way...
# And 2x faster than this:
error = "Unknown filename: " + filename
@pho
pho / gist:1016595
Created June 9, 2011 12:00
Dirty Pastebin script
import os
import re
import urllib2
import sys
import time
while True:
archive = urllib2.urlopen("http://pastebin.com/archive")
u = []
@jeremy
jeremy / schema.xml
Created April 2, 2011 00:53
Basecamp Solr schema
<?xml version="1.0" encoding="UTF-8" ?>
<schema name="basecamp" version="1.3">
<types>
<!-- indexed/stored verbatim -->
<fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true" omitTermFreqAndPositions="true"/>
<!-- "true" or "false" -->
<fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true" omitTermFreqAndPositions="true"/>
<!-- binary data, base64 -->
@donpark
donpark / gist:870585
Created March 15, 2011 10:53
node.js crypto notes

While this note is useful for achieving compatibility with non-node.js crypto code, it contains implementation details which maybe outdated in the near future. Beware.

key argument

key arguments are expected to be binary strings which is bytes packed as chararacter codes of a string.

What this means is that only lower byte of each character will be used.

crypto.createCipher and crypto.createDecipher

@donpark
donpark / PBKDF2Async.js
Created March 7, 2011 03:09
Asynch version of crypto-js 2.0.x PBKDF2
// original, synch version, is at:
// http://code.google.com/p/crypto-js/source/browse/branches/2.0.x/src/PBKDF2.js
(function(){
// Shortcuts
var C = Crypto,
util = C.util,
charenc = C.charenc,
UTF8 = charenc.UTF8,
Binary = charenc.Binary;
########################################################################
### Rakefile for encrypted passwords
########################################################################
#
# Here's a little Rakefile to manage your encrypted password file! It's
# really easy to use:
#
# 1) put the email addresses of the keys you want in AUTHORIZED_USERS
# 2) create a passwords.txt (and ignore it in your SCM)
# 3) run `rake passwords:encrypt`