Skip to content

Instantly share code, notes, and snippets.

View likwid's full-sized avatar

Jeff Gonzalez likwid

View GitHub Profile
# via
# http://wiki.apache.org/couchdb/Installing_on_Ubuntu
cd /tmp
wget http://mirror.netcologne.de/apache.org/couchdb/source/1.4.0/apache-couchdb-1.4.0.tar.gz
### make sure you have a couchdb user for the daemon, and couchb group also
## get developer tools dependencies
sudo apt-get install -y g++
sudo apt-get install -y erlang-dev erlang-manpages erlang-base-hipe erlang-eunit erlang-nox erlang-xmerl erlang-inets
function reduceInner(acc, item) {
return isArray(item) ? acc.concat(flatten(item)) : acc.concat(item);
}
function flatten(list) {
return _.reduce(list, reduceInner, []);
}
var sum = _.reduce(_.filter(flatten(arr), isNumber), function(acc, item) {
return acc + item;
traceroute to stackoverflow.com (198.252.206.140), 64 hops max, 72 byte packets
1 172.31.1.1 (172.31.1.1) 1.490 ms 1.053 ms 1.093 ms
2 l100.dllstx-vfttp-72.verizon-gni.net (173.71.10.1) 7.237 ms 7.666 ms 7.534 ms
3 g0-3-1-4.dllstx-lcr-22.verizon-gni.net (130.81.110.194) 9.487 ms 10.919 ms 10.119 ms
4 so-4-1-0-0.dfw9-bb-rtr2.verizon-gni.net (130.81.151.244) 61.041 ms 66.853 ms 139.873 ms
5 0.xe-2-1-6.xt2.nyc4.alter.net (152.63.3.46) 45.334 ms 54.914 ms 90.423 ms
6 gigabitethernet7-0-0.gw18.nyc4.alter.net (152.63.22.229) 46.384 ms 48.376 ms 45.951 ms
7 internap-gw.customer.alter.net (65.217.199.202) 47.686 ms 46.113 ms 46.309 ms
8 border1.po2-20g-bbnet2.nym008.pnap.net (216.52.95.65) 57.888 ms 45.899 ms 44.888 ms
9 stackexchange-1.border1.nym008.pnap.net (74.201.252.22) 46.903 ms 53.788 ms 50.867 ms
(function () {
"use strict";
var Q = require("q"),
AWS = require('aws-sdk'),
ec2 = new AWS.EC2(),
df = Q.defer();
/*jslint unparam:true*/
ec2.describeInstances({}, function (err, data) {
if (err) {
static void Main(string[] args)
{
var foo1 = new Foo("Jeff G", 36);
var foo2 = new Foo("Kirk G", 58);
var output1 = foo1.ToMaybe()
.If(a => a.Age < 37)
.Return(x => x.Name, "Too Old");
var output2 = foo2.ToMaybe()
get
{
if (_ConnectionString == null)
{
_ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
}
return _ConnectionString;
}
vs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WaterDistrict.Web.Infrastructure;
namespace WaterDistrictDriver
{
class Program
@likwid
likwid / Dequeue
Last active August 29, 2015 14:06
(function (_, q, spawn, harCapturer, aws) {
"use strict";
var gcArgs = ["--remote-debugging-port=9222", "--enable-benchmarking", "--enable-net-benchmarking"],
options = { cwd: undefined, env: process.env },
google = spawn("google-chrome", gcArgs, options),
queueUri = process.env.QUEUE_URI,
awsRegion = "us-east-1",
bucketName = "blitz-project-10k";
aws.config.update({region: awsRegion});
(function (_, q, harCapturer, aws, spawn) {
"use strict";
harCapturer.setVerbose(true);
var gcArgs = ["--remote-debugging-port=9222", "--enable-benchmarking", "--enable-net-benchmarking"],
options = { cwd: undefined, env: process.env },
google = spawn("google-chrome", gcArgs, options),
queueUri = process.env.QUEUE_URI,
shouldDebug = process.env.DEBUG || false,
bucketName = "blitz-project-10k",
var customerData = [
{
customerId: 1000,
name: "ABC Company",
postalCode: 75023
}, {
customerId: 1001,
name: "XYZ Company",
postalCode: 75023
}],