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
#task_helper.rb | |
require 'spec_helper' | |
describe Task do | |
describe '#reccurent' do | |
it 'raises an Argument error' do | |
expect { Task.new.reccurent }.to raise_error {|error| error.should be_a(ArgumentError)} | |
end |
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
#persistent_string.rb | |
class PersistentString < String | |
def initialize data= nil | |
@@count ||= 0 | |
load data #ObjectSpace.define_finalizer self, proc {persist} | |
super | |
end | |
#Instance Methods | |
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
require 'active_support/all' | |
class Article | |
attr_accessor :id | |
def initialize(attributes={}) | |
@id = attributes[:id] | |
end | |
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
require 'csv' | |
require 'active_support/inflector' | |
require 'ruby-prof' | |
Customer = Struct.new(:cust_id, | |
:elect_or_gas, | |
:disconnect_doc, | |
:move_in_date, | |
:move_out_date, |
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
#!/usr/bin/env ruby | |
#Usage parse <argument> | |
require 'csv' | |
require 'active_support/inflector' | |
require 'set' | |
module Printer | |
def print_statistics |
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
#Use backtick as the prefix | |
# Do it just like this or you will not | |
# be able to use type backtick literally | |
unbind C-b | |
set -g prefix ` | |
bind ` send-prefix | |
bind-key l last-window | |
unbind % | |
bind '|' split-window -h | |
unbind '"' |
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
# Path to your oh-my-zsh installation. | |
export ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="bureau" | |
# Uncomment the following line to use case-sensitive completion. |
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
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common | |
sudo apt-get build-dep vim-gnome | |
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev mercurial libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev | |
sudo rm -rf /usr/local/share/vim | |
sudo rm /usr/bin/vim | |
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
const state = [ | |
{id: 12, foo: 'bar', 'attribute': 101}, | |
{id: 34, foo: 'baz', 'attribute': 102}, | |
{id: 56, foo: 'qux', 'attribute': 103} | |
]; | |
const action = {payload: {id: 34, attribute: 'attribute'}}; | |
// findObjectIndex :: [Object] -> Int | |
const findObjectIndex = findIndex(propEq('id', action.payload.id)); |
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
const Test = ( | |
React.createClass({ | |
render: function() { | |
return ( | |
<Panel {...this.props} header={this.props.header} eventKey={this.props.eventKey}> | |
{React.createElement(React.createClass({ | |
getInitialState: function() { | |
return {term: "test"}; | |
}, |
OlderNewer