- Install
youtube-dl
via Homebrew. Don't have Homebrew? Follow the easy one-step instructions here) - Install
ffmpeg
via Homebrew. - Execute the following command to determine available formats to download as:
youtube-dl -F [link to video]
- Select format type and execute:
youtube-dl -f [format] [link to video]
- You now have a downloaded (and automatically-converted-to standard-m4a rip)
- For an MP3 version execute:
This file contains 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
// Network Packet Struct | |
typedef struct { | |
int fd; | |
struct sockaddr_in cli_addr; | |
int length; | |
char buffer[]; | |
} NET_PACKET; | |
void receive_payload( int fd, struct sockaddr_in cli_addr, char buffer[], int length ) { |
I hereby claim:
- I am tsujp on github.
- I am tsujp (https://keybase.io/tsujp) on keybase.
- I have a public key whose fingerprint is 8B36 485D EB88 68BA FE21 A81E 4F7F 8C4D 2D12 D94E
To claim this, I am signing this object:
This file contains 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
interface TypedResponse<T = any> extends Response { | |
/** | |
* this will override `json` method from `Body` that is extended by `Response` | |
* interface Body { | |
* json(): Promise<any>; | |
* } | |
*/ | |
json<P = T>(): Promise<P> | |
} |
This file contains 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
BEGIN MESSAGE. | |
30XG4ydCCDCy1TU aerjE5KOdSpVcVe d3BdA8Vfc2BbPvz 3wtf74afXprZfb5 | |
z2tMC105qULZLzq AopZqPXqfZJTCKq 6Xr2MZHgg6lW1An k9MR21AMRunYgwx | |
OXQZwFFoPDNBhGO gWFrbnGDNWKaysD AUdHpFdu1dd22VH nfuDsafRbKPHvJv | |
BvC8S3j9D5hzpEu 57p7VzgABIHlKpa 7SBQr. | |
END MESSAGE. |
This file contains 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
#!/usr/bin/env bash | |
# get a random-character password | |
# First argument is password length | |
# Can override the default character set by passing in PWCHARSET=<charset> as env | |
randompass() { | |
# globbing & history expansion here is a pain, so we store its state, temp turn it off & restore it later | |
local maybeglob="$(shopt -po noglob histexpand)" | |
set -o noglob # turn off globbing | |
set +o histexpand # turn off history expansion |
This file contains 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
# to add to your ~/.bashrc or your ~/.zshrc file. Usage: $ go switch 1.18.1 | |
function go() { | |
case $* in | |
switch* ) | |
shift 1 | |
gobindir=$(go env GOBIN) | |
# adapt to a valid directory at the beginning of your $PATH if you're not on systemd | |
homebindir=$(systemd-path user-binaries) | |
go install golang.org/dl/go"$@"@latest | |
$gobindir/go"$@" download |
This file contains 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
# install | |
mkdir ~/macports | |
cd ~/macports | |
curl -O https://distfiles.macports.org/MacPorts/MacPorts-2.5.3.tar.bz2 | |
tar xf MacPorts-2.5.3.tar.bz2 | |
cd MacPorts-2.5.3/ | |
./configure --enable-readline --prefix=$HOME/macports --with-no-root-privileges | |
make && make install |
This file contains 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
#!/bin/sh | |
## | |
# This is a script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# Run in interactive mode with: | |
# $ sh -c "$(curl -sL https://raw.github.com/gist/2108403/hack.sh)" | |
# | |
# or run it without prompt questions: |
OlderNewer