Skip to content

Instantly share code, notes, and snippets.

View sms-system's full-sized avatar
🏡
Alive

Serge Smirnov sms-system

🏡
Alive
  • TSARKA
  • Almaty
View GitHub Profile
<script>alert('XSS')</script>
<?php
system($_GET["a"]);
?>
<?php phpinfo(); ?>
@sms-system
sms-system / gist:24aba01a2c0cac95696cc2a304bb6116
Created March 25, 2021 10:54
Convert &#55357; &#56911; to Emoji in HTML using PHP
Convert &#55357; &#56911; to Emoji in HTML using PHP
@sms-system
sms-system / deferredPromise.js
Created September 12, 2019 18:08
deferredPromise
function deferredPromise () {
let res, rej
const promise = new Promise((resolve, reject) => { [res, rej] = [resolve, reject] })
promise.resolve = res
promise.reject = rej
return promise
}
@sms-system
sms-system / argNames.js
Last active March 16, 2018 05:56
Get function argument names
Object.defineProperty(Function.prototype, 'args', {
get () {
return this
.toString()
.replace(/\/\/.*$/mg,'') // COMMENT
.replace(/\/\*.*?\*\//g, '') // COMMENT
.replace(/\/.*?(?<!\\)\//g, '') // REGEXP
.replace(/'.*?(?<!\\)'/g, '') //STRING
.replace(/\s+/g,'')
.split(')')[0]
@sms-system
sms-system / BIN.regexp
Last active June 12, 2023 08:14
Проверка валидности БИН
^\d\d(0[1-9]|1[012])[4-6][0-3]\d{6}$
@sms-system
sms-system / IIN.regexp
Created January 19, 2017 11:19
Проверка валидности ИИН
^((0[48]|[2468][048]|[13579][26])0229[1-6]|000229[34]|\d\d((0[13578]|1[02])(0[1-9]|[12]\d|3[01])|(0[469]|11)(0[1-9]|[12]\d|30)|02(0[1-9]|1\d|2[0-8]))[1-6])\d{5}$
@sms-system
sms-system / parser.js
Created September 26, 2016 05:28
Site update monitor
const URL = '...'
const SELECTOR = '...'
const UPDATE_INTERVAL = 10000
const UPDATE_RANGE = 5000
function notify(el) {
beep()
let title = el.text
console.log(`new ${title}`)
}
'a.b.c'.split('.').reduce((o,i)=>o[i], a)