Skip to content

Instantly share code, notes, and snippets.

@YellowAfterlife
YellowAfterlife / closure.js
Created July 20, 2014 14:38
Does Google Closure not like this for-loop macros?
// ==ClosureCompiler==
// @compilation_level SIMPLE_OPTIMIZATIONS
// @output_file_name default.js
// @formatting pretty_print
// ==/ClosureCompiler==
// Before Closure: 0, 1, 3
// After Closure: 0, 1, 3, 5, 6
// Bug
Stay within the confines of the giant beast's shadow to avoid its wrath
Only way to power-up is to die & be reborn as a more powerful creature but you have to keep finding secret 1-ups to kamikaze.
You are a piñata. find required amount hidden candy. inbetween levels, kids beat the shit out of you & the adults rebuild you.
A stealth game about a towering giant that wears the stealthiest footwear a giant can wear: skyscraper boots.
You are in a living, breathing dungeon where some doors have pulsing veins to be slit & other doors have grotesque hands to shake
Follow a trail of blood through a maze dungeon. defeat creatures. their blood splatter disorientates you.
Game title: alt-stab-delete.
You tire of your power. you decide to give 1 power-up to each of your friends. outcomes differ, depending what each friend gets.
Every enemy body part has an inventory of verbs to steal from, slowly providing each of your body parts with more freedom.
A game about finding your way out of small, enclosed spaces before your
/// draw_background_layer(index, x, y, bx, by, bw, bh)
/// draw_background_layer(index, x, y, view)
// Simulates built-in background drawing behaviour (for non-use-for-3d backgrounds).
var idx = argument[0], bi;
bi = background_index[idx]
if (bi == -1) return 0
if (!background_visible[idx]) return 0
if (!background_exists(bi)) return 0
var ox = argument[1], oy = argument[2],
rx, ry, rw, rh;
/// draw_background_layer(index, x, y, bx, by, bw, bh)
/// draw_background_layer(index, x, y, view)
// Simulates built-in background drawing behaviour (for use-for-3d backgrounds).
var idx = argument[0], bi;
bi = background_index[idx]
if (bi == -1) return 0
if (!background_visible[idx]) return 0
if (!background_exists(bi)) return 0
var ox = argument[1], oy = argument[2],
rx, ry, rw, rh;
/**
* Draws a "square" to given Graphics object.
* @param g Graphics object to draw in
* @param x X position of square (px)
* @param y Y position of square (px)
* @param z Size of square (px)
* @param a Top-left value (0..1)
* @param b Top-right value (0..1)
* @param c Bottom-left value (0..1)
* @param d Bottom-right value (0..1)
@YellowAfterlife
YellowAfterlife / wpeditor.part.css
Created September 8, 2014 17:52
WP Editor fix for WordPress 4.0
/* wpeditor.css, line 240: */
.CodeMirror {
height:auto !important;
width:100%;
}
.wp-editor-container .CodeMirror {
width:100% !important;
}
.wp-editor-container .CodeMirror-scroll {
border:none;
static function tryNormal() {
var r;
try {
r = 'normal';
} catch (_:Dynamic) {
r = null;
}
return r;
}
static function tryCompact() {
function Main_Main.tryNormal()
local r
local try, catch = pcall(function ()
r = "normal"
end);
if (try == false) then
local _ = catch;
r = nil
end
return r
function printTry(e1:haxe.macro.TypedExpr, catches: Array<{ v : haxe.macro.TVar, expr : haxe.macro.TypedExpr }>)
{
// TODO catch other types of exceptions
// getting last (e:Dynamic) catch:
var _dynCatch = catches.pop(), _tabs;
// try-block:
var s = 'local try, catch = pcall(function ()';
_tabs = tabs; tabs += tabString;
var tryBlock = printExpr(e1);
@YellowAfterlife
YellowAfterlife / assign-operator.lua
Created September 17, 2014 14:29
Comparisons for what is "var2 = (var1 = value)" in other languages.
function set_field(t, f, v)
t[f] = v
return v
end
local n = 10000000
local t = { }
local q
local p
-- Direct:
q = os.clock()