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 zmq = require('zmq'); | |
var ip = require('ip') | |
var port = 'tcp://'+process.argv[2] | |
var cli_sock = zmq.socket('dealer'); | |
var srv_sock = zmq.socket('router') | |
var recv_port = 'tcp://'+ip.address()+':2222' | |
cli_sock.identity = recv_port | |
cli_sock.connect(port) |
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
package.json === | |
{ | |
"name": "", | |
"version": "", | |
"description": "", | |
"main": "", | |
"scripts": { | |
"codestyle": "./node_modules/.bin/jscs src/index.js tests/*.js", | |
"lint": "./node_modules/.bin/jshint .", |
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
def solution(A): | |
eqIndex = [] | |
sums = [0]*len(A) | |
sums[0]=A[0] | |
for index, val in enumerate(A): | |
if index!=0: | |
sums[index]=sums[index-1]+A[index] | |
print sums | |
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 fileinput | |
def detectIntruder(str): | |
arr = list(str) | |
i, j = 0, len(arr)-1 | |
while i <= j: | |
if arr[i] != arr[j]: | |
if arr[i] == arr[j-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
class Solution: | |
def firstMissingPositive(self, arr): | |
if not arr: | |
return 1 | |
res = checkArrayComplete(arr) | |
if res: | |
return res | |
else: | |
return checkFirstMissing(arr) |
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
//in initDb.js | |
var DB = require('mongodb').Db, | |
client = require('mongodb').MongoClient | |
var remoteURI = 'mongodb://user:user@ds029950.mongolab.com:29950/scheduler' | |
var db = 'not ready' | |
var connect = function(remoteURI, cb) { | |
client.connect(remoteURI, function(err, db_res) { |
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
server { | |
listen 8080 default_server; | |
server_name domain.co www.domain.co; | |
#fallback to europe | |
set $site eu.domain.com; | |
if ($geoip_country_code = PT) { | |
set $site domain.co/us; | |
} |
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
server { | |
listen 8080 default_server; | |
server_name slushed.co www.slushed.co; | |
#logging | |
access_log /home/user/www/slushed.co/logs/access.log; | |
error_log /home/user/www/slushed.co/logs/error.log error; | |
#fallback to europe |
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
define(['settings'], | |
function (Settings) { | |
"use strict"; | |
return new Settings({ | |
datasources: { | |
influx: { | |
default: true, | |
type: 'influxdb', |
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
gpestana@workstation:/$ ls /usr/src/ | |
linux-config-3.16 linux-headers-3.16.0-4-amd64 linux-source-3.16.tar.xz | |
linux-headers-3.13.0-4 linux-headers-3.16.0-4-common vboxhost-4.3.28 | |
linux-headers-3.13.0-4-generic linux-kbuild-3.16 | |
gpestana@workstation:~/inst$ uname -a | |
Linux workstation 3.13-1-amd64 #1 SMP Debian 3.13.5-1 (2014-03-04) x86_64 GNU/Linux | |
gpestana@workstation:~/inst$ sudo dpkg -i virtualbox-4.3_4.3.28-100309~Debian~wheezy_amd64.deb |