Skip to content

Instantly share code, notes, and snippets.

View capynet's full-sized avatar
🏠
Working from home

Marcelo Tosco capynet

🏠
Working from home
View GitHub Profile
@capynet
capynet / _flex-grid.scss
Created April 30, 2017 13:49
Genera una grilla basandose en flex.
/**
* Genera una grilla basandose en flex.
*
* $gutter: espacio entre cada elemento. (px, em, etc)
* $itemsByLine: Cantidad de items por defecto. (numero entero)
* $breakpoints: mapa de "breakpoint" -> items.
*
* Usage:
* @include flex-grid(9px, 2, (bp-s-m: 3, bp-m: 4, bp-m-l:6));
* En este caso de uso por defecto de imprimen 2 items por fila con
@capynet
capynet / Prompt personalizado y con colores para git
Last active August 29, 2015 14:07
Prompt personalizado y con colores para git
# Prompt personalizado y con colores para git
# ------------------------------
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
export PS1='\[\033[0;31m\]\[\033[0m\]\[\033[01;31m\]pc-\u\[\033[01;33m\]@\[\033[01;36m\]''\[\033[01;33m\]\w \[\033[01;35m\]\[\033[00m\]$(parse_git_branch)\$ '
@capynet
capynet / hammer-js.jquery.js
Last active July 5, 2017 10:39
Micro hammer.js adapter for jQuery
// Download http://hammerjs.github.io/
// jQuery plugin
(function ($) {
$.fn.mobileEvent = function (event, cb) {
this.length && (new Hammer(this.get(0)).on(event, $.proxy(cb, this)));
};
})(jQuery);
@capynet
capynet / monit-myapp.conf
Last active August 29, 2015 14:06
Monit template file for monit Node.js apps
check process my-service with pidfile "/var/run/my-service.pid"
start program = "/etc/init.d/my-service start"
stop program = "/etc/init.d/my-service stop"
if failed
port [THE NODEJS PORT HERE] protocol HTTP
request / with timeout 10 seconds
then restart
@capynet
capynet / node-app-systemd-template
Last active August 29, 2015 14:06
Nodejs systemd daemon template
#!/bin/bash
# This service requires you have forever app installed in your system.
### CONFIG ZONE
# This is the service name. It cant have any special char or space.
serviceName="my-service"
# Where is located your app
appFilePath="/var/node/my-service-node-app"
@capynet
capynet / Search form fluid
Last active August 29, 2015 14:06
Search form responsive
<h1>Resize the window</h1>
<form>
<div class="form-element textfield">
<input type="text">
</div>
<div class="form-element submit-btn">
<input type="submit" value="Search">
</div>