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 async(arg, callback) { | |
console.log('do something with \''+arg+'\', return 1 sec later'); | |
setTimeout(function() { callback(arg * 2); }, 1000); | |
} | |
function final() { console.log('Done', results); } | |
var items = [ 1, 2, 3, 4, 5, 6 ]; | |
var results = []; | |
var running = 0; | |
var limit = 2; |
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
sudo su | |
adduser <userid> | |
# check the groups of another user to work out what groups to add | |
groups <account to copy> | |
adduser sudo | |
adduser docker | |
adduser <whatever other groups> |
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 Grabber = function (url, collection) { | |
this.url = url; | |
this.filename = url.substring(url.lastIndexOf('/')+1); | |
this.collection = collection; | |
var self = this; | |
}; | |
// function declaration | |
Grabber.prototype.init = function () { | |
console.log('init jobs'); |
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 a nice truetype font and size by default... | |
xterm*faceName: DejaVu Sans Mono Book | |
xterm*faceSize: 11 | |
! Every shell is a login shell by default (for inclusion of all necessary environment variables) | |
xterm*loginshell: true | |
! I like a LOT of scrollback... | |
xterm*savelines: 16384 |
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
sudo apt-add-repository ppa:webupd8team/java | |
sudo apt-get update | |
sudo apt-get install gradle | |
sudo apt-get install groovy | |
sudo apt-get install git | |
sudo apt-get install oracle-java8-installer oracle-java7-installer oracle-java6-installer | |
sudo apt-get install curl | |
http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase5-419410.html#jdk-1.5.0_22-oth-JPR | |
https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu |
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
http://fourkitchens.com/blog/article/trigger-jenkins-builds-pushing-github | |
To make a build work | |
1. add settings.xml TO THE BUILD ITSELF (maven config dont work) | |
2. add GITHUB URL to github section | |
3. add git repository to git section | |
4. delete the PMFKey/password from settings.xml (you wont need it) | |
5. Make sure JUNIT versions are LATEST in POM (needs improvement) |
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
et nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins | |
"call vundle#begin('~/some/path/here') | |
" let Vundle manage Vundle, required |
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
name := """play-java""" | |
version := "1.0-SNAPSHOT" | |
lazy val root = (project in file(".")).enablePlugins(PlayJava) | |
scalaVersion := "2.11.7" | |
libraryDependencies ++= Seq( | |
javaJdbc, |
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/python | |
import logging,logging.handlers | |
class Loglog(object): | |
def loglog(self): | |
self.logger = logging.getLogger('parsible') | |
handler = logging.handlers.RotatingFileHandler('testlog.log', mode='a', maxBytes=200, backupCount=1) | |
handler.setFormatter(logging.Formatter('[%(levelname)s] %(asctime)s - %(message)s')) | |
self.logger.addHandler(handler) |
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 logging | |
import sys | |
import numpy as np | |
log = logging.getLogger("hello") | |
sh = logging.StreamHandler(sys.stdout) | |
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') | |
sh.setFormatter(formatter) | |
log.addHandler(sh) |