Skip to content

Instantly share code, notes, and snippets.

Lars-Magnus Skog ralphtheninja

Block or report user

Report or block ralphtheninja

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View xvfb.init
# /etc/rc.d/init.d/xvfbd
# chkconfig: 345 95 28
# description: Starts/Stops X Virtual Framebuffer server
# processname: Xvfb
joepie91 /
Last active Jan 14, 2020
Getting started with Node.js

"How do I get started with Node?" is a commonly heard question in #Node.js. This gist is an attempt to compile some of the answers to that question. It's a perpetual work-in-progress.

And if this list didn't quite answer your questions, I'm available for tutoring and code review! A donation is also welcome :)

Setting expectations

Before you get started learning about JavaScript and Node.js, there's one very important article you need to read: Teach Yourself Programming in Ten Years.

Understand that it's going to take time to learn Node.js, just like it would take time to learn any other specialized topic - and that you're not going to learn effectively just by reading things, or following tutorials or courses. _Get out there and build things!

View ,prebuildrc
target[] = 0.10.26
target[] = 0.12.7
target[] = 1.8.1
target[] = 1.0.1
target[] = 2.4.0
bnagy /
Last active Jan 2, 2020
Mutt, Gmail and GPG

GPG / Mutt / Gmail


This is a collection of snippets, not a comprehensive guide. I suggest you start with Operational PGP.

Here is an incomplete list of things that are different from other approaches:

  • I don't use keyservers. Ever.
  • Yes, I use Gmail instead of some bespoke hipster freedom service
substack / backup
Last active Mar 12, 2016
backup and restore settings
View backup
tar -cjf- ~/.crypt/passwd ~/.ssh ~/.bashrc ~/.profile ~/.vimrc ~/.gitconfig \
~/.config/chromium ~/.mozilla \
| openssl enc -aes-256-cbc \
| ssh $SERVER 'cat>~/www/backup/`date +%F.%T`'
ssh $SERVER 'ls -1 ~/www/backup | grep ^[0-9] | sort > ~/www/backup/list.txt'
dominictarr / .travis.yml
Last active Jan 5, 2016
pull-streams crash course
View .travis.yml
language: node_js
- '0.10'
- '0.12'
deanlandolt /
Last active Aug 29, 2015


Write-ahead logging for transactions in a bytespace.

Write operations are given a monotonically increasing id and written to transaction log. Batches are processed asynchronously and added to the store. By default, query methods withheld until batch processing is complete for the commit which was current at the time the query is received.

Batch processing pipeline

The batch processing pipeline exposes extensions points to allow pre-commit hooks to do additional work before committing to the transaction log, and post-commit hooks to do additional work after a transaction. Work can be isolated to specific subspaces, allowing heavyweight analytical processing to proceed without blocking queries in hot-path or transaction-heavy spaces. Analytical work can be delegated to subprocesses or even remote machines. Work on multiple commits can be batched together, and monotonically increasing batch ids can be leveraged to allow reads on possibly stale data to be held, e.g. until the next "

View heapdump.js
* Simple userland heapdump generator using v8-profiler
* Usage: require('[path_to]/HeapDump').init('datadir')
* @module HeapDump
* @type {exports}
var fs = require('fs');
var profiler = require('v8-profiler');
View git-squash
git rebase --interactive --autosquash \
$(git merge-base $(git symbolic-ref --short HEAD) master)
View wheel
var page;
window.onload = function() {
page = document.getElementsByTagName('html');
page.addEventListener('DOMMouseScroll', <HANDLER>, false);
window.mimicWheel = function() {
var evt = document.createEvent("MouseEvents");
evt.initMouseEvent('DOMMouseScroll', <OPTIONS> )
You can’t perform that action at this time.