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
# From https://github.com/tpope/vim-pathogen with .vim replaced with vimfiles | |
mkdir -p ~/vimfiles/autoload ~/vimfiles/bundle; \ | |
curl -so ~/vimfiles/autoload/pathogen.vim \ | |
https://raw.github.com/tpope/vim-pathogen/HEAD/autoload/pathogen.vim | |
# Install some plugins | |
cd ~/vimfiles/bundle | |
git clone git://github.com/scrooloose/nerdtree.git | |
git clone git://github.com/msanders/snipmate.vim.git |
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
""" base58 encoding / decoding functions """ | |
import unittest | |
alphabet = '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' | |
base_count = len(alphabet) | |
def encode(num): | |
""" Returns num in a base58-encoded string """ | |
encode = '' | |
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 | |
# | |
# Smoke on the water by Deep Purple, for the Lego Mindstorms | |
# | |
# Note frequencies worked out as follows: | |
# A = 440 | |
# Notes above A = A * (1.059463)^ no. of steps above A | |
# Notes below A = A * (1.059463)^ -no. of steps below A | |
# |
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
// Edited / adapted from http://forum.jquery.com/topic/jquery-validate-comma-seperated-multiple-emails-validation#14737000002179275 | |
jQuery.validator.addMethod("multiemail", function (value, element) { | |
if (this.optional(element)) { | |
return true; | |
} | |
var emails = value.split(','), | |
valid = true; | |
for (var i = 0, limit = emails.length; i < limit; i++) { |
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 | |
""" Script that prints out tomorrow's weather forecast, using the Yahoo Weather API. | |
You'll need to get your location's WOEID, which you can get from entering your | |
location in the form on http://weather.yahoo.com/ - currently where it says | |
'Enter city of zip code'. | |
The WOEID numerical id will be in the URL of the page you get redirected to | |
after submitting the form e.g. in the URL | |
http://weather.yahoo.com/united-kingdom/england/newcastle-upon-tyne-30079/ the |
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
using System; | |
using System.Data; | |
using System.IO; | |
using System.Text; | |
using System.Web; | |
using System.Web.Mvc; | |
public sealed class CsvActionResult : FileResult | |
{ | |
private readonly DataTable _dataTable; |
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/bash | |
# Favicon and Apple Touch Icon Generator | |
# | |
# This bash script takes an image as a parameter, and uses ImageMagick to convert it to several | |
# other formats used on modern websites. The following copies are generated: | |
# | |
# * apple-touch-icon-144x144-precomposed.png | |
# * apple-touch-icon-114x114-precomposed.png | |
# * apple-touch-icon-57x57-precomposed.png |
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
:-webkit-full-screen .gist { | |
overflow-y:auto; | |
} |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Canvas Transforms</title> | |
<style> | |
canvas { | |
border:1px solid #ccc; | |
} | |
</style> |
NewerOlder