Skip to content

Instantly share code, notes, and snippets.

View ryansobol's full-sized avatar

Ryan Sobol ryansobol

  • Ryan Sobol LLC
  • Seattle, WA
  • 05:23 (UTC -07:00)
View GitHub Profile
@ryansobol
ryansobol / set_literals.rb
Created April 27, 2014 01:28
It's fun to dream what a literal syntax for Ruby's Set class might look like...
# generic literal of symbols
<:earth, :wind, :fire>
# => Set.new [:earth, :wind, :fire]
# %e literal of symbols without interpolation
%e<earth wind fire>
# => Set.new [:earth, :wind, :fire]
# %E literal of symbols with interpolation
element = :wind
# POST /articles
def create
@article = Article.new(article_params)
if @article.save
redirect_to @article, notice: 'Article was successfully created.'
else
render :new
end
end
class ResourcesController < ApplicationController
# GET /resources
def index
@resources = Resource.all
end
# GET /resources/1
def show
@resource = Resource.find(params[:id])
end
IRB.conf[:PROMPT_MODE] = :SIMPLE
IRB.conf[:AUTO_INDENT] = true
git config --global push.default simple
git config --global credential.helper osxkeychain
postgres: postgres -D db/postgres
git config --global push.default simple
git config --global credential.helper 'cache --timeout=3600'
#!/bin/sh
TARGET="/c/Program Files (x86)/Git/bin/subl"
echo '#!/bin/sh' > $TARGET
echo '"C:\Program Files\Sublime Text 2\sublime_text.exe" "$1" &' >> $TARGET
document.getElementById("todo").addEventListener("keypress", function(event) {
if (event.keyCode == 13) {
addToDo();
}
});
function addToDo() {
var newEl = document.createElement("li");
var parentEl = document.getElementById("list");
var firstEl = parentEl.firstChild;

Keybase proof

I hereby claim:

  • I am ryansobol on github.
  • I am ryansobol (https://keybase.io/ryansobol) on keybase.
  • I have a public key whose fingerprint is 796F F213 9A11 4FB9 2921 5DE7 34D6 FF00 1F05 B945

To claim this, I am signing this object: