Skip to content

Instantly share code, notes, and snippets.

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

Daniel Camargo pererinha

🏠
Working from home
View GitHub Profile
#!/usr/bin/env bash
# fresh-chrome
#
# Use this script on OS X to launch a new instance of Google Chrome
# with its own empty cache, cookies, and user configuration.
#
# The first time you run this script, it will launch a new Google
# Chrome instance with a permanent user-data directory, which you can
# customize below. Perform any initial setup you want to keep on every
@pererinha
pererinha / cloudSettings
Last active November 20, 2020 16:52
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-11-20T16:52:46.995Z","extensionVersion":"v3.4.3"}
@pererinha
pererinha / fiddle.css
Created March 15, 2018 18:37 — forked from anonymous/fiddle.css
Find word
body{
margin: 10px;
}
.warning {
background: #d56c61;
}
td {
border: 1px solid #ccc;
height: 30px;
@pererinha
pererinha / fresh-chrome-with-custom-tz.sh
Created November 2, 2017 01:19 — forked from prasadsilva/fresh-chrome-with-custom-tz.sh
Launch new instances of Google Chrome on OS X with isolated cache, cookies, user config and custom Timezone
#!/usr/bin/env bash
# fresh-chrome
#
# Use this script on OS X to launch a new instance of Google Chrome
# with its own empty cache, cookies, and user configuration.
#
# The first time you run this script, it will launch a new Google
# Chrome instance with a permanent user-data directory, which you can
# customize below. Perform any initial setup you want to keep on every
@pererinha
pererinha / ignoreMouseWheel.js
Created June 30, 2014 12:58
Angular JS Directive - to disable mouse wheel on input type number
directive( 'ignoreMouseWheel', function( $rootScope ) {
return {
restrict: 'A',
link: function( scope, element, attrs ){
element.bind('mousewheel', function ( event ) {
element.blur();
} );
}
}
} );
var restaurants = $resource( App.service + 'restaurant/:action/:id', { action: '@action', id: '@id' }, {
// list methods
'list' : { 'method': 'GET', params : { 'action' : 'list' }, isArray: true },
'paid_list' : { 'method': 'GET', params : { 'action' : 'paid-list' }, isArray: true },
'delete' : { 'method': 'GET', params : { 'action' : 'delete', 'id': 1 },
}
);
@pererinha
pererinha / gist:0858d9a848deeba636a7
Last active August 29, 2015 14:02
just an alert
var a = function(){ alert(1); };a();
@pererinha
pererinha / isVersionCompatible.js
Last active August 29, 2015 14:01
Compare versions
function isVersionCompatible( required, installed ) {
required = required.toString().split( '.' )
installed = installed.toString().split( '.' );
var length = Math.max( required.length, installed.length );
var comparator = 0;
for( var i = 0; i < length && !comparator; i++ ) {
var part1 = parseInt( required[ i ], 10 ) || 0;
var part2 = parseInt( installed[ i ], 10 ) || 0;
if( part1 < part2 ){
comparator = 1;
@pererinha
pererinha / jQueryPluginBootstrap.js
Created December 27, 2011 16:31
jQuery Plugin Bootstrap
(function( $ ){
var info = {
name : 'markdownEditor',
version : '1.0',
soundtrack : 'Requiem for a dream',
author : '@pererinha',
date : '27/12/2011'
}
var defaults = {
height : 400,