Skip to content

Instantly share code, notes, and snippets.

View guybrush's full-sized avatar

Patrick guybrush

View GitHub Profile

Build Rust with Emscripten support

For more up2date information: http://www.hellorust.com/emscripten/

Emscripten is the LLVM-based project to compile stuff into JavaScript. Luckily, Rust already uses LLVM and just recently got an upgrade to the used version of LLVM. Now emscripten uses a fork of LLVM, which is on the way to use more or less the same base LLVM as Rust. See the next-merge branch.

Simple 13 step recipe to build Rust with Emscripten support

@mhausenblas
mhausenblas / README.md
Last active March 21, 2016 08:08
Kubernetes debugging session leveraging labels

That's our RC:

$ cat ws-rc.yaml
apiVersion: v1
kind: ReplicationController
metadata:
  name: webserver-rc
spec:
  replicas: 5

selector:

@trevnorris
trevnorris / perf-flame-graph-notes.md
Last active December 24, 2023 05:25
Quick steps of how to create a flame graph using perf

The prep-script.sh will setup the latest Node and install the latest perf version on your Linux box.

When you want to generate the flame graph, run the following (folder locations taken from install script):

sudo sysctl kernel.kptr_restrict=0
# May also have to do the following:
# (additional reading http://unix.stackexchange.com/questions/14227/do-i-need-root-admin-permissions-to-run-userspace-perf-tool-perf-events-ar )
sudo sysctl kernel.perf_event_paranoid=0
$ cat > x.js
// watch this.
console.log(arguments.callee.toString() + ' is the function that was called');
^D
$ node x.js
function (exports, require, module, __filename, __dirname) { // watch this.
console.log(arguments.callee.toString() + ' is the function that was called');
} is the function that was called
var WriteStream = require("write-stream")
, uuid = require("node-uuid")
, assert = require("assert")
, Introducer = require("./introducer")
, PeerConnectionPool = require("./peerConnectionPool")
// This URI doesn't exist yet
var introducer = Introducer("discoverynetwork.co/echo", "unique group name")
var id = uuid()
@tj
tj / foo.js
Created October 30, 2012 05:08
Stream example
var fs = require('fs')
function cat(file) {
var stream = fs.createReadStream(file)
stream.setEncoding('utf8')
return function(write){
stream.on('error', write)
stream.on('data', function(d){ write(null, d) })
stream.on('end', write)
@max-mapper
max-mapper / index.js
Created August 11, 2012 00:14
geo queries on leveldb (geohash) (not really usable)
var plumbdb = require('plumbdb')
var shp2json = require('shp2json')
var tako = require('tako')
var geohash = require('geohash').GeoHash // my fork (not on npm): https://github.com/maxogden/geohash-js
var JSONStream = require('JSONStream')
var async = require('async')
var gju = require('geostuff')
var t = tako()
@adammw
adammw / README.md
Created August 3, 2012 06:30
Node.js for Raspberry Pi

Node.js for Raspberry Pi

Pre-built binaries

Recent releases have been pre-built using cross-compilers and this script and are downloadable below.

If you have found these packages useful, give me a shout out on twitter: @adammw

a Stream spec


##UPDATE

I've now moved this stuff into it's own repo and added an executable checker, and some nifty diagrams of the stream state transitions state diagrams

This gist is no longer being maintained. goto dominictarr/stream-spec


@toji
toji / triangle-collision.js
Created May 27, 2012 05:37
Javascript Swept-Sphere/Triangle Collision Detection
/*
* Copyright (c) 2012 Brandon Jones
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions: