Skip to content

Instantly share code, notes, and snippets.

#require 'action_controller'
require 'rqrcode'
require 'rqrcode-rails3/size_calculator.rb'
require 'rqrcode-rails3/renderers/svg.rb'
class LibQRCode
def self.generate_qrcode(text, options)
size = options[:size]
level = options[:level] || :h

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.

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
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the branch/status of the current git repository
# * the branch of the current subversion repository
# * the return value of the previous command
#
# USAGE:

Odometer.js init not going to work on templates of angular's ui-router, because they loaded after the scan. This directive solves the problem.

'use strict';
angular.module('templates', []).run([ '$templateCache', function($templateCache) {
<%
environment.context_class.instance_eval { include ActionView::Helpers::JavaScriptHelper }
app_root = File.expand_path('../', __FILE__)
html_templates = File.join(app_root, %w{templates ** ** *.html })
templates = Dir.glob(html_templates)
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the branch/status of the current git repository
# * the branch of the current subversion repository
# * the return value of the previous command
#
# USAGE:
# My steps for creating a DigitalOcean server to run non-exit Tor node for just $5/mo
# Screen shots of my setup process: https://plus.google.com/photos/+DrewFustini/albums/6057260188204970945
# Create Digital Ocean account: https://www.digitalocean.com/
# Create Droplet on Digital Ocean: select $5/mo, and select Debian 7.0 64-bit
# This instructions are based on Tor Project: https://www.torproject.org/docs/tor-relay-debian.html.en
afustini@lappy486:~$ ssh root@107.170.203.104
root@107.170.203.104's password:
You are required to change your password immediately (root enforced)
Linux Tor300SoF 3.2.0-4-amd64 #1 SMP Debian 3.2.54-2 x86_64
% curl -s https://static.rust-lang.org/rustup.sh | sudo sh
rustup: CFG_CURL := /usr/bin/curl (curl 7.37.1 (x86_64-apple-darwin14.0) libcurl/7.37.1 SecureTransport zlib/1.2.5)
rustup: CFG_TAR := /usr/bin/tar (bsdtar 2.8.3 - libarchive 2.8.3)
rustup: CFG_FILE := /usr/bin/file
rustup: CFG_SHA256SUM :=
rustup: CFG_SHASUM := /usr/bin/shasum (5.84)
rustup:
rustup: processing sh args
rustup:
rustup: CFG_PREFIX :=