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 table WHERE id IN (118,17,113,23,72) ORDER BY FIELD(id,118,17,113,23,72) |
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
<?php | |
function getSerie($type, $save = false) { | |
global $reg; | |
switch($type) { | |
case 'shipments': | |
$id = 17; | |
break; | |
case 'drivers': |
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 theInstructions = "alert('Hello World'); var x = 100"; | |
var F = new Function (theInstructions); | |
return(F()); |
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
$('.btn-group a').each(function(){ | |
$(this).data('onclick', this.onclick); | |
this.onclick = function(event) { | |
return false; | |
//$(this).data('onclick').call(this, event || window.event); | |
}; | |
}); |
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 formatDate = function(dateString) { | |
var parsedDate = $.fullCalendar.parseDate(dateString); | |
return $.fullCalendar.formatDate(parsedDate, 'dddd d MMMM yyyy',options); | |
} |
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
<?php | |
$sek = x;//laikas sekundemis | |
$dt = new DateTime('@'.$sek, new DateTimeZone('UTC')); | |
$plannedHours = ($dt->format('z')*24 + $dt->format('G')).":".$dt->format('i'); //turetu rodyti kitokiu formatu t.y. ir dienas |
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 errorLog = function errorLog(msg, url, line) { | |
var i = document.createElement('img'); | |
i.src = '/error/log?msg=' + encodeURIComponent(msg) + '&url=' + encodeURIComponent(url) + '&line=' + encodeURIComponent(line); | |
}; | |
window.onerror = errorLog; |
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 connection = new WebSocket('ws://127.0.0.1:1337'); | |
connection.onopen = function () { | |
// first we want users to enter their names | |
input.removeAttr('disabled'); | |
status.text('Choose name:'); | |
}; | |
connection.onerror = function (error) { | |
// just in there were some problems with conenction... |
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
$ ulimit -n | |
4096 | |
$ ulimit -n 8192 | |
bash: ulimit: open files: cannot modify limit: Operation not permitted | |
$ sudo bash | |
# ulimit -n | |
4096 | |
# ulimit -n 8192 | |
# su - normaluser | |
$ ulimit -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
recurse_func = function(arr, callback, delay) { | |
if (typeof(callback) == "function") { | |
delay = delay || 200; | |
var self = arr, idx = 0; | |
setInterval(function() { | |
callback(self[idx], idx); | |
idx = (idx+1 < self.length) ? idx+1 : 0; | |
}, delay); | |
} |