Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
// Use built in or binary modules | |
var crypto = require('crypto'); | |
var hash = crypto.createHmac("sha1",key).update(signatureBase).digest("base64"); |
var net = require('net') | |
var sock = net.connect(1337) | |
process.stdin.pipe(sock) | |
sock.pipe(process.stdout) | |
sock.on('connect', function () { | |
process.stdin.resume(); | |
process.stdin.setRawMode(true) |
var redis = require("redis") | |
, subscriber = redis.createClient() | |
, publisher = redis.createClient(); | |
subscriber.on("message", function(channel, message) { | |
console.log("Message '" + message + "' on channel '" + channel + "' arrived!") | |
}); | |
subscriber.subscribe("test"); |
Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
import 'dart:io' show HttpRequest, HttpClient, HttpServer, ContentType; | |
import 'dart:convert' show JSON; | |
void handleRequest(HttpRequest request) { | |
// For convenience. | |
var response = request.response; | |
// No path is expected. Return with 404 for anything else. | |
if (request.uri.path != '' && request.uri.path != '/') { | |
response.statusCode = 404; |
#!/usr/bin/env bash | |
sudo locale-gen en_US.UTF-8 | |
sudo update-locale LANG=en_US.UTF-8 | |
sudo update-locale LC_ALL=en_US.UTF-8 | |
sudo apt-get update | |
sudo apt-get install -y build-essential git curl libxslt1-dev libxml2-dev libssl-dev | |
# postgres |
import urllib2 | |
import re | |
import cookielib | |
from cookielib import CookieJar | |
# If the web site expects cookies | |
cookie = CookieJar() | |
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookie)) | |
# Get Scrapper pose as Browser |
#!/bin/sh | |
set -e | |
set -x | |
for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f3) | |
do | |
npm -g install "$package" | |
done |
##Setup your server (this would ideally be done with automated provisioning)
npm install -g forever
##Install flightplan
npm install -g flightplan
npm install flightplan --save-dev