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
(ns anagram | |
(:require [clojure.string :refer [lower-case split]])) | |
(defn- duplicate? [a b] | |
(= (lower-case a) (lower-case b))) | |
(defn- unique-candidates [source candidates] | |
(remove #(duplicate? % source) candidates)) | |
(defn- canonicalize [word] |
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' | |
get '/' do | |
@name = # GET GIST HERE!!! | |
erb :home | |
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
class Player | |
attr_accessor :warrior, :direction, :health, :hurt, :step | |
def initialize | |
self.direction = :backward | |
self.hurt = false | |
self.step = true | |
end | |
def play_turn(warrior) |
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 'openssl' | |
class AppUser < Sequel::Model(:AppUsers) | |
AppUser.unrestrict_primary_key | |
def self.authenticate(username, password) | |
#TODO: Store salt in config | |
puts "In Auth" | |
user = self.first(:username => username) |
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
autocmd User Rails Rnavcommand config config -suffix.rb -default=environment | |
autocmd User Rails Rnavcommand fabricator spec/fabricators -glob=**/* -suffix=_fabricator.rb | |
autocmd User Rails Rnavcommand feature features -suffix=.feature -default=cucumber | |
autocmd User Rails Rnavcommand sass app/stylesheets -glob=**/* -suffix=.sass -default=main | |
autocmd User Rails Rnavcommand scss app/stylesheets -glob=**/* -suffix=.scss -default=style | |
autocmd User Rails Rnavcommand steps features/step_definitions -suffix=_steps.rb -default=web | |
let g:surround_{char2nr("l")} = "link_to \1text: \1, \2path:\2\r" | |
let g:surround_{char2nr("#")} = "#{\r}" |
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
context "POST edit_subscriptions" do | |
setup do | |
fake_login | |
@user.subscriptions << Factory(:subscription) | |
@preference = Factory(:reminder_preference) | |
@user.reminder_preferences << @preference | |
post :edit_subscriptions, :id => @user.id, "#{@preferences.id}_email" => "on" | |
end | |
should "empty the users reminder preferences" do | |
@user.reload |