Skip to content

Instantly share code, notes, and snippets.

View avdg's full-sized avatar

Anthony Van de Gejuchte avdg

View GitHub Profile
@avdg
avdg / roomPosition.js
Last active August 29, 2015 14:21
Screeps dump
c.prototype.findClosest = function(b, c) {
var e = this;
c = d.clone(c || {});
var f = a.rooms[this.roomName];
if (!f) throw new Error("Could not access a room " + this.roomName);
if (d.isUndefined(b)) return null;
var g, j = null, k = f.getEndNodes(b, c);
if (!c.algorithm) {
var l, m = 0;
k.objects.forEach(function(a) {
@avdg
avdg / moment-timezone-full.js
Created January 23, 2015 11:25
Tried to uglify this and it works fine for me
//! moment-timezone.js
//! version : 0.3.0
//! author : Tim Wood
//! license : MIT
//! github.com/moment/moment-timezone
var moment = (function (root, factory) {
"use strict";
/*global define*/
@avdg
avdg / ecmascript-unicode.js
Last active August 29, 2015 14:13
Experimental script to fetch unicode chars for ecmascript 5
var fs = require('fs');
var http = require('http');
var path = require('path');
var useLocal = false; // Just to stop this script from fetching unicodeData all the time ;-)
var es6mode = false; // If false, we use es5 syntax and ommit some characters for now
// Format:
// 0000;<control>;Cc;0;BN;;;;;N;NULL;;;;
//
@avdg
avdg / engine.js
Last active February 2, 2024 20:27
Decompilation screeps engine.js (as of Tue Nov 24 2015 14:12:26 GMT+0100 (Romance (standaardtijd)))
var global = self;
var Reflect = {
global: global
};
!function a(b, c, d) {
function e(g, h) {
if (!c[g]) {
if (!b[g]) {
@avdg
avdg / gist:786f6c7ba9e1111c070f
Created September 18, 2014 09:39
keybase.md
### Keybase proof
I hereby claim:
* I am avdg on github.
* I am anthonyvdg (https://keybase.io/anthonyvdg) on keybase.
* I have a public key whose fingerprint is AEAB D787 FD4A 0B8E CD9B D3B1 E296 08B0 FF0E 3964
To claim this, I am signing this object:
@avdg
avdg / gist:5077874
Last active December 14, 2015 11:19
Language candidates to add to src/network/network_internal.h
- arabic_egypt
- basque
- belarusian
- brazilian_portuguese
- english_AU
- english_US
- hebrew
- indonesian
- irish
- luxembourgish
# Note htmlFilter is WiP (Work in Progress) ;-)
import cgi
buf_re = {
'basicTags': re.compile( \
r'&lt;(' \
r'/?(b|c(ite|ode)|d([dlt]|el)|em|h[0-6]|i(ns)?|li|marquee|ol|p|' \
r's(mall|tr(ike|ong)|u[bp])?|t(able|[dhrt])|u[lm]?)|[bh]r'
r')\s*&gt;'),
'closingComplexTags': re.compile('&lt;/(a)&\s*gt;'),
PAGE = "<page:(?:/([a-zA-Z0-9-][a-zA-Z0-9_-]*/?)*)?>"
VERSION = "<version:(?:\:[\d]+)?>"
WIKIURL = PAGE + VERSION
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; SPACE PONG ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Player a: Use S and X ;;
; Player b: Use H and N ;;
; HOLD DOWN A KEY TO START THE GAME ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; GOAL ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Be the real captain ;;
@avdg
avdg / gist:2210109
Created March 26, 2012 22:03
Bootstrap popover triggered by hover, fading away in few seconds
var tmp = null;
$('###selector###').popover({
trigger: 'manual',
title: 'testing',
delay: {show:500, hide:100}
});
$('###selector###').hover(function(){
clearTimeout(tmp);