Skip to content

Instantly share code, notes, and snippets.

@okjake
okjake / gist:073f4c0b2aa3906c400a20a34164f9b8
Last active August 14, 2018 10:46
How to complete an initial time machine backup in under forty years
# debug.lowpri_throttle_enabled: 1 -> 0
# remove low priority process throttling
sudo sysctl debug.lowpri_throttle_enabled=0
# do your backup
# if everything slows down, your macbook just
# caught fire or the backup finishes re-enable it
sudo sysctl debug.lowpri_throttle_enabled=1
periods: [
{
open: {
day: 0,
hours: 8,
minutes: 30,
},
close: {
day: 0,
hours: 13,
@okjake
okjake / hub-digest-usage.sh
Last active July 11, 2016 14:00
Example usage for GitHub digest
wt cron schedule \
-s MANDRILL_API_KEY=<api key> \
--param from=<from address, configured in mandrill> \
--param repository=<github repo to watch eg. facebook/react> \
--param to=<a single email address to send to> \
'0 8 * * *' \
https://gist.githubusercontent.com/okjake/70f42a461585ca3ff3064c0b467b8283/raw/a262537f1959a11e8d53e398e8c6be4ed2ca190e/hub-digest.js
@okjake
okjake / hub-digest.js
Created July 11, 2016 11:38
GitHub digest webtask
"use latest";
const _ = require('lodash');
const request = require('superagent');
const moment = require('moment');
const mandrillApi = require('mandrill-api/mandrill');
/*
* utilites
*/
function time(timestamp) {
{
"id": "example-promo",
"name": "Example Promo",
"products": ["News"],
"types": ["Promo Groups"],
"description": "Promotes three items in a row",
"owner": "jake@tuimedia.com",
"examples": [
{
"name": "Domestic example",
@okjake
okjake / patterns.json
Last active January 26, 2016 12:07
pattern manifest
{
"patterns": [
{
"id": "news-card-audio-001",
"name": "Audio Card",
"product": "News",
"type": "Card",
"inUse": true,
"description": "Used to play audio without leaving the current page",
"owner": "test@example.com",
@okjake
okjake / convert
Last active August 29, 2015 14:07
video transcoding for the web
#!/bin/bash
# Produces HTML5 friendly video formats
# Usage (OSX):
# brew install ffmpeg --with-libvpx --with-libvorbis --with-theora
# curl https://gist.githubusercontent.com/okjake/7d347f26b8bdc9496b67/raw/f2c91daf1ebacc3c117d8b304403f03b157f1109/gistfile1.txt > cnv.sh && chmod u+x cnv.sh
# cnv.sh /path/to/video1.mp4 /path/to/video2.mov
if [ ! $# -gt 0 ]; then
@okjake
okjake / gist:441e807515bc740afcf1
Created August 31, 2014 16:59
Minimal PS1. Uses git-prompt.sh
source ~/.git-prompt.sh
export PS1='\[\033[0;31m\]$(__git_ps1 " (%s)") \[\033[0;37m\]~ '
@okjake
okjake / atmos
Last active August 29, 2015 13:57
EMC Atmos file upload
# Edit the following with relevant details
uid=""
key=""
endpoint=""
file_to_upload="/local/path/to/large/file.ext"
atmos_dir="/test/"
contentType="image/jpeg"
# Stop editing here
filename=`basename $file_to_upload`
@okjake
okjake / deploy.rb
Created December 12, 2013 13:06
Generic capistrano / capifony configuration for Symfony 2 project deployment to dopey servers
# app/config/deploy.rb
# Replace strings in "CAPITALS"
# Assumptions, adjust to taste:
# - Using Composer
# - No git on remote server
# - Staging and production environments are on the same IP
# - Database and webserver are on the same IP
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = =