Skip to content

Instantly share code, notes, and snippets.

@pau1m
pau1m / add_ssh_key
Last active January 2, 2016 14:49
Add SSH Key
cd ~/.ssh
ssh-keygen -t rsa -C "[email protected]"
ssh-add id_rsa
clip < ~/.ssh/id_rsa.pub
@pau1m
pau1m / drush cheat sheet
Last active December 30, 2015 21:49
Drush cheat sheet
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
@pau1m
pau1m / gist:4944280
Created February 13, 2013 12:34
Quick n dirty oauth request
<?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';
@pau1m
pau1m / gist:4771520
Created February 12, 2013 17:25
Quick hack to help get multiple image info in services / views
/*
*
*@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
*/
@pau1m
pau1m / KineticjsPolylineTransition.js
Last active December 10, 2015 16:08
Animating a shape across a polyline using transitions in KineticJS.
(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
});
@pau1m
pau1m / index.js
Created December 29, 2012 12:16 — forked from GothAck/index.js
#!/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() {