Skip to content

Instantly share code, notes, and snippets.

@szkrd
szkrd / mocha_jsdom_setup.js
Created June 27, 2016 15:37
babel + mocha + chai + sinon + jsdom + hacked require + browser window objects
/*eslint no-console: 0*/
// mocha unit tests setup, no e2e, probably no integ!
require('babel-core/register');
require('babel-polyfill');
const jsdom = require('jsdom');
const sinon = require('sinon');
const chai = require('chai');
const sinonChai = require('sinon-chai');
// use sinon with bdd
@ik5
ik5 / colors.go
Last active April 8, 2024 14:25
Simple golang expirement with ANSI colors
package main
// http://play.golang.org/p/jZ5pa944O1 <- will not display the colors
import "fmt"
const (
InfoColor = "\033[1;34m%s\033[0m"
NoticeColor = "\033[1;36m%s\033[0m"
WarningColor = "\033[1;33m%s\033[0m"
ErrorColor = "\033[1;31m%s\033[0m"
DebugColor = "\033[0;36m%s\033[0m"
; The official HD AI
; An Artificial Intelligence Script written by Archon and Promiskuitiv
; Get in contact with Promiskuitiv by sending a mail to neuernamae@web.de
; List of taunts it reacts to:
; Standard taunts.
; 33 - Stop slinging resources. If slinging is requested early and is immediately canceled it may mess up the strategy.
; 38 - Sling Resources. Human player only, stops any unit production except for civilian units.