Skip to content

Instantly share code, notes, and snippets.

fjsj / gist:92e8687de77917a7c084
Last active Aug 29, 2015
Print a properly secure SECRET_KEY in Django. Run this in your terminal.
View gist:92e8687de77917a7c084
python -c 'import random; print "".join([random.SystemRandom().choice("abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)") for i in range(50)])'
fjsj / hn_seach.js
Last active Sep 21, 2015 — forked from kristopolous/hn_seach.js
hn job query search
View hn_seach.js
function query() {
total = 0, shown = 0,
// HN is done with very unsemantic classes.
job_list ='.c5a,.cae,.c00,.c9c,.cdd,.c73,.c88')),
query_list =;
// This traverses up the dom stack trying to find a match of a specific class
function up_to(node, klass) {
if (node.className === klass) {
fjsj /
Last active May 21, 2017 — forked from nealtodd/gist:a8f87b0d95e73eb482c5
Django management command to detect missing migration files.
import sys
from django.apps import apps
from django.conf import settings
from import BaseCommand
from django.db import connections
from django.db.migrations.autodetector import MigrationAutodetector
from django.db.migrations.executor import MigrationExecutor
from django.db.migrations.state import ProjectState
from django.db.utils import OperationalError

Keybase proof

I hereby claim:

  • I am fjsj on github.
  • I am fjsj ( on keybase.
  • I have a public key whose fingerprint is F171 C0BF 34E3 858D 39A1 0A5B AC1C 200C F672 6AE0

To claim this, I am signing this object:

fjsj / dropzone-createThumbnailFromUrl-ios-fix.js
Created Sep 29, 2016
Dropzone monkey patch to fix iOS photo orientation bug
View dropzone-createThumbnailFromUrl-ios-fix.js
/* Start of monkey patch to fix iOS photo orientation bug.
Diff here: */
Dropzone.prototype.createThumbnailFromUrl = function(file, imageUrl, callback, crossOrigin) {
var img;
img = document.createElement("img");
if (crossOrigin) {
img.crossOrigin = crossOrigin;
img.onload = (function(_this) {
fjsj / django-apps-common-structure.txt
Created Apr 2, 2017
Django apps common structure
View django-apps-common-structure.txt
fjsj /
Last active Apr 21, 2018
PyCon and DjangoCon commonly accepted talk types (with examples)


Best/worst practices