Skip to content

Instantly share code, notes, and snippets.

View dpaola2's full-sized avatar

Dave Paola dpaola2

View GitHub Profile
@dpaola2
dpaola2 / gist:9609315
Created March 17, 2014 22:02
jarvis plugin
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 / jarvis_controller.js
Created March 17, 2014 22:03
jarvis controller
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;
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

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:

class Account
...
end
class Transfer
def self.exec(acct1, acct2, amt)
Transaction.begin do
acct1.balance -= amt
acct2.balance += amt
acct1.save!
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 }
--- ERROR REPORT TEMPLATE -------------------------------------------------------
- What did you do?
I ran the command `/Users/dpaola2/.rvm/gems/jruby-9.0.0.0@global/bin/bundle install`
- What did you expect to happen?
I expected Bundler to...
- What happened instead?
@dpaola2
dpaola2 / query.sql
Last active December 14, 2016 23:16
WITH checkpoint_completion_counts AS (
SELECT
COUNT(checkpoint_completions.id) AS checkpoint_completions_count,
checkpoints.ref AS checkpoint_ref,
users.slug
FROM checkpoint_completions
INNER JOIN checkpoints ON checkpoint_completions.checkpoint_ref = checkpoints.ref
INNER JOIN users ON users.id = checkpoint_completions.user_id
GROUP BY 2,3
)
@dpaola2
dpaola2 / request_response.cxml
Created April 18, 2018 22:09
Request and Response from Staples cXML
REQUEST:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.014/cXML.dtd">
<cXML xml:lang='en-us' version='1.2.008' payloadID='1524089251.1.2179199@eden.io' timestamp='2018-04-18T15:07:31-07:00'>
<Header>
<From>
<Credential domain='NetworkId'>
<Identity>
edentechnologies-t
@dpaola2
dpaola2 / punchoutsetuprequest.cxml
Created April 18, 2018 22:20
punchoutsetuprequest.cxml
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.014/cXML.dtd">
<cXML xml:lang='en-us' version='1.2.008' payloadID='1524089416.1.1993155@eden.io' timestamp='2018-04-18T15:10:16-07:00'>
<Header>
<From>
<Credential domain='NetworkId'>
<Identity>
edentech-t
</Identity>
</Credential>