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
let mapleader=" " | |
set number | |
set relativenumber | |
set ideajoin | |
Plug 'easymotion/vim-easymotion' | |
set easymotion | |
Plug 'tpope/vim-surround' | |
set quickscope | |
Plug 'vim-matchit' |
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
Newer version of Ubuntu (and Linux mint) have .Xauthority and that will interfere with your ability to run X11 apps from a docker container. Here's how you get around that: | |
docker run -ti -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY --net=host -v $HOME/.Xauthority:/root/.Xauthority <and the rest of your docker string...> |
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
<link rel="import" href="../paper-input/paper-input.html"> | |
<link rel="import" href="../paper-button/paper-button.html"> | |
<link rel="import" href="../core-icons/core-icons.html"> | |
<link rel="import" href="../core-icon/core-icon.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { |
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
<link rel="import" href="../paper-input/paper-input.html"> | |
<link rel="import" href="../paper-button/paper-button.html"> | |
<polymer-element name="ducking-wookie-signin"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; |
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
should "save birth date" do | |
assert @person.birth_date == Date.new(1964, 8, 9) | |
# NOTE: Isn't this equivalent to the assertion above? o_O | |
# assert_equal Date.new(1964, 8, 9), @person.birth_date | |
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
a = $('a') | |
a.find('descendant').doSomething().end().find('another descenadnt').doSomething2() | |
or | |
b = $('descendant', $a).doSomething() |
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
class Main < Monk::Glue | |
set :app_file, __FILE__ | |
use Rack::Session::Cookie, | |
:key => 'rack.session', | |
:domain => 'foo.com', | |
:path => '/', | |
:expire_after => 2592000, | |
:secret => 'change_me' | |
use Rack::Flash |
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 'sinatra/base' | |
require 'pathname' | |
require Pathname(__FILE__).dirname.expand_path + "models/abstract_user" | |
module Sinatra | |
module LilAuthentication | |
def self.registered(app) | |
#INVESTIGATE | |
#the possibility of sinatra having an array of view_paths to load from | |
#PROBLEM |
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 -w | |
require 'benchmark' | |
n = 1_000_000 | |
l = (1..n).to_a.shuffle | |
conditions = [ | |
proc { |i| i > 5 }, | |
proc { |i| (i % 2).zero? }, | |
proc { |i| (i % 3).zero? }, |
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
describe Item, 'with price_in_dollars of 1500' do | |
let(:item) { Item.new(:price_in_dollars => 1500) } | |
it 'should assign 1500_00 to the real price' do | |
item.price.should == 1500_00 | |
end | |
end | |
describe Item, 'with price_in_dollars of FooBar' do | |
subject { Item.new(:price_in_dollars => 'FooBar') } |