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
// pre 5.3 | |
function coalesce() { | |
return array_shift(array_filter(func_get_args())); | |
} | |
// 5.3+ | |
echo '' ?: 'B'; |
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 TABLE_NAME FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = ‘dbName’ and COLUMN_NAME like ‘%ColName%’; |
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(lab49) { | |
function privateAdder(n1, n2) { | |
return n1 + n2; | |
} | |
lab49.add = function(n1, n2) { | |
return privateAdder(n1); | |
}; |
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 callFlash(call) { | |
var flash = document.getElementById('flashapp'); | |
var result = null; | |
if (flash && flash[call] && typeof flash[call] == 'function') { | |
if (arguments.length > 1) { | |
params = []; | |
for (var i=1; i<arguments.length; i++) { |
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(Events) { | |
var _listeners = {}; | |
Events.proxy = function(event, handler) { | |
var proxyHandler = function(context) { | |
Events.removeEventListener(event, proxyHandler); | |
handler(context); | |
}; | |
return proxyHandler; |