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 / 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 / es6.ebnf
Last active September 15, 2023 06:04
ES6 bnf grammer - See https://avdg.github.io/es6.xhtml
/* ebnf file for es 6 - MAY CONTAIN ERRORS / DISAMBIGUITY */
Grammer::= Statement
/* Lexical grammer */
SourceCharacter ::= #x0000-#x10FFFF
InputElementDiv ::= WhiteSpace | LineTerminator | Comment | CommonToken | DivPunctuator | RightBracePunctuator
InputElementRegExp ::= WhiteSpace | LineTerminator | Comment | CommonToken | RightBracePunctuator | RegularExpressionLiteral
InputElementRegExpOrTemplateTail ::= WhiteSpace | LineTerminator | Comment | CommonToken | RegularExpressionLiteral | TemplateSubstitutionTail
InputElementTemplateTail ::= WhiteSpace | LineTerminator | Comment | CommonToken | DivPunctuator | TemplateSubstitutionTail
WhiteSpace ::= "<TAB>" | "<VT>" | "<FF>" | "<SP>" | "<NBSP>" | "<ZWNBSP>" | "<USP>"
@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);
<?php
function curl_get_contents($url, $timeout = 30, $settings_array = array())
{
$return false;
if (function_exists("curl_init")) {
$curl_options = array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => intval($timeout),
CURLOPT_HEADER => false
@avdg
avdg / lotery.js
Last active October 12, 2017 20:37
Lotery
var probabilities = [500, 200, 50, 5];
var iterations = 2000;
var results = [];
next:
for (let i = 0; i < iterations; i++) {
let probability = Math.floor(Math.random() * 1000);
let j = 0;
@avdg
avdg / pullRequests.graphql
Created June 11, 2017 18:43
GraphQL Example to fetch pull requests information from mishoo/UglifyJS2
{
repository(owner: "mishoo", name: "UglifyJS2") {
pullRequests(last: 100) {
nodes {
closed
number
}
totalCount
}
}
@avdg
avdg / Results.md
Created April 5, 2017 21:42
Test262 es 6 results for UglifyJS harmony branch
  • Uglify checkout c20bb99a62ad036368569bd89b934f52258429cd (harmony)
  • Test262 checkout 5da6f981e9c6eb6d8af9ad8be737fb2245cf2fdb (master)

process.versions:

{ http_parser: '2.7.0',
  node: '7.8.0',
  v8: '5.5.372.43',
 uv: '1.11.0',
@avdg
avdg / Results.md
Created April 3, 2017 13:59
Test262 es 6 results for UglifyJS harmony branch
  • Uglify checkout 35bae3fcd061cf736878b1005df62de15b727224 (harmony)
  • Test262 checkout 5da6f981e9c6eb6d8af9ad8be737fb2245cf2fdb (master)

process.versions:

{ http_parser: '2.7.0',
  node: '7.8.0',
  v8: '5.5.372.43',
 uv: '1.11.0',
@avdg
avdg / Results.md
Created March 30, 2017 12:52
Test262 es 6 results for UglifyJS harmony branch
  • Uglify checkout 12b56d9b48f7510afbb86327579a65efb5c3e171 (harmonyWith1701)
  • Test262 checkout 5da6f981e9c6eb6d8af9ad8be737fb2245cf2fdb (master)

process.versions:

{ http_parser: '2.7.0',
  node: '7.8.0',
  v8: '5.5.372.43',
 uv: '1.11.0',
@avdg
avdg / Results.md
Created March 17, 2017 14:45
Test262 es 6 results for UglifyJS harmony branch
  • Uglify checkout 2fd86d3cb02c2bcde81633c0096b308e2809ea00 (harmony)
  • Test262 checkout e4bbdba1059a871294dd25d305e4cab4b9c89f9e (master)

process.versions:

{ http_parser: '2.7.0',
  node: '7.7.3',
  v8: '5.5.372.41',
 uv: '1.11.0',