Skip to content

Instantly share code, notes, and snippets.

@bjpbakker
bjpbakker / JndiCapableJdbcAppender.java
Created February 7, 2011 22:14
Extension of the log4j JDBCAppender to allow using a JNDI data source
package nl.iprofs.blogs.log4j.databaselogging;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.naming.Context;
import javax.naming.InitialContext;
@bahaddinyasar
bahaddinyasar / ios_debugger_tips_and_tricks.txt
Created August 28, 2012 08:38
IOS Debugger(lldb): Tips and Tricks
The po command stands for "print object."
The symbol $eax refers to one of the CPU registers. In the case of an exception, this register will contain a pointer to the NSException object.
Note: $eax only works for the simulator, if you’re debugging on the device you’ll need to use register $r0.
(lldb) po [$eax class]
You will see something like this:
(id) $2 = 0x01446e84 NSException
You can call any method from NSException on this object. For example:
@pmeenan
pmeenan / user-timing-rum.js
Last active January 18, 2024 23:46
Support routine for adding W3C user timing events to a site. Includes some basic polyfill support for browsers that don't support user timing or navigation timing (though the start time for non-navigation timing support could be improved with IE < 9 to use IE's custom start event).
// Support routines for automatically reporting user timing for common analytics platforms
// Currently supports Google Analytics, Boomerang and SOASTA mPulse
// In the case of boomerang, you will need to map the event names you want reported
// to timer names (for mPulse these need to be custom0, custom1, etc) using a global variable:
// rumMapping = {'aft': 'custom0'};
(function() {
var wtt = function(n, t, b) {
t = Math.round(t);
if (t >= 0 && t < 3600000) {
// Google Analytics
@staltz
staltz / introrx.md
Last active June 29, 2024 15:58
The introduction to Reactive Programming you've been missing