git init
or
function addAllResourcesLoadedCallback(page, timeout) { | |
function debug(text) { | |
if (typeof page.onDebug == "function") { | |
page.onDebug(text); | |
} | |
} | |
var counter = [], timer; | |
timeout = timeout || 2000; |
node_modules | |
build | |
*.min.js |
#! /bin/sh | |
# Init. script for phantomjs, based on Ubuntu 12.04 skeleton. | |
# Author: Anthony Lapenna <[email protected]> | |
PATH=/sbin:/usr/sbin:/bin:/usr/bin | |
DESC="Phantomjs service" | |
NAME=phantomjs | |
DAEMON=/usr/bin/$NAME | |
PIDFILE=/var/run/$NAME.pid | |
SCRIPTNAME=/etc/init.d/$NAME |
var PRINT = false; | |
var LOG = 1; | |
var SEL = ".pin"; | |
var COND = function($node) { | |
var ret = true; | |
ret = checkNum($node, ".pinPrice", ">=", 10); | |
if (!ret) { return false; } |
As of version 3.3, python includes the very promising concurrent.futures
module, with elegant context managers for running tasks concurrently. Thanks to the simple and consistent interface you can use both threads and processes with minimal effort.
For most CPU bound tasks - anything that is heavy number crunching - you want your program to use all the CPUs in your PC. The simplest way to get a CPU bound task to run in parallel is to use the ProcessPoolExecutor, which will create enough sub-processes to keep all your CPUs busy.
We use the context manager thusly:
with concurrent.futures.ProcessPoolExecutor() as executor:
/** | |
* Created by andy hulstkamp | |
*/ | |
var webpage = require("webpage"), | |
fs = require("fs"); | |
var debug = false, | |
pageIndex = 0, | |
allLinks = [], |
## Install necessary packages | |
$ sudo apt-get install virtualbox-ose qemu-utils genisoimage cloud-utils | |
## get kvm unloaded so virtualbox can load | |
$ sudo modprobe -r kvm_amd kvm_intel | |
$ sudo service virtualbox stop | |
$ sudo service virtualbox start | |
## URL to most recent cloud image of 12.04 | |
$ img_url="http://cloud-images.ubuntu.com/server/releases/12.04/release" |
#!/bin/bash | |
## | |
## Usage: sudo ubuntu-cloud-bootable.sh precise-server-cloudimg-amd64-disk1.img | |
## | |
set -e | |
mount_point="$(mktemp -d)" | |
raw="$(mktemp)" | |
echo ">>> Converting to raw: $raw ..." |