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
# 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" | |
} |
#!/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 |
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' |
#!/usr/bin/env bash | |
git stash -q --keep-index | |
phpunit tests/ | |
RESULT=$? | |
git stash pop -q | |
[ $RESULT -ne 0 ] && exit 1 | |
exit 0 |
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
# 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() |
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. |
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 |