Skip to content

Instantly share code, notes, and snippets.

@LoonyPandora
LoonyPandora / bookmarklet.js
Created February 25, 2014 16:17
Table Flip Animation Bookmarklet
javascript:(function(){var%20bod=document.getElementsByTagName("body")[0];var%20styl=document.createElement("style");styl.textContent="@-webkit-keyframes%20rollOut%20{%200%%20{%20opacity:%201;%20-webkit-transform:%20translateX(0px)%20rotate(0deg);%20transform:%20translateX(0px)%20rotate(0deg);%20}%20100%%20{%20opacity:%200;%20-webkit-transform:%20translateX(100%)%20rotate(120deg);%20transform:%20translateX(100%)%20rotate(120deg);%20}%20}%20@keyframes%20rollOut%20{%200%%20{%20opacity:%201;%20-webkit-transform:%20translateX(0px)%20rotate(0deg);%20-ms-transform:%20translateX(0px)%20rotate(0deg);%20transform:%20translateX(0px)%20rotate(0deg);%20}%20100%%20{%20opacity:%200;%20-webkit-transform:%20translateX(100%)%20rotate(120deg);%20-ms-transform:%20translateX(100%)%20rotate(120deg);%20transform:%20translateX(100%)%20rotate(120deg);%20}%20}%20";document.body.appendChild(styl);bod.setAttribute("style","-webkit-animation-duration:1s;%20animation-duration:%201s;%20-webkit-animation-fill-mode:both;%20animation-fill-mo
@LoonyPandora
LoonyPandora / gist:8842918
Last active August 29, 2015 13:56
boot2docker output truncated
james@James-MacBook-Pro ~ → docker version
Client version: 0.8.0
Go version (client): go1.2
Git commit (client): cc3a8c8
Server version: 0.8.0
Git commit (server): cc3a8c8
Go version (server): go1.2
james@James-MacBook-Pro ~ → docker info
Containers: 97
@LoonyPandora
LoonyPandora / hashchange.js
Created March 13, 2013 23:40
How to bind to the JS "hashchange" event.
// Watches for changes in the URL hashbang and updates the #content pane accordingly
// Also updates the hash when we click on a link
function initHashChange() {
// Bind an event to window.onhashchange that, when the hash changes, gets the
// hash and adds the class "selected" to any matching nav link.
$(window).hashchange(function(){
var hash = window.location.hash.replace( /^#!\//, '' );
if (hash == '') { return; }
#--------------------------------------------------------------------------
# PORT ALLOCATION:
# - usr1 => 5001 to 5020
# - usr2 => 5021 to 5040
# - usr3 => 5041 to 5060
#--------------------------------------------------------------------------
server {
listen 5001;
server_name $hostname.internal.ac.uk;
@LoonyPandora
LoonyPandora / dabblet.css
Created January 19, 2013 11:11
CSS3 Animation Test
/**
* CSS3 Animation Test
*/
body {
padding: 20px;
}
* {
background-color: #111;
@LoonyPandora
LoonyPandora / homebrew.mxcl.nginx.plist
Created July 2, 2012 00:56
Working LaunchDaemon
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>homebrew.mxcl.nginx</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
@LoonyPandora
LoonyPandora / gist:1691612
Created January 27, 2012 23:41
Gitbox Error
/Users/james/Library/Application Support/Gitbox/git-1.7.7.rc3.7.g26c6e2/git.bundle/libexec/git-core/git-sh-setup: line 77: sed: command not found
/Users/james/Library/Application Support/Gitbox/git-1.7.7.rc3.7.g26c6e2/git.bundle/libexec/git-core/git-sh-setup: line 77: basename: command not found
/Users/james/Library/Application Support/Gitbox/git-1.7.7.rc3.7.g26c6e2/git.bundle/libexec/git-core/git-sh-setup: line 241: uname: command not found
/Users/james/Library/Application Support/Gitbox/git-1.7.7.rc3.7.g26c6e2/git.bundle/libexec/git-core/git-pull: line 236: sed: command not found
/Users/james/Library/Application Support/Gitbox/git-1.7.7.rc3.7.g26c6e2/git.bundle/libexec/git-core/git-pull: line 236: tr: command not found
Fetching tags only, you probably meant:
git fetch --tags
Repository: /Users/james/Sites/Dancer
@LoonyPandora
LoonyPandora / config.yml
Created September 28, 2011 11:16
Dancer & Template::Plugin::HTML
appname: "testing"
layout: "main"
charset: "UTF-8"
template: "template_toolkit"
engines:
template_toolkit:
encoding: 'utf8'
start_tag: '[%'
@LoonyPandora
LoonyPandora / Passphrase-Exctract.pm
Created September 26, 2011 13:58
Chocolat syntax highlighting issues
# Remove the '/' in the syntax highlighting bug comment
# The rest of the files syntax highlighting will be broken
if (_salt_offset()->{$rfc2307_scheme}) {
$salt = substr(decode_base64($salt_and_digest), _salt_offset()->{$rfc2307_scheme});
$digest = substr(decode_base64($salt_and_digest), 0, _salt_offset()->{$rfc2307_scheme});
$algorithm = $rfc2307_scheme =~ s/^S//r; # / syntax highlighting bug
} else {
$salt = '';
@LoonyPandora
LoonyPandora / gist:1213906
Created September 13, 2011 14:18
Dancer error catching.
package kapowaz;
use Dancer ':syntax';
use Dancer::Serializer::Mutable;
our $VERSION = '0.1';
get '/' => sub {
template 'index';
};