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
- copy .ssh and .zshrc | |
- install app store apps | |
- curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh | |
- ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" | |
- brew tap phinze/cask | |
- brew tap caskroom/versions | |
- brew install apgdiff brew-cask elasticsearch gd git gnuplot heroku-toolbelt jmeter leiningen libpng libyaml maven openssl pkg-config rbenv ruby-build unrar watch wget youtube-dl |
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
tell application "Mail" | |
set theSubject to "Clean me up!" | |
set theContent to "Nothing interesting here..." | |
set theAddress to "[email protected]" | |
set theAttachmentFile to "Macintosh HD:Users:kenneth:Dropbox:contact.jpg" | |
set msg to make new outgoing message with properties {subject: theSubject, content: theContent, visible:true} | |
tell msg to make new to recipient at end of every to recipient with properties {address:theAddress} |
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
POPULATION_SIZE = 24 | |
NUM_BITS = 64 | |
NUM_GENERATIONS = 1000 | |
CROSSOVER_RATE = 0.7 | |
MUTATION_RATE = 0.001 | |
class Chromosome | |
attr_accessor :genes |
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
Show hidden characters
{ | |
"auto_complete_commit_on_tab": true, | |
"caret_style": "solid", | |
"color_scheme": "Packages/RailsCasts Colour Scheme/RailsCastsColorScheme.tmTheme", | |
"draw_white_space": "all", | |
"ensure_newline_at_eof_on_save": true, | |
"file_exclude_patterns": | |
[ | |
"*.pyc", | |
"*.pyo", |
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
#!/bin/sh | |
# | |
# An example hook script to verify what is about to be committed. | |
# Called by "git commit" with no arguments. The hook should | |
# exit with non-zero status after issuing an appropriate message if | |
# it wants to stop the commit. | |
# | |
# Usage: | |
# Remove the .sh file extension when you put the script in your hooks folder! | |
# |
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 search_field(field, operator, attributes = {}) | |
field_op = "#{field}_#{operator}" | |
value = (params[:q][field_op] if params[:q]) | |
title = t(".#{field_op}") | |
label_tag = content_tag :label, title | |
attributes[:name] = "q[#{field_op}]" | |
attributes[:type] ||= 'text' | |
attributes[:value] = value | |
input_tag = content_tag :input, nil, attributes | |
[label_tag, input_tag].join.html_safe |
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
en: | |
hello: "Hello world" | |
activemodel: | |
models: | |
record: Record | |
user: User | |
attributes: | |
record: | |
customer_id: Customer ID | |
name: Customer Name |
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 document_actions_form_tag | |
capture do | |
concat form_tag('', method: :post, id: 'document_actions_form') | |
input_name_value_pairs(request.params).each do |name_value_pair| | |
concat tag('input', { name: name_value_pair.first, value: name_value_pair.last, type: 'hidden' }) | |
end | |
clazz = Class.new do | |
def checkbox_header |
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
require 'benchmark' | |
class Integer | |
def performant_factorial | |
(1..self).reduce(:*) || 1 | |
end | |
def recursive_factorial | |
self == 0 ? 1 : self * (self - 1).recursive_factorial | |
end |
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 FoodChain | |
VERSION = 2 | |
def self.song | |
0.upto(7).map { |n| FoodChainStanza.nth(n) }.join("\n") | |
end | |
end | |
class FoodChainStanza | |
ANIMALS = %w(fly spider bird cat dog goat cow horse) |
OlderNewer