Skip to content

Instantly share code, notes, and snippets.

View jcinis's full-sized avatar
BECOMING A SPHERE

Jessey White-Cinis jcinis

BECOMING A SPHERE
View GitHub Profile
@jcinis
jcinis / gist:2866253
Created June 4, 2012 04:02
Generate a random username for Django
from random import choice
from string import ascii_lowercase, digits
from django.contrib.auth.models import User
def generate_random_username(length=16, chars=ascii_lowercase+digits, split=4, delimiter='-'):
username = ''.join([choice(chars) for i in xrange(length)])
if split:
username = delimiter.join([username[start:start+split] for start in range(0, len(username), split)])
@jcinis
jcinis / EmailSignup.php
Last active December 14, 2015 15:59
Quick and dirty email signup in php and sqlite
<?php
class EmailSignup {
private $db;
// defaults can be overwritten on instantiation
private $filename = "emailsignups.sqlite";
private $tablename = "emails";
@jcinis
jcinis / jquery.append.js
Created March 15, 2013 16:00
jQuery plugin to add event triggering to dom elements anytime they append or are appended. The reason for creating this is was to allow backbone.js views to be aware of their being added to the dom and to trigger post-render functionality.
/**
* Adds event triggering whenever an append takes place.
*
* - Parent is given an "append" trigger with the child as an arguement
* - Child is given an "appended" trigger with the parent as an argument
*
* @author Jessey White-Cinis <jcinis@gmail.com>
*/
(function($) {
var jqueryAppend = $.fn.append;

I hereby claim:

  • I am jcinis on github.
  • I am jcinis (https://keybase.io/jcinis) on keybase.
  • I have a public key whose fingerprint is F4CB 4F01 3D7C 0373 181E FA7A 6BEE 105D 780B 8BA7

To claim this, I am signing this object:

{
server {
listen 80;
server_name _;
access_log /var/log/nginx/proxy.access.log;
underscores_in_headers on;
# your standard Nginx config for your site here...
location / {
proxy_set_header Host $host;
proxy_redirect off;
@jcinis
jcinis / nubook-mongodb-backup.py
Created January 9, 2015 19:47
MongoDB backup script used at nubook.com
#!/usr/bin/env python
'''
Script to backup mongodb data and push it out to s3
Tarballs will remain so local backups will need to be removed manually in the case that the drive is full
Run from crontab
20 1 * * * /usr/local/bin/nubook-mongodb-backup >/dev/null 2>&1
'''
Verifying that +jcinis is my blockchain ID. https://onename.com/jcinis
@jcinis
jcinis / tokyo-nyc.py
Created November 3, 2016 09:44
Shibuya, Tokyo to Williamsburg, New York door to door
from datetime import datetime
from pytz import timezone
start = '2016-11-02 13:00:00'
start_timezone = 'Asia/Tokyo'
end = '2016-11-02 18:18:00'
end_timezone = 'US/Eastern'
start_native_dt = datetime.strptime(start, "%Y-%m-%d %H:%M:%S")
Verifying that "jcinis.id" is my Blockstack ID. https://onename.com/jcinis

Keybase proof

I hereby claim:

  • I am jcinis on github.
  • I am jcinis (https://keybase.io/jcinis) on keybase.
  • I have a public key ASBXSgX8-BQDlto8BT_LRii6TGjqa9f55RFa9ywpnZfqWgo

To claim this, I am signing this object: