Skip to content

Instantly share code, notes, and snippets.

@num8er
num8er / catchAccessToken.js
Last active June 10, 2017 16:00
Middleware for ExpressJS to catch access token and attach to request context
'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 = [
@num8er
num8er / FileSearch.js
Last active April 25, 2018 20:28
Recursive search for files by filename in nested directories
const
fs = require('fs'),
path = require('path'),
EventEmitter = require('events');
class FileSearch extends EventEmitter {
constructor(filename, startDir) {
super();
this._filename = filename;
<?php
$string="
Спишется 50,26р. Пароль 6675
Перевод на счет 41001830685343";
interface IConfirmationSMS {
public function setConfirmationCode($confirmation_code);
public function getConfirmationCode();