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
| Usage: pip wheel [OPTIONS] PACKAGE_NAMES... | |
| Creates wheel archives from your requirements and place into ./wheels | |
| (requires distribute>0.6.28 and wheel) | |
| -w --wheel-dir <DIR> //alternative dir to place wheels into | |
| --force-rebuild //rewrite existing wheels | |
| --unpack-only <DIR> //unpack to dir, for manual building with "setup.py bdist_wheel" | |
| -r, --requirement <FILENAME> | |
| -f, --find-links <URL> |
| """ | |
| 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` |
| import abc | |
| import re | |
| import argparse | |
| class ArgBaseError(Exception): pass | |
| def _inject_vals(name, bases, dict): | |
| expected_args = {} |
| import sys | |
| import baker | |
| import slumber | |
| import pathlib | |
| import colorama | |
| API_URL = 'https://api.github.com/' | |
| def get_api(auth=None): |
| #!/usr/bin/env python | |
| import os | |
| import random | |
| import time | |
| import platform | |
| snowflakes = {} | |
| try: | |
| # Windows Support |
| 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++; |
| import re | |
| import os | |
| import ast | |
| import glob | |
| import collections | |
| class ImportVisitor(ast.NodeVisitor): | |
| def __init__(self): | |
| self.imports = [] | |
| self.modules = collections.defaultdict(list) |
| 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, |
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
| # 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 |