Skip to content

Instantly share code, notes, and snippets.

@jtanx
jtanx / results.md
Last active September 15, 2018 01:44
log slowness

Windows

  • VS2015 x64: 10.19 sec: 3591342062.644168

  • mingw-w64 x64 gcc 7.3.0 (msys2): 29.3 sec: 3591342062.644168

  • VS2015 32-bit: 13.71 sec: 3591342062.644168

  • mingw-w64 32-bit gcc 7.3.0 (msys2): 27.23 sec: 3591342062.644168

  • windows go 1.8.3: 16.67 sec: 3591342062.644168

@jtanx
jtanx / display.py
Last active November 25, 2018 08:22
Simple image viewer
from flask import Flask, redirect, url_for, render_template_string, send_from_directory, make_response, Response
from functools import wraps, update_wrapper
from datetime import datetime
from zipfile import ZipFile
import os
import sys
app = Flask(__name__)
arch = None
@jtanx
jtanx / index.html
Created November 29, 2018 11:34
bokeh shennanigans
{% extends base %}
{% block preamble %}
<style>
.hidden {
display: none !important;
}
.bk-grid.bk-layout-fixed {
width: auto !important;
height: auto !important;
@jtanx
jtanx / Hong Kong.txt
Created December 28, 2018 05:18
Flag Drawing V1
path-start
stroke-width 1
stroke #ffffff
fill #ffffff
path m 449.96406,299.9134 c -105.26305,-44.48626 -58.60174,-181.58185 42.06956,-174.6907 -20.36609,10.46694 -23.31775,29.99772 -11.68704,48.09021 13.02444,20.2558 -1.19897,52.84856 -18.80577,60.7674 -28.93485,13.02443 -34.72791,47.74999 -11.57675,65.83309 z
path-end
path-start
stroke-width 1
stroke #de2910
@jtanx
jtanx / hilink-12d1-14db.txt
Created December 28, 2018 12:48
Huawei E8372h lsusb verbose output
@jtanx
jtanx / .config
Created December 28, 2018 13:02
A5-V11 config for 'make menuconfig' - NCM, CDC ethernet support, USB ext4 storage support, SQM support, no IPv6, no opkg
#
# Automatically generated file; DO NOT EDIT.
# OpenWrt Configuration
#
CONFIG_MODULES=y
CONFIG_HAVE_DOT_CONFIG=y
# CONFIG_TARGET_sunxi is not set
# CONFIG_TARGET_apm821xx is not set
# CONFIG_TARGET_ath25 is not set
# CONFIG_TARGET_ar71xx is not set
@jtanx
jtanx / clang-format.xt
Created March 11, 2019 20:09
Clang format
"C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: LLVM, UseTab: Always, AccessModifierOffset: -4, IndentWidth: 4, CompactNamespaces: true, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: true, ColumnLimit: 0, TabWidth: 4, PointerAlignment: Left, AlignAfterOpenBracket: DontAlign, BreakBeforeBraces: Custom, BraceWrapping: {AfterClass: true, AfterControlStatement: true, AfterEnum: true, AfterFunction: true, AfterNamespace: false, AfterObjCDeclaration: true, AfterStruct: true, AfterUnion: true, BeforeCatch: true, BeforeElse: true, IndentBraces: false}, BreakConstructorInitializers: BeforeComma}",
@jtanx
jtanx / ggtkwindow.c
Created March 24, 2019 03:16
Minimal GTK custom widget implementation
#include "ggtkwindow.h"
// Define the structure of the type
struct _GGtkWindow
{
GtkLayout parent_instance;
// private data here
// because this is a final type, I don't need to use G_DEFINE_TYPE_WITH_PRIVATE
// and jump through all the hoops that entails. That is required
@jtanx
jtanx / gtk.c
Last active March 26, 2019 09:12
messing around with gtk
#include <gtk/gtk.h>
#include <stdbool.h>
typedef struct ggtkwindow *GGTKWindow;
// GGtkWindow GObject declaration
#define GGTK_TYPE_WINDOW ggtk_window_get_type()
G_DECLARE_FINAL_TYPE(GGtkWindow, ggtk_window, GGTK, WINDOW, GtkLayout)
@jtanx
jtanx / gb12345.txt
Created April 6, 2019 09:32
gb12345 FontForge
# gb12345 based on https://github.com/fontforge/fontforge/blob/35de97a/plugins/gb12345.c
0x0 0x0
0x1 0x1
0x2 0x2
0x3 0x3
0x4 0x4
0x5 0x5
0x6 0x6
0x7 0x7
0x8 0x8