Skip to content

Instantly share code, notes, and snippets.

View adambutler's full-sized avatar

Adam Butler adambutler

View GitHub Profile
@adambutler
adambutler / README.md
Last active August 29, 2015 14:04
WP-Engine mount SFTP for automation yo!
brew install osxfuse
If upgrading from a previous version of osxfuse, the previous kernel extension
will need to be unloaded before installing the new version. First, check that
no FUSE-based file systems are running:

  mount -t osxfusefs
@adambutler
adambutler / cordovaParse.md
Last active August 29, 2015 14:04
Cordova Push-notifications with Parse

Parse

  1. Create an application
  2. Goto Data Browser
  3. Create a new class, select installation
  4. Add a new column call it Id

Apple Developer

  1. Create a certificate and provisioning profile for push
@adambutler
adambutler / diy.js
Created September 26, 2014 13:28
diy.js
$ = document
@adambutler
adambutler / regex.md
Created October 13, 2014 09:17
Regex to convert a normal css url to a rusic liquid css url

Find

url\('(.*?)'\)

Replace

url(#{"{{ '$1' | image_url }}"})

@adambutler
adambutler / gist:399b0cc481c0dfebb435
Created November 6, 2014 13:10
Handbreak - Fix iPhone Video

HandBrakeCLI -i ./src.mp4 -o ./out.mp4 --rotate=4 --crop 0:0:424:424

@adambutler
adambutler / cap.md
Last active August 29, 2015 14:17
Capistrano Errors Troubleshooting

Capistrano errors troubleshooting

SSHKit::Runner::ExecuteError: [...] bundle exit status: 5

Capistrano runs bundler with --quiet by default, this can cause bundler issues to not bubble back up to capistrano. You can fix this by adding this in your deploy.rb file -

set :bundle_flags, "--deployment"
@adambutler
adambutler / generate_uid.rb
Created May 20, 2015 10:15
Generate a UID
def generate_uid
self.uid = loop do
uid = SecureRandom.urlsafe_base64(nil, false)
break uid unless Model.exists?(uid: uid)
end
end
@adambutler
adambutler / readme.md
Last active August 29, 2015 14:25
whatthefuckhaveibeenworkingon.sh

example

Install

Add the whatthefuckhaveibeenworkingon function into your .zshrc / .bashrc file.

Usage

whatthefuckhaveibeenworkingon

var divider, mappedCoords, an, bn, cn, dn, en, fn;
var ref0 = [0, 0]; // upper left corner
var ref1 = [0, 1024]; // lower left corner
var ref2 = [1280, 0]; // upper right corner
var ref3 = [1280, 1024]; // lower right corner
// Tomap -> which are mapped to [ref0, ref1, ref2, ref3, ref4]
var tomap0 = [0, 0]; // upper left corner
var tomap1 = [0, 768]; // lower left corner
i = 100
z = []
i.times do
a = []
while true
c = (0...5).map { (65 + rand(26)).chr }.join
break if a.include? c