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
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 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.

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
/**
* jQuery.preload
*
* Preload images using the promise pattern.
*
* Usage:
*
* $.preload(img_uri, img_uri, ...).done(function(img, img, ...) {
* // Do stuff with the arguments
* });
@Victa
Victa / script.js
Created February 6, 2013 15:22
# Basic example of an infinite touch carousel By @bdc (open it on any iOS device) http://sharedfil.es/ios-carousel-3DWDjXht64.html https://twitter.com/bdc/status/299161246031298562
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 January 5, 2013 22:40
Strip Whitespace From String
// 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 January 3, 2013 09:59
Lighten / Darken Color
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 December 7, 2012 16:07
Showing Git Commit Counts
# 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 November 27, 2012 13:18
Gisties Bookmarklet
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;
}
})());