Skip to content

Instantly share code, notes, and snippets.

@maiiku
maiiku / disable_signals.py
Last active May 25, 2021 07:48 — forked from bruce-shi/disable_signals.py
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,
@maiiku
maiiku / introrx.md
Created August 28, 2018 06:17 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@maiiku
maiiku / _upgrade-pg9.4-to-pg9.5.md
Created January 8, 2017 22:48 — forked from chbrown/_upgrade-pg9.4-to-pg9.5.md
Upgrade PostgreSQL 9.4 to 9.5 on Mac OS X with Homebrew

First, check your current config (example output in homebrew.mxcl.postgresql.plist.xml lower down in this gist):

cat ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

Most importantly, note the -D /usr/local/var/postgres argument.

Second, shut down your current PostgreSQL.

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist