A curated list of all interesting articles I'd recommend you to read.
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
| // Whenever we use `import { GameObject } from "kontra/kontra.mjs";` | |
| // TS compiler will resolve the typings from "kontra". | |
| declare module "kontra/kontra.mjs" { | |
| import kontra from "kontra"; | |
| export = kontra; | |
| } |
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
| docker run -it -v /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock -e SSH_AUTH_SOCK="/run/host-services/ssh-auth.sock" --rm alpine /bin/sh -c "apk update && apk add openssh-client && mkdir ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts && ssh -T git@github.com" |
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
| alias theia='docker run --rm -it --init -u root -p 3000:3000 -v "$(pwd)":/home/project -v theia-node-modules:/home/project/node_modules theiaide/theia;' |
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
| alias node='docker run --rm -it -v "$(pwd)":/workspace -w /workspace -u node node:lts-alpine node' |
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
| PORT=5000 |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <title>Testing xTerm.js</title> | |
| <link | |
| rel="stylesheet" | |
| href="https://cdnjs.cloudflare.com/ajax/libs/xterm/3.14.4/xterm.css" | |
| /> | |
| <link | |
| rel="stylesheet" |
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
| free -h && \ | |
| sudo fallocate -l 1G /swapfile && \ | |
| sudo chmod 600 /swapfile && \ | |
| sudo mkswap /swapfile && \ | |
| sudo swapon /swapfile && \ | |
| sudo cp /etc/fstab /etc/fstab.bak && \ | |
| echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab && \ | |
| sudo sysctl vm.swappiness=10 && \ | |
| echo 'vm.swappiness = 10' | sudo tee -a /etc/sysctl.conf && \ | |
| sudo sysctl vm.vfs_cache_pressure=50 && \ |
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 Bcrypt | |
| { | |
| private static $cost = 10; | |
| public static function encode($string) | |
| { | |
| $salt = substr(base_convert(sha1(uniqid(mt_rand(), true)), 16, 36), 0, 22); | |
| $param = sprintf('$2a$%02d$%s$', self::$cost, $salt); | |
| return crypt($string, $param); |
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 Base64UrlSafe | |
| { | |
| /** | |
| * Encodes a string or an array with MIME base64 safely for URLs. | |
| * @param string|mixed $var | |
| * @return string | |
| */ | |
| public static function encode($var) |