This file contains hidden or 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
#include <pthread.h> | |
#include <unistd.h> | |
#include <iostream> | |
#include <v8.h> | |
using namespace v8; | |
static void *run(void *ptr) { |
This file contains hidden or 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
// Copyright 2015 the V8 project authors. All rights reserved. | |
// Use of this source code is governed by a BSD-style license that can be | |
// found in the LICENSE file. | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <fstream> | |
#include <iostream> |
This file contains hidden or 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
/** | |
* Deep diff between two object, using lodash | |
* @param {Object} object Object compared | |
* @param {Object} base Object to compare with | |
* @return {Object} Return a new object who represent the diff | |
*/ | |
function difference(object, base) { | |
function changes(object, base) { | |
return _.transform(object, function(result, value, key) { | |
if (!_.isEqual(value, base[key])) { |
This file contains hidden or 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
/** | |
* echo server | |
* | |
*/ | |
var net = require('net'), | |
port = 5000, | |
unixsocket = '/tmp/echo.sock'; | |
var log = function(who, what) { |
This file contains hidden or 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
# update the host | |
apt-get update && apt-get upgrade -y # && apt-get dist-upgrade -y && apt-get autoremove --purge -y && apt-get autoclean -y | |
# https://www.stgraber.org/ | |
# install linux containers | |
sudo apt-get install lxc | |
# list all containers and view their current status | |
sudo lxc-ls -f |
This file contains hidden or 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
namespace Sagas | |
{ | |
using System; | |
using System.Collections.Generic; | |
class Program | |
{ | |
static ActivityHost[] processes; |
import hashlib
# Hash pairs of items recursively until a single value is obtained
def merkle(hashList):
This file contains hidden or 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
/** | |
this is from the Redux createStore() | |
/** | |
* Interoperability point for observable/reactive libraries. | |
* @returns {observable} A minimal observable of state changes. | |
* For more information, see the observable proposal: | |
* https://github.com/tc39/proposal-observable | |
*/ | |
function observable() { | |
const outerSubscribe = subscribe |
This file contains hidden or 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
const reducer = ((state = 0, action) => { | |
switch (action.type) { | |
case 'INCREMENT': return state + 1 | |
case 'DECREMENT': return state - 1 | |
default: return state | |
} | |
}) | |
const initialState = { | |
count: 0 |
NewerOlder