Skip to content

Instantly share code, notes, and snippets.

James jlao

Block or report user

Report or block jlao

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jlao
jlao / profile.ps1
Created Aug 29, 2012
My PowerShell profile customizations
View profile.ps1
function prompt
{
$loc = Get-Location
$parts = $loc.Path.split("\")
$shortparts = @($parts[0])
if ($parts.length -gt 2)
{
$shortparts += $parts[1..($parts.length - 2)] | % { $_[0] }
}
@jlao
jlao / MapPerf.scala
Created Oct 18, 2010
A simple performance test comparing the performance of java.util.HashMap, scala.collection.immutable.HashMap, scala.collection.mutable.HashMap.
View MapPerf.scala
import java.util.HashMap
object MapPerf {
def main(args: Array[String]) {
if ( args.length < 2 ) {
println("Usage: scala MapPerf <number of elements to insert> <num trials>")
return
}
View t-pain.c
#test return -18
//many tests catch special behaviour around tmin and tmax. this one tests for tpain.
int main()
{
int b; int o; int a; int t; int _____;
b = 1;
o = 2;
a = 4;
View gist:502972
abstract class Status {
import java.util.Date
val id: Long
val text: String
val createdAt: Date
val user: User
val inReplyToStatusID: Option[Int]
val inReplyToUserID: Option[Int]
View gist:467644
function p75_jw_player_handler( $matches, $attr, $url, $rawattr )
{
static $counter = 1;
if ( !empty($rawattr['width']) && !empty($rawattr['height']) ) {
$width = (int) $rawattr['width'];
$height = (int) $rawattr['height'];
} else {
list( $width, $height ) = wp_expand_dimensions(
get_option('p75_default_player_width'),
You can’t perform that action at this time.