Skip to content

Instantly share code, notes, and snippets.

View wietseneven's full-sized avatar

Wietse Neven wietseneven

View GitHub Profile
@wietseneven
wietseneven / 0_reuse_code.js
Last active August 29, 2015 14:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@wietseneven
wietseneven / svgpng.js
Created October 20, 2014 18:26
SVG PNG replace script
/* Modernizr 2.5.2 (Custom Build) | MIT & BSD
* Build: http://www.modernizr.com/download/#-svg
*/
;window.Modernizr=function(a,b,c){function u(a){i.cssText=a}function v(a,b){return u(prefixes.join(a+";")+(b||""))}function w(a,b){return typeof a===b}function x(a,b){return!!~(""+a).indexOf(b)}function y(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:w(f,"function")?f.bind(d||b):f}return!1}var d="2.5.2",e={},f=b.documentElement,g="modernizr",h=b.createElement(g),i=h.style,j,k={}.toString,l={svg:"http://www.w3.org/2000/svg"},m={},n={},o={},p=[],q=p.slice,r,s={}.hasOwnProperty,t;!w(s,"undefined")&&!w(s.call,"undefined")?t=function(a,b){return s.call(a,b)}:t=function(a,b){return b in a&&w(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=q.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(q.call(argument
@wietseneven
wietseneven / dabblet.css
Created June 18, 2013 12:01
Image grayscale effect
/* Image grayscale effect */
#grayscale img:hover {
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+, Firefox on Android */
filter: gray; /* IE6-9 */
-webkit-filter: grayscale(100%); /* Chrome 19+, Safari 6+, Safari 6+ iOS */
}
@wietseneven
wietseneven / dabblet.css
Created May 20, 2013 19:58
Just for fun™: Mr. Border-Radius in pure CSS
/**
* Just for fun™: Mr. Border-Radius in pure CSS
*/
.mr-border-radius {
width: 540px;
height: 420px;
border-radius: 40px;
margin: 60px auto 0;
background: radial-gradient(hsl(40, 100%, 70%), hsl(40, 100%, 50%));
@wietseneven
wietseneven / dabblet.css
Created April 18, 2013 16:04
CSS pseudo childs
/**
* CSS pseudo childs
*/
/* Eerste en laatste */
.first-last li:first-child {
background:red;
color:white;
}
.first-last li:last-child {
background:blue;
@wietseneven
wietseneven / dabblet.css
Created April 18, 2013 15:29
Pseudo elements in an article
/**
* Pseudo elements in an article
*/
html {
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
font-family:helvetica;
}
@wietseneven
wietseneven / dabblet.css
Created April 18, 2013 15:12
CSS3 Ribbon
/**
* CSS3 Ribbon
*/
*, *:after,*:before {-webkit-box-sizing:border-box;-moz-box-sizing: border-box;box-sizing: border-box;}
div {
font-size: 15px !important;
width: 50%;
position: relative;
background: rgb(186, 137, 182);
@wietseneven
wietseneven / dabblet.css
Created April 18, 2013 14:21
CSS3 logo enschede
/**
* CSS3 logo enschede
*/
@import url(http://fonts.googleapis.com/css?family=Noto+Serif:400italic|Sanchez);
body {
background: white;
min-height: 100%;
}
div {
width:250px;
@wietseneven
wietseneven / dabblet.css
Created April 18, 2013 14:03
Standard 'known' pseudo classes
/**
* Standard 'known' pseudo classes
*/
body {
text-align:center;
font:50px/130px 'Lobster 1.4';
}
a:link {color:#FF0000;} /* unvisited link */
a:visited {color:#00FF00;} /* visited link */
a:hover {color:#FF00FF;} /* mouse over link */
@wietseneven
wietseneven / dabblet.css
Created April 18, 2013 13:37
CSS3 Ribbon
/**
* CSS3 Ribbon
*/
*, *:after,*:before {-webkit-box-sizing:border-box;-moz-box-sizing: border-box;box-sizing: border-box;}
div {
font-size: 15px !important;
width: 50%;
position: relative;
background: rgb(186, 137, 182);