Skip to content

Instantly share code, notes, and snippets.

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

Geremia Taglialatela tagliala

🏠
Working from home
View GitHub Profile
@tagliala
tagliala / gist:7e2dcd600cc015b07a8a
Created January 21, 2015 14:39
Recursively optimize images
find . -name "*.jpg" -type f -exec jpegtran -copy none -optimize -progressive -outfile {} {} \;
find . -name "*.png" -type f -exec optipng {} \;
@tagliala
tagliala / gist:6cfe162c3294924e77da
Created August 28, 2014 08:18
Friendly Id bug with globalize
# Activate the gem you are reporting the issue against.
gem 'activerecord', '3.2.19'
gem 'friendly_id', '4.0.10.1'
gem 'globalize', '3.0.4'
gem 'i18n'
require 'active_record'
require 'friendly_id'
require 'globalize'
require 'minitest/autorun'

Ten days ago I submitted a question on StackOverflow: "How to profile CSS selectors?" [1] and I didn't get proper answers. I'm going to repost (and update) that question here for faster reading

  1. Google removed the CSS Profiler [2]

  2. Firefox doesn't have one [3]

  3. Opera had dragonfly, but now Opera is Blink based... and dragonfly is gone.

  4. The only profiler around there in Safari, doesn't work on my 7.0.0 / OSX 10.9. (it keeps recording CSS and I can't stop it)

@tagliala
tagliala / gist:7174356
Last active December 26, 2015 15:39
Tests FA
Comparison FA 3.2.1 vs 4.0.0 (in ms - lower is better)
http://tagliala.github.io/vectoriconsroundup/cssperf/fa321
http://tagliala.github.io/vectoriconsroundup/cssperf/fa400
Old hardware (Windows 7 x64)
BROWSER 3.2.1 4.0.0 %
Chrome 31 204 166 +22.9 (std dev 11ms/8ms)
Chrome 32 204 166 +22.9 (std dev 11ms/8ms)
Safari 5.1.7 140 103 +35.9 (std dev 18ms)
@tagliala
tagliala / 3.2.1.html
Created October 16, 2013 15:18
How to profile CSS selectors?
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'/>
<meta content='width=device-width, initial-scale=1.0' name='viewport'/>
<title>FA 3.2.1 performance test</title>
<script src="js/test.js"></script>
<link rel="stylesheet" href="css/font-awesome.3.2.1.min.css">
</head>
<body onload="test()" id="body" data-icon-class="icon"></body>
@tagliala
tagliala / forms.css
Created August 2, 2013 21:16
Firefox default forms.css
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
Styles for old GFX form widgets
**/
@namespace url(http://www.w3.org/1999/xhtml); /* set default namespace to HTML */
@tagliala
tagliala / html.css
Created August 2, 2013 21:10
Firefox mobile default stylesheet
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@namespace url(http://www.w3.org/1999/xhtml); /* set default namespace to HTML */
@namespace xul url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
/* bidi */
[dir="rtl"] {
@tagliala
tagliala / gist:5705809
Last active December 18, 2015 01:39
svg people marker, home marker google maps
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Simple markers</title>
<link href="https://developers.google.com/maps/documentation/javascript/examples/default.css" rel="stylesheet">
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<script>
function initialize() {
@tagliala
tagliala / style.css
Created February 26, 2013 11:38
Pure CSS3 filled-in Radio Buttons feat. FontAwesome
.circle-radio-boxes {
margin-left: -10px;
padding-top: 5px;
}
.circle-radio-boxes input[type=radio] {
visibility: hidden;
position: absolute !important;
top: -9999px !important;
left: -9999px !important;
}
@tagliala
tagliala / random_close_location.rb
Created January 6, 2013 15:06
Random location near source
def random_close_location(max_dist = 0.5, km = true)
# http://www.geomidpoint.com/random/calculation.html
return unless source && source[:lat] != nil && source[:lng] != nil
deg_to_rad = Math::PI / 180
rad_to_deg = 180 / Math::PI
radius_earth_M = 3960.056052
radius_earth_Km = 6372.796924