Skip to content

Instantly share code, notes, and snippets.

View kontur's full-sized avatar

Johannes Neumeier kontur

View GitHub Profile
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
var msViewportStyle = document.createElement("style");
msViewportStyle.appendChild(document.createTextNode("@-ms-viewport{width:auto!important}"));
document.getElementsByTagName("head")[0].appendChild(msViewportStyle);
}
@kontur
kontur / gist:5332271
Created April 7, 2013 20:08
MySQL CLI command to create csv view from select
SELECT *
FROM test
INTO OUTFILE '/tmp/test.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n';
@kontur
kontur / gist:3839798
Created October 5, 2012 13:25
javascript getter for a flash object on page, for calls to external interface
function getFlashMovie(movieName) {
var isIE = navigator.appName.indexOf('Microsoft') !== -1;
return (isIE) ? window[movieName] : document[movieName];
}
// with a swfobject embedding like:
var flashvars = {};
var params = {};
var attributes = {};
attributes.id = "myFlash"; // required for flash to javascript communication
@kontur
kontur / gist:3789544
Created September 26, 2012 18:02
empty a php array of values, but leave the keys
array_map(create_function('', ''), $array);