Skip to content

Instantly share code, notes, and snippets.

View peterix's full-sized avatar
⛱️
Take out the parasols! Take out the plastic chairs!

Petr Mrázek peterix

⛱️
Take out the parasols! Take out the plastic chairs!
View GitHub Profile
@peterix
peterix / Usable.hpp
Last active November 14, 2016 23:52
Use tracking thingy
#pragma once
#include <cstddef>
#include <memory>
class Usable;
/**
* Base class for things that can be used by multiple other things and we want to track the use count.
*
@peterix
peterix / MCLauncherInit.js
Created October 25, 2016 16:58
MCLauncher interface
var MCLauncher;
// if there's not a MCLauncher object, make a new one... an interface between js and native code
if (!MCLauncher)
MCLauncher = {};
// reassign all the interface functions anyway, no matter what
(
function()
{
MCLauncher.writePreferences = function(config)
{
@peterix
peterix / keybase.md
Created August 15, 2016 21:28
Keybase proof

Keybase proof

I hereby claim:

  • I am peterix on github.
  • I am peterix (https://keybase.io/peterix) on keybase.
  • I have a public key whose fingerprint is A5CE B1DE 0468 2EB2 6072 930A 6111 18D2 4E3C D3EF

To claim this, I am signing this object:

@peterix
peterix / BMCLAPI.json
Last active July 15, 2016 13:07
Mirrors
{
"version":1,
"name":"BMCLAPI",
"mirrors":
[
{
"name":"assetsURL",
"officialPrefix":"http://resources.download.minecraft.net/",
"mirrorPrefix":"http://bmclapi2.bangbang93.com/objects/"
},
{
"+libraries": [
{
"insert": "prepend",
"name": "org.ow2.asm:asm-all:5.0.3"
},
{
"insert": "prepend",
"name": "net.minecraft:launchwrapper:1.12"
},
{
"+libraries": [
{
"insert": "replace",
"name": "org.apache.commons:commons-lang3:3.3.2"
},
{
"insert": "replace",
"name": "com.google.guava:guava:17.0"
},
@peterix
peterix / com.cuchazinteractive.m3l.json
Created April 28, 2015 21:47
Put this in a 1.8.3 instance patches folder to get M3L working
{
"+libraries": [
{
"name": "cuchaz:m3l:1.8.3-0.2b",
"url": "http://maven.cuchazinteractive.com/",
"insert": "prepend"
},
{
"name": "net.minecraft:launchwrapper:1.8",
"insert": "prepend"
@peterix
peterix / SeparatorPrefixTree.h
Last active August 29, 2015 14:19
Separator based prefix tree for Qt.
template <char Tseparator>
class SeparatorPrefixTree
{
public:
SeparatorPrefixTree(bool contained = false)
{
m_contained = contained;
}
/// insert an exact path into the tree
SeparatorPrefixTree & insert(QString path)
#!/bin/python2
from lxml import html
import requests
from operator import methodcaller
page = requests.get('https://www.patreon.com/user?u=130816&ty=p')
tree = html.fromstring(page.text)
patrons = tree.xpath("//div[contains(concat(' ', normalize-space(@class), ' '), ' shareWindow ')]/h1/a/text()")
print "\n".join(filter(None, map(methodcaller("strip"), patrons)))
@peterix
peterix / gist:ce367fc0c09ceea0bb9f
Created April 7, 2015 19:16
mod.shader.json - with local
{
"+libraries": [
{
"insert": "prepend",
"name": "org.ow2.asm:asm-all:4.1"
},
{
"insert": "prepend",
"name": "net.minecraft:launchwrapper:1.9"
},