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
top - 22:24:02 up 127 days, 5:32, 1 user, load average: 0.87, 0.35, 0.11 | |
Tasks: 95 total, 1 running, 94 sleeping, 0 stopped, 0 zombie | |
Cpu(s): 0.4%us, 0.2%sy, 0.0%ni, 99.1%id, 0.1%wa, 0.0%hi, 0.0%si, 0.1%st | |
Mem: 4054804k total, 2263500k used, 1791304k free, 204860k buffers | |
Swap: 0k total, 0k used, 0k free, 1560948k cached | |
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND | |
24520 root 20 0 1166m 211m 9820 D 2.0 5.3 73:33.39 node | |
1 root 20 0 19232 1500 1228 S 0.0 0.0 1:14.64 init | |
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd |
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
# Suggest this goes in it's own file | |
$.pageLoad = (ready) -> | |
$(document).ready(ready) | |
$(document).on('page:load', ready) | |
# Called on document ready and turbo links page:load | |
$.pageLoad -> | |
unless window.UserVoice | |
loadUserVoice() | |
else |
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
<script type="text/javascript"> | |
var clicky_site_ids = clicky_site_ids || []; | |
clicky_site_ids.push(100615330); | |
(function() { | |
var s = document.createElement('script'); | |
s.type = 'text/javascript'; | |
s.async = true; | |
s.src = '//static.getclicky.com/js'; | |
( document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0] ).appendChild( s ); | |
})(); |
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
Adjusting close. | |
Dividend multiplier for adjusting close: (Close(T-1) - d)/Close(T-1) where d is the dividend. | |
Splits adjusting close: Close(T) * 1/N Where N is the split ratio. | |
Sharpe ratio | |
Daily return: (new_price - old_price)/old_price | |
Excess daily return: (daily_return - base_return) e.g. base_return for risk free rate at 4% would be 0.04/252 where 252 is number of trading days. | |
Sharpe ratio: √252 * average(excess_daily_return) / standard_deviation(excess_daily_return) |
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
module List | |
def self.included(base) | |
base.extend ClassMethods | |
base.list = [] | |
end | |
module ClassMethods | |
attr_accessor :list |
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
has_many :super_heros | |
has_one :batman, :through => :super_heros | |
belongs_to :catwoman | |
:Tabularize / :[a-z|A-Z|_]* | |
has_many :super_heros | |
has_one :batman , :through => :super_heros | |
belongs_to :catwoman |
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
var jq = document.createElement('script'); | |
jq.src = "http://code.jquery.com/jquery-latest.min.js"; | |
document.getElementsByTagName('head')[0].appendChild(jq); | |
jQuery.noConflict(); |
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
cat ~/.ssh/id_rsa.pub | ssh user@remote.machine.com 'cat >> .ssh/authorized_keys' |
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
# Base application | |
https://github.com/RailsApps/rails3-devise-rspec-cucumber | |
appscrolls | |
# Validations | |
validates_email_format_of | |
client_side_validations | |
# CSS | |
twitter-bootstrap-rails |
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
.bashrc | |
export HISTCONTROL=ignoredups:erasedups # no duplicate entries | |
export HISTSIZE=100000 # big big history | |
export HISTFILESIZE=100000 # big big history | |
shopt -s histappend # append to history, don't overwrite it | |
# Save and reload the history after each command finishes | |
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND" |