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
// WAY 1 - Instantiating an anonymous function | |
var MySingleton = new (new MyClass(args)); | |
// WAY 2 - Using an instance manager | |
var getMySingleton = (function(options) { | |
function MyClass(args) {} | |
var singleton; | |
return function(args) { | |
return singleton ? singleton : singleton = new MyClass(args); |
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
// WAY 1 - Instantiating an anonymous function | |
var MySingleton = new (new MyClass(args)); | |
// WAY 2 - Using an instance manager | |
var getMySingleton = (function(options) { | |
function MyClass(args) {} | |
var singleton; | |
return function(args) { | |
return singleton ? singleton : singleton = new MyClass(args); |
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
-- PF.WrapSelectionWithFolder.applescript | |
-- | |
-- Created by Peter Geil on 05.12.09. | |
-- Copyright 2009 Peter Geil. All rights reserved. | |
registerWithGrowl() |
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 NamespaceManager = new function() { | |
// Used to store dependencies; Two Arrays because there are | |
// probably multiple dependencies on the same classes | |
var memberIds = [], | |
callbacks = []; | |
// Used to store ALL loaded classes | |
var loaded = []; | |
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 repeat = 500; | |
// Using Crockford's Module Pattern | |
console.profile("Crockford's Module Pattern"); | |
var arrObjLit = [], | |
iObjLit = repeat; | |
while (iObjLit--) { | |
(function() { |
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
""" | |
This fabric file makes setting up and deploying a django application much | |
easier, but it does make a few assumptions. Namely that you're using Git, | |
Apache and mod_wsgi and your using Debian or Ubuntu. Also you should have | |
Django installed on your local machine and SSH installed on both the local | |
machine and any servers you want to deploy to. | |
_note that I've used the name project_name throughout this example. Replace | |
this with whatever your project is called._ |
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
${1:}: ${2:}; | |
-moz-${1/\s.*//}: $2; | |
-webkit-${1/\s.*//}: $2; | |
-o-${1/\s.*//}: $2; | |
-ms-${1/\s.*//}: $2;$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
#!/usr/bin/env bash | |
# Author: Peter Geil -- @pbyte | |
# Version: 0.1 | |
# Description: Tool for batch downloading <http://fm4.orf.at> podcasts. | |
DIRECTORY=$(cd `dirname $0` && pwd) | |
if [ $(($#)) -gt 0 ]; then | |
URL=$1 |
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 sh | |
# A simple one-liner | |
find . -depth 1 -type f -name "*.pdf" -exec file {} \; |
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
/** | |
* | |
* Filmtipps.at Mouseover5000(tm) | |
* | |
* Author: Peter Geil | |
* Created: 15.07.11 | |
* License: to kill | |
* Description: When hovering a movie entry, the corresponding film poster will | |
* be highlighted and vice versa. The code is written for the document/markup model | |
* Filmtipps.at is using right now (15.07.11)and might break when they change it. My intention |
OlderNewer