Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀

James Ramsay jamesramsay

🚀
View GitHub Profile
@jamesramsay
jamesramsay / example.rb
Created Jul 17, 2020 — forked from mislav/example.rb
Dump objects into YAML using specific style
View example.rb
full_data = {
response: {body: StyledYAML.literal(DATA.read), status: 200},
person: StyledYAML.inline('name' => 'Steve', 'age' => 24),
array: StyledYAML.inline(%w[ apples bananas oranges ])
}
StyledYAML.dump full_data, $stdout
__END__
{
View init.d.homebridge.sh
#!/bin/sh
### BEGIN INIT INFO
# Provides: homebridge
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop:
# Description: HomeKit support for the impatient
### END INIT INFO
# -*- coding: utf-8 -*-
@jamesramsay
jamesramsay / books.md
Last active Dec 9, 2019
Books I finished reading
View books.md

Books I finished reading in 2019.

  • Death's End - Cixin Liu
  • Surprised by Hope - N. T. Wright
  • Why Liberalism Failed - Patrick Deneen
  • Escaping the Build Trap - Melissa Perri
  • Childhood's End - Arthur C. Clarke
  • Dune - Frank Herbert

Books I finished reading in 2018.

View keybase.md

Keybase proof

I hereby claim:

  • I am jamesramsay on github.
  • I am jramsay (https://keybase.io/jramsay) on keybase.
  • I have a public key whose fingerprint is FF28 FAB1 8CD4 198C 2658 4CF1 642F EA93 2DC9 67CB

To claim this, I am signing this object:

@jamesramsay
jamesramsay / README.md
Last active Jun 12, 2022
Gmail: delete old emails automatically
View README.md

Gmail: delete old emails automatically

Automatically deletes old emails that match the specified label.

Get started

  • Create a new Google Apps Script at https://script.google.com
  • Overwrite the placeholder with the javascript below
  • Update the following constants:
  • LABEL_TO_DELETE: the label that should be have old messages deleted
@jamesramsay
jamesramsay / README.md
Last active Jun 10, 2017
HAR analysis
View README.md

Analysis of editorial vs advertising content

Methodology:

  • Access mobile site using Chrome device debugging tools
  • Record network activity
  • Save as HAR
  • Clean recording

Clean Recording

@jamesramsay
jamesramsay / creative.md
Last active Aug 29, 2015
API Blueprint puzzle #1
View creative.md

Group Creatives

Creative [/creatives/{creativeId}]

  • Parameters

    • creativeId (integer, 1) ... id of the creative
  • Model

  • Header

@jamesramsay
jamesramsay / brewery.coffee
Created Jun 16, 2014
Cassowary.js example
View brewery.coffee
# PROBLEM: Small brewery produces ale and beer
# Production is limited by scarce resources: corn, hops, barley malt.
# Recipes for ale and beer require differenty proportions of resources
#
# Ale (barrel)
# - 5lb corn
# - 4oz hops
# - 35lb malt
# - $13 profit
#