Skip to content

Instantly share code, notes, and snippets.

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

Victor Coulon Victa

🏠
Working from home
View GitHub Profile
mkdir -p sunrise/deps && curl -L https://github.com/Homebrew/homebrew/tarball/master | tar xz --strip 1 -C sunrise/deps
export PATH=~/sunrise/deps/bin:$PATH
brew update
mkdir -p sunrise/brew_cache
HOMEBREW_CACHE=~/sunrise/brew_cache brew install fontforge
@Victa
Victa / gist:2cae3732654894a60d36
Created December 10, 2014 20:32
Percentage Bugs in WebKit

No later than a few days ago, at Octave & Octave, I had to make a grid generator in Sass which is fully responsive. Rather than using a fixed grid as I usually do, I decided to create a fluid grid using percentages (calculated with the famous target / context * 100 = result).

Indeed, after finishing the book Response Web Design from A Book Apart where the author proposes to use this type of grid, I must say I was convinced by this flexibility. And I think that I am not alone. Just look at the number of frameworks using this kind of grid (Foundation, Tiny Fluid Grid, Fluid960gs…)

After some hours of development to obtain optimal results based on the guidelines of my agency, I was surprised to notice a very annoying display bug on my Safari.

itms-services://?action=download-manifest&url=https%3A%2F%2Frink.hockeyapp.net%2Fapi%2F2%2Fapps%2F90df60738862e638dacdaed0c56eafc0%2Fapp_versions%2F1620%3F%26avtoken%3D668106a4bc589cd1638f50aa91ffd7c8cf0eda87%26udid%3D9023204911d5ebea8659161891397a3bade829cb
@Victa
Victa / canvas.html
Created May 17, 2011 09:23
Apple-esque toolbar (navbar) CSS3 & canvas
<!doctype html>
<title>Tabbar canvas</title>
<canvas id="toolbar"></canvas>
<script>
var canvas = document.getElementById("toolbar");
var context = canvas.getContext("2d");
var gradient = context.createLinearGradient(0, 0, 0, 44);
gradient.addColorStop(0,'#2F2F2F');
gradient.addColorStop(0.5,'#151515');
gradient.addColorStop(0.51,'#000000');
@Victa
Victa / scripts.js
Created May 23, 2011 15:06
Get URL parameters
function getUrlParameters(search) {
var search = search ? search : window.location.search;
var vars = {};
if (search.length > 0) {
var hash, hashes = search.slice(1).split('&');
for (var i = 0; i < hashes.length; i++) {
hash = hashes[i].split('=');
vars[hash[0]] = hash[1];
}
}
@Victa
Victa / slide.html
Created May 23, 2011 17:21
Slide toggle - CSS3 only
<!doctype html>
<html>
<head>
<title>Slide CSS3</title>
<meta charset="UTF-8">
<style>
body {background:#FFF;text-align:center;font-family:sans-serif;}
p {margin:10px 150px;}
@Victa
Victa / gist:988876
Created May 24, 2011 15:04
Extends JS array sort functions
Array.prototype.sortIntAsc = function(field){
this.sort(function(a,b){
var v1 = parseInt(a[field]);
var v2 = parseInt(b[field]);
if (v1<v2) return -1;
if (v1>v2) return 1;
return 0;
});
}
@Victa
Victa / gist:994985
Created May 27, 2011 10:04
Placeholder support for shitty browsers
$('[placeholder]').parents('form').submit(function() {
$(this).find('[placeholder]').each(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
}
})
});
@Victa
Victa / .htaccess
Created May 30, 2011 17:41
Remove www in url
RewriteEngine On
RewriteCond %{HTTP_HOST} !^your-site.com$ [NC]
RewriteRule ^(.*)$ http://your-site.com/$1 [L,R=301]
@Victa
Victa / .htaccess
Created May 30, 2011 17:42
Redirect all WordPress feeds to feedburner
<IfModule mod_alias.c>
RedirectMatch 301 /feed/(atom|rdf|rss|rss2)/?$ http://feedburner.com/yourfeed/
RedirectMatch 301 /comments/feed/(atom|rdf|rss|rss2)/?$ http://feedburner.com/yourfeed/
</IfModule>