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
/* image rotate javascript */ | |
/* This script and many more are available free online at | |
The JavaScript Source!! http://javascript.internet.com | |
Created by: Benoit Asselin | http://www.ab-d.fr */ | |
function rotate(p_deg) { | |
if(document.getElementById('canvas')) { | |
/* | |
Ok!: Firefox 2, Safari 3, Opera 9.5b2 |
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
Oh sure, you could do this with jQuery, but in my early days, this is what I used ... | |
<script> | |
<!-- | |
// Set slideShowSpeed (milliseconds) | |
var slideShowSpeed = 8000 | |
// Duration of crossfade (seconds) | |
var crossFadeDuration = 3 |
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 xhr = function() { | |
var xhr = new XMLHttpRequest(); | |
return function( method, url, callback ) { | |
xhr.onreadystatechange = function() { | |
if ( xhr.readyState === 4 ) { | |
callback( xhr.responseText ); | |
} | |
}; | |
xhr.open( method, url ); | |
xhr.send(); |
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
pg_restore --clean --no-acl --no-owner -d <database> -U <user> <filename.dump> |
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
A warning occurred (42 apples) | |
An error occurred |
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
# Thomas Parslow http://almostobsolete.net | |
# Just a work in progress and adapted to what I need right now. | |
# It does uploads (via a file-like object that you write to) and | |
# I've started on downloads. Needs the development version of Boto from Github. | |
# | |
# Example: | |
# | |
# glacierconn = GlacierConnection(AWS_ACCESS_KEY, AWS_SECRET_ACCESS_KEY) | |
# writer = GlacierWriter(glacierconn, GLACIER_VAULT) | |
# writer.write(somedata) |
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
"""A basic database set-up for Travis CI. | |
The set-up uses the 'TRAVIS' (== True) environment variable on Travis | |
to detect the session, and changes the default database accordingly. | |
Be mindful of where you place this code, as you may accidentally | |
assign the default database to another configuration later in your code. | |
""" | |
import os |
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
#In form.py | |
#The original source for this : http://djangosnippets.org/snippets/1303/ | |
from django import forms | |
from django.template.defaultfilters import filesizeformat | |
from django.utils.translation import ugettext_lazy as _ | |
# 2.5MB - 2621440 | |
# 5MB - 5242880 | |
# 10MB - 10485760 |
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 python3 | |
def crc(msg, div, code='000'): | |
"""Cyclic Redundancy Check | |
Generates an error detecting code based on an inputted message | |
and divisor in the form of a polynomial representation. | |
Arguments: | |
msg: The input message of which to generate the output code. |
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 python3 | |
# -*- mode: python -*- | |
# This program is free software. It comes without any warranty, to the extent | |
# permitted by applicable law. You can redistribute it and/or modify it under | |
# the terms of the Do What The Fuck You Want To Public License, Version 2, as | |
# published by Sam Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more | |
# details. | |
# Some useful resources: |
OlderNewer