Skip to content

Instantly share code, notes, and snippets.

View wildeyes's full-sized avatar
🎯
Focusing

wildeyes wildeyes

🎯
Focusing
  • TLV
View GitHub Profile
@wildeyes
wildeyes / pup.wikipedia.original.image.sh
Created February 18, 2020 18:18
Download the original wikipedia image on the commandline using pup
# https://github.com/ericchiang/pup
curl -s https://en.wikipedia.org/wiki/File:Great_Wave_off_Kanagawa2.jpg | pup '.internal' 'attr{href}'
# Say you have a list of urls in a file, and you want to download all of them to a directory
cat all-hokusai-views-of-mount-fuji.txt | xargs -I{} curl -s {} | pup '.internal' 'attr{href}' | xargs -I{} wget "http:"\{\} -P hokusai-mount-fiji-collection/
@wildeyes
wildeyes / setup.ps1
Created October 29, 2019 21:16
Install windows base system
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install -y cmdutils
@wildeyes
wildeyes / base.sh
Last active January 14, 2020 13:33
Install base macOS system.
# Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Software
brew cask install apptivate
brew cask install spectacle
brew cask install hyperswitch
brew cask install iterm
brew cask install iterm2
brew install mackup
@wildeyes
wildeyes / unfollow-all.js
Created October 1, 2019 11:14
Medium Userscripts
// run this in dev console
// copied from https://www.quora.com/How-can-I-unfollow-everyone-on-Medium
var button = document.getElementsByTagName("button");
for (var i = 0; i < button.length; i++)
{
if(button[i].className.includes("js-followButton"))
{ button[i].click(); }
}
var script = document.createElement('script'),
scripts = document.getElementsByTagName('script')[0];
script.src = url;
scripts.parentNode.insertBefore(script, scripts);
// <script src="https://platform.twitter.com/widgets.js" async defer></script>
function parseQuery(queryString) {
var query = {};
var pairs = (queryString[0] === '?' ? queryString.substr(1) : queryString).split('&');
for (var i = 0; i < pairs.length; i++) {
var pair = pairs[i].split('=');
query[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1] || '');
}
return query;
}
@wildeyes
wildeyes / privacy.policy.md
Created January 9, 2018 19:25
Negishut Privacy Policy

We do not collect any data beyond what is provided to us.

Array.from({ length: 12 }, (v, i) => i + 1)
@wildeyes
wildeyes / lies-i-tell-you.lies.ts
Created October 24, 2017 11:13
Lying to the typesystem
// const getPortfoliosSync = createActionWithoutAlsoTyingDispatch(() => ({}));
const createActionWithoutAlsoTyingDispatchAsync = <T>(getMeAPromise: () => Promise<T>) => {
const retValue: any = () => {
return;
};
return retValue as Promise<T>;
};
const getPortfoliosAsync = createActionWithoutAlsoTyingDispatchAsync(() => Promise.resolve(1));
@wildeyes
wildeyes / gotcha,elm
Created October 4, 2017 08:14
Beginner Elm (Or simply functional programming) Gotchas
-- Functions are curried, that means when a function is called with not enough arguments, we don't get an "argument error exception", but a NEW function, that expects the remaining amount of arguments.
-- This can lead to some cryptic-for-beginners compiler type errors.