Skip to content

Instantly share code, notes, and snippets.

@kaizimmer
kaizimmer / TyphoonTestUtils.m
Created June 21, 2013 15:50
Fixing Clang scan error (original method code commented out): Clang scan-build bug report: File /Pods/Typhoon/Source/Utils/TyphoonTestUtils.m Bug Type Branch condition evaluates to a garbage value Category Logic error Description Branch condition evaluates to a garbage value
////////////////////////////////////////////////////////////////////////////////
//
// JASPER BLUES
// Copyright 2013 Jasper Blues
// All Rights Reserved.
//
// NOTICE: Jasper Blues permits you to use, modify, and distribute this file
// in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////
@kaizimmer
kaizimmer / build-machine-name.xml
Created July 25, 2012 10:13
Ant script storing machine name in property
<?xml version="1.0" encoding="UTF-8"?>
<project name="get-machine-name" default="default">
<target name="default">
<exec executable="hostname" outputproperty="computer.hostname"/>
<echo level="info">${computer.hostname}</echo>
</target>
</project>
@kaizimmer
kaizimmer / CalcNumberOfDays.js
Created July 21, 2012 13:14
Ecmascript | Calculate number of days in a month
function getNumberOfDays ( year, month )
{
return 32 - new Date(year, month, 32).getDate();
}
@kaizimmer
kaizimmer / private.xml
Created June 17, 2012 18:33
KeyRemap4MacBook PC Developer shortcuts
<?xml version="1.0"?>
<root>
<appdef>
<appname>Intellij</appname>
<equal>com.jetbrains.intellij</equal>
</appdef>
<appdef>
<appname>SUBLIME</appname>
@kaizimmer
kaizimmer / fiddler_add_column_client_ip
Created January 2, 2012 16:11
Fiddler - add "client ip" column
static function Main()
{
var today: Date = new Date();
FiddlerObject.StatusText = " CustomRules.js was loaded at: " + today;
//*/
FiddlerObject.UI.lvSessions.AddBoundColumn("Client IP", 120, "x-clientIP");
//*/
}
@kaizimmer
kaizimmer / fiddler_hide_local_traffic
Created January 2, 2012 15:57
Fiddler Rule - hide local traffic
static function OnBeforeRequest(oSession: Session)
{
//*/
if (oSession["X-CLIENTIP"] != null && oSession["X-CLIENTIP"].EndsWith("ffff:127.0.0.1"))
{
oSession["ui-hide"]="hiding local host"; //String value not important
}
//*/
// remainder ...
@kaizimmer
kaizimmer / WindowErrorLogging.js
Created December 21, 2011 19:15
Logs all errors passed to window.onerror handler
window.onerror = function ( descr, script, loc )
{
console.log("!!!!!!!!!!!");
console.log("!!! ERROR: " + JSON.stringify( { description: descr, script: script, line: loc } ));
console.log("!!!!!!!!!!!");
/*/
return true; //stops error propagation
//*/
};