Skip to content

Instantly share code, notes, and snippets.

Maxime Guerreiro PunKeel

Block or report user

Report or block PunKeel

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 taskgraph.py
#! /usr/bin/env python3
# Little script to display TaskWarrior tasks in a graph, along with their dependencies
# alias td='rm -f ~/tasks.svg; task export status:pending | ~/taskgraph.py > ~/tasks.svg; echo Saved tasks graph to ~/tasks.svg'
from __future__ import print_function
import sys, json
try:
from graphviz import Digraph
except:
@PunKeel
PunKeel / detect-private-browsing.js
Created Jul 8, 2017 — forked from cou929/detect-private-browsing.js
Detect private browsing mode (InPrivate Browsing or Incognito).
View detect-private-browsing.js
function retry(isDone, next) {
var current_trial = 0, max_retry = 50, interval = 10, is_timeout = false;
var id = window.setInterval(
function() {
if (isDone()) {
window.clearInterval(id);
next(is_timeout);
}
if (current_trial++ > max_retry) {
window.clearInterval(id);
View keybase.md

Keybase proof

I hereby claim:

  • I am PunKeel on github.
  • I am punkeel (https://keybase.io/punkeel) on keybase.
  • I have a public key whose fingerprint is 0216 8B4D 30F6 BD17 4A19 85EC FF57 EC5B 089B B801

To claim this, I am signing this object:

@PunKeel
PunKeel / cf_update.sh
Created Aug 25, 2013
In your nginx.conf, in the http block, add include cf_rules.conf; Then, "touch /etc/nginx/cf_rules.conf" and you're free to use the bash script ! Thanks to CloudFlare's service. :)
View cf_update.sh
#!/bin/bash
echo "real_ip_header CF-Connecting-IP;">/etc/nginx/cf_rules.conf;
for f in $(curl "https://www.cloudflare.com/ips-v4"); do
echo "set_real_ip_from $f;">>/etc/nginx/cf_rules.conf;
done
for f in $(curl "https://www.cloudflare.com/ips-v6"); do
echo "set_real_ip_from $f;">>/etc/nginx/cf_rules.conf;
done
@PunKeel
PunKeel / remove-bots.php
Last active Dec 21, 2015
Mybb bot removal - detection using http://www.stopforumspam.com
View remove-bots.php
<?php
$confidence = 75;
$db_prefix = 'forum';
function check_user($u) {
$details = array('username' => urlencode($u['username']), 'email' => urlencode($u['email']), 'ip' => $u['lastip']);
$url = "http://www.stopforumspam.com/api?ip={$details['ip']}&email={$details['email']}&username={$details['username']}&f=json";
$data = @file_get_contents($url);
$data = json_decode($data);
You can’t perform that action at this time.