Skip to content

Instantly share code, notes, and snippets.

View laukstein's full-sized avatar
🏠
Working from home

Binyamin Laukstein laukstein

🏠
Working from home
View GitHub Profile
@luk-
luk- / http_build_query.js
Created May 17, 2012 22:42
php's http_build_query() in javascript
var build_query = function (obj, num_prefix, temp_key) {
var output_string = []
Object.keys(obj).forEach(function (val) {
var key = val;
num_prefix && !isNaN(key) ? key = num_prefix + key : ''
@igrigorik
igrigorik / file.html
Created July 6, 2012 08:01
Example of early head flush on load time
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Hello</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
Hello World
</body>
@Rob-ot
Rob-ot / prefixedCalc.js
Created August 20, 2012 01:23
Detect which prefixed css calc to use via javascript
// public domain, use it for whatever
// returns "calc", "-moz-calc", etc
// (no -ms because they already support it non-prefixed)
function prefixedCalc () {
var prefixes = ["","-webkit-","-moz-","-o-"], el
for (var i = 0; i < prefixes.length; i++) {
el = document.createElement('div')
el.style.cssText = "width:" + prefixes[i] + "calc(9px)"
if (el.style.length) return prefixes[i] + "calc"
@mathiasbynens
mathiasbynens / LICENSE.txt
Created May 23, 2011 07:47 — forked from 140bytes/LICENSE.txt
Google Analytics snippet in 140 bytes
Author: Mathias Bynens <http://mathiasbynens.be/>
This code is licensed under the WTFPL. Feel free to relicense as needed.