Skip to content

Instantly share code, notes, and snippets.

View rfreebern's full-sized avatar
⛰️
Working from home

Ryan Freebern rfreebern

⛰️
Working from home
View GitHub Profile
# install both ffmpeg and gifsicle first
function mkgif () {
BASE_FILENAME=${*%.*}
`ffmpeg -i "$1" -loglevel quiet -hide_banner -stats -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=10 > "$BASE_FILENAME.gif" 2>/dev/null`
echo "Wrote $BASE_FILENAME.gif"
}
@rfreebern
rfreebern / move_to_root.php
Created September 17, 2018 15:31
Old script to move Phabricator projects to root to allow reorganization
#!/usr/bin/env php
<?php
// See <https://secure.phabricator.com/T10350> for discussion.
require_once 'scripts/__init_script__.php';
$args = new PhutilArgumentParser($argv);
$args->parseStandardArguments();
$args->parse(
There once was a maker, who worked very hard and was very honest: but still he could not earn enough to live upon; and at last all he had in the world was gone, save just PLA enough to make one little 3D-printed doohickey.
Then he drafted his design out, all ready to print up the next day, meaning to rise early in the morning to his work. His conscience was clear and his heart light amidst all his troubles; so he went peaceably to bed, left all his cares to Heaven, and soon fell asleep. In the morning after he had said his prayers, he sat himself down to his work; when, to his great wonder, there stood the whatsit all ready made, filled with intricate detail and a level of polish never before seen, within the printer. The good man knew not what to say or think at such an odd thing happening. He looked at the workmanship; there was not one false seam in the whole job; all was so neat and true, that it was quite a masterpiece.
The same day a customer came in, and the thingamajig suited him so well that he wi
@rfreebern
rfreebern / gist:6828053
Created October 4, 2013 15:45
Handy screenshot thing
sudo apt-get install scrot xclip dropbox
scrot -s '%Y-%m-%d_%s-$wx$h.png' -e 'mv $f ~/Dropbox/Public/screenshots && echo -n https://dl.dropbox.com/u/19958133/screenshots/$f | xclip -selection c'
@rfreebern
rfreebern / pre-commit.sh
Created October 12, 2012 14:51
Run phpunit tests before allowing a commit
#!/usr/bin/env bash
git stash -q --keep-index
phpunit tests/
RESULT=$?
git stash pop -q
[ $RESULT -ne 0 ] && exit 1
exit 0
@rfreebern
rfreebern / gist:2979120
Created June 23, 2012 17:27
installing mozillians in a virtualenv

Repo clone:

git clone git://github.com/mozilla/mozillians.git mozillians
cd mozillians
mkvirtualenv mozillians
git submodule sync
git submodule update --init --recursive
pushd vendor
git submodule sync

git submodule update --init --recursive

@rfreebern
rfreebern / su.py
Created June 23, 2012 11:43 — forked from nigelbabu/su.py
make me a vouched super staff user on mozillians
# pipe this to manage like $ cat su.py | ./manage.py shell
from apps.users.models import User, UserProfile
u = User.objects.get(email="user@email.address")
u.is_staff = True
u.is_superuser = True
u.save()
p = UserProfile.objects.get(user=u)
p.is_vouched = True
p.save()
@rfreebern
rfreebern / README
Created October 3, 2011 19:52
Use bitbucket as a private offsite code backup
Now that bitbucket supports git, it's easy to use their service as a free, private, offsite code backup. Just create an empty repo for your project on bitbucket, add it as a remote to your development repo:
username@host:~/project$ git remote add bitbucket git@bitbucket.org:username/project.git
and use this post-commit hook to silently and automatically push your changes up after each commit.
@rfreebern
rfreebern / README
Created September 28, 2011 18:11
git post-receive hook for atomic deployment
On server:
mkdir -p ~/deploy/mysite.git && cd $_
git init --bare
(place the post-receive file in hooks/post-receive)
mkdir -p /var/www/mysite
Make sure your virtual host's DocumentRoot is set to /var/www/mysite/live
On development machine:
git remote add deploy ssh://username@server/home/username/deploy/mysite.git