Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Victor Coulon Victa

🏠
Working from home
View GitHub Profile
View gist:6625bd133e2b700bc0d4
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 / gist:2cae3732654894a60d36
Created Dec 10, 2014
Percentage Bugs in WebKit
View gist:2cae3732654894a60d36

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.

View gist:c4ca89cc616440c5c6d8
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
View jquery.preload.js
/**
* jQuery.preload
*
* Preload images using the promise pattern.
*
* Usage:
*
* $.preload(img_uri, img_uri, ...).done(function(img, img, ...) {
* // Do stuff with the arguments
* });
View script.js
var deviceWidth = document.width,
gallery = document.createElement("section"),
numberOfPages = 3,
positions = {
startX: 0,
currentX: 0,
direction: null,
upcomingPage: null
},
touchEvents = {
@Victa
Victa / gist:4464100
Created Jan 5, 2013
Strip Whitespace From String
View gist:4464100
// Remove leading and trailing whitespace
// Requires jQuery
var str = " a b c d e f g ";
var newStr = $.trim(str);
// "a b c d e f g"
// Remove leading and trailing whitespace
// JavaScript RegEx
var str = " a b c d e f g ";
var newStr = str.replace(/(^\s+|\s+$)/g,'');
@Victa
Victa / gist:4442341
Created Jan 3, 2013
Lighten / Darken Color
View gist:4442341
function LightenDarkenColor(col, amt) {
var usePound = false;
if (col[0] == "#") {
col = col.slice(1);
usePound = true;
}
var num = parseInt(col,16);
@Victa
Victa / gist:4234257
Created Dec 7, 2012
Showing Git Commit Counts
View gist:4234257
# Show total number of commits in the current repository
git shortlog | grep -E '^[ ]+\w+' | wc -l
# Show number of commits by developer
git shortlog -s -n
@Victa
Victa / bookmarklet.js
Created Nov 27, 2012
Gisties Bookmarklet
View bookmarklet.js
void ((function(){
var parser = document.createElement('a');
parser.href = document.URL;
if(parser.host === 'gist.github.com'){
var id = parser.pathname.split('/').filter(function(e){return e;})[0];
var user = document.querySelector('#owner .name a').innerText;
window.location = 'http://lite.gisti.es/'+user+'/'+id;
}
})());