A Pen by Stas Ukolov on CodePen.
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
:: USAGE | |
:: cmdize name [...] | |
:: | |
:: This tool converts a supported code into a batch file that can be | |
:: executed without explicit invoking the executable engine. The script | |
:: creates new file and places it under the same directory as the original | |
:: one with the same name, replacing the original extension with ".bat". | |
:: The content of the new file consists of the original file and the | |
:: special header that being the "polyglot" and having some tricks to be a | |
:: valid code in batch file and the wrapped code at the same time. |
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
Set-ExecutionPolicy RemoteSigned -scope CurrentUser | |
iwr -useb get.scoop.sh | |
scoop install git | |
scoop bucket add extras | |
scoop bucket add versions |
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
// Check Admin rights | |
var out = GetObject("winmgmts://./root/default:StdRegProv") .EnumKey(1 << 31 | 3, "S-1-5-20") | |
WScript.Echo("Admin =", !out) |
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
netsh advfirewall firewall add rule name="Cisco Packet Tracer" dir=out program="C:\Program Files\Cisco Packet Tracer 8.0\bin\PacketTracer.exe" action=block |
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 | |
vbox = "C:/Program Files/Oracle/VirtualBox/VBoxManage.exe" | |
var | |
sh = new ActiveXObject('WScript.Shell'), | |
fso = new ActiveXObject("Scripting.FileSystemObject") | |
var | |
ms=[], | |
f = sh.Exec(vbox+' list runningvms').StdOut |
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
// | |
// Z-combinator | |
// https://habr.com/ru/post/322052/ | |
// | |
const Z = f => (f => f(f))(z => f(x => z(z)(x))) |
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
// Order Statistic | |
// https://stepik.org/lesson/12564/step/8?unit=2992 | |
#include <utility> | |
#include <vector> | |
template <typename T> | |
T kth(std::vector<T>& v, size_t k) { | |
size_t L = 0, R = v.size(); | |
while (L + k < R) { |
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 range(from, to) { | |
return { next: nextPromise, [Symbol.asyncIterator]: iterator } | |
function next() { | |
return from <= to | |
? { done: false, value: from++ } | |
: { done: true } | |
} | |
function iterator() { |
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
// Числа Фибоначчи | |
#include <ctime> | |
#include <iostream> | |
#include <vector> | |
int fib(int n); | |
int fibM(int n); | |
int fibM(int n, std::vector<int>&); | |
int fibSM(int n); | |
int fibF(int n); |
NewerOlder