A Pen by Derek Wheelden on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var map; | |
var infoWindow; | |
var markers = []; | |
var contents = []; | |
function addMarker(location, i) | |
{ | |
var image = 'bs-gold-32-rounded.png'; | |
var latLong = new google.maps.LatLng(parseFloat(location.lat), parseFloat(location.lng)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import praw | |
from random import choice | |
def joke(): | |
"""Prints a joke from a random selection of the | |
top 20 reddit jokes in r/jokes | |
""" | |
r = praw.Reddit(user_agent="Reddit Joke Grabber") | |
subs = r.get_subreddit("jokes").get_hot(limit=20) | |
jokes = list(subs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.blink_me { | |
-webkit-animation-name: blinker; | |
-webkit-animation-duration: 1s; | |
-webkit-animation-timing-function: linear; | |
-webkit-animation-iteration-count: infinite; | |
-moz-animation-name: blinker; | |
-moz-animation-duration: 1s; | |
-moz-animation-timing-function: linear; | |
-moz-animation-iteration-count: infinite; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
openssl req -new -newkey rsa:2048 -nodes -out www.example.co.uk.csr -keyout www.example.co.uk.key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This is an obfuscated Yii Migration example taken from a commercial project I'm working on. | |
* | |
* I thought I may find the creation of fields in one table and | |
* copying over of the data from the related table (thereby de-normalising it) | |
* of some use in future. It was required in a few tables due to the unusual | |
* nature of the related data. | |
* | |
* @see http://www.yiiframework.com/doc/guide/1.1/en/database.migration |
When installing Python packages on OSX Mavericks there will be a Clang error akin to this: clang: error: unknown argument: '-mno-fused-madd' To bypass this you need to tell Clang to ignore unknown flags So far this problem has occured with xattr and PIL/pilow but this command fixed both
sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install pillow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" Quick & dirty script used for downloading latest stock sheet from | |
Google Apps Email and saving to server for further processing""" | |
import email | |
import imaplib | |
import os | |
save_dir = '.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var memoizer = function (memo, formula) { | |
var recur = function (n) { | |
var result = memo[n]; | |
if (typeof result !== 'number') { | |
result = formula(recur, n); | |
memo[n] = result; | |
} | |
return result; | |
}; | |
return recur; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Generates URN/codes and saves them to separate CSV files - 1 for each depot. | |
URN Format: (\d{3})([A-Z])(\d{3}) | |
Group 1: Random capital letter A-Z (technically unecessary) | |
Group 2: Depot number 01-67 | |
Group 3: Sequence number 001-250 (never repeats) | |
""" |
OlderNewer