Skip to content

Instantly share code, notes, and snippets.

@shauns
shauns / gist:1e08504b85b16a038a42
Created June 16, 2015 16:18
Snapshot site and convert to thumbnail
capturejs --uri="http://airbnb.com" --viewportsize="1152x720" --cliprect="0x0x1152x720" --output="airbnb.png" && gm convert airbnb.png -resize "576x" -unsharp 2x0.5+0.7+0 airbnb-preview.jpg && rm airbnb.png && open airbnb-preview.jpg

Keybase proof

I hereby claim:

  • I am shauns on github.
  • I am shauns (https://keybase.io/shauns) on keybase.
  • I have a public key whose fingerprint is 89B2 3B21 4B0F DB7E 3A7F 695B BAB7 22A2 3A5D 98FD

To claim this, I am signing this object:

(function (window, videojs) {
videojs.plugin('pauseOnCue', function() {
var myPlayer = this,
cuePointAra = [],
allCuePointData;
myPlayer.on('loadstart', function () {
cuePointAra = myPlayer.mediainfo.cue_points;
var tt = myPlayer.textTracks()[0];
if (tt) {
.vjs-paused .vjs-big-play-button {
display: block;
color: white;
}
<script src='https://www.workable.com/assets/embed.js' type='text/javascript'></script>
<script type='text/javascript' charset='utf-8'>
whr(document).ready(function(){
whr_embed(116603, {detail: 'titles', base: 'jobs', zoom: 'country', grouping: 'none'});
});
</script>
<div id="whr_embed_hook"></div>
@shauns
shauns / slack.py
Created August 10, 2016 14:44
Deleting and listing slack files, sorting by size
from slacker import Slacker
import itertools
slack = Slacker('<API TOKEN>')
pages = slack.files.list(page=1).body['paging']['pages']
all_the_files = list(itertools.chain(*[slack.files.list(page=i).body['files'] for i in range(1,pages + 1)]))
biggest_first = sorted(all_the_files, key=lambda f: f['size'], reverse=True)
@shauns
shauns / creating_auth0_user.py
Last active September 23, 2016 10:04
Use management API to create an Auth0 user
import requests
# Needs create:users scope, https://auth0.com/docs/api/management/v2#!/Users/post_users
headers = {'Authorization': 'Bearer qwertyuiop'}
body = {'connection': 'Username-Password-Authentication', 'email': u'[email protected]', 'family_name': 'Bloggs', 'given_name': 'Joe', 'password': 'secrets'}
res = requests.post('https://freeformers.auth0.com/api/v2/users', json=body, headers=headers)
res.json()
@shauns
shauns / qr.sh
Created October 25, 2016 10:26
QR code to terminal
qrencode -o - 1234eabcdf | imgcat
@shauns
shauns / gist:c8bc24868c1e9c61aa3f8cd80efeb332
Created October 27, 2016 10:06
Running Django manage commands on EBS
[eb ssh]
source /opt/python/run/venv/bin/activate
source /opt/python/current/env
cd /opt/python/current/app
./manage.py help
@shauns
shauns / backing-up-github.sh
Created November 11, 2016 16:35
Backing up Github repositories and wikis and issues
# uses https://github.com/josegonzalez/python-github-backup
github-backup -o ff-backup -p "API token" -u shauns --all -P -R "ff-docs" Freeformers