Skip to content

Instantly share code, notes, and snippets.

Avatar

Farid Rener proteusvacuum

View GitHub Profile
View gist:82332db141c3545fffbf

Keybase proof

I hereby claim:

  • I am proteusvacuum on github.
  • I am provac (https://keybase.io/provac) on keybase.
  • I have a public key whose fingerprint is AF3D FDA8 B0EF 3B8F BE71 E1A9 6964 E318 5B7D A47E

To claim this, I am signing this object:

View gist:235ddf5b4da0ed8911aa

Ran into a bunch of db issues when deploying staging... fun!

Name conflict between 2 migrations in accounting: 0041_update_privileges_locations.py 0041_remove_like_indexes.py Since these were applied out of name order, South complained.

I resolved this by running ./manage.py migrate --merge accounting

View update_translations.py
#!/usr/bin/env python
import csv
def main():
translations = {}
with open('messages_en-2.txt', 'rb') as translation_file:
translation_reader = csv.reader(translation_file, delimiter="=")
for row in translation_reader:
if len(row) > 1:
@proteusvacuum
proteusvacuum / mock_brownbag.py
Created Oct 28, 2015
Python mocks brownbag
View mock_brownbag.py
# coding: utf-8
from mock import MagicMock, call, patch
# “mock is a library for testing in Python. It allows you to replace parts of
# your system under test with mock objects and make assertions about how they
# have been used.”
thing = MagicMock(name='thing', return_value=100)
print thing()
@proteusvacuum
proteusvacuum / open_CI_links_new_tab.user.js
Last active Nov 27, 2015
Open CI links on github in a new window
View open_CI_links_new_tab.user.js
@proteusvacuum
proteusvacuum / Kafka topics.sh
Last active Jul 7, 2016
Delete Kafka topics
View Kafka topics.sh
sudo rm -r ~/.local/share/dockerhq/zookeeper ~/.local/share/dockerhq/kafka
./scripts/docker restart
./manage.py create_kafka_topics
You can’t perform that action at this time.