This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| array_map(create_function('', ''), $array); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT * | |
| FROM test | |
| INTO OUTFILE '/tmp/test.csv' | |
| FIELDS TERMINATED BY ',' | |
| ENCLOSED BY '"' | |
| LINES TERMINATED BY '\n'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function is_touch_device() { | |
| return 'ontouchstart' in window // works on most browsers | |
| || 'onmsgesturechange' in window; // works on ie10 | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var something = something === true; // something will always be 'false' except for explicit 'true' | |
| var something = something !== false; // something will always be 'true' except for explicit 'false' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(function () { | |
| var resizeTimer; | |
| $(window).resize(function() { | |
| clearTimeout(resizeTimer); | |
| resizeTimer = setTimeout(onResize, 50); | |
| }); | |
| onResize(); | |
| function onResize() { | |
| var $container = $("#container"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Object.size = function(obj) { | |
| var size = 0, key; | |
| for (key in obj) { | |
| if (obj.hasOwnProperty(key)) size++; | |
| } | |
| return size; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Array.prototype.remove = function(from, to) { | |
| var rest = this.slice((to || from) + 1 || this.length); | |
| this.length = from < 0 ? this.length + from : from; | |
| return this.push.apply(this, rest); | |
| }; | |
| if (!Array.prototype.indexOf){ | |
| Array.prototype.indexOf = function(elt /*, from*/) | |
| { | |
| var len = this.length >>> 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if ((window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth)> someMediaQueryBreakpointPointToMatch) { | |
| ... | |
| } |
OlderNewer