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
'use-strict'; | |
module.exports = { | |
doLogin: { | |
/** | |
* Adds 5 coins every time a user logs into their account. | |
*/ | |
coins: 5, | |
/** | |
* Adds the 'some-badge' and 'some-other-badge' the first |
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
# | |
# Script by Leigh Purdie | |
# | |
# 1) Install a Ubuntu system, and remove packages according to your | |
# requirements using synaptic. | |
# Don't install any new packages that are NOT available from the CD, | |
# at this stage, unless you include the packages in an 'extras' directory. | |
# | |
# 2) dpkg -l > PackageList | |
# Copy this file to $BASEDIR/source on your build server. |
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
node_modules |
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 Promise = require('bluebird'); | |
var callbackHellTimeout = function(cb, time) { | |
setTimeout(function() { | |
cb(); | |
}, time); | |
}; | |
var promiseTimeout = function(time) { | |
return new Promise(function(resolve, reject) { |
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 twisted.internet import reactor | |
def main(): | |
reactor.addSystemEventTrigger('during', 'bang', bangHandler) # 3 listening for bang event - when heard, bangHandler() will be called | |
loadingGun() # 4 loadingGun() called | |
def loadingGun(): | |
print('Loading gun . . .') | |
reactor.callLater(5, aimingGun) # 5 after 5 seconds aimingGun() 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
var _ = require('lodash'); | |
console.log(combinations('abc')); | |
function combinations(chars) { | |
return getCombinations(chars.length, chars); | |
} | |
function getCombinations(count, chars, word) { | |
var combinations = []; |
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/python3 | |
import os | |
os.system('cd ~/Android/Sdk/tools') | |
AVDs = [file.split('.')[0] for file in os.listdir(os.path.expanduser('~/.android/avd/')) if file.split('.')[len(file.split('.'))-1] == 'ini'] | |
i = 0 | |
for avd in AVDs: | |
i += 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
import socket | |
import docker | |
client = docker.DockerClient(base_url='unix://var/run/docker.sock') | |
def getMe(): | |
ip = socket.gethostbyname(socket.gethostname()) | |
containers = client.containers.list() | |
for container in containers: | |
containerIP = container.attrs['NetworkSettings']['Networks']['bridge']['IPAddress'] | |
if (ip == containerIP): |
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 Promise = require('bluebird'); | |
var callbackHellTimeout = function(cb, time) { | |
setTimeout(function() { | |
cb(); | |
}, time); | |
}; | |
var promiseTimeout = function(time) { | |
return new Promise(function(resolve, reject) { |