Skip to content

Instantly share code, notes, and snippets.

@ahendrix
ahendrix / gist:7030300
Created October 17, 2013 18:56
bash stacktrace
function errexit() {
local err=$?
set +o xtrace
local code="${1:-1}"
echo "Error in ${BASH_SOURCE[1]}:${BASH_LINENO[0]}. '${BASH_COMMAND}' exited with status $err"
# Print out the stack trace described by $function_stack
if [ ${#FUNCNAME[@]} -gt 2 ]
then
echo "Call tree:"
for ((i=1;i<${#FUNCNAME[@]}-1;i++))
@squarism
squarism / iterm2.md
Last active November 19, 2024 15:14
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@btroncone
btroncone / rxjs_operators_by_example.md
Last active November 7, 2024 09:19
RxJS 5 Operators By Example
@korniychuk
korniychuk / collection.ts
Created July 25, 2016 09:38
TypeScript: extends Array class example
'use strict';
class Collection<T> extends Array<T> {
// noinspection JSAnnotator
public constructor(...args: T[]) {
let array = super(...args);
Object.setPrototypeOf(array, this.constructor.prototype);
return array;
}
@oubiwann
oubiwann / appify.sh
Last active August 13, 2024 01:24 — forked from advorak/appify.sh
appify — create the simplest possible Mac app from a shell script (adds an application icon)
#!/usr/bin/env bash
VERSION=4.0.1
SCRIPT=`basename "$0"`
APPNAME="My App"
APPICONS="/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericApplicationIcon.icns"
OSX_VERSION=`sw_vers -productVersion`
PWD=`pwd`
function usage {
@gr1ev0us
gr1ev0us / find.sh
Last active November 12, 2024 19:23
Cheatsheet for find linux
# List of cheatsheet for linux find.
# Taken from here http://alvinalexander.com/unix/edu/examples/find.shtml
# basic 'find file' commands
# --------------------------
find / -name foo.txt -type f -print # full command
find / -name foo.txt -type f # -print isn't necessary
find / -name foo.txt # don't have to specify "type==file"
find . -name foo.txt # search under the current dir
find . -name "foo.*" # wildcard
@hygull
hygull / LICENSE KEY FOR SUBLIME TEXT 3 BUILD 3143.md
Last active December 16, 2023 19:30
LICENSE KEY FOR SUBLIME TEXT 3 BUILD 3143

STEPS

  • Click on Help menu

  • Select Enter License

  • Then paste given KEY given at bottom

  • Finally click on Use License

@shuhei
shuhei / README.md
Last active October 22, 2021 16:34
Node.js HTTP timeout

Node.js HTTP timeout

Findings

  • http.request({ timeout }) is not working for response timeout.
    • Agent timeout supercedes the option
  • Doesn't leak because request.on('timeout') instead of socket.on('timeout'). It's easier because request is always thrown away.
    • Then why header leaks?
      • Print socket's listeners('timeout').length
  • Try dropRequestAfter together
@korniychuk
korniychuk / touch-typing_how-to.md
Last active October 23, 2024 23:50
Печатать быстрее чем говорить? Вам сюда! | Touch Typing - How To
https://github.com/monosans/proxy-list/raw/main/proxies/http.txt
https://github.com/ShiftyTR/Proxy-List/raw/master/https.txt
https://github.com/clarketm/proxy-list/raw/master/proxy-list-raw.txt
https://github.com/TheSpeedX/PROXY-List/raw/master/http.txt