Skip to content

Instantly share code, notes, and snippets.

View levelsio's full-sized avatar

levelsio levelsio

View GitHub Profile
@levelsio
levelsio / twitter_inbox_cleaner.js
Created January 3, 2019 08:07
Twitter Inbox Cleaner (by @levelsio)
//
// Twitter lets you close your inbox to people you don't follow. The problem
// is that still authorizes ANYONE who sent you a message EVER to continue
// messaging you, even if your privacy settings are changed.
//
// The only way (I think) to avoid that is to delete every message from a
// person so that Twitter's internal check "did you talk to this person
// before?" results in FALSE. That sucks because maybe you want more privacy
// than before. But it's do-able by deleteing all the message history of each
// conversation.
# Copy this URL and add it as a bookmark, then open Google Maps, go to a place, and click it to open Hoodmaps at the same location
# by @marckohlbrugge
javascript:(function()%7Bvar%20parts%20%3D%20window.location.href.split(%22%40%22)%5B1%5D.split(%22%2C%22)%3Bwindow.location%20%3D%20%60https%3A%2F%2Fhoodmaps.com%2Findex.php%3Flatitude%3D%24%7Bparts%5B0%5D%7D%26longitude%3D%24%7Bparts%5B1%5D%7D%26zoom%3D%24%7Bparts%5B2%5D.replace(%22z%22%2C%20%22%22)%7D%60%7D)()
@levelsio
levelsio / ip_limiter.php
Created April 24, 2019 08:29
MAKE book IP limiter (req'd by @rashidi_life)
#
// check if customer hash correct
loadDbs(array('customers'));
$query=$customersDb->prepare("SELECT * FROM customers WHERE secret_hash=:secret_hash");
$query->bindValue(':secret_hash',$_GET['hash']);
$query->execute();
$customers=$query->fetchAll(PDO::FETCH_ASSOC);
$customer=$customers[0];
if(!empty($customer) && $customers[0]['secret_hash']==$_GET['hash']) {
@levelsio
levelsio / obfuscate.php
Last active May 5, 2023 12:33
WordPress plugin to progressively obfuscate text like MAKEbook.io
/*
--PIETZ OBFUSCATE CODE--
2019-06-01
from MAKEbook.io
Instructions:
1) put this in your functions.php file
2) add this to the post you want to obfuscate, on top
3) [obfuscate]
4) to start obfuscating, add a HTML code or HTML block with <start></start>
@levelsio
levelsio / blunble.php
Last active August 5, 2022 06:24
Blunble Bot for Twitter
<?
//
// BLUNBLE BOT (by @levelsio)
//
// "Blunble" is Korean internet slang for [BL]ock [UNBL]ock
// If you block and unblock somebody on Twitter, they stop following you.
// It's a polite way of getting rid of trolls without permanently blocking
// because blocking usually results in more anger and more trolling.
//
// WHAT THIS SCRIPT DOES:
@levelsio
levelsio / canggu.geojson
Created August 25, 2019 12:52
canggu.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
function updateSlug() {
if(
$('.filters .filter.month .choice.active').length>0 &&
$('.filters .filter.region .choice.active').length>0
) {
slug='';
}
firstTemperatureDoneAlready=false;
/* dragging logic for nomadlist.com/dating */
/* by @levelsio */
/* MIT license */
/* <dragging logic> */
$('body').on('mousedown touchstart','.card',function(e) {
if(!currentCardUserId) return;
if($('card.match_card').is(':visible')) return;
if(typeof e.originalEvent.touches !=='undefined') {
/* touch device */
@levelsio
levelsio / log_js_errors.js
Created December 15, 2019 15:56
Log JS errors as a POST to your server
// <log errors to server>
window.onerror = function (messageOrEvent, source, lineno, colno, error) {
try {
console.log({
//error message(string).Available as event (sic!) in HTML onerror = "" handler.
messageOrEvent: messageOrEvent,
//URL of the script where the error was raised(string)
source: source,
//Line number where error was raised(number)
@levelsio
levelsio / getRandomFollower.php
Created January 11, 2020 10:22
get random Twitter follower from your exported followers.js
<?
// str_replace removes the JS part and makes it into a normal JSON file
$followers=json_decode(str_replace('window.YTD.follower.part0 = ','',file_get_contents(__DIR__.'/followers.js')),true);
echo "\n\n";
echo number_format(count($followers)).' followers';
echo "\n\n";