Skip to content

Instantly share code, notes, and snippets.

View rujmah's full-sized avatar
👨‍🚀
Looking to the future

Robin Mayfield rujmah

👨‍🚀
Looking to the future
View GitHub Profile
@rujmah
rujmah / command.txt
Last active August 29, 2015 14:24 — forked from nrk/command.txt
ffprobe -v quiet -print_format json -show_format -show_streams "lolwut.mp4" > "lolwut.mp4.json"

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@rujmah
rujmah / cuke_devise1.rb
Created June 13, 2015 14:25
Cucumber and Devise template for Rails
# template includes:
# cucumber and devise
# gem 'pg'
gem 'devise'
gem_group :development, :test do
gem 'pry-rails'
gem 'rspec-rails'
@rujmah
rujmah / Dockerfile
Last active August 29, 2015 14:22
Nodejs with ffmpeg Dockerfile
# Creates am image with node and ffmpeg
# run:
# $ docker build -t reponame/imagename:version
FROM node:0.12
RUN apt-get update \
&& apt-get install yasm \
&& wget http://ffmpeg.org/releases/ffmpeg-2.5.tar.bz2 \
&& tar -xvf ffmpeg-2.5.tar.bz2 \
&& cd ffmpeg-2.5 \
@rujmah
rujmah / keybase.md
Created December 31, 2014 16:58
Keybase Proof

Keybase proof

I hereby claim:

  • I am rujmah on github.
  • I am rujmah (https://keybase.io/rujmah) on keybase.
  • I have a public key whose fingerprint is 029E 1C3B A4ED 2386 72CA 4ADE 1680 E17F 4821 B295

To claim this, I am signing this object:

@rujmah
rujmah / api.js
Created August 4, 2014 16:34 — forked from fwielstra/api.js
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');

Restore MySQL from Amazon S3

This is a hands-on way to pull down a set of MySQL dumps from Amazon S3 and restore your database with it

Sister Document - Backup MySQL to Amazon S3 - read that first

1 - Set your MySQL password and S3 bucket, make a temp dir, get a list of snapshots

# Set our variables

export mysqlpass="ROOTPASSWORD"

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

# This is a short collection of tools that are useful for managing your
# known_hosts file. In this case, I'm using the '-f' flag to specify the
# global known_hosts file because I'll be adding many deploy users on this
# system. Simply omit the -f flag to operate on ~/.ssh/known_hosts
# Add entry for host
ssh-keyscan -H github.com > /etc/ssh/ssh_known_hosts
# Scan known hosts
ssh-keygen -f /etc/ssh/ssh_known_hosts -H -F github.com

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods