Skip to content

Instantly share code, notes, and snippets.

@djaiss
djaiss / gist:85a0ada83e6bca68e41e
Last active December 7, 2024 12:42
Block Twitter/Facebook in your /etc/hosts
# Block Facebook IPv4
127.0.0.1 www.facebook.com
127.0.0.1 facebook.com
127.0.0.1 login.facebook.com
127.0.0.1 www.login.facebook.com
127.0.0.1 fbcdn.net
127.0.0.1 www.fbcdn.net
127.0.0.1 fbcdn.com
127.0.0.1 www.fbcdn.com
127.0.0.1 static.ak.fbcdn.net
@timohausmann
timohausmann / Vector.js
Last active October 13, 2015 15:56
Vector JS
/**
* Vector Lib
* @author Timo Hausmann <hello.timohausmann@gmail.com>
* @url https://gist.github.com/timohausmann/9603675
* @licence MIT
* @version 1.0
*/
function Vector(x, y) {
this.x = x,
@my8bit
my8bit / Get only text nodes
Last active September 25, 2021 01:51 — forked from IceCreamYou/Inc 500 TSV
Get only text nodes inside dom element
/**
* Get an array containing the text nodes within a DOM node.
*
* From http://stackoverflow.com/a/4399718/843621
*
* For example get all text nodes from <body>
*
* var body = document.getElementsByTagName('body')[0];
*
* getTextNodesIn(body);
/* The Grid ---------------------- */
.lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row.large-collapse .column,
.lt-ie9 .row.large-collapse .columns { padding: 0; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row .row.large-collapse { margin: 0; }
.lt-ie9 .column, .lt-ie9 .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; }
.lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; }
@timohausmann
timohausmann / gist:5055811
Last active December 14, 2015 08:09
HTML: HTML5 Template
<!doctype html>
<!--[if lt IE 7 ]> <html class="no-js ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]> <html class="no-js ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]> <html class="no-js ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<title>Seitentitel</title>
<meta charset="utf-8" />
<meta name="description" content="Kurzbeschreibung der Seite, idealerweise unter 160 Zeichen" />
@kosso
kosso / dataURItoBlob
Created December 9, 2012 20:26
convert base64 to raw binary data held in a string
/**
via http://stackoverflow.com/questions/4998908/convert-data-uri-to-file-then-append-to-formdata/5100158
via http://www.smartjava.org/content/face-detection-using-html5-javascript-webrtc-websockets-jetty-and-javacvopencv
**/
function dataURItoBlob(dataURI) {
var binary = atob(dataURI.split(',')[1]);
var array = [];
for(var i = 0; i < binary.length; i++) {
@leostratus
leostratus / webkit-pseudo-elements.md
Created September 21, 2012 01:44
Webkit Pseudo-Element Selectors (Shadow DOM Elements)

An ongoing project to catalogue all of these sneaky, hidden, bleeding edge selectors as I prepare my JSConf EU 2012 talk.

Everything is broken up by tag, but within each the selectors aren't particularly ordered.

I have not tested/verified all of these. Have I missed some or got it wrong? Let me know. - A

A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want:

-webkit-appearance:none;

@paulirish
paulirish / rAF.js
Last active November 20, 2024 13:00
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];