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
#!/usr/bin/env node | |
/* | |
* Parsing BIG compressed data with Node.js and SAX | |
* Probably some bugs, but worked fine for OpenStreetMap Great Britain bz2 | |
* Greg Miell 2012 | |
*/ | |
// Simple string trim prototype extension | |
String.prototype.trim = function() { |
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
(function(){ | |
//[x,y] | |
var examplePolyline = [[10,10], [50,50], [50,100], [20,20], [60,100],[200,200],[0,0]]; | |
var stage = new Kinetic.Stage({ | |
container: 'myCanvas', | |
width: 600, | |
height: 400 | |
}); |
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
/* | |
* | |
*@param int $nid | |
*A node nid | |
*@param string $image_field | |
*Name of field on which to find images | |
* | |
*@return array | |
*Urls for various sizes of image | |
*/ |
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
<?php | |
ini_set('display_errors', 'On'); | |
error_reporting(E_ALL); | |
//@see http://oauth.googlecode.com/svn/code/php/ | |
require "lib/OAuth.php"; | |
$key = 'xx'; | |
$secret = 'xx'; |
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
Roles, Perms and Users | |
drush -u 1 role-create 'site administrator' | |
drush -u 1 role-delete 'site administrator' | |
drush help | grep perm | |
drush help perm-grant | |
drush -u 1 perm-grant --roles="site administrator" --permissions="administer nodes, administer users" | |
drush perm-grant --roles="site administrator" --all-modules |
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
cd ~/.ssh | |
ssh-keygen -t rsa -C "[email protected]" | |
ssh-add id_rsa | |
clip < ~/.ssh/id_rsa.pub |
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
<?php | |
/** | |
* Implements hook_menu(). | |
*/ | |
function mymodule_menu() { | |
$items['mymodule/%ctools_js/add'] = array( | |
'page callback' => 'mymodule_node_add_modal_callback', | |
'page arguments' => array(1), | |
'access arguments' => array('access content'), |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
<?php | |
function mymodule_block($op = 'list', $delta = 0, $edit = array()) { | |
switch($op) { | |
case 'list': | |
$blocks['mymodule_quicktabs'] = array('info' => t('[mymodule] Quicktabs')); | |
return $blocks; | |
break; | |
case 'view': | |
switch ($delta) { |
OlderNewer