Skip to content

Instantly share code, notes, and snippets.

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"; },
@MrMaksimize
MrMaksimize / commit-msg.sh
Created September 22, 2012 00:27
Commit message hook that appends story id
#!/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".
@MrMaksimize
MrMaksimize / nsincrementalstore.markdown
Created September 4, 2012 14:18 — forked from chriseidhof/nsincrementalstore.markdown
Accessing an API using CoreData's NSIncrementalStore

Accessing an API using CoreData's NSIncrementalStore

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.

<?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(
<?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
<?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.