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
@Victa
Victa / gist:2309363
Created April 5, 2012 09:06
fetch.sublime-settings
{
"files":
{
"Backbone.js": "http://documentcloud.github.com/backbone/backbone-min.js",
"Eric Meyer's reset": "http://meyerweb.com/eric/tools/css/reset/reset.css",
"Prefix free": "https://raw.github.com/LeaVerou/prefixfree/master/prefixfree.min.js",
"Underscore.js": "http://documentcloud.github.com/underscore/underscore-min.js",
"animate css": "https://raw.github.com/daneden/animate.css/master/animate.css",
"iOs Orientation Change Fix": "https://raw.github.com/scottjehl/iOS-Orientationchange-Fix/master/ios-orientationchange-fix.js",
"jQuery Transit": "https://raw.github.com/rstacruz/jquery.transit/master/jquery.transit.js",
@Victa
Victa / gist:2215952
Created March 27, 2012 13:39
update all submodules to the latest version
git submodule foreach git pull origin master && git commit -am 'Update submodules' && git push
@Victa
Victa / gist:2205221
Created March 26, 2012 13:56
Relative dates
// Relative times
function prettyDate(date) {
var date, seconds, formats, i = 0, f;
date = new Date(date);
seconds = (new Date - date) / 1000;
formats = [
[60, 'seconds', 1],
[120, '1 minute ago'],
[3600, 'minutes', 60],
[7200, '1 hour ago'],
@Victa
Victa / _media-queries.scss
Created March 26, 2012 13:09 — forked from anthonyshort/_media-queries.scss
Media Queries in Sass
// Media Queries in Sass 3.2
//
// These mixins make media queries a breeze with Sass.
// The media queries from mobile up until desktop all
// trigger at different points along the way
//
// And important point to remember is that and width
// over the portrait width is considered to be part of the
// landscape width. This allows us to capture widths of devices
// that might not fit the dimensions exactly. This means the break
@Victa
Victa / gist:2172723
Created March 23, 2012 16:53
Typography with Compass
@import "compass/typography/vertical_rhythm";
$base-font-size: 16px;
$base-line-height: 24px;
@include establish-baseline;
body {
font-family: 'Helvetica Neue', sans-serif;
@include debug-vertical-alignment(
"../images/debug.png");
}
h1 {@include adjust-font-size-to(48px)}
@Victa
Victa / gist:2169221
Created March 23, 2012 10:08
Force Hardware Acceleration in WebKit with translate3d
/* warp speed ahead */
.animClass {
-webkit-transform: translate3d(0, 0, 0);
/* more specific animation properties here */
}
/*
The use of translate3d pushes CSS animations into hardware acceleration.
Even if you're looking to do a basic 2d translation, use translate3d for more power!
If your animation is still flickering after switching to the transform above,
@Victa
Victa / gist:2005821
Created March 9, 2012 09:24
Get Object Size
function objectSize(the_object) {
/* function to validate the existence of each key in the object to get the number of valid keys. */
var object_size = 0;
for (key in the_object){
if (the_object.hasOwnProperty(key)) {
object_size++;
}
}
return object_size;
}
@Victa
Victa / gist:1942906
Created February 29, 2012 17:53
portfolio header paralax
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
* {
margin: 0;
padding: 0;
}
@Victa
Victa / _cssarrow.scss
Created February 29, 2012 16:41
Sass Snippets
@mixin cssArrow($size, $color1, $color2, $color3, $color4){
border-color: $color1 $color2 $color3 $color4;
border-style:solid;
border-width:$size;
width:0;
height:0;
}
@Victa
Victa / _media-object.scss
Created January 18, 2012 09:45
OOCSS media object - SCSS mixin
@mixin media-object($margin:10px, $position: left, $formating-context: 'overflow', $media: '.media', $block: '.block') {
@include pie-clearfix; // or extend a .clearfix class
#{unquote($block)} {
@if $formating-context == 'overflow' {
overflow:hidden;
} @else {
display:table-cell;
width:10000px;
*width:auto;
*zoom:1;