Skip to content

Instantly share code, notes, and snippets.

View tsujp's full-sized avatar
💻
Making 1s and 0s work

Jordan Ellis Coppard tsujp

💻
Making 1s and 0s work
View GitHub Profile
@tsujp
tsujp / youtube-dl-mux.md
Last active August 29, 2015 14:19
You Are A Pirate

How To Become A Pirate

  1. Install youtube-dl via Homebrew. Don't have Homebrew? Follow the easy one-step instructions here)
  2. Install ffmpeg via Homebrew.
  3. Execute the following command to determine available formats to download as: youtube-dl -F [link to video]
  4. Select format type and execute: youtube-dl -f [format] [link to video]
  5. You now have a downloaded (and automatically-converted-to standard-m4a rip)
  6. For an MP3 version execute:
// 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 ) {

Keybase proof

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:

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>
}
BEGIN MESSAGE.
30XG4ydCCDCy1TU aerjE5KOdSpVcVe d3BdA8Vfc2BbPvz 3wtf74afXprZfb5
z2tMC105qULZLzq AopZqPXqfZJTCKq 6Xr2MZHgg6lW1An k9MR21AMRunYgwx
OXQZwFFoPDNBhGO gWFrbnGDNWKaysD AUdHpFdu1dd22VH nfuDsafRbKPHvJv
BvC8S3j9D5hzpEu 57p7VzgABIHlKpa 7SBQr.
END MESSAGE.
@tsujp
tsujp / Fibonacci_OCaml_Crystal_Go.md
Created June 29, 2022 10:44 — forked from s0kil/Fibonacci_OCaml_Crystal_Go.md
Crystal vs Ocaml vs Go Fibonacci Benchmark

Fibonacci - Crystal vs OCaml vs Go

Crystal

Program: fibonacci.cr

def fibonacci(n)
  return n if n < 2
  fibonacci(n - 1) + fibonacci(n - 2)
@tsujp
tsujp / random_password.sh
Created June 29, 2022 13:19 — forked from pmarreck/random_password.sh
Generate random strings or dictionary words in Bash
#!/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
@tsujp
tsujp / go-switch-bash
Created June 30, 2022 06:45 — forked from AnomalRoil/go-switch-bash
The `go switch` function allows you to easily switch you current Go version
# 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
@tsujp
tsujp / install-mac-ports-no-root.bash
Created July 1, 2022 09:38 — forked from daggerok/install-mac-ports-no-root.bash
Install MacPorts 2.5.3 without sudo / root privileges
# 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
@tsujp
tsujp / hack.sh
Created July 1, 2022 09:58 — forked from DAddYE/hack.sh
OSX For Hackers
#!/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: