Skip to content

Instantly share code, notes, and snippets.

@bochsdbg
bochsdbg / creeptd-server-status.py
Created April 17, 2020 21:50
CreepTD server status parser script
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import urllib.request
import re
def to_int(s):
s = s.strip()
try:
return int(s) if s else 0
@bochsdbg
bochsdbg / YmlToOC.php
Created August 3, 2019 15:36
yml -> opencart import
<?php
namespace YA;
use \XMLReader;
use \stdClass;
class YmlToOC {
/**
* @var XMLReader
@bochsdbg
bochsdbg / main.cpp
Created August 1, 2019 06:48
sample tcp proxy for miniaicups
#include <QCommandLineParser>
#include <QCoreApplication>
#include <QJsonDocument>
#include <QJsonObject>
#include <QProcess>
#include <QRandomGenerator>
#include <QTcpSocket>
#include <QTimer>
#include <iostream>
#include <thread>
#include <type_traits>
#include <unistd.h>
#include <cassert>
#include <atomic>
template <typename T, size_t kMaxSize = 4096>
FROM elixir:latest
# Set exposed ports
EXPOSE 80
ENV PORT=80
ENV MIX_ENV=prod
ADD app/ ./
ADD script.sh ./
@bochsdbg
bochsdbg / _proc_cpuinfo
Created December 26, 2018 08:32
hlcup sysinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 26
model name : Intel Core i7 9xx (Nehalem Class Core i7)
stepping : 3
microcode : 0x1
cpu MHz : 2400.084
cache size : 4096 KB
physical id : 0
@bochsdbg
bochsdbg / main.c
Last active December 23, 2018 16:37
small hdd benchmark
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <time.h>
#include <sys/stat.h>
#include <memory.h>
@bochsdbg
bochsdbg / main.cpp
Last active September 4, 2018 15:57
0 900.0000000000000000 300.0000000000000000
1 900.0000000000000000 300.0000000000000000
2 900.0000000000000000 299.8208000000000197
3 900.0000000000000000 299.4628653689623548
4 900.0000000000000000 298.9266602673209832
5 900.0666191788642436 298.5463640783465848
6 900.1601326780249792 298.1316464994481521
7 900.2775211616437900 297.6863695951958562
8 900.4145424732954552 297.2125517013183185
9 900.4601937712625386 296.0391422709075187
2846259680917054518906413212119868890148051401702799230794179994274411340003764443772990786757784775815884062142317528830042339940153518739052421161382716174819824199827592418289259787898124253120594659962598670656016157203603239792632873671705574197596209947972034615369811989709261127750048419884541047554464244213657330307670362882580354896746111709736957860367019107151273058728104115864056128116538532596842582599558468814643042558983664931705925171720427659740744613340005419405246230343686915405940406622782824837151203832217864462718382292389963899282722187970245938769380309462733229257055545969002787528224254434802112755901916942542902891690721909708369053987374745248337289952180236328274121704026808676921045155584056717255537201585213282903427998981844931361064038148930449962159999935967089298019033699848440466541923625842494716317896119204123310826865107135451684554093603300960721034694437798234943078062606942230268188522759205702923084312618849760656074258627944882715595683153344053442544664841689458042
-module(test_method).
%-compile([export_all, nowarn_export_all]).
% standard callbacks
-export([init/2, allowed_methods/2, content_types_provided/2, content_types_accepted/2, resource_exists/2]).
% custom callbacks
-export([method_jsone/2]).