This file contains 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
package bcast | |
type Broadcaster interface { | |
// Неблокирующая отправка сообщения | |
Send(interface{}) | |
// Блокирующее получение одного сообщения | |
Fetch() interface{} | |
} | |
type bcaster struct { |
This file contains 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
\b | |
(?: | |
(?:(https?|ftp)://|www\.)(?:[a-zа-я0-9-]+\.)*[a-zа-я0-9]+ | |
| | |
(?:[a-zа-я0-9][a-zа-я0-9-]*\.)+(?:ru|com|net|org|рф)(?![\w-]) | |
) | |
[^<>\s]* | |
(?: | |
(?<![[:punct:]]) | |
| |
This file contains 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 findURLs = (function() { | |
var bracketBalance = function(text) { | |
var brackets = { | |
"(": 1, | |
")": -1, | |
"[": 100, | |
"]": -100, | |
"{": 10000, | |
"}": -10000 | |
}, |
This file contains 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 | |
/** | |
* From http://stackoverflow.com/a/6337021 | |
*/ | |
class Bcrypt { | |
private $rounds; | |
public function __construct($rounds = 12) { | |
if (CRYPT_BLOWFISH != 1) { | |
throw new Exception("bcrypt not supported in this installation. See http://php.net/crypt"); |
This file contains 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 | |
/** | |
* Implementation of the PBKDF2 key derivation function as described in | |
* RFC 2898. | |
* | |
* @param string $PRF Hash algorithm. | |
* @param string $P Password. | |
* @param string $S Salt. | |
* @param int $c Iteration count. | |
* @param mixed $dkLen Derived key length (in octets). If $dkLen is FALSE |
This file contains 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 codeToUtf8($code) { | |
$code = (int)$code; | |
if ($code < 0x80) return chr($code); | |
if ($code < 0x800) return chr(0xC0 + (($code >> 6) & 0x1F)) . | |
chr(0x80 + ($code & 0x3F)); | |
if ($code < 0x10000) return chr(0xE0 + (($code >> 12) & 0x0F)) . | |
chr(0x80 + (($code >> 6) & 0x3F)) . | |
chr(0x80 + ($code & 0x3F)); | |
if ($code < 0x200000) return chr(0xF0 + (($code >> 18) & 0x07)) . |
This file contains 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
#!/bin/sh | |
if [ $# -eq '0' ] | |
then | |
echo 'Empty command' | |
exit 1 | |
fi | |
stop=0 | |
trap 'stop=1' TERM QUIT INT |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 (undefined) { | |
"use strict"; | |
var | |
isArray = Array.isArray || function (v) { | |
return Object.prototype.toString.call(v) === "[object Array]"; | |
}, | |
isFunction = function (v) { | |
return Object.prototype.toString.call(v) === "[object Function]" | |
}, |
This file contains 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 | |
$strTargetDir = "user_images/"; | |
$fileUploadField = "file_name"; | |
$max_image_width = 600; | |
$max_image_height = 600; | |
$max_image_size = 1 << 20; // 1 MiB | |
$error_msg = ""; | |
// .... |
OlderNewer