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
<?php | |
$audit = file_get_contents('audit.txt'); | |
$audit = split("\n", $audit); | |
$data = Array(); | |
for ($i=0; $i!=count($audit); $i++) { | |
$line = $audit[$i]; | |
$datatype = substr($line, 0, 1); | |
switch ($datatype) { | |
case '-': | |
$day = substr($line, 3, 10); |
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
# Homebrew, Ruby, Bash Completion | |
# After upgrading Ruby, run: gem pristine --all --only-executables | |
export PATH="/usr/local/bin:/usr/local/opt/ruby/bin:$PATH" | |
if [ -f $(brew --prefix)/etc/bash_completion ]; then | |
. $(brew --prefix)/etc/bash_completion | |
fi | |
# Directory Shortcuts | |
alias prj='cd "$HOME/Projects/"' | |
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
/* | |
* object.watch polyfill | |
* | |
* 2012-04-03 | |
* | |
* By Eli Grey, http://eligrey.com | |
* Public Domain. | |
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. | |
*/ |
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
Code | |
$("button").single_double_click(function () { | |
alert("Try double-clicking me!") | |
}, function () { | |
alert("Double click detected, I'm hiding") | |
$(this).hide() | |
}) | |
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
// | |
// AssertEventually.h | |
// LRResty | |
// | |
// Created by Luke Redpath on 03/08/2010. | |
// Copyright 2010 LJR Software Limited. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
#import "HCMatcher.h" |
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
// placed in my applicationDidFinishLaunchingWithOptions | |
if(getenv("NSZombieEnabled") || getenv("NSAutoreleaseFreedObjectCheckEnabled")) | |
NSLog(@"NSZombieEnabled/NSAutoreleaseFreedObjectCheckEnabled enabled!"); |
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
#import <libkern/OSAtomic.h> | |
#import <dispatch/dispatch.h> | |
#import <objc/runtime.h> | |
@implementation MySingleton | |
+ (void) load | |
{ | |
// check for weak-linked libdispatch symbols | |
if ( dispatch_queue_create != 0 ) |
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
- (BOOL) textField: (UITextField *) textField shouldChangeCharactersInRange: (NSRange) range replacementString: (NSString *) string | |
{ | |
([(textField == self.serverField ? self.emailField : self.serverField).text length] > 0 && | |
[(textField == self.passwordField ? self.emailField : self.passwordField).text length] > 0 && | |
[[textField.text stringByReplacingCharactersInRange: range withString: string] length] > 0 | |
) ? (self.navigationItem.rightBarButtonItem.enabled = YES) : (self.navigationItem.rightBarButtonItem.enabled = NO) ; | |
return YES; | |
} |
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
// Meanwhile, somewhere in a UI-specific non-thread-safe class | |
- (void) dealloc { | |
// glView is not thread-safe and may only be accessed via the main thread. | |
[_glView release]; | |
[super dealloc]; | |
} | |
- (void) updateUI { |
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
/* | |
Licensed under the MIT License | |
Copyright (c) 2011 Cédric Luthi | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
OlderNewer