Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
import collections
import Xlib
import Xlib.display
Hints = collections.namedtuple("Hints", ["flags", "functions", "decorations", "inputMode", "status"])
MWM_HINTS_DECORATIONS = (1 << 1)
function getTabName(tabLink) {
return tabLink.href.split("#")[1];
}
function switchTab(tabName) {
var tabs = document.getElementsByClassName("tab");
for (var i = 0; i < tabs.length; i++) {
var tab = tabs[i];
if (tab.id == "tab-" + tabName) {
tab.style.display = "";
140_game 1096313866
140_soundtrack 1087788668
1849_the_gold_rush 1207664483
1954_alcatraz 1207661333
1979_revolution_black_friday_original_soundtrack 1626989378
1nsane 1207658658
7th_legion 1207660773
80_days 1441269533
88_heroes 2115164708
8bit_armies 1459422114
import struct
import io
class ByteReader(object):
def __init__(self, stream):
self.stream = stream
def read(self, *args):
return self.stream.read(*args)
#define _GLIBCXX_USE_CXX11_ABI 1
#include <ios>
#include <typeinfo>
#include <exception>
extern const std::type_info& old_abi_failure;
const std::type_info& new_abi_failure = typeid(std::ios::failure&);
bool is_ios_failure(std::exception& e) {
const std::type_info& e_type = typeid(e);
/*
* Copyright (c) 2015 Andrew Kelley
*
* This file is part of libsoundio, which is MIT licensed.
* See http://opensource.org/licenses/MIT
*/
#include <soundio/soundio.h>
#include <stdio.h>
import struct
import os
from collections import namedtuple
HEADER_FMT = "<4s7L"
HeaderTuple = namedtuple("Header", ["magic", "unknown1", "size1", "offset1",
"size3", "names_ofs", "names_len", "offset3"])
binary = open("data.up", "rb")
header_bytes = binary.read(32)
@Yepoleb
Yepoleb / dxrextract.py
Created August 30, 2016 02:00
Attempt to extract images from Macromedia Director dxr/dir files
import struct
import collections
import PIL.Image
# Attempt to extract images from Macromedia Director dxr/dir files
PATH = "ber.dxr"
CHUNK_FMT = ">4sL"
CHUNK_SIZE = struct.calcsize(CHUNK_FMT)

How 2 install worldedit on client

  1. You go to http://files.minecraftforge.net/ and download the recommended installer-win or installer.
  2. Run it and select install client
  3. Open minecraft launcher and select forge profile, then start the game once
  4. Get worldedit for mc 1.9.4 from https://minecraft.curseforge.com/projects/worldedit/files/2309681
  5. Put the jar in .minecraft/mods
  6. Launch the game and have the worldedit

Optional

  1. Download Worldedit CUI FE from https://minecraft.curseforge.com/projects/worldeditcui-forge-edition because liteloader sucks
#!/usr/bin/env python3
"""
Solution for https://scrap.tf/raffles/2JKVYD
"""
# https://github.com/savoirfairelinux/num2words
from num2words import num2words
PRIMES = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59,
61, 67, 71, 73, 79, 83, 89, 97]