- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/
- They are the people who get things done. Effective Engineers produce results.
| CMD = Super | |
| # General | |
| FDAS | |
| ## Text navigation | |
| CTRL + LEFT/RIGHT : jump word forward/backward | |
| CTRL + SHIFT + LEFT/RIGHT : select word forward/backward | |
| Super + Q |
| import { EventEmitter } from 'events' | |
| interface MyEvent { | |
| payload: any | |
| } | |
| type MyOpenEvent = MyEvent & { type: 'open' } | |
| type MyCloseEvent = MyEvent & { type: 'close' } | |
| type MyOpenHandler = (event: MyOpenEvent) => void |
| for x in $(nslookup -q=TXT _cloud-netblocks.googleusercontent.com 8.8.8.8| egrep -o "include:_cloud[-.a-z0-9]*" | cut -c9-);do | |
| nslookup -q=TXT $x 8.8.8.8 | egrep -o 'ip4:[./0-9]*' | cut -c5- | |
| done |
| const lockUpdaters = {} | |
| function sleep(timeout) { | |
| return new Promise((resolve) => { | |
| setTimeout(resolve, timeout) | |
| }) | |
| } | |
| async function waitForLock(lockname, timeoutWindow) { |
| #!/usr/bin/env bash | |
| # Homebaked Slack Dark Mode. After executing this script, hit refresh (⌘ + R) or restart Slack for changes to take effect. | |
| # Adopted from https://gist.github.com/a7madgamal/c2ce04dde8520f426005e5ed28da8608 | |
| SLACK_RESOURCES_DIR="/Applications/Slack.app/Contents/Resources" | |
| SLACK_SSB_INTEROP_FILEPATH="$SLACK_RESOURCES_DIR/app.asar.unpacked/src/static/ssb-interop.js" | |
| THEME_FILEPATH="$SLACK_RESOURCES_DIR/dark-theme.css" | |
| curl -o "$THEME_FILEPATH" "https://cdn.rawgit.com/laCour/slack-night-mode/master/css/raw/black.css" |
| Tue Apr 10 13:47:51 UTC 2018 |
| #!/bin/bash | |
| zero_pad(){ | |
| # zero_pad <string> <length> | |
| [ ${#1} -lt $2 ] && printf "%0$(($2-${#1}))d" '' | |
| printf "%s\n" "$1" | |
| } | |
| source=$1 | |
| name=${2:-$(basename $source)} |
| #!/bin/sh | |
| # Source : https://github.com/Sanchiz/fake_sendmail.sh | |
| prefix="/home/USERNAME/sendmail/new" | |
| numPath="/home/USERNAME/sendmail" | |
| if [ ! -f $numPath/email_numbers ]; then | |
| echo "0" > $numPath/email_numbers | |
| fi |
| function ifNoneMatch($etag, $expire = 60, $cacheAt = "public",$mime_type = 'application/json') { | |
| header("Content-Type: $mime_type"); | |
| header("Cache-Control: max-age=$expire, $cacheAt=true"); | |
| header('Expires:' . gmdate('D, d M Y H:i:s T', strtotime("+$expire seconds", $timestamp))); | |
| header('Etag:' . $etag); | |
| // exit if not modified | |
| if ($_SERVER['HTTP_IF_NONE_MATCH'] == $etag) { | |
| header("HTTP/1.1 304 Not Modified"); | |
| exit; |