Skip to content

Instantly share code, notes, and snippets.

ryanmark / embed_helper.js
Created Sep 19, 2019
Little helper module for building embeddable iframes that work with pym.js and AMP
View embed_helper.js
const pym = require('pym.js')
const pymChild = window && window.pymChild ? window.pymChild : new pym.Child()
if ( window && !window.pymChild ) window.pymChild = pymChild
function sendHeight() {
// Tell pym and AMP to update the height
if ( window && window.parent )

Keybase proof

I hereby claim:

  • I am ryanmark on github.
  • I am ryanmark ( on keybase.
  • I have a public key ASCNxKeQujzWBWLLKDBvadJX8YSSitIX9dJzVelg6xBGRgo

To claim this, I am signing this object:

ryanmark / download.rb
Created Dec 6, 2018
ruby download with progress
View download.rb
def download(src, dest)
uri = URI.parse(src)
yield "Download #{src} to #{dest}"
mutex =
size = 0
downloaded = 0
ryanmark / test-phantom.js
Last active Jun 16, 2016
Phantom js doesn't seem to handle em-based media queries properly when zoomed
View test-phantom.js
var WebPage = require('webpage'),
System = require('system');
var address = System.args[1];
var zoom = System.args[2];
var width = 700;
var page = WebPage.create();
page.viewportSize = {
ryanmark /
Last active Aug 8, 2019 — forked from jdowning/
Script to clean up Ubuntu EC2 instance before packaging as an AMI
# This script cleans up your EC2 instance before baking a new AMI.
# Run the following command in a root shell:
# bash <(curl -s
function print_green {
echo -e "\e[32m${1}\e[0m"
ryanmark /
Created Jul 10, 2015
Why does this script throw an UnboundLocalError?
#!/usr/bin/env python
foo = 0
bar = {'foo': 0}
def wtf():
# Totally fine
bar['foo'] += 1
ryanmark /
Last active Aug 29, 2015
This tiny script allows you to run many things in the background, then shuts them all down when you hit ctrl-c
# This tiny script allows you to run many things in the background, then shuts them all down
# when you hit ctrl-c. Put your commands below, and be sure to include the & at the end of the
# line to make the command run in the background.
# Your commands here
# EX: compass watch &
# Kill all subprocesses when the user does ctrl-c
ryanmark /
Last active Sep 2, 2015
Import issues from markdown formatted text into github issues

Generate Github Issues

This script will read a markdown-formatted text file and generate milestones and issues in a Github project.

The script will go line by line, looking for lines that start with #, - or *. Lines that start with # will create a new milestone. All bulleted items after a header will be created as issues and assigned to the last milestone.

Milestones will be automatically assigned due-dates. Starting with the closest Friday at 1:30pm

ryanmark / fixmic
Created Jan 5, 2015
Fix your Mac OS X microphone
View fixmic
sudo kill -9 `ps ax|grep 'coreaudio[a-z]' |awk '{print $1}'`
ryanmark /
Last active Aug 9, 2016
Setup or update the voxmedia middleman rig
echo "#!/bin/bash" >/usr/local/bin/setup-vox-middleman
echo 'exec bash -c "$(curl -fsSL"' >>/usr/local/bin/setup-vox-middleman
chmod +x /usr/local/bin/setup-vox-middleman
exec /usr/local/bin/setup-vox-middleman