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
### | |
# To create a plugin you need to include the `classy-core` module and then pass | |
# your plugin object into the `class.plugin.controller function` | |
### | |
angular.module('classy-yourPlugin', ['classy-core']).classy.plugin.controller | |
name: 'yourPlugin' | |
### | |
# Dependencies placed in the localInject array will be available on `@` (`this`) |
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
/* | |
* To create a plugin you need to include the `classy-core` module and then pass | |
* your plugin object into the `class.plugin.controller function` | |
*/ | |
angular.module('classy-yourPlugin', ['classy-core']).classy.plugin.controller({ | |
name: 'yourPlugin', | |
/* | |
* Dependencies placed in the localInject array will be available on `@` (`this`) | |
* in the plugins init and postInit methods. |
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
extendsScope_module = angular.module 'classy-extends', ['classy-core'] | |
### | |
Note that this does NOT get the mixin class dependencies as of now. | |
### | |
extendsScope_module.classy.plugin.controller | |
name: 'extends' | |
localInject: ['$controller'] |
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
Verifying that +davej is my Bitcoin username. You can send me #bitcoin here: https://onename.io/davej |
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
# -*- coding: utf-8 -*- | |
""" | |
This script will follow all those who follow you and unfollow those who | |
unfollow you. Basically it keeps your followers and friends in sync. | |
You will need to get a consumer key and consumer secret token to use this | |
script, you can do so by registering a twitter application at http://twitter.com/apps | |
@requirements: Python 2.5+, Tweepy (https://github.com/joshthecoder/tweepy) | |
@author: Dave Jeffery |
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 | |
# I stole this little script from somewhere but can't remember where, sorry for not including credit. | |
for i in "rte.ie" "facebook.com" "reddit.com" "tb4.fr" "bbc.co.uk" "boards.ie" "google.com" | |
do | |
for j in "4.2.2.2" "8.8.8.8" "208.67.222.222" "89.101.160.4" # Tests Level 3, Google Public DNS, OpenDNS, UPC default DNS. | |
do | |
echo $j $i `dig @$j $i | grep Query | awk -F ":" '{print $2}'` | |
done | |
done |
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
# Simple Version | |
server { | |
listen 80; | |
server_name example.com; | |
access_log /var/log/nginx/example.log; | |
location / { | |
proxy_pass http://127.0.0.1:1337; | |
} |
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
# /etc/hosts | |
127.0.0.1 local.domain | |
123.123.123.123 www.domain.com | |
# In the Mac OS X terminal type: | |
dscacheutil -flushcache |
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
// helper function that goes inside your socket connection | |
client.connectSession = function(fn) { | |
var cookie = client.request.headers.cookie; | |
var sid = unescape(cookie.match(/connect\.sid=([^;]+)/)[1]); | |
redis.get(sid, function(err, data) { | |
fn(err, JSON.parse(data)); | |
}); | |
}; | |
// usage |
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
function cacheOrDB (id, callback) { | |
asynchronousCache.get("id:"+id, function(err, myThing) { | |
if (myThing == null) { | |
asynchronousDB.query("SELECT * from something WHERE id = "+id, function(err, myThing) { | |
callback(err, myThing); | |
}); | |
} else { | |
callback(err, myThing); | |
} | |
}); |
OlderNewer