This file contains hidden or 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
# http://skitch.com/wesmaldonado/dw6iy/git-treezy | |
[alias] | |
treezy = log --graph --full-history --all --color \ | |
--pretty=format:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s" |
This file contains hidden or 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 goertzel(block_size,samples) | |
freq = 500 # from demorse.h AUDIO_FREQ | |
s = 0.0 | |
s_prev1 = 0.0 | |
s_prev2 = 0.0; | |
coeff = 2.0 * Math.cos(2.0 * Math::PI* freq); | |
samples.map do |sv| | |
s = sv + (coeff * s_prev1) - s_prev2; |
This file contains hidden or 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
# My sister and brother inlaw got into geocaching | |
# after I showed them the android app for it... anyhow I was in Olympia for my m | |
# oms birthday and I showed them that puzzle cache (http://coord.info/GC1JD07)... | |
# and when my manual math ended up being off by one in my "B" calculation (21-19 | |
# != 3) I uh, got carried away once I got back to seattle. :( | |
# I only got this carried away though 'cause I'm trying to build a presentation | |
# on parsers for a conference and I thought this was a reasonable mini language wh | |
# ere I could show the "quick" hour long solution I came up with versus the actual | |
# parser one I'll present. I also could've done this faster by just coding this |
This file contains hidden or 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
puts Time.now.strftime("%Y/%m/%d %H:%M:%S") | |
enable_maintenance_page | |
puts Time.now.strftime("%Y/%m/%d %H:%M:%S") | |
bundle_install | |
puts Time.now.strftime("%Y/%m/%d %H:%M:%S") | |
restart | |
puts Time.now.strftime("%Y/%m/%d %H:%M:%S") | |
sphinx_stop | |
puts Time.now.strftime("%Y/%m/%d %H:%M:%S") | |
link_sphinx_directory |
This file contains hidden or 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 User < ActiveRecord::Base | |
# Include default devise modules. Others available are: | |
# :token_authenticatable, :confirmable, :lockable and :timeoutable | |
devise :database_authenticatable , :registerable, :recoverable, :rememberable, :trackable, :validatable | |
devise :omniauthable#, :omniauth_providers => [:facebook] | |
devise :encryptable, :encryptor => :custom_encryptor | |
# Devise: Setup accessible (or protected) attributes for your model | |
attr_accessible :email, :password, :password_confirmation, :remember_me |
This file contains hidden or 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
hdid -nomount ram://100000 | |
sudo /sbin/newfs_hfs -v mysql_ram_disk /dev/disk1 | |
diskutil mount /dev/disk1 |
This file contains hidden or 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
hgfhgfh |
This file contains hidden or 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
67 before_filter :ping | |
68 before_filter :reset_current_request | |
69 before_filter :initialize_current_page | |
70 before_filter :rpc_tracking_prefix | |
71 before_filter :update_content_cache | |
72 before_filter :update_config | |
73 before_filter :initialize_site | |
74 before_filter :initialize_ad_system | |
75 before_filter :update_content_cache | |
76 before_filter :initialize_rpc |
This file contains hidden or 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
# Shows the difference in doing crazy stuff like extending an instance on a say... busy loop or lots of requests. | |
# | |
# [16:38][wmaldonado@wmaldonado0:]$ ruby test.local.extend.rb | |
# user system total real | |
# extend instance 23.150000 0.430000 23.580000 ( 23.777088) | |
# create a class 2.390000 0.810000 3.200000 ( 3.209350) | |
# | |
require 'benchmark' |
This file contains hidden or 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
asdf | |
asdf | |
asdf | |
asdf | |
asdf |