Skip to content

Instantly share code, notes, and snippets.


Anthony Van de Gejuchte avdg

View GitHub Profile

Various command line applications use an Interpreter Directive to define how they should be run.

#! js -m foo
#! node foo
View pathReverser.js
exports.reversePath = function(path)
var reversedPath = [];
for(var i = 0; i < path.length; i++)
var currentStep = path[i];
var dx = currentStep.dx * -1;
var dy = currentStep.dy * -1;
View engine.js
var global = self;
var Reflect = {
global: global
!function a(b, c, d) {
function e(g, h) {
if (!c[g]) {
if (!b[g]) {
laverdet /
Last active Sep 7, 2021
Screeps git sync script

To use first you need to create two branches, master and sim using the in-game editor. Then just run node sync.js from your local machine. When you're on your local master branch it will push to master in game, any other branch (including detached states) will push to sim. Note that it will push unstaged changes, so be careful when switching to branches with modified code.

There is support included for compressing your JS files on the server side via UglifyJS. Some users reported some speedups by compressing their code, however I did not notice any significant gains. Furthermore, UglifyJS does not yet support ES6 features, so it's disabled by default.

View nyt-upshot.css
@media screen and (max-width: 719px) {
.nytint-upshot-stream-item-bCol {
margin: 0;
.nytint-upshot-stream-item .photo.embedded.layout-large-horizontal,
.nytint-upshot-stream-item-article .story-heading {
max-width: 100%;
namuol /
Last active Oct 4, 2022
rage-quit support for bash

rage-quit support for bash


Put flip somewhere in your $PATH and chmod a+x it.

Copy fuck into ~/.bashrc.

Blackshawk / blog - Explaining My Choices
Last active Mar 5, 2017
In which I do a little digging about the choices I've made with PHP. This is a long read, but it isn't something that can be explained in one or two paragraphs.
View blog - Explaining My Choices

In the comments from my last post and on Twitter I noticed a lot of people who had something to say about PHP. The comments were varied but they usally sounded something like this (sorry @ipetepete, I picked yours because it was the shortest).

...the little bits of soul from all of us who've had to work on, and or maintain large PHP applications. – ipetepete

In Pete's defense, he did go on to say that rest of the stack I was using was a "smorgasbord of awesome". Thanks, Pete. I agree!

I would, however, like to take a little time to correct a misperception in the developer community about PHP. I recently got into this same... discussion... with Jeff Atwood, and I seem to be running into it more and more. So here goes. Please bear with me as I cover a little history further on.

Pete, and everybody else, _you're exactly rig

lsauer / gist:2907369
Last active Jan 17, 2022
Google Chrome special pages for memory, debug, resources, profiling, downloads...
View gist:2907369

###Overview of all chrome:// pages.

  • List by calling chrome://about/
  • Following is a direct dump from the 'about' page for reference

###List of Pages as per

jboner / latency.txt
Last active Dec 8, 2022
Latency Numbers Every Programmer Should Know
View latency.txt
Latency Comparison Numbers (~2012)
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
pascaldevink / scrollspy.js
Created Apr 13, 2012
ScrollSpy in pure javascript
View scrollspy.js
Copyright (C) 2021 Pascal de Vink (
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of