Skip to content

Instantly share code, notes, and snippets.

Jeremy Tan jtanx

Block or report user

Report or block jtanx

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jtanx
jtanx / CustomInstallPath.cmake
Created Aug 3, 2019
Custom library install path for MacOS and CMake
View CustomInstallPath.cmake
# Suppose under certain circumstances you want to set the library path explicitly to something, but
# in the usual case, you would like it to remain as an rpath.
# This adds a variable to the install script that can be overridden
install(CODE "
if(NOT DEFINED CUSTOM_LIBRARY_PREFIX)
set(CUSTOM_LIBRARY_PREFIX \"@rpath\")
endif()
")
set_property(TARGET my_target PROPERTY INSTALL_NAME_DIR "\${CUSTOM_LIBRARY_PREFIX}")
@jtanx
jtanx / makecombiners.h
Created Jul 21, 2019
Combiners parsing for combiners.h
View makecombiners.h
#!/usr/bin/env python3
import sys,os,re
# http://www.unicode.org/reports/tr44/#Canonical_Combining_Class_Values
COMBIN = {
0x000: '0',
0x001: 'FF_UNICODE_Overstrike',
0x202: 'FF_UNICODE_Below|FF_UNICODE_Touching',
0x214: 'FF_UNICODE_Above|FF_UNICODE_Touching',
@jtanx
jtanx / gb12345.txt
Created Apr 6, 2019
gb12345 FontForge
View gb12345.txt
# 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
@jtanx
jtanx / ggtkwindow.c
Created Mar 24, 2019
Minimal GTK custom widget implementation
View ggtkwindow.c
#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 Mar 26, 2019
messing around with gtk
View gtk.c
#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)
View clang-format.xt
"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 / README.md
Last active Dec 31, 2018
Partial OpenWRT NB604N support
View README.md

Partial NB604N support

Mostly works, but I can't get changes to persist to flash, so settings are lost on reboot. Looking in dmesg there's some jffs2 issues that I can't work out.

Use the brcmsmac driver for wireless support, delete all references to the b43 driver, or you will end up with at best only 802.11g support instead of 802.11n.

Updating the flash via LuCi also doesn't work, I always have to use the CFE web updater instead.

See also NB604N on OpenWRT wiki

View 0001-Add-Huawei-alt-mode-support.patch
From 7b33451b684c5c2703ee8ff9a523c8384337eaa0 Mon Sep 17 00:00:00 2001
From: Jeremy Tan <jtanx@outlook.com>
Date: Thu, 27 Dec 2018 20:28:27 +0800
Subject: [PATCH] Add Huawei alt mode support
diff --git a/convert-modeswitch.pl b/convert-modeswitch.pl
index b1530bd..33f123b 100755
--- a/convert-modeswitch.pl
+++ b/convert-modeswitch.pl
@jtanx
jtanx / .config
Created Dec 28, 2018
A5-V11 config for 'make menuconfig' - NCM, CDC ethernet support, USB ext4 storage support, SQM support, no IPv6, no opkg
View .config
#
# 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 / hilink-12d1-14db.txt
Created Dec 28, 2018
Huawei E8372h lsusb verbose output
View hilink-12d1-14db.txt
You can’t perform that action at this time.