Skip to content

Instantly share code, notes, and snippets.

View jameswilliamiii's full-sized avatar

James Stubblefield jameswilliamiii

View GitHub Profile
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@agnellvj
agnellvj / friendly_urls.markdown
Created September 11, 2011 15:52 — forked from jcasimir/friendly_urls.markdown
Friendly URLs in Rails

Friendly URLs

By default, Rails applications build URLs based on the primary key -- the id column from the database. Imagine we have a Person model and associated controller. We have a person record for Bob Martin that has id number 6. The URL for his show page would be:

/people/6

But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6 here, is called the "slug". Let's look at a few ways to implement better slugs.

@cheenu
cheenu / netflix_api_sample_signed_request.rb
Last active November 2, 2022 06:22
How to generate an OAuth signature for the Netflix API using Ruby
## This gist is intended to provide a code example for the
# 'Making Signed Requests' section of the 'Authentication Overview' document.
# (http://developer.netflix.com/docs/Security).
#
# We are going to make a catalog request. The hardest part of
# it is figuring out how to generate the oauth_signature.
require 'cgi'
require 'base64'
require 'openssl'
/* The Grid ---------------------- */
.lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row.large-collapse .column,
.lt-ie9 .row.large-collapse .columns { padding: 0; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row .row.large-collapse { margin: 0; }
.lt-ie9 .column, .lt-ie9 .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; }
.lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; }

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@willbarrett
willbarrett / gist:9307877
Last active August 29, 2015 13:56
Instructions for Capistrano Deploy

First, ensure you are in the jeffs-store directory.

To set up the environment for this deployment example, run these commands:

vagrant box add capistrano https://dl.dropboxusercontent.com/u/1863351/StarterSchoolFeb2014/capistrano.box
git checkout capistrano
git pull origin capistrano
bundle update
vagrant halt

vagrant up capistrano

How Rails is Revolutionizing Our Schools

Abstract

Rails began life aimed at professional developers, but now I'm using it to revolutionize the way kids and adults learn computer programming. Building an app enables non-programmers to step into computer science without the boring theory and math-like courses that have been traditionally used. I'll show the curriculum I'm using at schools like NU and UChicago, in which students pick up basic CS concepts and more, like design patterns, agile principles, critical thinking skills, and teamwork.

For The Review Committee

I think many developers don't know the wealth of computer science literacy that's gained when new programmers learn Rails for the first time. Students think they're building a fun app, but I use it to introduce fundamental CS concepts along the way. It's been a wonderful way for students to learn CS basics in a manner completely anti-thetical to the standard CS curriculum used across the nation.

module Paperclip
# A wrapper for a queued item. Normally this would be a temporary file, but we can't do that, because Paperclip
# would copy the temporary file before the content is actually written.
class BulkQueueItem
attr_reader :destination
def initialize(destination)
@destination = destination
end
def closed?