Skip to content

Instantly share code, notes, and snippets.

View moro-programmer's full-sized avatar

moro-programmer moro-programmer

View GitHub Profile
@moro-programmer
moro-programmer / dabblet.css
Created December 1, 2013 17:49
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
@moro-programmer
moro-programmer / blob2img
Created February 7, 2014 13:22
blob to img
socket.onmessage = function(event) { if (event.data instanceof Blob) { // 1. Get the raw data. var blob = event.data; // 2. Create a new URL for the blob object. window.URL = window.URL || window.webkitURL; var source = window.URL.createObjectURL(blob); // 3. Create an image tag programmatically. var image = document.createElement("img"); image.src = source; image.alt = "Image generated from blob"; // 4. Insert the new image at the end of the document. document.body.appendChild(image); }
// This script will boot app.js with the number of workers
// specified in WORKER_COUNT.
//
// The master will respond to SIGHUP, which will trigger
// restarting all the workers and reloading the app.
var cluster = require('cluster');
var workerCount = process.env.WORKER_COUNT || 2;
// Defines what each worker needs to run

(Several of these git examples have been extracted from the book 'Pragmatic guide to GIT' of Travis Swicegood )

Git tips

Global git user

git config --global user.name "Fernando Guillen"
git config --global user.email "fguillen.mail+spam@gmail.com"

Repository git user

cd /develop/myrepo

-server
-Dfile.encoding=UTF-8
-Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient
-Dawt.useSystemAAFontSettings=lcd
-Djava.net.preferIPv4Stack=true
-Dsun.java2d.opengl=true
-Dsun.java2d.d3d=false
-Xverify:none
-Xms600m
-Xmx600m

Bookmarklet: Active Element Logger

This will log the current document.activeElement to the console. Useful when debugging keyboard focus issues. Click once to turn it on, click again to turn it off.

Unfortunately, markdown gists aren't allowed to include JS in links, or this would work:

Active Element Logger

So you'll have to add this to your bookmarks the hard way:

@moro-programmer
moro-programmer / README.md
Created January 14, 2016 08:44 — forked from Dr-Nikson/README.md
Auth example (react + redux + react-router)

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
'use strict';
// Generated on <%= (new Date).toISOString().split('T')[0] %> using <%= pkg.name %> <%= pkg.version %>
var gulp = require('gulp');
var open = require('open');
var wiredep = require('wiredep').stream;
// Load plugins
var $ = require('gulp-load-plugins')();