This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/ | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/' | |
} | |
function is_git_svn { | |
git config --get svn-remote.svn.url > /dev/null | |
if [ $? == 0 ]; then | |
echo "(svn) " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
N = 1_000_000 | |
a = [] | |
100.times { a << (rand(10) > 5 ? true : false) } | |
Benchmark.bm(20) { |x| | |
x.report("String#to_i(base)") { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CmdUtils.CreateCommand({ | |
name: "wowhead", | |
arguments: [{role: 'object', nountype: noun_arb_text, label: 'query'}], | |
icon: "http://www.wowhead.com/favicon.ico", | |
homepage: "http://www.wowhead.com", | |
author: { name: "Carlos Moll", email: "[email protected]"}, | |
license: "MPL,GPL", | |
description: "Search Wowhead", | |
help: "Search for an item, quest, NPC, etc on Wowhead", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
# | |
# Simple Flash Socket Policy Server | |
# http://www.lightsphere.com/dev/articles/flash_socket_policy.html | |
# | |
# Copyright (C) 2008 Jacqueline Kira Hamilton | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Jason Roelofs | |
email = [email protected] | |
[color] | |
diff = auto | |
status = auto | |
branch = auto | |
[color "branch"] | |
current = yellow reverse | |
local = yellow |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// leaks memory because a copy of the value of scene is returned and the pointer is never deleted | |
Image Scene::draw() const { | |
Image scene = *(new Image()); | |
// build the scene | |
return *scene; | |
} | |
// doesn't leak memory, but is ugly |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Turn this: | |
$.post("/cameras/" + cameraId + "/wireless", { | |
"_method": "delete" | |
}, | |
function(response) { | |
$.prompt( | |
"<h3>Disconnecting from Wireless</h3>" + | |
"<ul><li class=\"processing\">Sending Request to Camera</li></ul>", { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def some_method | |
4 | |
end | |
some_method {|ret_val| puts ret_val} #=> 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/gamebox/template_app/crate_boot.c b/lib/gamebox/template_app/crate_boot.c | |
index ebb0c76..0126574 100644 | |
--- a/lib/gamebox/template_app/crate_boot.c | |
+++ b/lib/gamebox/template_app/crate_boot.c | |
@@ -173,6 +173,9 @@ int main( int argc, char** argv ) | |
/* initialize all extensions */ | |
Init_ext(); | |
+ /* Force setup of amalgamite */ | |
+ Init_amalgalite3(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> "#1123:somethinghere" =~ /(#[\d.]+)(?:\(.+?\))?/ | |
=> 0 | |
>> $1 | |
=> "#1123" |