Skip to content

Instantly share code, notes, and snippets.

mozillalives /
Created Sep 25, 2018
Elastic Beanstalk Docker run config
"AWSEBDockerrunVersion": 2,
"volumes": [
"name": "shark-cat-app",
"host": {
"sourcePath": "/var/app/current"
mozillalives /
Last active May 18, 2018 — forked from pinfort/
Django database fields for using unsigned bigint column
from django.db import models
from django.utils.translation import ugettext
class PositiveBigIntegerRelDbTypeMixin(models.fields.PositiveIntegerRelDbTypeMixin):
def rel_db_type(self, connection):
if connection.features.related_fields_match_type:
return self.db_type(connection)
return models.BigIntegerField().db_type(connection=connection)
mozillalives / Toggle Hot Corners.scpt
Created Sep 1, 2017
Just a simple applescript I wrote years ago to toggle hot corners on or off. Useful when you're about to play a game and don't want to suddenly have your display go to sleep XD
View Toggle Hot Corners.scpt
property theSavedValues : {"Put Display to Sleep", "Desktop", "Mission Control", "Application Windows"}
# or this can be something like
# property theSavedValues : {"Put Display to Sleep", "-", "-", "-"}
tell application "System Preferences"
set current pane to pane id ""
tell application "System Events"
delay 1 # you might need to tweak this for your system
from whoosh import index, qparser
def search(blah, page, length):
ix = index.open_dir(INDEX_DIR)
with ix.searcher() as s:
q = qparser.QueryParser("content", ix.schema).parse(blah)
r = s.search_page(q, page, pagelen=length)
t = []
for res in r:
t.append({'field1': res['field1'],
mozillalives / gist:1655083
Created Jan 22, 2012
Improved notify for long running terminal tasks
View gist:1655083
#!/usr/bin/env python
# I tried the notify script at but
# I always received errors with it. Not being a bash guy, I wrote mine in python.
# To use this, just save it as something like "n" in your bin/, mark it as executable and prepend it to
# whatever you plan on calling. For example.
# nj rm -rf blah
import sys
You can’t perform that action at this time.