Skip to content

Instantly share code, notes, and snippets.

Lewis 6ewis

  • Toronto, Ontario
Block or report user

Report or block 6ewis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
6ewis / gist:7919715
Created Dec 11, 2013
random task =)
View gist:7919715
require 'spec_helper'
describe Task do
describe '#reccurent' do
it 'raises an Argument error' do
expect { }.to raise_error {|error| error.should be_a(ArgumentError)}
6ewis / gist:7919828
Last active Dec 31, 2015
random test. # I wanted to try and flush the string before it dies. note that ruby only has a finalizer , it does not have a destructor. I could have use ObjectSpace.define_finalizer self, proc {persist} and use GC.start at the command line to run the garbage collector however it would be after destroying an instance object.
View gist:7919828
class PersistentString < String
def initialize data= nil
@@count ||= 0
load data #ObjectSpace.define_finalizer self, proc {persist}
#Instance Methods
6ewis / gist:7941346
Created Dec 13, 2013
here is what I suggest you could do
View gist:7941346
require 'active_support/all'
class Article
attr_accessor :id
def initialize(attributes={})
@id = attributes[:id]
View gist:8522961
require 'csv'
require 'active_support/inflector'
require 'ruby-prof'
Customer =,
View gist:8612604
#!/usr/bin/env ruby
#Usage parse <argument>
require 'csv'
require 'active_support/inflector'
require 'set'
module Printer
def print_statistics
View gist:d6cbe45544b6e9628a66
#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 '"'
View .zshrc.vim
# 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.
# Uncomment the following line to use case-sensitive completion.
6ewis / vim74_lua
Last active Aug 29, 2015 — forked from jdewit/vim74_lua
Installing vim 7.4 with lua on Ubuntu 12.04
View vim74_lua
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
View ramda_refactoring1.js
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',;
View accordionReproducedBug.js
const Test = (
render: function() {
return (
<Panel {...this.props} header={this.props.header} eventKey={this.props.eventKey}>
getInitialState: function() {
return {term: "test"};
You can’t perform that action at this time.