This file contains 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
# I made a change to the PS1, I prefer my dirpath on a line above the prompt, | |
# so the prompt does not wind up at the right edge in deep trees. | |
# http://henrik.nyh.se/2008/12/git-dirty-prompt | |
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/ | |
# username@Machine ~/dev/dir[master]$ # clean working directory | |
# username@Machine ~/dev/dir[master*]$ # dirty working directory | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" |
This file contains 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
object MyPayPalIPN extends PayPalIPN { | |
def actions = { | |
case (action, info, _) => { | |
val payAmt: Long = info.paymentGross match { | |
case Full(gross) => gross.roboSplit("\\.") match { | |
case whole :: fraction => println("split case");toLong(whole) * 100 + toLong(fraction) | |
case _ => println("non-split case"); toLong(info.paymentGross) | |
} | |
case _ => 0 | |
} |
This file contains 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
object MyPayPalPDT extends PayPalPDT { | |
override def pdtPath = "paypal_complete" | |
def paypalAuthToken = Props.get("paypal.authToken") openOr "cannot find auth token from props file" | |
def pdtResponse: PartialFunction[(PayPalInfo, RequestState), LiftResponse] = { | |
case _ => println("--- in pdtResponse"); DoRedirectResponse("/account_admin/index"); | |
} | |
} | |
This file contains 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
# Bash snippet to open new shells in most recently visited dir. | |
# Useful if you want to open a new terminal tab at the present | |
# tab's location. | |
# | |
# Put this in your .bashrc or whatever. | |
pathed_cd () { | |
if [ "$1" == "" ]; then | |
cd | |
else |
This file contains 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
/** | |
* api helpers | |
*/ | |
implicit def boxNodeSeqToNodeSeq(in: Box[NodeSeq]): NodeSeq = { | |
in match { | |
case Full(n) => n | |
case Failure(msg, _, _) => <error>{msg}</error> | |
case _ => <error></error> | |
} |
This file contains 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
// Copied from Apple's SeismicXML code sample | |
// When the user taps a row in the table, display the USGS web page that displays details of the earthquake they selected. | |
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { | |
Earthquake *earthquake = (Earthquake *)[earthquakeList objectAtIndex:indexPath.row]; | |
PLActionSheet *sheet = [[PLActionSheet alloc] initWithTitle: @"Display Map"]; | |
[sheet addButtonWithTitle: @"Show USGS Site in Safari" block: ^{ | |
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: [earthquake USGSWebLink]]]; | |
}]; |
This file contains 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
// | |
// Events.h | |
// TWI | |
// | |
// Created by Shaun Harrison on 3/18/09. | |
// Copyright enormego 2009. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
This file contains 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
// | |
// EGOTitledTableViewCell.h | |
// EGOClasses | |
// | |
// Created by Shaun Harrison on 6/2/09. | |
// Copyright 2009 enormego. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
This file contains 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
@implementation CPTextView : CPView | |
{ | |
DOMElement FIXME_textArea; | |
id _delegate; | |
CPScrollView _scrollView; | |
CPView _contentView; | |
JSObject _existingSelectStart; |
This file contains 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
/** | |
* REST interface to Akka's JMX service. | |
* <p/> | |
* Here is an example that retreives the current number of Actors. | |
* <pre> | |
* http://localhost:9998/management | |
* ?service=service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi | |
* &component=se.scalablesolutions.akka:type=Stats | |
* &attribute=counter_NrOfActors | |
* </pre> |
OlderNewer