Skip to content

Instantly share code, notes, and snippets.

@npow
npow / gist:4c85a5414ee90e1b4b84
Created July 7, 2014 02:58
Increase number of open files on OSX
sudo sysctl -w kern.maxfiles=1048600
sudo sysctl -w kern.maxfilesperproc=1048576
ulimit -S -n 1048576
@npow
npow / setTimeout.js
Created July 6, 2014 02:31
Promisified setTimeout()
function delay(ms) {
var deferred = Promise.pending();
setTimeout(function() {
deferred.fulfill();
}, ms);
return deferred.promise;
}
delay(1000).then(function () {
// do stuff
@npow
npow / gist:aad7cb5f77780d5445e7
Last active August 29, 2015 14:03
Compiling RxCpp on Oracle Linux 6.4

install dependencies

sudo yum install cmake28
sudo yum install devtoolset-2-gcc-c++.x86_64

checkout repository

git clone --recursive https://github.com/Reactive-Extensions/RxCpp.git
@npow
npow / update_hosts.sh
Created June 21, 2013 22:19
http://linuxshia.wordpress.com/2012/07/17/update-etchosts-automatically-on-a-dhcp-network/ If you happen to run your linux system on a virtualized env and you happen to have a DHCP netwotk config you can use a script like the one below to update your hosts file in order for it to use its assigned IP everytime it boots [or whenever you want]. I c…
#!/bin/bash
# Automatically replacing /etc/hosts eth[x] IP with new assigned one from DHCP
IFACE=(0 1 2 3 4 5 6 7 8 9)
x=0
while [ $x != ${#IFACE[@]} ] ; do
ifconfig eth${IFACE[$x]} 1>/dev/null 2>&1
@npow
npow / test_10unfusedx1singleport.splmm
Created May 2, 2013 23:08
10 sources (unfused), 1 sink (one port)
namespace TR;
<%
my $numSource = 10;
my $numSink = 1;
%>
composite ThreadTest {
graph
stream<uint64 x> Control = Beacon() {
@npow
npow / test_10unfusedx10fused.splmm
Created May 2, 2013 22:44
10 sources (unfused), 10 sinks (fused)
namespace TR;
<%
my $numSource = 1;
my $numSink = 10;
%>
composite ThreadTest {
graph
stream<uint64 x> Control = Beacon() {
@npow
npow / test_10fusedx1.splmm
Created May 2, 2013 22:39
10 sources (fused, 1 sink
namespace TR;
<%
my $numSource = 10;
my $numSink = 1;
%>
composite ThreadTest {
graph
stream<uint64 x> Control = Beacon() {
@npow
npow / test_1x1.splmm
Created May 2, 2013 22:25
1 source, 1 sink
namespace TR;
<%
my $numSource = 1;
my $numSink = 1;
%>
composite ThreadTest {
graph
stream<uint64 x> Control = Beacon() {
@npow
npow / test_1x10unfused.splmm
Created May 2, 2013 22:23
1 source, 10 sinks unfused
namespace TR;
<%
my $numSource = 1;
my $numSink = 10;
%>
composite ThreadTest {
graph
stream<uint64 x> Control = Beacon() {
@npow
npow / test_1x10fused.splmm
Created May 2, 2013 22:13
1 source, 10 sinks (fused)
namespace TR;
<%
my $numSource = 1;
my $numSink = 10;
%>
composite ThreadTest {
graph
stream<uint64 x> Control = Beacon() {