Skip to content

Instantly share code, notes, and snippets.

View LevitatingBusinessMan's full-sized avatar
🕴️
Ricing my polybar...

Rein Fernhout LevitatingBusinessMan

🕴️
Ricing my polybar...
View GitHub Profile
@LevitatingBusinessMan
LevitatingBusinessMan / sharex.php script
Last active March 15, 2018 22:35
A simple sharex custom upload script
<?php
#No dashes in the end/begin of directory or domain
$key = "key_here";
$file_dir = "i"; #Make sure this does exist already
$nameLength = 5;
$IMGonly = true;
$domain = 'domain_here';
if (isset($_POST['key'])){
if ($_POST['key'] == $key){
@LevitatingBusinessMan
LevitatingBusinessMan / insta.js
Created February 27, 2018 23:53
Insta follow all
function start(){
let x = document.getElementsByClassName("_qv64e");
if(x.length){
let i = 0;
setInterval( function () {
if (x.length > i){
if (x[i].innerHTML == "Follow" || x[i].innerHTML == "Volgen"){
x[i].click();
}
/*
Stupid small project of mine, if you run this in a web.whatsapp console you should be good to go
Note, it looks like sending a msg in a group is bugged. And the group command doesnt work because of it
*/
var lastMessage;
setInterval(getLastMessage, 500);
var prefix = '!';
var messagesMap = new Map();
$('header ._1wjpf').click();
@LevitatingBusinessMan
LevitatingBusinessMan / README.md
Last active February 7, 2019 08:04
Calculate PI

This is an educational project that aims to show how pi works, and how that definition can be used to calculate it.

In this example a square is made. Then a circle with the radius of half the square's length is used, making it fit perfectly within the square. Now we create random coordinates within the square and use pythagoras to decide if the coordinate is within the circle (it's distance to the center would be less then the circle radius). If this is done let's say 10 times, and 8 points would be within the circle, that means that on average the ratio of [surface area circle : surface area square] is about [8:10].

If we understand that 4*r^2 is the surface area of the full square, and pi*r^2 is the surface area of the circle, we understand that pi is this ratio of circle:square times four. So by rougly calculating this ratio we can also calculate pi

In the example we don't use 10 but rather 500 or a thousand random points to calculate this ratio as closely as possible.

@LevitatingBusinessMan
LevitatingBusinessMan / README.md
Last active February 10, 2019 22:46
Game of Life

The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970.

The game is a zero-player game, meaning that its evolution is determined by its initial state, requiring no further input. One interacts with the Game of Life by creating an initial configuration and observing how it evolves, or, for advanced players, by creating patterns with particular properties.

Rules:

  1. Any live cell with fewer than two live neighbors dies, as if by underpopulation.
  2. Any live cell with two or three live neighbors lives on to the next generation.
  3. Any live cell with more than three live neighbors dies, as if by overpopulation.
  4. Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.
@LevitatingBusinessMan
LevitatingBusinessMan / audio.html
Last active September 24, 2018 18:44
Audio visualizer
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.0/p5.js"></script>
<script src=" https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.0/addons/p5.sound.js"></script>
<style>body{margin:0px}</style>
<script>
let mic,
particles =[],
fft,
canvas,
@LevitatingBusinessMan
LevitatingBusinessMan / grade_calc.js
Last active October 8, 2018 19:10
Magister Grade Calculator
//Example: node <script.js> "<school>" <username> <password>
const { default: magister, getSchools } = require('magister2.js');
const chalk = require('chalk');
process.stdout.write('\033c');
let school = process.argv[2];
let username = process.argv[3];
let password = process.argv[4];
@LevitatingBusinessMan
LevitatingBusinessMan / yt_wrapper.js
Last active July 2, 2018 20:37
YT playlist API
module.exports = class API {
constructor(key){
this.key = key;
this.axios = require('axios');
}
playlistItems(id) {
const key = this.key;
const axios = this.axios;
@LevitatingBusinessMan
LevitatingBusinessMan / Alexa.js
Created September 11, 2018 21:13
Alexa reddit bot (meme)
const fs = require('fs');
const config = {
userAgent: 'Alexa bot/v1.0.0.',
clientId: 'FQmyKSMDo-o-Vg',
clientSecret: '4PNMTraK0fNlwYaCyyhtqSBH6dk',
username: 'Alexa_play',
password: 'Alexabot'
};
@LevitatingBusinessMan
LevitatingBusinessMan / blue_yt.css
Last active April 10, 2019 01:48
Blue Youtube
:root {
--main-color: #0099ff;
}
/*progress bar (player)*/
.ytp-swatch-background-color,
/*playback progress bar*/
#progress.ytd-thumbnail-overlay-resume-playback-renderer,
/*HD tag settings icon (player)*/
.ytp-settings-button.ytp-hd-quality-badge:after, .ytp-settings-button.ytp-4k-quality-badge:after, .ytp-settings-button.ytp-5k-quality-badge:after, .ytp-settings-button.ytp-8k-quality-badge:after,