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 | |
// dry run | |
// find . -type f -name '*.php' -exec php fix-constructors.php {} \; | |
// real run | |
// find . -type f -name '*.php' -exec php fix-constructors.php {} y \; | |
// @read https://ideone.com/aLpfBh | |
// @read https://regex101.com/r/hzzzkz/1/ |
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
using System; | |
using System.Net; | |
using System.Net.Sockets; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace Extensions.Tcp | |
{ | |
public static class TcpClientExtensions | |
{ |
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 getUserById(userId, signal) { | |
if (signal.aborted) { | |
return Promise.reject(new DOMException('The API request was aborted.', 'AbortError')); | |
} | |
return new Promise(function(resolve, reject) { | |
const jobTimeout = setTimeout(function() { | |
signal.removeEventListener('abort', abortHandler); | |
resolve({ id: userId, name: 'John' }); | |
}, 3000); |
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
const url = 'big.mkv'; | |
const abortController = new AbortController(); | |
setTimeout(function() { | |
abortController.abort(); | |
}, 1); | |
async function fetchVideo() { | |
try { | |
const response = await fetch(url, { signal: abortController.signal }); |
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 convert_number_to_latvian_words($num) | |
{ | |
if ( ! is_numeric($num)) | |
return false; | |
if (($num >= 0 && (int) $num < 0) OR (int) $num < 0 - PHP_INT_MAX) { | |
// overflow | |
trigger_error('convert_number_to_latvian_words only accepts numbers between -' . PHP_INT_MAX . ' and ' . PHP_INT_MAX, E_USER_WARNING); |
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 IE 9]> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.1/jquery.xdomainrequest.min.js"></script> | |
<![endif]--> |
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
Sveicināti! | |
Vēlos izteikt pretenziju par grozījumiem Latvijas Administratīvo pārkāpumu kodeksā - Nr: 431/Lp11. | |
Pretenzijas man ir pret 171.3 pantu. | |
171.3 pants. Alkoholisko dzērienu iegādāšanās, ja pircējs vecumā no 18 līdz 25 gadam neuzrāda personu apliecinošu dokumentu | |
Par alkoholisko dzērienu iegādāšanos, ja pircējs vecumā no 18 līdz 25 gadam neuzrāda personu apliecinošu dokumentu –izsaka brīdinājumu vai uzliek naudas sodu līdz divdesmit pieciem latiem. | |
Loģiski spriežot, 24 gadus veca persona, iegādājoties alkoholiksu dzērienu un neuzrādot personu apliecinošu dokumentu, būs izdarījusi administratīvu pārkāpumu, par kuru var tikt sodīta ar līdz pat 25 latu naudas sodu. |
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
<script> | |
Post = can.Model({ | |
}, { | |
init: function() { | |
var children = this.children; | |
this.removeAttr('children'); | |
this.children = new Post.List( children.serialize() ); | |
} | |
}); |
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
I18n | |
Kohana_I18n | |
Log | |
Kohana_Log | |
Config | |
Kohana_Config | |
App_Exception_Handler | |
Log_File | |
Kohana_Log_File | |
Log_Writer |
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 defined('SYSPATH') or die('No direct script access.'); | |
/** | |
* App Exception handler | |
*/ | |
class App_Exception_Handler { | |
public static function handle(Exception $e) | |
{ |
NewerOlder