Skip to content

Instantly share code, notes, and snippets.

View wildeyes's full-sized avatar
🎯
Focusing

wildeyes wildeyes

🎯
Focusing
  • TLV
View GitHub Profile
Array.from({ length: 12 }, (v, i) => i + 1)
@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.

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;
}
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>
@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(); }
}
@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 / 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 / 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 / github-openbase-bookmarklet.js
Created July 16, 2020 19:04
Open github repo in openbase via it's npm/yarn name bookmarklet.
javascript:window.open(`https://openbase.io/js/${document.documentElement.innerText.match(/(?:(npm install)|(npm i)|(yarn add)) ([\w\-]+)/).slice(-1)}`)
@wildeyes
wildeyes / listen.for.all.events.js
Created August 3, 2020 18:55
Catch all events from iframe
// https://www.thetopsites.net/article/50469550.shtml
Object.keys(window).forEach(key => {
if (/^on/.test(key)) {
window.addEventListener(key.slice(2), event => {
console.log(event);
});
}
});