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
Test |
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
alias ls='ls -gFh' | |
# MacPorts Installer addition on 2010-10-11_at_11:46:41: adding an appropriate $ | |
export PATH=/usr/local/bin:/opt/local/bin:/opt/local/sbin:$PATH | |
# Finished adapting your PATH environment variable for use with MacPorts. | |
export GREP_OPTIONS='--color=auto' | |
export CLICOLOR=1; | |
function git-branch() { |
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
The following doesnt work for some reason and it's really hurting my brains. | |
The variables contents are: | |
=========================== | |
myString = <script src="/mint/?js" type="text/javascript"> | |
matchedString = ?js" | |
I'm finding the range: | |
====================== | |
NSRange matchRange = [[myString string] rangeOfString:matchedString options:NSLiteralSearch]; |
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
[[self layer] setMasksToBounds:YES]; | |
[[self layer] setShadowColor:[[UIColor blackColor] CGColor]]; | |
[[self layer] setShadowOffset:CGSizeMake(0, 0)]; | |
[[self layer] setShadowOpacity:1]; | |
[[self layer] setShadowRadius:4.0]; | |
[[self layer] setBackgroundColor:[[UIColor clearColor] CGColor]]; |
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
/** | |
* Live updating API JS client side class | |
* @author Tim Davies | |
*/ | |
function liveupdatingClient (container) | |
{ | |
/** | |
* Set up, include handlebars and setup template | |
*/ | |
var endpoint = 'liveupdating.php'; |
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 | |
function sortPins (&$array, $key) { | |
$sorterArray = array(); | |
$ret=array(); | |
reset($array); | |
foreach ($array as $ii => $va) | |
$sorterArray[$ii]=$va[$key]; | |
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
int64_t delayInSeconds = 2.0; | |
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC); | |
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ | |
<#code to be executed on the main queue after delay#> | |
}); | |
// Do something in the background and then when done call something on the main thread | |
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 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
Handlebars.registerHelper('set', function(name, value) { | |
Handlebars.registerHelper(name, function() { | |
return value; | |
}); | |
}); | |
/* usage */ | |
{{ set "foo" "bar" }} |
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
class User extends Base | |
{ | |
public static $table = 'users'; | |
public static $rules = array('email' => 'required|email|unique:users','password' => 'required',); | |
} |
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
/** | |
* Handle the dynamic retrieval of attributes and associations. | |
* | |
* @param string $key | |
* @return mixed | |
*/ | |
public function __get($key) | |
{ | |
// Lets check if the model has a function for this first | |
if(method_exists($this, $key)) |