Skip to content

Instantly share code, notes, and snippets.

View n3h3m's full-sized avatar

nehem n3h3m

  • Sydney, Australia
View GitHub Profile
@n3h3m
n3h3m / youtube-dl.py
Created May 31, 2021 10:50 — forked from nneonneo/youtube-dl.py
YouTube-DL for Pythonista - download YouTube videos on your iPhone/iPad!
#!python3
'''
Directions:
- install youtube-dl via Pip (e.g. using the StaSh command: https://github.com/ywangd/stash)
- add this script as a Share extension through Settings -> Share Extension Shortcuts
- while watching a video in the YouTube site or app, just share the video to Pythonista and select this script
- the video will download, and when it's done you can share the video file itself with any app (e.g. VLC)
Advanced usage:
@n3h3m
n3h3m / docker_kill.sh
Created August 24, 2020 07:33 — forked from evanscottgray/docker_kill.sh
kill all docker containers at once...
docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt
@n3h3m
n3h3m / termux-url-opener
Created June 25, 2019 08:02 — forked from LordH3lmchen/termux-url-opener
termux-url-opener
#!/data/data/com.termux/files/usr/bin/zsh
#
# This is a termux-url-opener script to do diffrent tasks on my Android phone
#
url=$1
echo "What should I do with $url ?"
echo "y) download youtube video to movies-folder"
echo "u) download youtube video and convert it to mp3 (music-folder)"
echo "s) download with scdl (soundcloud)"
@n3h3m
n3h3m / gist:5262f774104e88e7e8cc5fc1e71a7448
Created May 20, 2019 07:10 — forked from LarsFronius/gist:e579051d7f140fd803b0
If you ever want to debug a kinesis stream, copy this bash one liner.
On a mac, `brew install awscli gnu-sed` before.
streamname=staging;aws kinesis describe-stream --stream-name $streamname --output text | grep SHARDS | awk '{print $2}' | while read shard; do aws kinesis get-shard-iterator --stream-name $streamname --shard-id $shard --shard-iterator-type LATEST --output text | while read iterator; do while output=`aws kinesis get-records --shard-iterator $iterator --output text`; do iterator=`echo "$output" | head -n1`; echo "$output" | gsed 1d | grep RECORDS | while read record; do echo $record | awk '{print $2}' | base64 -D; done; done; done; done
@n3h3m
n3h3m / mac.md
Created January 19, 2017 05:22 — forked from lornajane/mac.md
Keyboard Only OS X

Keyboard-only Mac Cheatsheet

Hi, I'm Lorna and I don't use a mouse. I have had RSI issues since a bad workstation setup at work in 2006. I've tried a number of extra hardware modifications but what works best for me is to use the keyboard and only the keyboard, so I'm in a good position and never reaching for anything else (except my coffee cup!). I rather unwisely took a job which required me to use a mac (I've been a linux user until now and also had the ability to choose my tools carefully) so here is my cheatsheet of the apps, tricks and keyboard shortcuts I'm using, mostly for my own reference. Since keyboard-only use is also great for productivity, you may also find some of these ideas useful, in which case at least something good has come of this :)

Apps List

There's more detail on a few of these apps but here is a quick overview of the tools I've installed and found helpful

Tool Link Comments
@n3h3m
n3h3m / fl
Created September 7, 2016 05:57 — forked from McNull/fl
Open current directory in forklift
#!/bin/bash
# Open current directory in forklift
# Adapted from https://gist.github.com/elentok/6218781
# Adapted from comment https://gist.github.com/elentok/6218781#comment-891115
# Added optional path argument and removed using the clipboard buffer.
set -e
if [ -z "$@" ]; then
@n3h3m
n3h3m / config.fish
Created July 26, 2016 07:32 — forked from ronaldsuwandi/config.fish
My personal fish shell config for OS X (better blue colour for directory in dark terminal). Supports git branch and virtualfish for virtualenv
# nice light cyan color instead of dark blue
set -Ux LSCOLORS gxfxcxdxbxegedabagacad
function ls --description 'List contents of directory'
command ls -lhFG $argv
end
function df --description 'Displays disk free space'
command df -H $argv
end
@n3h3m
n3h3m / config.fish
Last active September 20, 2015 23:57 — forked from fmariluis/config.fish
Basic configuration for Fish Shell
set -xg PYTHONPATH /opt/eleccion/ $PYTHONPATH
set -xg PYTHONPATH /opt/operaciones/ $PYTHONPATH
set -xg GOROOT /usr/local/go $GOROOT
set -xg PATH /usr/local/go/bin $PATH
set -xg EDITOR vim $EDITOR
setenv EDITOR vim
function l
ll $argv
@n3h3m
n3h3m / InstaScan.py
Last active April 18, 2019 18:09 — forked from mapmeld/InstaScan.py
# InstaScan.py
# prints a CSV of all geolocated Instagram photos with a certain tag between dates
import json
import urllib
import datetime
createdate = datetime.datetime.now()
latestprint = datetime.datetime(2012, 11, 11) # Nov 11, 2012
earliestprint = datetime.datetime(2012, 10, 28) # Oct 28, 2012