Skip to content

Instantly share code, notes, and snippets.

View giuliandrimba's full-sized avatar
🥁

Giulian Drimba giuliandrimba

🥁
View GitHub Profile
@giuliandrimba
giuliandrimba / jquery.loadimages.js
Created November 13, 2012 19:36
JavaScript: Load all images inside element
(function($)
{
/*
* Author: Giulian Drimba
*
*/
$.fn.loadImages = function(callback, scope)
{
var images = $(this).find("img");
@giuliandrimba
giuliandrimba / gist:3104727
Last active October 7, 2015 04:18 — forked from millermedeiros/gist:3057782
Infos: Links sobre otimização de performance (WPO)
@giuliandrimba
giuliandrimba / terminal.colors.txt
Created July 3, 2012 17:21
SHELL: Terminal Colors
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
PURPLE="\[\033[0;35m\]"
BROWN="\[\033[0;33m\]"
BLUE="\[\033[0;34m\]"
CYAN="\[\033[0;36m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GRAY="\[\033[0;37m\]"
WHITE="\[\033[1;37m\]"
@giuliandrimba
giuliandrimba / git-empty-branch.txt
Created June 29, 2012 18:02
GIT: Create empty branch
git symbolic-ref HEAD refs/heads/empty
touch .gitignore
git add .gitignore
git commit -m 'Initial headless branch commit'
@giuliandrimba
giuliandrimba / is_mobile.js
Created May 24, 2012 18:43
JavaScript: Check mobile browser
function is_mobile() {
if (navigator.userAgent.match(/Android/i) ||
navigator.userAgent.match(/webOS/i) ||
navigator.userAgent.match(/iPhone/i) ||
navigator.userAgent.match(/iPad/i) ||
navigator.userAgent.match(/iPod/i) ||
navigator.userAgent.match(/BlackBerry/) ||
navigator.userAgent.match(/Windows Phone/i) ||
navigator.userAgent.match(/ZuneWP7/i)
) {
<!doctype html>
<!-- Helpful things to keep in your <head/>
// Shi Chuan, https://github.com/shichuan/mobile-html5-boilerplate
-->
<head>
<!-- consider using below meta tags if you want to disable format detection by default -->
<meta name="format-detection" content="telephone=no"/>
<meta name="format-detection" content="address=no"/>
<!-- consider using below link tag if the page is duplicate content of a desktop version -->
sudo install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient.18.dylib ~/.rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.2.17/lib/mysql2/mysql2.bundle
mysqladmin -u root -p create database_name_development
mysql -u root table_name < database/dump.sql
scp root@domain.com:file.txt file.txt
@giuliandrimba
giuliandrimba / hack.sh
Last active March 15, 2022 08:04 — forked from erikh/hack.sh
SHELL: OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@giuliandrimba
giuliandrimba / gist:2376778
Last active October 3, 2015 02:58 — forked from maccman/gist:1232164
Infos: Mobile Safari viewport sizes on iOS 4.3 and 5
iPad
1024 × 690 In landscape on iOS 4.3
1024 × 672 In landscape on iOS 5
768 × 946 In portrait on iOS 4.3
768 × 928 In portrait on iOS 5
1024 × 660 Always showing bookmarks bar in landscape on iOS 4.3
1024 × 644 Always showing bookmarks bar in landscape on iOS 5
768 × 916 Always showing bookmarks bar in portrait on iOS 4.3
@giuliandrimba
giuliandrimba / jquery.placeholder.js
Created March 15, 2012 14:46
IE jQuery Placeholder
$(document).ready(function(){
try {
jsToggle();
} catch (jsToggleE){
}
});
function jsToggle()
{