Skip to content

Instantly share code, notes, and snippets.

View jshirley's full-sized avatar

Jay Shirley jshirley

View GitHub Profile
@jshirley
jshirley / ci.pl
Created July 9, 2012 18:31
Automatically run tests when a file is modified
use Filesys::Notify::Simple;
use App::Prove;
use lib qw(lib);
my $tests = @ARGV;
my $watcher = Filesys::Notify::Simple->new([ './lib', './t/lib' ]);
my $prove = App::Prove->new;
@jshirley
jshirley / gist:9863326
Created March 29, 2014 21:27
My "Solve a Problem" paper for Dan Ariely's Behavioral Economics course.

Leveraging Technology to Increase Pain of Paying and Improve Personal Savings

As technology advances, people are getting further from the hard concept of money. Without seeing immediate feedback, people repeat undesired behaviors without having any pain. The tendency to repeat previous behaviors without thinking of the original motivation has been observed (Ariely, D. & Norton, M. I., 2008). This behavior may cause repeated purchases without adequate deliberate decision-making.

This problem is exacerbated by the reduction of the pain of paying as the distance from physical currency increases (Ariely and Silva, 2002). We are increasingly moving towards electronic payments and this trend will not reverse (Borzekowski, Kiser, Ahmed, 2006).

The convenience of credit and debit payments directly reduces pain, in combination of self-herding leads people to inadequately consider other aspects of the purchase. With the exception of frugal individuals, people do not automatically think about the opportunity cost o

@jshirley
jshirley / app-short.js
Created August 28, 2012 17:18
Code for my loading strategy, documented at http://tech.tdp.me/2012/08/28/better-spa/
var YUI = require('yui').YUI,
Y = YUI(/* Your YUI Config */),
requireAuth = require('./lib/middlware/auth'),
modelLoader = require('./lib/middlware/loader'),
app = /* create express app */;
Y.namespace('TDP').config = {
webservices : global.config.webservices.path
};
@jshirley
jshirley / gist:1973907
Created March 4, 2012 17:04
Managing start_server with start-stop-daemon and graceful restarting.
#!/bin/bash
PORT=5000
# This should be the directory name/app name
APP="TDP"
PIDFILE="$HOME/$APP.pid"
STATUS="$HOME/$APP.status"
# The actual path on disk to the application.
APP_HOME="$HOME/$APP"
@jshirley
jshirley / .rubocop-todo.yml
Last active May 18, 2016 21:00
rubocop Exclude relative path bug
Lint/EndAlignment:
Exclude:
- 'rel/path/broken.rb'
{
"projects": [
{
"name": "Sample data",
"key": "SAM",
"issues": [
{
"status" : "Open",
"reporter" : "admin",
"summary" : "Parent case",
@jshirley
jshirley / install_plenv.yml
Created November 29, 2013 19:33
Start of the plenv ansible gist that I'm using for TDP
---
- name: plenv | update plenv repo
git: repo=git://github.com/tokuhirom/plenv.git dest=$plenv_root
sudo: True
sudo_user: ${plenv_user}
- name: plenv | install perl-build
git: repo=git://github.com/tokuhirom/Perl-Build.git dest=/home/{{ plenv_user }}/.plenv/plugins/perl-build
sudo: True
sudo_user: ${plenv_user}
title date tags
Worklog for 2016-01-11
2016-01-11
worklog

Worklog for 2016-01-11

What must I do today?

@jshirley
jshirley / gae_test.go
Created January 4, 2016 03:49
This shows a failing test that I'm unable to figure out what I'm doing wrong.
package hello
import (
"appengine/aetest"
"appengine/datastore"
"reflect"
"testing"
)
type Foo struct {
@jshirley
jshirley / gist:6312764
Created August 22, 2013 21:05
Parse the TDP v1 /goals API result to find cooldown goals "expiration" date
#!env perl
use JSON;
use DateTimeX::Easy;
use Data::Printer;
my $json = JSON::decode_json(<STDIN>);
my $goals = $json->{goals};