Skip to content

Instantly share code, notes, and snippets.

View dangayle's full-sized avatar

Dan Gayle dangayle

View GitHub Profile
import string
ALPHABET = 'ABCDEGHKLPQRSTUVWXYZ' + '23456789'
ALPHABET_REVERSE = dict((c, i) for (i, c) in enumerate(ALPHABET))
BASE = len(ALPHABET)
START_FROM = 1
def encode(n):
n = n * START_FROM
@louy
louy / wp-oauth.php
Created September 18, 2010 02:32
Simple OAuth script to use with your wp plugins.
<?php
/**
* OAuth script for WordPress
* @author Louy Alakkad <louy08@gmail.com>
* @website http://l0uy.com/
*/
if( !defined( 'WP_OAUTH' ) ) :
define('WP_OAUTH', true);
@soulcutter
soulcutter / _stacked.scss
Last active December 11, 2015 18:39
SCSS mixin creating a stacked block element
////
// Makes a div appear to be a stacked like 3 sheets of paper with each
// sheet offset by a given amount.
//
// Example: @include stacked(5px);
@mixin stacked($offset) {
border: 1px solid #494949;
&:after, &:before {
background: inherit;
@furzeface
furzeface / lovely-media-queries.css
Last active December 31, 2015 02:19
An example of my new set of media queries. Flexible, more fluid media queries.
//=Variables
//=Media Queries
$breakpoint-tiny: 20em;
$breakpoint-small: 30em;
$breakpoint-medium: 50em;
$breakpoint-extra-medium: 65em; //lol
$breakpoint-large: 80em;
$breakpoint-extra-large: 100em;
//=Global Styles
@julianklotz
julianklotz / plinks.js
Last active January 18, 2018 14:57
Utility functions for linking into native messaging applications (currently SMS and WhatsApp) without prepoluating a phone number.
@lauris
lauris / markov.py
Last active February 6, 2018 15:21
Markov Chains
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import random
import string
import re
from collections import Counter
@anqxyr
anqxyr / archived
Last active July 5, 2018 15:08
Create EPUB files with Python
The gist that used to be here has since been implemented as a complete pip-installable package: https://github.com/anqxyr/mkepub
This notice is left here as a courtesy to the people who starred/bookmarked this gist in the past.
@lucasrizoli
lucasrizoli / gist:1603274
Created January 12, 2012 21:33
70 Unique Ways to Encode <
<
%3C
&lt
&lt;
&LT
&LT;
&#60
&#060
&#0060
&#00060
@jakevdp
jakevdp / PythonCpp.ipynb
Last active January 8, 2020 03:44
Hack to make Python look like C++
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mxcl
mxcl / rsync+watcher.rb
Created July 18, 2009 09:32
rsync whenever the directory the script is in changes using the OS X FSEvents API
#!/usr/bin/ruby
require 'osx/foundation'
OSX.require_framework '/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework'
include OSX
$d=File.basename Dir.pwd
Dir.chdir '..'
fsevents_cb = proc do |stream, ctx, numEvents, paths, marks, eventIDs|
system "rsync --delete -rt --rsh=ssh '#{$d}' 'methylblue.com:public_html/'"