Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

import * as winston from 'winston';
import * as WebSocket from 'ws';
import Config from './config';
import Database from './database';
import GameEngine from './gameengine';
import {
ErrorCode,
EventType,
IBonus,
IEvent,
@WebRTCGame
WebRTCGame / index.html
Last active December 31, 2019 07:21
testplayground
<div>hi</div>
@WebRTCGame
WebRTCGame / wordfindreplaceexcel.vba
Created November 13, 2019 17:15
Microsoft Word VBA Find And Replace from Excel file
'excel file should have two columns, left being the find, right being the replace
'the find items should read like: [xxxx]
Sub ReplaceByExcel()
Dim xl As Object
Dim wb As Object
Dim ws As Object
Dim rng As Object
Dim cl As Object
Set xl = CreateObject("Excel.Application")
@WebRTCGame
WebRTCGame / Basic custom function.EXCEL.yaml
Last active July 22, 2019 22:35
Calculates the volume of a sphere.
name: Basic custom function
description: Calculates the volume of a sphere.
host: EXCEL
api_set: {}
script:
content: |
/**
* Calculates the volume of a sphere.
* @customfunction
* @param {number} radius
@WebRTCGame
WebRTCGame / Memoize.js
Last active August 16, 2019 20:06
Javascript Multiple Argument Memoization
console.clear();
function mem2() {
let iset = {};
return (fn) => {
return (...args) => {
!(args in iset) && (iset[args] = fn(...args));
return iset[args];
}
}
@WebRTCGame
WebRTCGame / gist:8e7d3118e52cacbe6dbc7dd275966ad7
Created November 27, 2018 16:49
Simple Javascript Performance Profiler Log
let perf = {
t0: 0,
t1: 0,
tick: 0,
last: 0,
start() {
this.tick = 1;
console.trace();
this.t0 = performance.now();
@WebRTCGame
WebRTCGame / JavascriptBooks.md
Last active April 10, 2024 01:44
Free Javascript Books

Useful Links

23 Free JavaScript Books

A curated collection of awesome & free JavaScript books to help you learn the JavaScript programming language.

If you know of any other free JavaScript books that you think should be on this list, please let me know in the comments section and I will get them added.

@WebRTCGame
WebRTCGame / nouns.js
Last active August 29, 2015 14:19
nouns.js
var nouns = [
"aardvark",
"abacus",
"ability",
"abroad",
"abuse",
"abyssinian",
"accelerator",
"access",
"accident",
@WebRTCGame
WebRTCGame / prettyconsole.js
Created October 30, 2014 14:50
Colored console output
console.__proto__.__proto__.fLog = (function () {
var severityColor = function (severity) {
switch (severity) {
case 1:
return 'green';
break;
case 2:
return 'blue';
break;
@WebRTCGame
WebRTCGame / borrowcontentfromsite.html
Created October 30, 2014 13:00
Borrow Content Cross-origin from a website
<div id="queryResultContainer">abc</div>
<script>
var ExternalURL = "www.reptilesmagazine.com/Reptile-Events-Calendar/";
$(document).ready(loadContent);
function loadContent() {
var QueryURL = "http://anyorigin.com/get?url=" + ExternalURL + "&callback=?";
$.getJSON(QueryURL, function (data) {