Skip to content

Instantly share code, notes, and snippets.

View fernandoporazzi's full-sized avatar

Fernando Porazzi fernandoporazzi

  • Bitvavo
  • Amsterdam
View GitHub Profile
@tomysmile
tomysmile / mac-setup-redis.md
Last active October 31, 2024 21:46
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@toddmotto
toddmotto / consoleLoge.js
Last active August 29, 2015 13:57
console.loge(), many log, much console
window.console.loge = function (msg) {
var gifs = ['wink','shake-space','peepers','prizza','hat','gradient','fat','rainbow','sunglasses','derp','shake'],
wow = ['', 'wow! ', 'amaze! ', 'dazzle! '],
adjs = ['so', 'such', 'many', 'much', 'very'],
randomizr = function (a) { return a[Math.floor(Math.random() * a.length)];},
message = '%c ' + randomizr(wow) + randomizr(adjs) + ' ' + typeof msg + ': ',
css = 'background: url(http://d1e3ezyatlol8u.cloudfront.net/img/212/doge-' + randomizr(gifs) + '-212.gif) no-repeat 0 0; background-size: 80px 80px; font-family: \'Comic Sans MS\', cursive; text-shadow: 0 1px 1px rgba(0,0,0,1); font-size: 14px; padding: 25px; line-height: 70px; color: #fff; font-weight: 100;';
console.log.apply(console, typeof msg === 'object' ? [message, css, msg] : [message += msg, css]);
};
@danielrohers
danielrohers / app.js
Last active February 13, 2017 13:57
My JavaScript Module Pattern
;(function (w, d, undefined) {
'use strict';
var app = (function () {
var exports = {};
var _privateMethod = function () {
return 'private method';
@hullen
hullen / mobileCheck.js
Last active May 23, 2021 12:49
Detects mobile devices: phones, tablets. mobileCheck is a lightweight Javascript utils for detecting mobile devices and tablets. Its using User Agent string. Usage: if ( mobileCheck.smarphone ) { // Code }
var mobileCheck = {
ios: (function(){
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
}()),
android: (function(){
return navigator.userAgent.match(/Android/i);
}()),
blackBerry: (function(){
return navigator.userAgent.match(/BB10|Tablet|Mobile/i);
}()),
@toddmotto
toddmotto / gist:6730919
Created September 27, 2013 16:04
Assumptious click/touch binding events
var device = function () {
return 'ontouchstart' in window ? 'touchstart' : 'click';
};
element.on(device(), myFunction);
@hullen
hullen / ios_mediaqueries.css
Last active December 21, 2015 01:08
iOS Media Queries
/**
iOS Media Queries
compatível com iPhone, iPhone 3G, iPhone 3GS, iPhone 4, iPhone 4S, iPad, and iPad 2
Author @hullen
Fique a vontade em utilizar, colaborar e compartilhar!
*/
/**
iPhone (4/4S) - modo paisagem
cor do link: laranja com fundo verde
@hullen
hullen / wp_sql_update_url.sql
Created February 15, 2013 01:55
Wordpress SQL Update for alter the URL changes when you publish your site. This SQL helps you to speed up update yours url values in tables of the database. Just replace your old url by your new url of the site. Code helped by my friend @akbortoli
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldsite.com', 'http://www.newsite.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = REPLACE (guid, 'http://www.oldsite.com.br', 'http://www.newsite.com');
UPDATE wp_posts SET post_content = REPLACE (post_content, 'http://www.oldsite.com', 'http://www.newsite.com');
UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, 'http://www.oldsite.com','http://www.newsite.com');
@tsabat
tsabat / zsh.md
Last active October 16, 2024 14:43
Getting oh-my-zsh to work in Ubuntu
@nuxlli
nuxlli / sublime_text_2_useful_shortcuts.md
Created September 9, 2011 18:51 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods