Skip to content

Instantly share code, notes, and snippets.

View bjrmatos's full-sized avatar

BJR Matos bjrmatos

View GitHub Profile
@bjrmatos
bjrmatos / .editorconfig
Last active August 29, 2015 14:00
my personal .editorconfig
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
# Change these settings to your own preference
indent_style = space
@bjrmatos
bjrmatos / .jshintrc
Last active August 29, 2015 14:00
My personal configuration .jshintrc
{
// Documentation: http://www.jshint.com/docs/options/
// Predefined globals who JSHint will ignore.
"browser": true, // Standard browser globals e.g. `window`, `document`.
"node": true,
"rhino": false,
"couch": false,
"wsh": false, // Windows Scripting Host.
@bjrmatos
bjrmatos / cookie-options.json
Last active August 29, 2015 14:00
Explanation of configuration for create cookies in express
@bjrmatos
bjrmatos / forever.txt
Created May 2, 2014 14:48
Run forever with logs
sudo forever start -l /path/to/forever.log -o /path/to/out.log -e /path/to/err.log -c node app.js
@bjrmatos
bjrmatos / app.js
Created May 12, 2014 16:10 — forked from robertklep/app.js
Express vhosting
var express = require('express');
var app = express();
var app2 = express();
app.use(express.vhost('app1.example.com', require('./app1').app));
app.use(express.vhost('app2.example.com', app2));
app2.get('/', function(req, res) {
res.send('app 2');
@bjrmatos
bjrmatos / example.css
Created May 13, 2014 17:19
CSS Order of properties
.declaration-order {
content: '';
/* Positioning */
position: relative;
top: 0;
right: 0;
bottom: 0;
left: 0;
@bjrmatos
bjrmatos / example.css
Created May 13, 2014 17:20
CSS Hide text
.hide-text {
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}
// antigua tecnica
.hide-text{
text-indent: -9999px;
}
@bjrmatos
bjrmatos / example.css
Created May 13, 2014 17:21
CSS Full width and height element (ligthbox wrapper)
.element {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
@bjrmatos
bjrmatos / example.css
Created May 13, 2014 17:23
CSS Vertical and Horizontal center
.centrar {
width: 300px;
height: 200px;
position: absolute;
left: 50%;
top: 50%;
margin-left: -150px; /*(width/2)*/
margin-top: -100px; /*(height/2)*/
}
@bjrmatos
bjrmatos / post-merge
Created May 15, 2014 04:02 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed. In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed. Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"