Skip to content

Instantly share code, notes, and snippets.

View Hans5958's full-sized avatar
🏫
Uni and uni and uni and... (limited availability!)

Hans5958 Hans5958

🏫
Uni and uni and uni and... (limited availability!)
View GitHub Profile
@Hans5958
Hans5958 / OSM Sumatera main streets.bat
Created May 27, 2021 10:43
Commands that I use to get Sumatera's main streets
osmconvert64.exe indonesia-140101.osm.pbf >indonesia-140101.osm
osmfilter.exe indonesia-140101.osm --out-key
osmfilter.exe indonesia-140101.osm --keep="highway= boundary=administrative" >indonesia-140101.filtered.osm
osmconvert64.exe indonesia-140101.filtered.osm -B=sumatra.poly >indonesia-140101.sumatra.filtered.osm
osmconvert64.exe indonesia-210505.osm.pbf -B=sumatra.poly --drop-author >indonesia-210505.sumatra.osm
osmfilter.exe indonesia-210505.sumatra.osm --keep="highway=motorway highway=trunk highway=primary highway=secondary boundary=administrative" >indonesia-210505.sumatra.filtered.osm
@Hans5958
Hans5958 / FNF ffmpeg.bat
Created May 27, 2021 10:47
A very simple command to merge the two channels of Friday Night Funkin's song
ffmpeg -i Inst.ogg -i Voices.ogg -filter_complex amix=inputs=2:duration=longest output.ogg
/* Make the logo bigger and the margin smaller */
.logo {
margin-inline-end: 0.75rem;
transform: scale(1.75);
}
/* No need hover effect on dropdown icons */
.addon-group > span > img:hover {
@Hans5958
Hans5958 / unblock-all-twitter-2.user.js
Last active October 28, 2021 02:01
A later version of my script for unblocking everyone on Twitter. Made as an userscript for auto-reload purposes. Upon adding, go to https://twitter.com/settings/blocked/all and it will start unblocking people. Old version: https://gist.github.com/Hans5958/007c47112c4510856c1a642a32aa2964
// ==UserScript==
// @name Unblock All Twitter (REMOVE WHEN DONE!)
// @namespace https://gist.github.com/Hans5958/4ff0a03f4d7cd6d7af6f03371ca907a6
// @version 0.1.0
// @author Hans5958
// @match https://twitter.com/settings/blocked/all
// @grant none
// @run-at document-start
// ==/UserScript==
@Hans5958
Hans5958 / instagram-block-hitman.user.js
Created October 28, 2021 02:06
A script to block all Instagram users on an array. Upon adding, go to the first user's page and it will start blocking. Most likely won't work for large number for users.
// ==UserScript==
// @name Instagram Block Hitman
// @namespace https://gist.github.com/Hans5958/e6c02ffd2c91c3d6aca0ca529e154112
// @version 0.1.0
// @author Hans5958
// @match https://www.instagram.com/*
// @grant none
// @run-at document-idle
// ==/UserScript==
@Hans5958
Hans5958 / Get Scratch followers count.js
Created January 3, 2022 02:59
A simple script to get the followers count on Scratch (scratch.mit.edu).
var headers = new Headers();
headers.append('pragma', 'no-cache');
headers.append('cache-control', 'no-cache');
var parser = new DOMParser();
var user = 'griffpatch'
var page = 1
fetch(`https://scratch.mit.edu/users/${user}/followers/`, {
headers
})
if (document.querySelector("h1.css-901oao > span:nth-child(1)")) {
document.location.reload()
}
console.clear()
console.log("Script loaded!\n\nLoading...")
window.scrollBy(0, window.innerHeight)
var blockedNow = []
var totalUnblocked = 0
autoUnblock = setInterval(() => {
blockedNow = []
@Hans5958
Hans5958 / Analysis of Timeline Granularity.md
Last active April 13, 2022 06:57
Analysis of Timeline Granularity - made for https://github.com/placeAtlas/atlas.

Analysis of Timeline Granularity

Made for placeAtlas/atlas.

Since the epoch of the timeline feature (so-called time travel), many members of the community suggests to add more time on the Atlas. I myself the one who supports the idea, but we should think about it for a while, especially on how fine we should make the timeline. Henceforth is my scribe about it.

Conditions

Here are my conditions on choosing the granularity of the timeline.

CD Key, [JavaScript (Node.js)], 234 bytes

(a,b)=>{P=(n,p)=>{for(n=n+"";n.length<p;n="0"+n);return n};R=n=>Math.random()*n|0;F=w=>w.slice(-1);while(!a||(a[0]==a[1]==a[2]>2))a=P(R(999),3);while(!b||(!b.split``.map(n=>t+=n,t=0)%7&&(!F(b)||F(b)>7)))b=P(R(1e7-1),7);return a+"-"+b}

[Try it online!][TIO-kattqmui]

OEM Key, [JavaScript (Node.js)], 262 bytes