Skip to content

Instantly share code, notes, and snippets.

View IQAndreas's full-sized avatar

Andreas Renberg IQAndreas

View GitHub Profile
@IQAndreas
IQAndreas / request-animation-frame.js
Last active August 29, 2015 13:59
Make sure the `requestAnimationFrame()` function exists in one way or another.
window.requestAnimationFrame ||=
window.mozRequestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function() { console.log("WARNING: 'window.requestAnimationFrame()' not available in this browser."); };
@IQAndreas
IQAndreas / haxeflixel-v.3.0.1-packages.md
Last active August 29, 2015 14:00
HaxeFlixel v.3.0.1 package structure

[root]

FlxBasic
FlxCamera
FlxGame
FlxG
FlxObject
FlxSprite
FlxState
FlxSubState

@IQAndreas
IQAndreas / flixel-power-tools-v.1.9-packages.md
Created April 29, 2014 00:14
Flixel Power Tools v.1.9 package structure

[root]

FlxBar
FlxBitmapFont
FlxButtonPlus
FlxCollision
FlxColor
FlxControl
FlxControlHandler
FlxCoreUtils
FlxDelay

@IQAndreas
IQAndreas / Main.as
Last active August 29, 2015 14:01
Inconsistent Math results between AS3 and Haxe->AS3. See https://groups.google.com/forum/#!msg/haxelang/GHqaYCea8fE/5TJi7Mio0ngJ
package
{
import flash.text.TextField;
import flash.display.Sprite;
public class Main extends Sprite
{
public function Main()
{
traceVisual("TEST #5");
private static void rangeCheck(int arrayLen, int fromIndex, int toIndex) {
if (fromIndex > toIndex)
throw new IllegalArgumentException("fromIndex(" + fromIndex + ") > toIndex(" + toIndex+")");
if (fromIndex < 0)
throw new ArrayIndexOutOfBoundsException(fromIndex);
if (toIndex > arrayLen)
throw new ArrayIndexOutOfBoundsException(toIndex);
}
00:00.0 Host bridge [0600]: Intel Corporation Mobile PM965/GM965/GL960 Memory Controller Hub [8086:2a00] (rev 0c)
Subsystem: Hewlett-Packard Company Device [103c:30c8]
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort+ >SERR- <PERR- INTx-
Latency: 0
Capabilities: <access denied>
Kernel driver in use: agpgart-intel
00:02.0 VGA compatible controller [0300]: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (primary) [8086:2a02] (rev 0c) (prog-if 00 [VGA controller])
Subsystem: Hewlett-Packard Company Device [103c:30c8]
@IQAndreas
IQAndreas / .bashrc
Created May 20, 2014 09:10
Snippet from "~/.bashrc"
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
RED="\[\033[0;31m\]"
RESET="\[\033[00m\]"
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
#host="@${RED}medtech${RESET}"
host="@\h"
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u${host}\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
@IQAndreas
IQAndreas / replace-html-entities.sh
Created May 31, 2014 03:46
Replace HTML entities with the actual unicode characters with Bash
# There are more, but these were all I needed for the current project
sed -i 's/&ldquo;/“/g' *.md
sed -i 's/&rdquo;/”/g' *.md
sed -i 's/&copy;/©/g' *.md
# Check if we have any HTML entities remaining (requires some manual filtering by eye)
grep '&' *.md
$ time last > /dev/null
real 0m0.006s
user 0m0.004s
sys 0m0.004s
$ time last -i > /dev/null
real 0m0.005s
user 0m0.008s
sys 0m0.000s