Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am fakegit on github.
  • I am fakegit (https://keybase.io/fakegit) on keybase.
  • I have a public key ASB79KfFqrc1p9E8s0lB0FOm6olW_xpUV-J2ElYiRZLdogo

To claim this, I am signing this object:

@fakegit
fakegit / countryinfo.py
Created October 29, 2017 12:12 — forked from pamelafox/countryinfo.py
Python list of country codes, names, continents, capitals, and pytz timezones
countries = [
{'timezones': ['Europe/Andorra'], 'code': 'AD', 'continent': 'Europe', 'name': 'Andorra', 'capital': 'Andorra la Vella'},
{'timezones': ['Asia/Kabul'], 'code': 'AF', 'continent': 'Asia', 'name': 'Afghanistan', 'capital': 'Kabul'},
{'timezones': ['America/Antigua'], 'code': 'AG', 'continent': 'North America', 'name': 'Antigua and Barbuda', 'capital': "St. John's"},
{'timezones': ['Europe/Tirane'], 'code': 'AL', 'continent': 'Europe', 'name': 'Albania', 'capital': 'Tirana'},
{'timezones': ['Asia/Yerevan'], 'code': 'AM', 'continent': 'Asia', 'name': 'Armenia', 'capital': 'Yerevan'},
{'timezones': ['Africa/Luanda'], 'code': 'AO', 'continent': 'Africa', 'name': 'Angola', 'capital': 'Luanda'},
{'timezones': ['America/Argentina/Buenos_Aires', 'America/Argentina/Cordoba', 'America/Argentina/Jujuy', 'America/Argentina/Tucuman', 'America/Argentina/Catamarca', 'America/Argentina/La_Rioja', 'America/Argentina/San_Juan', 'America/Argentina/Mendoza', 'America/Argentina/Rio_Gallegos', 'America/Argentina/Ushuai
@fakegit
fakegit / django.contrib.auth.views.py
Created October 18, 2016 17:02 — forked from bmispelon/django.contrib.auth.views.py
Django's auth using class-based views
# https://code.djangoproject.com/ticket/17209
import urlparse
from django.conf import settings
from django.core.urlresolvers import reverse_lazy
from django.http import HttpResponseRedirect, QueryDict
from django.utils.decorators import method_decorator
from django.utils.http import base36_to_int
from django.utils.translation import ugettext as _
from django.views import generic
@fakegit
fakegit / urlsigning.php
Created May 22, 2016 07:02 — forked from paulferrett/urlsigning.php
Simple URL signing helper class written in PHP. Use this to generate and verify signed URLs with a shared secret.
<?php
/**
* Url Signing Helper Class
*
* @author Paul Ferrett <[email protected]>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
class UrlSigning {
@fakegit
fakegit / url-tokens.php
Created May 21, 2016 17:46 — forked from bradyvercher/url-tokens.php
Basic URL signing functions for WordPress
<?php
/**
* Basic URL Signing functions for WordPress.
*
* @author Brady Vercher (twitter.com/bradyvercher)
* @link http://www.blazersix.com/blog/protect-your-products-and-improve-your-systems-with-signed-urls/
*/
/**
* Sign a URL to ensure it hasn't been tampered with.
import cv2
import numpy as np
canny = rho = threshold = minLen = maxGap = None
def draw():
lines = cv2.HoughLinesP(canny, rho, np.pi / 180,
threshold, None, minLen, maxGap)
dst = cv2.cvtColor(canny, cv2.COLOR_GRAY2BGR)
function randomColor(){
return "rgb("+Math.floor(Math.random()*255)+","+Math.floor(Math.random()*255)+","+Math.floor(Math.random()*255)+")";
}
function showBoxes(window) {
var rects = [];
function getRects(node){
var range = window.document.createRange();
range.setStartBefore(node);
range.setEndAfter(node);