Skip to content

Instantly share code, notes, and snippets.

View philippbosch's full-sized avatar

Philipp Bosch philippbosch

View GitHub Profile
@philippbosch
philippbosch / _animations.scss
Last active August 29, 2019 00:20
Compass mixins for CSS keyframe animations
@import "compass/css3/shared";
@mixin keyframes($name) {
@-webkit-keyframes $name {
@content;
}
@-moz-keyframes $name {
@content;
}
@thbar
thbar / Guardfile
Last active December 15, 2015 10:28
How to automatically restart the simulator in RubyMotion when code is updated (beta version!)
require 'childprocess'
guard 'shell' do
watch %r{^app/(.+)\.rb$} do |m|
`killall rake`
# Why this:
# - spawn a child process to avoid locking Guard
# - make sure that the child process has stdout and stdin otherwise it crashes
# - bonus point: get REPL access in the simulator!
@rnorth
rnorth / per_app_postgres.sh
Last active December 18, 2015 10:59
A 'predeploy' script for dokku to automatically create an empty postgres database for new apps. Would require pre/post deploy hook support in dokku.
#!/bin/bash
set -e
export APP_NAME=$1
export PGHOST=$(< $HOME/predeploy.d/postgres_host)
export PGUSER=admin
if [ -f $HOME/$APP_NAME/DATABASE_URL ]; then
# Database URL is already set - DB must exist
DATABASE_URL=$(cat $HOME/$APP_NAME/DATABASE_URL)
@RobertKolner
RobertKolner / disable_signals.py
Last active August 15, 2018 10:11
[Note: for a better version, visit here: https://github.com/RobertKolner/django-signal-disabler] Temporarily disable all signals in django
from collections import defaultdict
from django.db.models.signals import *
class DisableSignals(object):
def __init__(self, disabled_signals=None):
self.stashed_signals = defaultdict(list)
self.disabled_signals = disabled_signals or [
pre_init, post_init,
pre_save, post_save,