Skip to content

Instantly share code, notes, and snippets.

@rHermes
rHermes / PyOverflow.py
Created November 3, 2013 15:30
This was an experiment, trying to parse the XML dump of stackoverflow into a mysql database. Unfortuently, the script failed once the XML dumps got large enough.
from lxml import etree
import pymysql
def fast_iter(context, func):
for event, elem in context:
func(elem)
elem.clear()
while elem.getprevious() is not None:
del elem.getparent()[0]
del context
// 2013-4-toerrskodd-moetevirksomhet.cpp
#include <iostream>
#include <set>
#include <vector>
#include <sys/types.h>
#include <limits>
#include <algorithm>
#include <utility>
#include <stack>
#!/usr/bin/env ruby
## Bot, sits in TB server and pings periodically to
## remain connected. Parses SAY strings for globals
require 'socket'
require 'digest/md5'
require 'io/wait'
def resolver(server)
puts "Trying to resolve #{server} to IP..."
#!/usr/bin/env python2.7
# Written by rHermes
# Cross compapatebility:
try:
xrange
except NameError:
xrange = range
import struct
#!/usr/bin/env python2
# Written by Alexogo and rHermes
print('Welcome to the QSL Login site, please enter your credentials.')
#TODO: Hash these passwords, as this could be read straight from memory.
logins = {
"QSL Alexogo": "Test01",
"QSL Viper": "Test02",
def HMP(n):
x = 2
z = []
while x <= n//2:
while n % x == 0:
n //= x
z.append(x)
x += 1
if n is not 1:
; Created by rHermes (2017.03.14 12:36:40 UTC)
;
; This was made so that I could use the ingame code editor in the very cool
; game called "liberation-circut"[1]. It has only been minimally tested so
; please fork and share your improvements!
;
; [1] - [https://github.com/linleyh/liberation-circuit]
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"
#define STB_IMAGE_WRITE_IMPLEMENTATION
#include "stb_image_write.h"
int main() {
int x, y, n;
unsigned char *data = stbi_load("testimage.jpg", &x, &y, &n, 3);
package main
import (
"bufio"
"fmt"
"io"
"log"
"math/rand"
"net"
"net/http"
{"id":"8819736634"}
{"id":"8819736636"}
{"id":"8819736637"}
{"id":"8819736638"}
{"id":"8819736639"}
{"id":"8819736640"}
{"id":"8819736642"}
{"id":"8819736644"}
{"id":"8819736648"}
{"id":"8819736651"}