Skip to content

Instantly share code, notes, and snippets.

Avatar

Anthony Madhvani octagonal

  • EU, Belgium
View GitHub Profile
View wordlist
This file has been truncated, but you can view the full file.
password
123456789
12345678
1q2w3e4r
sunshine
football
1234567890
computer
superman
@octagonal
octagonal / sorrymoot.sh
Last active Dec 27, 2019
Fast + Simple 4chan Image Downloader
View sorrymoot.sh
#!/usr/bin/sh
# Every time you use this, Moot sheds a single manly tear. Please use it sparingly if at all.
echo -e "(curl)\t\t Downloading thread"
curl -s http://boards.4chan.org/$1 -o thread.html
echo -e "(grep -Po)\t Finding images "
cat thread.html | grep -Po '(?<=fileThumb" href=")\S+(?=")' > img
echo -e "(sed)\t\t Extracting image links"
@octagonal
octagonal / fib.js
Last active Sep 6, 2018
Fibonacci sequence codegolf
View fib.js
// This is the shortest fib function using generators afaik
// Will exceed the call stack eventually
function fib(n) {
const f = function* run(a = 0, b = 1) {
yield a;
yield* run(b, a + b);
}();
return Array(n).fill().map(()=>f.next().value);
}
@octagonal
octagonal / queryHeroku.js
Last active Jul 4, 2018
Query an Heroku apps' config vars for a given regex and match it to a given list
View queryHeroku.js
const { execSync } = require('child_process');
const fs = require('fs');
// Convert a newline delimited list to an array, removing all empty values
const lineToArray = lines => lines.split('\n').filter(line => line);
const dbList = lineToArray(fs.readFileSync(process.env.LIST, 'utf8'));
// Get all apps from given org
const herokuApps = lineToArray(execSync(
@octagonal
octagonal / heroku_env.sh
Last active Jun 11, 2018
Some simple oneliners that make working with Heroku easier
View heroku_env.sh
# A collection of snippets for managing Heroku env vars
# It ain't pretty but it works
# Copy Heroku config to a local .env file
heroku config --app $HEROKU_APP | sed 's/: */=/' | tail -n +2 | tee $ENV_FILE
# Set a Heroku app's config from a local env file
# I got this oneliner from a blog somewhere, can't find it again
heroku config:set --app $HEROKU_APP $(cat .env | sed '/^$/d; /#[[:print:]]*$/d')
# Set a Heroku app's config from another Heroku app's config
@octagonal
octagonal / queroku.sh
Created Sep 21, 2017
Find heroku config vars
View queroku.sh
# Output is ; delimited
for i in $(heroku apps -o $ORG --json | jq -r ".[] | .name"); do
# Find by value:
echo -n "$i;"; heroku config --app $i | awk '{print $2}' | grep -e "$QUERY" | tr -d '\n'; echo '';
# Find by key:
# echo -n "$i;"; heroku config:get $QUERY --app $i | tr -d '\n'; echo '';
done
View .vimrc
set nocp
execute pathogen#infect()
syntax on
filetype plugin indent on
syntax enable
set background=dark
colorscheme solarized
@octagonal
octagonal / vapor
Created Aug 12, 2016
j a v a s c r i p t
View vapor
for(var e = 0; e < 10; e++){
for(var i = Math.floor((Math.PI / 2) * 100); i < Math.floor((Math.PI ) * 1000); i += Math.floor((Math.PI / 2) * 100) ){
var chars = "";
//console.log(i/1000);
for(var y = Math.floor(Math.sin(i/1000) * 100); y > 0; y--){
chars += "vaporwave".split("")[((100 - y) % "vaporwave".split("").length) % "vaporwave".split("").length];
}
console.log(chars);
}
}
@octagonal
octagonal / .material-icons.fix
Created May 30, 2016
Make material icons x-height aligned, with inherited font-sizings
View .material-icons.fix
font-size: inherit;
line-height: inherit;
letter-spacing: inherit;
transform: translate(0px, 0.3ex);
@octagonal
octagonal / BashSuperpowers.sh
Last active Dec 25, 2015
This bash script will give you superpowers
View BashSuperpowers.sh
#!/usr/bin/env bash
function superpower {
echo $(curl -Is http://powerlisting.wikia.com/wiki/Special:Random | grep Location | cut -d / -f 5 | sed "s/_/ /g")
}
count=$1
echo "Your superpowers for today are: " > $HOME/super.txt
for (( c=1; c<=$count; c++ ))
You can’t perform that action at this time.