Skip to content

Instantly share code, notes, and snippets.

View giuliandrimba's full-sized avatar
🥁

Giulian Drimba giuliandrimba

🥁
View GitHub Profile
@giuliandrimba
giuliandrimba / get-sprite-retina
Created August 29, 2014 17:57
SASS + Compass retina sprite mixin
@mixin get-sprite($imgs, $name, $resize : false)
{
$dimensions: true !default;
$clean-up: true !default;
$layout:vertical !default;
$map: sprite-map($imgs, $layout: $layout, $cleanup: $clean-up, $spacing: 15px);
background: $map no-repeat;
@include sprite($map, $name, $dimensions, 0, 0);
module.exports = function(jObj) {
var obj;
obj = {
_y: 1000,
_x: 1000,
_opacity: 0,
dom: jObj
};
Object.defineProperty(obj, "y", {
get: function() {
@giuliandrimba
giuliandrimba / typo
Created February 24, 2015 21:45
Photoshop typography
letter_spacing($spacing)
letter-spacing: unit($spacing/1000, 'em');
font_size($size, $leading)
font-size $size
if $leading
line-height: unit(100 * ($leading / $size), "%")
_get_images: (data, imgs=[])->
for prop, val of data
if /(jpg|png|gif)$/.test(data[prop])
imgs.push data[prop]
if Array.isArray(data[prop])
for c in data[prop]
@_get_images c, imgs
return imgs
@giuliandrimba
giuliandrimba / jquery.placeholder.js
Created March 15, 2012 14:46
IE jQuery Placeholder
$(document).ready(function(){
try {
jsToggle();
} catch (jsToggleE){
}
});
function jsToggle()
{
@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
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
<!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 -->
@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)
) {
@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\]"