Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").
Author: Chris Jacob @_chrisjacob
Tutorial (Gist): https://gist.github.com/833223
#!/usr/bin/env python | |
# | |
# find-duplicates | |
# by Keith Gaughan <http://talideon.com/> | |
# | |
# Finds an lists any duplicate files in the given directories. | |
# | |
# Copyright (c) Keith Gaughan, 2008. | |
# All Rights Reserved. | |
# |
# A priority queue-based, wheel-using incremental Sieve of Eratosthenes. | |
# See `The Genuine Sieve of Eratosthenes' by Melissa E. O'Neill | |
# (http://www.cs.hmc.edu/~oneill/papers/Sieve-JFP.pdf) | |
# for the Haskell incremental sieve which inspired this implementation | |
# (along with detailed analyses of performance of several Haskell | |
# sieves). | |
# | |
# Usage: | |
# Sieve() -> simple SoE | |
# Sieve(Wheel(4)) -> SoE + a wheel based on 4 initial primes |
Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").
Author: Chris Jacob @_chrisjacob
Tutorial (Gist): https://gist.github.com/833223
Copyright (c) 2012, Miguel Araujo | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
* Redistributions of source code must retain the above copyright notice, this | |
list of conditions and the following disclaimer. | |
* Redistributions in binary form must reproduce the above copyright notice, |
import re | |
import os | |
import ast | |
import glob | |
import collections | |
class ImportVisitor(ast.NodeVisitor): | |
def __init__(self): | |
self.imports = [] | |
self.modules = collections.defaultdict(list) |
import java.lang.Boolean; | |
import java.lang.Integer; | |
public class AtkinSieveArray { | |
static private int count(boolean[] buffer) { | |
int counter = 0; | |
for(int i = 2; i < buffer.length; ++i) { | |
if(buffer[i]) { | |
counter++; |
#!/usr/bin/env python | |
import os | |
import random | |
import time | |
import platform | |
snowflakes = {} | |
try: | |
# Windows Support |
import sys | |
import baker | |
import slumber | |
import pathlib | |
import colorama | |
API_URL = 'https://api.github.com/' | |
def get_api(auth=None): |
import abc | |
import re | |
import argparse | |
class ArgBaseError(Exception): pass | |
def _inject_vals(name, bases, dict): | |
expected_args = {} |
""" | |
Two things are wrong with Django's default `SECRET_KEY` system: | |
1. It is not random but pseudo-random | |
2. It saves and displays the SECRET_KEY in `settings.py` | |
This snippet | |
1. uses `SystemRandom()` instead to generate a random key | |
2. saves a local `secret.txt` |