Skip to content

Instantly share code, notes, and snippets.

Pieter Levels levelsio

Block or report user

Report or block levelsio

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Nomad List generate slug function.js
function updateSlug() {
if(
$('.filters .filter.month .choice.active').length>0 &&
$('.filters .filter.region .choice.active').length>0
) {
slug='';
}
firstTemperatureDoneAlready=false;
View canggu.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@levelsio
levelsio / blunble.php
Last active Jul 1, 2019
Blunble Bot for Twitter
View blunble.php
<?
//
// 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 / obfuscate.php
Last active Jun 5, 2019
WordPress plugin to progressively obfuscate text like MAKEbook.io
View obfuscate.php
/*
--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 / ip_limiter.php
Created Apr 24, 2019
MAKE book IP limiter (req'd by @rashidi_life)
View ip_limiter.php
#
// 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']) {
View Hoodify Google Maps
# 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)()
View twitter_inbox_cleaner.js
//
// 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.
@levelsio
levelsio / malaysia_singapore.geojson
Last active Dec 13, 2018
Singapore + Malaysia country borders in GeoJSON because most are missing Singapore!
View malaysia_singapore.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View autoRefundChargebackDispute.php
<?
// this script receives a Stripe dispute / chargeback and:
//
// - immediately refunds the payment
// - closes the user's account (in my DB, add your own code there)
//
// this is to automate dispute handling (because you never win a dispute on Stripe anyway)
// and by refunding avoiding the chargeback fee
//
@levelsio
levelsio / Is it now Ramadan.php
Last active Jun 6, 2018
"Is it now Ramadan?" function in PHP
View Is it now Ramadan.php
# by @levelsio
#
# MIT licensed
#
# make sure you enable php_intl on PHP
# you can do by uncommenting ;extension=intl or ;extension=php_intl
# and installing php-intl, e.g. sudo apt-get install php-intl
#
# made for Nomad List to give people a notice if they go to a place
# where it is currently Ramadan
You can’t perform that action at this time.