Skip to content

Instantly share code, notes, and snippets.

View mgrubinger's full-sized avatar

Martin Grubinger mgrubinger

View GitHub Profile
@nfreear
nfreear / wai-aria.use.css
Created December 3, 2013 15:13
CSS bookmarklet to highlight WAI-ARIA landmark roles etc. | Inspired by the Juicy Studio Accessibility toolbar - works in Chrome..
/*!
CSS bookmarklet to highlight WAI-ARIA landmark roles etc.
NDF, 3 December 2013.
http://w3.org/TR/wai-aria/roles#landmark_roles
Inspiration: https://addons.mozilla.org/en-US/firefox/addon/juicy-studio-accessibility-too/
javascript:(function(){
var D=document,s=D.createElement("link");s.href="//dl.dropbox.com/u/3203144/wai-aria/wai-aria.css";s.rel="stylesheet";D.head.appendChild(s)
@phoenixg
phoenixg / header_http_status_codes.php
Created April 6, 2013 14:02
PHP header() for sending HTTP status codes
<?php
/*
参考自:
http://darklaunch.com/2010/09/01/http-status-codes-in-php-http-header-response-code-function
http://snipplr.com/view/68099/
*/
function HTTPStatus($num) {
$http = array(
@coryjthompson
coryjthompson / 0.js
Created November 10, 2012 22:00
FileTransfer Progress with PhoneGap
var fileTransfer = new FileTransfer();
fileTransfer.onprogress = function(result){
var percent = result.loaded / result.total * 100;
percent = Math.round(percent);
console.log('Downloaded: ' + percent + '%');
};
fileTransfer.download(remoteFile, localPath, successCallback, errorCallback);
@nunosans
nunosans / html-head-boilerplate.html
Last active February 12, 2025 16:36
HTML Head Boilerplate & Reference
<!doctype html>
<html>
<head>
<!-- Priority tags. These must come first. -->
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge; chrome=1"> <!-- Render Chrome if available or using latest version of Internet Explorer (Recommended). -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<!-- Document Title -->
<title>Page Title</title>
<!-- Allows control over where resources are loaded from. Place as early in the document as possible, only applies to content below this tag. -->
@rmetzler
rmetzler / gist:2947828
Created June 18, 2012 10:43
find all non UTF-8 encoded files
find . -type f | xargs -I {} bash -c "iconv -f utf-8 -t utf-16 {} &>/dev/null || echo {}" > utf8_fail
@penguinboy
penguinboy / Object Flatten
Created January 2, 2011 01:55
Flatten javascript objects into a single-depth object
var flattenObject = function(ob) {
var toReturn = {};
for (var i in ob) {
if (!ob.hasOwnProperty(i)) continue;
if ((typeof ob[i]) == 'object') {
var flatObject = flattenObject(ob[i]);
for (var x in flatObject) {
if (!flatObject.hasOwnProperty(x)) continue;