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 readline = require('readline'); | |
var rl = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout, | |
terminal: false | |
}); | |
var lines = []; | |
rl.on('line', line => { |
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 myobfiscate($emailaddress){ | |
$email= $emailaddress; | |
$length = strlen($email); | |
for ($i = 0; $i < $length; $i++){ | |
$obfuscatedEmail .= "&#" . ord($email[$i]).";"; | |
} | |
echo $obfuscatedEmail; | |
} |
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/bash | |
wget -qO- https://get.docker.com/ | sh | |
sudo usermod -aG docker $(whoami) | |
sudo systemctl enable docker.service | |
sudo systemctl start docker.service | |
sudo yum install -y epel-release | |
sudo yum install -y python-pip | |
sudo yum upgrade -y python* | |
sudo pip install docker-compose --force --upgrade |
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
const {createCipheriv, createDecipheriv, createHash, randomBytes} = require('crypto'); | |
function encrypt (input, password) { | |
const IV = Buffer.from(randomBytes(16)); | |
const encryptor = createCipheriv( | |
'aes-128-cbc', | |
createHash('md5').update(password).digest(), | |
IV |
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
const ONCHANGE_LISTENERS_TYPE = 'change:listeners'; | |
function OnChanged$ (...properties: Array<string>) { | |
return function targetChangeFunction (target: any, propertyKey: string, descriptor: PropertyDescriptor) { | |
Reflect.defineMetadata(ONCHANGE_LISTENERS_TYPE, [ | |
...(Reflect.getMetadata(ONCHANGE_LISTENERS_TYPE, target) || []), | |
{ | |
properties, |
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
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>; | |
interface FunctionComponent<P = {}> { | |
(props: P, context?: any): string; | |
} | |
// Our component props types | |
interface IInputProps { | |
firstName: string; | |
lastName: string; |
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
npx svgo --multipass \ | |
--disable={removeViewBox} \ | |
--enable={removeTitle,removeMetadata,removeComments,inlineStyles,cleanupAttrs,minifyStyles,convertColors,convertStyleToAttrs,collapseGroups,sortAttrs,removeDimensions} \ | |
-o (pwd)/out \ | |
-f (pwd) |
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
# 1. redo last command but as root | |
sudo !! | |
# 2. open an editor to run a command | |
ctrl+x+e | |
# 3. create a super fast ram disk | |
mkdir -p /mnt/ram | |
mount -t tmpfs tmpfs /mnt/ram -o size=8192M |
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
git branch -ar \ | |
| grep origin/ \ | |
| grep -v 'master$' \ | |
| grep -v HEAD \ | |
| cut -d/ -f 2- \ | |
| xargs -I % -n 1 -P 8 sh -c "git push origin :%" |
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
/* tslint:disable */ | |
import fs from 'fs'; | |
import path from 'path'; | |
import ts from 'typescript'; | |
const aliasWhitelist = ['ResponsiveProp']; | |
const tsconfigPath = path.join(__dirname, '../tsconfig.json'); | |
const componentsFile = path.join(__dirname, '../lib/components/index.ts'); |
OlderNewer