Skip to content

Instantly share code, notes, and snippets.

View handrus's full-sized avatar

Handrus Stephan Nogueira handrus

View GitHub Profile
@handrus
handrus / gist:8337bd05b91ddf282320
Last active August 29, 2015 14:18
Get all permissions from a role and output as a array
var text= '';
jQuery('[id^="edit-6"]:checked').each(function(index, el){
text += "'" + el.value + "',\n";
});
copy(text);
@handrus
handrus / gist:f2cb1f6f19776f9e19d4
Last active August 29, 2015 14:18
ansible-playbook reference
ansible-playbook playbook.yml -c ssh -i providers/dev/Inventory -e @providers/dev/extravars.yaml -vvvv -f10
@handrus
handrus / pubsub.js
Last active August 29, 2015 14:16 — forked from weslleyaraujo/pubsub.js
/**
* @method: PubSub
* */
;(function(global) {
'use strict';
function PubSub () {
this.topics = {};
};
@handrus
handrus / Default (Linux).sublime-keymap
Created February 4, 2015 21:04
Sublime preferences and project template
[
{ "keys": ["ctrl+super+t"], "command": "phpcs_clear_sniffer_marks" },
{ "keys": ["alt+d"], "command": "goto_definition" },
{ "keys": ["ctrl+super+d"], "command": "goto_drupalapi" }
]
@handrus
handrus / README1.md
Last active August 29, 2015 14:07
Curso Oglivy

##Instalar drush, yeoman e usando phpcs com Drupal coder.

sudo apt-get install curl php-pear nodejs
sudo pear channel-discover pear.drush.org
sudo pear install drush/drush
sudo drush version

sudo ln -s /usr/bin/nodejs /usr/bin/node
sudo npm install -g yo
@handrus
handrus / gist:bd7771655258c721723e
Created August 8, 2014 20:22
Faster elementary OS Luna
#if you only use apps in english do not download other languages
sudo vim /etc/apt/apt.conf.d/00aptitude
#Add this line on the end
Acquire::Languages "none";
#remove zeitgeist, gnome online indicator and telepathy and shitty apps
zeitgeist-daemon --quit
sudo apt-get --purge autoremove deja-dup indicator-messages empathy-* gnome-online-accounts activity-log-manager-common activity-log-manager-control-center zeitgeist zeitgeist-core zeitgeist-datahub midori-granite noise software-center scratch-text-editor modemmanager geary
sudo apt-get autoremove
sudo apt-get autoclean
#! /usr/bin/env python2
# Requires: PIL, colormath
#
# Improved algorithm now automatically crops the image and uses much
# better color matching
from PIL import Image, ImageChops
from colormath.color_objects import RGBColor
import argparse
import math
@handrus
handrus / pre-commit
Last active August 29, 2015 13:56 — forked from skwashd/pre-commit
#!/bin/bash
#
# Git pre-commit hook for Drupal projects.
# Created by Dave Hall - http://davehall.com.au
#
# Changed by Handrus Nogueira and Luiz Petri
#
# Distributed under the terms of the WTFPL - http://www.wtfpl.net/
#
@handrus
handrus / gist:8835872
Created February 5, 2014 23:59
Faster git clone for large repositories
git clone --depth 1 https://github.com/CocoaPods/Specs
@handrus
handrus / CommentTrick.php
Last active December 17, 2015 19:48
Active/Deactive code trick
<?php
//*
myFunction();
//*/
/*
myFunction();
//*/