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 / 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();
}
@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 / 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 / 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 / start.sh
Last active January 22, 2019 00:47
Minecraft server startup script
#!/bin/bash
#Has to be run from within server files
#(because of how the server itself works)
if pgrep -x "world_backup.sh" > /dev/null
then
echo "Backup script already running"
else
echo "Starting backup script"
/*
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.

<!DOCTYPE HTML>
<html>
<head>
<title>PONG!!!</title>
<link rel="icon" href=favicon.ico type=image/x-icon>
<link href=style.css rel=stylesheet type=text/css>
<link href="https://fonts.googleapis.com/css?family=Montserrat|Roboto|Anton|Roboto+Mono" rel="stylesheet">
</head>
<body>