Skip to content

Instantly share code, notes, and snippets.

View handrus's full-sized avatar

Handrus Stephan Nogueira handrus

View GitHub Profile
@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 / 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 / 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 / indepent_class.patch
Created May 15, 2015 19:21
CPN_7.x-1.x_patches
diff --git a/cpn.js b/cpn.js
index 57a25d8..2029107 100644
--- a/cpn.js
+++ b/cpn.js
@@ -9,7 +9,13 @@
attach: function(context, settings) {
// Append enable/disable links.
$('.form-item-cpn-css, .form-item-cpn-js', context).each(function() {
- $('.description', this).append(' <a href="#" class="cpn-toggle">Enable syntax highlighting</a>.');
+ if ($('.description', this).length) {
@handrus
handrus / Different_Cultures.md
Created September 30, 2015 01:06
Custo Software vs Product

Custom Development | Revenue Software | | --- | --- | --- | | Key Metric | Staff Utilization (busy developers) | Users (subscribers, licenses) | | Business Model | Mark-up on staff hours | Re-use of identical bits | | We track... | Projects/programs | Products/releases | | Essential skills | Sales, business development | Segmentation, validation | | Innovation ownership & risk | Client owns IP: we hope they pay and send more projects our way | We own IP: we hope target segment pays handsomely for perceived value | | Graded first on... | On time, on budget, on spec | Market winner vs. competition | | Customer wants a one-off? | "Great! Here's a change order" | "Let me put that (deep) into the backlog." | | Plan to productize platforms? | Always sacrificed when paid projects run late | Essential part of product line planning |

@handrus
handrus / hyphenate.css
Created October 10, 2015 17:50
Dealing with long words in CSS
.hyphenate {
overflow-wrap: break-word;
word-wrap: break-word;
-webkit-hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
}
@handrus
handrus / pv.sh
Last active April 17, 2016 23:08
Restore mysql db from .gz file with progress bar
pv mydump.sql.gz | gunzip | mysql -u User -p database_name
@handrus
handrus / prevent_double_click.js
Created March 10, 2016 01:51 — forked from pangui/prevent_double_click.js
Prevent double click!
// jQuery plugin to prevent double click
jQuery.fn.preventDoubleClick = function() {
$(this).on('click', function(e){
var $el = $(this);
if($el.data('clicked')){
// Previously clicked, stop actions
e.preventDefault();
e.stopPropagation();
}else{
// Mark to ignore next click

Fixing coding style problems on scss files

You'll need to install csscomb

npm install csscomb -g

After that place the file .csscomb.json at you project root folder and run the comand

`csscomb path_to_your_SCSC_or_CSS_files