##Docs
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 | |
$somefunction = function($foo, $bar){ | |
//do something | |
} | |
$myfunction = ($somefunction($foo, $bar), $variable){ | |
//do stuff | |
//call somefunction | |
//do some more stuff |
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 | |
$array_one = array('bird' => 'penguin'); | |
$t1 = $array_one['bird']; //that's fine | |
$t2 = $array_one['mammal']; //doesn't exist, throws a notice | |
$t3 = empty($array_one['mammal']) ? NULL : $array_one['mammal']; //checks if mammal is empty, if it is, sets null, otherwise sets the value. |
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 | |
/** | |
* Converts a date string to a date object with requested time zone | |
* | |
* @param $date | |
* Date String | |
* @param $from_tz | |
* String of timezone to convert FROM | |
* @param $to_tz |
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 | |
$feeds_importer = new stdClass(); | |
$feeds_importer->disabled = FALSE; /* Edit this to true to make a default feeds_importer disabled initially */ | |
$feeds_importer->api_version = 1; | |
$feeds_importer->id = 'mailhandler_nodes'; | |
$feeds_importer->config = array( | |
'name' => 'Mailhandler nodes', | |
'description' => 'Imports nodes from a Mailhandler mailbox', | |
'fetcher' => array( |
Note: the original location of this article is on my blog, however, it is posted here too for better readability.
In this article, we will see how to use Core Data for accessing your API. We will use the Bandcamp API as our running example. I've only been experimenting with this code for a few days, so there might be mistakes in there.
https://github.com/AFNetworking/AFIncrementalStore
##Accessing an API using CoreData's NSIncrementalStore https://gist.github.com/1860108 http://sealedabstract.com/code/nsincrementalstore-the-future-of-web-services-in-ios-mac-os-x/
##AppDelegate.m
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator
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
#!/bin/sh | |
# | |
# An example hook script to check the commit log message. | |
# Called by "git commit" with one argument, the name of the file | |
# that has the commit message. The hook should exit with non-zero | |
# status after issuing an appropriate message if it wants to stop the | |
# commit. The hook is allowed to edit the commit message file. | |
# | |
# To enable this hook, rename this file to "commit-msg". |
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
channels = ( | |
{ name = "#allplayers"; chatnet = "freenode"; autojoin = "yes"; }, | |
{ name = "#api-craft"; chatnet = "freenode"; autojoin = "yes"; }, | |
{ name = "#Node.js"; chatnet = "freenode"; autojoin = "yes"; }, | |
{ name = "#drupal"; chatnet = "freenode"; autojoin = "yes"; }, | |
{ name = "#drupal-chicago"; chatnet = "freenode"; autojoin = "yes"; }, | |
{ name = "#cadug"; chatnet = "freenode"; autojoin = "yes"; }, | |
{ name = "#drupal-wscci"; chatnet = "freenode"; autojoin = "yes"; }, | |
{ name = "#drupal-services"; chatnet = "freenode"; autojoin = "yes"; }, | |
{ name = "#drupal-contribute"; chatnet = "freenode"; autojoin = "yes"; }, |