Skip to content

Instantly share code, notes, and snippets.

David Underwood davefp

Block or report user

Report or block davefp

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@davefp
davefp / raddit.service
Last active May 19, 2018 — forked from Artemmkin/raddit.service
Raddit unit file
View raddit.service
[Unit]
Description=Raddit application
After=network.target
[Service]
Type=simple
User=raddit-user
WorkingDirectory=/home/raddit-user/raddit
ExecStart=/home/raddit-user/.rbenv/bin/rbenv exec bundle exec puma
Restart=always
@davefp
davefp / ugly_ruby.rb
Created Apr 9, 2014
How would you format this line of ruby to be more readable?
View ugly_ruby.rb
#One liner?
assert_requested(:post, url, body: hash_including({name: 'web', events: ['release'], active: true, config: {url: 'http://example.com/webhooks/release', content_type: 'json'}}))
# Params aligned with the structure they're part of?
assert_requested(:post, url,
body: hash_including({name: 'web', events: ['release'], active: true,
config: {url: 'http://example.com/webhooks/release', content_type: 'json'}}))
# Something else?
@davefp
davefp / keybase.md
Created Mar 31, 2014
Keybase proof
View keybase.md

Keybase proof

I hereby claim:

  • I am davefp on github.
  • I am davefp (https://keybase.io/davefp) on keybase.
  • I have a public key whose fingerprint is 3ABF B586 F553 4C5C B6D8 FED4 BC7B B853 4735 E097

To claim this, I am signing this object:

View rake stats
+----------------------+-------+-------+---------+---------+-----+-------+
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| Controllers | 226 | 183 | 7 | 35 | 5 | 3 |
| Helpers | 6 | 6 | 0 | 0 | 0 | 0 |
| Models | 94 | 77 | 6 | 15 | 2 | 3 |
| Mailers | 0 | 0 | 0 | 0 | 0 | 0 |
| Javascripts | 289 | 146 | 0 | 20 | 0 | 5 |
| Libraries | 41 | 34 | 0 | 6 | 0 | 3 |
| Controller tests | 315 | 246 | 8 | 2 | 0 | 121 |
@davefp
davefp / checklist.md
Last active Dec 24, 2015
My checklist for building rockets in KSP
View checklist.md

#Kerbal Space Program Pre-Flight Checklist

Launch Vehicle

  • Canards
  • Sepatrons
  • Staging order

Lander

View gist:6510142
My favourite animal is the ferret.
My second favourite animal is the Queen.
View gist:6453348
David loves the Queen. She is the ruler of our Commonwealth and owns some corgis and likes riding horses.
@davefp
davefp / curl.sh
Last active Dec 20, 2015
Dashing dashboard API cURL example
View curl.sh
curl -i -d '{ "auth_token": "YOUR_AUTH_TOKEN", "event": "reload"}' http://localhost:3030/dashboards/sample
@davefp
davefp / Gemfile.lock
Created Mar 13, 2013
Gemfile.lock for dashing
View Gemfile.lock
GEM
remote: http://rubygems.org/
specs:
backports (3.1.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.4.0)
daemons (1.1.9)
dashing (1.0.4)
@davefp
davefp / weather_multiple.rb
Created Mar 7, 2013
Send to multiple weather widgets from a single job
View weather_multiple.rb
require 'net/http'
require 'xmlsimple'
# Get a WOEID (Where On Earth ID)
# for your location from here:
# http://woeid.rosselliot.co.nz/
woe_ids = {"weather-ottawa" => 3369, "weather-toronto" => 123, "weather-montreal" => 456}
# Temerature format:
# 'c' for Celcius
You can’t perform that action at this time.