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 | |
$string=" | |
Спишется 50,26р. Пароль 6675 | |
Перевод на счет 41001830685343"; | |
interface IConfirmationSMS { | |
public function setConfirmationCode($confirmation_code); | |
public function getConfirmationCode(); | |
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 | |
fs = require('fs'), | |
path = require('path'), | |
EventEmitter = require('events'); | |
class FileSearch extends EventEmitter { | |
constructor(filename, startDir) { | |
super(); | |
this._filename = filename; |
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
'use strict'; | |
module.exports = (req, res, next) => { | |
const [left, right] = req.headers.authorization ? req.headers.authorization.split(' ') : []; | |
if(left === 'Bearer') { | |
req.accessToken = right; | |
return next(); | |
} | |
req.accessToken = [ |
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 originalText = 'Hello World'; | |
const widgets = [ | |
{position: 2, text: '111'}, | |
{position: 4, text: '222'}, | |
{position: 6, text: '333'} | |
]; | |
Given text and widgets, need to inject widget text in positions. |
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
func panic() { | |
let url = URL(string: "https://mywebsite.com/send.php")! | |
let parameters = ["title": "Some title", "content": "Some content"] | |
let body = try! JSONSerialization.data(withJSONObject: parameters, options: []) | |
let request = URLRequest(url: url) | |
request.httpMethod = "POST" | |
request.setValue("application/json", forHTTPHeaderField: "Content-Type") | |
request.httpBody = body | |
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 config = require('./config.json'); | |
(async () => { | |
for (let i = 0; i < config.serverList.length; i++) { | |
const {serverIp, serverPort} = config.serverList[i]; | |
const serverInfo = await getServerInfo(serverIp, serverPort); | |
if (serverInfo && serverInfo.constructor.name === 'Object') { | |
config.serverList[i] = {...config.serverList[i], ...serverInfo}; | |
} | |
} |
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 matchStringsBetweenWrappers($string, $start, $end) { | |
// preserving symbols from being removed | |
$preserveDashPlaceholder = md5($string.'1'); | |
$string = str_replace('-', $preserveDashPlaceholder, $string); | |
$preserveQuotePlaceholder = md5($string.'2'); | |
$string = str_replace("'", $preserveQuotePlaceholder, $string); | |
$preserveWildcardPlaceholder = md5($string.'3'); | |
$string = str_replace('*', $preserveWildcardPlaceholder, $string); | |
$preserveExclamationPlaceholder = md5($string.'4'); |
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 matchStringsBetweenWrappers($string) { | |
preg_match_all('/\[N\](.*?)\[\/N\]/u', $string, $matches); | |
array_walk($matches[0], function(&$item) { | |
$item = trim($item); | |
}); | |
return $matches; | |
} |
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 | |
class WrapperMatcher { | |
private $startPattern = 'N_'; | |
private $endPattern = '_N'; | |
/** | |
* WrapperMatcher constructor. | |
* |
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
Some text N_abc_New_New_New_N! other text N_ghi_jkl_N and other text:;.#{}()[]N_abc_New_N.!@ | |
Немного текста abc_New_New_New ! другой текст ghi_jkl и другой текст:;. # {} () [] abc_New ! @ | |
Some text N_abc_New_New_New_N! other text N_ghi_jkl_N and other text:;.#{}()[]N_abc_New_N.!@ | |
Lego_New New_Friends_New Lego_New | |
--------- | |
Some text N_abc_New_New_New_N! other text N_ghi_jkl_N and other text:;.#{}()[]N_abc_New_N.!@ | |
Du texte abc_New_New_New ! autre texte ghi_jkl et autre texte:;. # {} () [] abc_New ! @ | |
--------- |
OlderNewer