Skip to content

Instantly share code, notes, and snippets.

@jessecravens
jessecravens / rmr-ember.md
Last active August 29, 2015 14:06
Rocky Mountain Ruby Ember.js Workshop

Ember.js Workshop (RMR 2014)


Schedule

  8:00 AM - 9:00 AM: Part 1 - Lessons 1-3
  9:00 AM - 10:00 PM: Part 1 - Lessons 4-7

Break

@marksim
marksim / tictactoe_spec.rb
Created June 15, 2013 03:18
My favorite TicTacToe implementation yet. Doing testing right results in better design.
require 'rspec'
class TicTacToe
def initialize
@x_moves = []
@o_moves = []
end
def play space
return false unless (1..9).include?(space)
def render
print " "
(0..7).each { |column_num| print " #{column_num} " }
puts ""
board.each_with_index do |row, row_num|
print row_num
row.each_with_index do |piece, col_num|
if invalid_board_moves.include?([row_num, col_num])
print (piece ? piece.render : " ").colorize(background: :white)
else
@gillibrand
gillibrand / totalhours.py
Last active January 2, 2016 01:59
A custom preprocessor for Marked.app that makes it into a super simple time tracker. Finds all the hours in a document (e.g., +1h, +2h, +3h, etc.) and shows the total in a floating badge. Only looks for whole number hours (no minutes or fractions). See a screenshot at http://cl.ly/TB7D
#!/usr/bin/env python
import sys, re
hours_re = re.compile(r'([-+] \d+)h \b', re.X)
total = 0
for line in sys.stdin:
total += sum(int(hour) for hour in hours_re.findall(line))
print line.strip()
@potatowire
potatowire / gist:8403582
Last active January 3, 2016 03:39
I use [Pinboard](http://pinboard.in) for all of my links, including "read later" items that I used to send to [Instapaper](http://www.instapaper.com/). I am often subject to a spotty network and [primitive browsres](http://www.microsoft.com/en-us/download/internet-explorer-7-details.aspx), and the [supplied "read later" bookmark](https://pinboar…
javascript:if(document.getSelection){s=document.getSelection();}else{s='';};document.location='https://pinboard.in/add?later=yes&noui=yes&jump=close&next=same&url='+encodeURIComponent(location.href)+'&description='+encodeURIComponent(s)+'&title='+encodeURIComponent(document.title)
@bmatheny
bmatheny / gist:1069547
Created July 7, 2011 13:49
Why I left Indy (but still think it's great)

Miles recently wrote a post on the Indy Hackers Blog appropriately titled, Why Indy? In the post (http://blog.indyhackers.org/post/7262445527/why-indy) Miles (along with several other hoosiers) enumerates the various great things about why a developer/business might want to live in/stay in/come to Indiana. Having spent 10 of my 31 years in Indiana (4 in West Lafayette, 6 in Indianapolis) I definitely think of myself as a hoosier but despite that I moved to NYC in May. I am in the defector group, but maybe not in the dissenter group.

While I was in Indianapolis I held leadership roles at 3 different startups including ChaCha and Compendium, witnessed a very successful exit at one of my startups (3GUpload.com in 2004), and consulted for a half-dozen other various companies. That is to say, I think I have a pretty good feeling for what Indy has to offer in terms of work. Additionally, I participated in a variety of volunteer organizations (Big Brothers Big Sisters, Leukemia/Lymphoma society, ADA, etc) as well a

Hey there, I'm Ben, one of the developers working on FormKeep: the form backend for designers and developers.
Over the next few months, we're going to be investing heavily in the product and I want to make sure we're building the features that *you* want. To ensure that happens, would you please take this 5-minute survey?
I'm only sending this to a handful of our active users, so every response counts. I know it won't be the highlight of your week but it'll mean that future FormKeep changes will make it even better for you.
Side bonus: the entire survey is keyboard-navigable. No mouse required!
Thank you to the hundredth power :)
@bferg
bferg / feedfolder.rb
Created July 1, 2013 03:00
Create Feed Wrangler "smart streams" matching your Google Reader folders. First import your feeds from Google Reader, export your Reader OPML file to the script directory, edit the script to include your user name and password, then run it. Note Feed Wrangler has since added this feature, so this script should no longer be necessary!
#!//usr/bin/env ruby
require 'bundler/setup'
require 'opml_saw'
require 'json'
require 'net/https'
require 'uri'
#
# Enter your email and password for feedwrangler below
#
@ttscoff
ttscoff / Raketimer.rb
Created February 13, 2013 14:59
Example Rakefile additions for Jekyll task timer and push notifications
# Rake file tricks for timing and notifying task completion
# at the top of the file with other config settings
run_time = Time.now
# quick function to determine diff between passed time and now
def finish_timer(start_time)
finish_time = Time.now - start_time
total_min = "%d" % (finish_time / 60)
@naoyamakino
naoyamakino / gist:5504445
Created May 2, 2013 18:53
Dissecting Ruby with Ruby via @schneems #railsConf
Code Triage: gemhttp://www.codetriage.com/
budle open gemName
puts caller.inspect #where it came from
object#method
object.method(:method_name).source_location
method.source_location
self.class.ancestors #get superclass names in order