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 / dabblet.css
Created July 11, 2012 16:54
Pure CSS Icons (Folder/File)
/* Pure CSS Icons (Folder/File) */
body{text-align:center;background:#eff3f6;margin:2em;}
i{display:inline-block;position:relative;margin:0 .1em;}
i::before{content:"";position:absolute;display:block;}
.folder{
width:14px;
height:10px;
background-image:linear-gradient(#a7c3d9, #709fc2);
box-shadow:inset 0 1px 0 #c6d9e7, 0 1px 0 #bbbfc3;
@Victa
Victa / gist:2984645
Created June 24, 2012 19:43
<i> Cloud
/* <i> Cloud */
html {
min-height: 100%;
background: linear-gradient(#b4bcbf, #fff);
}
.cloud {
display: inline-block;
background-color: #fff;
@Victa
Victa / gist:2894433
Created June 8, 2012 08:17
addEventListner Polyfill
// addEventListener polyfill 1.0 / Eirik Backer / MIT Licence
(function(win, doc){
if(win.addEventListener)return; //No need to polyfill
function docHijack(p){var old = doc[p];doc[p] = function(v){return addListen(old(v))}}
function addEvent(on, fn, self){
return (self = this).attachEvent('on' + on, function(e){
var e = e || win.event;
e.preventDefault = e.preventDefault || function(){e.returnValue = false}
e.stopPropagation = e.stopPropagation || function(){e.cancelBubble = true}
@Victa
Victa / gist:2876160
Created June 5, 2012 16:44
conditional resource loading
yepnope({
test : window.matchMedia("(max-device-width: 640px)").matches,
yep : "",
nope : "slider.js"
});
@Victa
Victa / i.html
Created May 27, 2012 15:46
display favicon in pseudo element
<a href=http://github.com>GitHub</a>
@Victa
Victa / targetblank.js
Created May 27, 2012 08:29 — forked from bastianallgeier/targetblank.js
Do your clients have the incurable target=_blank disease for external links? Add this jQuery snippet to your js code to add targets to all external links.
$(function() {
$('a').not('[href*=clientdomain\\.com]').attr('target', '_blank');
});
@Victa
Victa / gist:2730459
Created May 19, 2012 10:56
CSS3 Substring Matching Attribute Selectors
  • [att^=val] – the “begins with” selector
  • [att$=val] – the “ends with” selector
  • [att=val]* – the “contains” selector
@Victa
Victa / index.html
Created April 24, 2012 09:16
jquery expand content
<div id="lastest-video" class="hidden">
....
</div>
<a href="#lastest-video" class="btn btn-allwidth expand-trigger" data-expand-text="view more latest videos +" data-collapse-text="collapse latest video -">
view more latest videos +
</a>
@Victa
Victa / gist:2407337
Created April 17, 2012 16:33
Detect private browsing mode in mobile Safari on iOS5
var testKey = 'qeTest', storage = window.sessionStorage;
try {
// Try and catch quota exceeded errors
storage.setItem(testKey, '1');
storage.removeItem(testKey);
} catch (error) {
if (error.code === DOMException.QUOTA_EXCEEDED_ERR && storage.length === 0)
alert('Hello, private browser.');
@Victa
Victa / test.as
Created April 6, 2012 13:09
use double curly brackets in Microtemplates
_.templateSettings = { interpolate : /\{\{(.+?)\}\}/g };