Skip to content

Instantly share code, notes, and snippets.

@t3h2mas
t3h2mas / pull-this.sh
Created July 26, 2020 20:45
Open the github new PR form in a browser for the current branch (mac)
#!/bin/bash
org="$(git remote get-url origin | cut -d '/' -f 4)"
repo="$(basename $(git rev-parse --show-toplevel))"
branch="$(git rev-parse --abbrev-ref HEAD)"
open "https://github.com/${org}/${repo}/pull/new/${branch}"
@t3h2mas
t3h2mas / builder.js
Created June 9, 2020 23:08
JavaScript Fluent Builder w/ JSDOC3 comments
class Burrito {
constructor(carb, protein, salsa, cheese = null, guac = False) {
this.carb = carb;
this.protein = protein;
this.salsa = salsa;
this.cheese = cheese;
this.guac = guac;
}
/* ... the many behaviors of a burrito go here... */
@t3h2mas
t3h2mas / open.md
Created July 3, 2019 19:48
Open slack w/ devtools on Mac

SLACK_DEVELOPER_MENU=true /Applications/Slack.app/Contents/MacOS/Slack

@t3h2mas
t3h2mas / express_postgress_knex.md
Created November 27, 2018 04:00 — forked from laurenfazah/express_postgress_knex.md
Cheat Sheet: Setting up Express with Postgres via Knex

Express & Postgres via Knex

Note: <example> is meant to denote text replaced by you (including brackets).

Setup

// global dependencies
npm install -g knex
defmodule One do
@moduledoc """
advent of code, day 1
"""
def captcha(nums) do
split_and_indexed = Integer.to_string(nums)
|> String.graphemes
|> Enum.map(fn x -> String.to_integer(x) end)
|> Enum.with_index
split_and_indexed
@t3h2mas
t3h2mas / nmap_quick.sh
Created September 6, 2017 12:39
quick nmap scan of target list file; saves results to [HOSTNAME].scanq
#!/bin/bash
if [[ -z "$1" ]]; then
echo "[!] usage: $0 [HOST LIST]"
exit
fi
hosts="$1"
len=$(wc -l "$hosts")
@t3h2mas
t3h2mas / HTTPoxy.sh
Last active September 6, 2017 12:37
send httpoxy requests to target file list
#!/bin/bash
# https://httpoxy.org/
if [ -z "$1" ]; then
echo "[!] usage $0 [TARGET HOSTS FILE]"
exit 1
fi
targets="$1"
@t3h2mas
t3h2mas / gobuster_dns.sh
Created September 6, 2017 12:32
use a hosts list for gobuster's DNS search
#!/bin/bash
set -e
if [[ -z "$2" ]]; then
echo "[!] usage: $0 [HOSTS FILE] [WORDS FILE] [THREADS (optional)]"
exit
fi
hosts=$1
@t3h2mas
t3h2mas / registry.sh
Created April 25, 2017 22:02
Deploy registry to Docker Swarm
#!/bin/bash
docker service create --name registry \
-e "REGISTRY_STORAGE=s3" \
-e "REGISTRY_STORAGE_S3_REGION=[S3 REGION]" \
-e "REGISTRY_STORAGE_S3_ACCESSKEY=[ACCESS KEY]" \
-e "REGISTRY_STORAGE_S3_SECRETKEY=[SECRET KEY]" \
-e "REGISTRY_STORAGE_S3_BUCKET=[BUCKET NAME]" \
-e "REGISTRY_STORAGE_S3_ENCRYPT=true" \
--publish 5000:5000 \

Keybase proof

I hereby claim:

  • I am t3h2mas on github.
  • I am t3h2mas (https://keybase.io/t3h2mas) on keybase.
  • I have a public key whose fingerprint is 1152 CA36 D83A 2473 03A7 BAF0 FFDA 1B5C E276 21CB

To claim this, I am signing this object: