Skip to content

Instantly share code, notes, and snippets.

Dave Paola dpaola2

View GitHub Profile
View gist:3d0efab611f030f5c23120a21088066f
FactoryGirl.define do
# Default enrollment has mentor
factory :enrollment do
course_start_date { 1.week.ago.beginning_of_week }
birth_date { 1.week.ago.beginning_of_week - 2.days }
View transfer.rb
class Account
...
end
class Transfer
def self.exec(acct1, acct2, amt)
Transaction.begin do
acct1.balance -= amt
acct2.balance += amt
acct1.save!
View richhickey.md

Rich Hickey on becoming a better developer

Rich Hickey • 3 years ago

Sorry, I have to disagree with the entire premise here.

A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero.

Mastery comes from a combination of at least several of the following:

View tweet.rb
class Tweet < ActiveRecord::Base
def self.client
client = Twitter::REST::Client.new do |config|
config.consumer_key = ENV['TWITTER_KEY']
config.consumer_secret = ENV['TWITTER_SECRET']
end
client
end
View jarvis_controller.js
function JarvisController ($scope, $http) {
$scope.newRecognition = function() {
var r = new webkitSpeechRecognition();
r.lang = "en";
r.continuous = false;
r.onerror = function(error) {
console.log(error);
var stop = false;
var message = false;
View gist:9609315
function WeatherService($http) {
this.name = "WeatherService";
this.responds_to = ["current_weather"];
this.send = function(intent) {
if (intent == "current_weather") {
return "cloudy with a chance of rain";
} else {
return "I don't understand";
}
@dpaola2
dpaola2 / keybase.md
Created Mar 17, 2014
keybase verification
View keybase.md

Keybase proof

I hereby claim:

  • I am dpaola2 on github.
  • I am dpaola2 (https://keybase.io/dpaola2) on keybase.
  • I have a public key whose fingerprint is A3F4 CA96 F237 D46F 614D 2F29 606B 2DB9 F4CD BD3C

To claim this, I am signing this object:

@dpaola2
dpaola2 / operationengine.py
Created Jul 16, 2012 — forked from inportb/operationengine.py
operational composition and transformation in Python
View operationengine.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
## Copyright (C) 2011 by Jiang Yio <http://inportb.com/>
## The latest code is available at <https://gist.github.com/962122>
##
## Permission is hereby granted, free of charge, to any person obtaining a copy
## of this software and associated documentation files (the "Software"), to deal
## in the Software without restriction, including without limitation the rights
## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@dpaola2
dpaola2 / passages_spec.rb
Created Jun 14, 2012 — forked from unobliged/phs
passages helper spec
View passages_spec.rb
require 'spec_helper'
describe PassagesHelper do
describe "#unique_words" do
let(:passage) { FactoryGirl.create(:passage) }
passage.title.should eq("testFG")
end
end
View gist:2883814
rake task:
passages.each do |passage|
words = deduplicate(passage)
words.each do |word|
Redis.set(word, retrieve_definition(word))
end
end
You can’t perform that action at this time.