Skip to content

Instantly share code, notes, and snippets.

@jtanx
jtanx / MSYS2 base package creation.md
Last active March 2, 2018 10:13
Creating the MSYS2 base package from scratch

MSYS2 base package

This is one method to create the base package required to bootstrap an msys2 environment. I'm not sure if it's the official way.

Note: You'll have to run this from an existing msys2 installation.

mkdir -p msys64/var/lib/pacman
pacman -r msys64 -Sy base
@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 / comparespline-O1.txt
Last active May 7, 2017 10:04
comparespline dump
^done
(gdb)
&"disas\n"
~"Dump of assembler code for function comparespline:\n"
~" 0xb7824580 <+0>:\tpush %ebp\n"
~" 0xb7824581 <+1>:\tpush %edi\n"
~" 0xb7824582 <+2>:\tmov %eax,%edi\n"
~" 0xb7824584 <+4>:\tpush %esi\n"
~" 0xb7824585 <+5>:\tpush %ebx\n"
~" 0xb7824586 <+6>:\tcall 0xb76a7ac0 <__x86.get_pc_thunk.bx>\n"
@jtanx
jtanx / keybindings.json
Created April 23, 2017 09:33
Visual Studio Code disable MRU tab switching
[
{
"key": "ctrl+shift+tab",
"command": "workbench.action.previousEditor"
},
{
"key": "ctrl+tab",
"command": "workbench.action.nextEditor"
}
]
@jtanx
jtanx / python_web_app_azure_deployment.md
Last active December 30, 2016 14:27
Deploying a Python Web App on Azure

NOTE: For more up-to-date instructions and more explanations, please see the readme of https://github.com/jtanx/isso-azure

Basic instructions

  1. Add a new Web App
  2. Go to https://my-web-app-name.scm.azurewebsites.net and click on Site Extensions
  3. Install the Python 2.7.12 x64 and IIS Manager extensions. Click on Restart site when both are installed.
  4. Under the installed site extensions, click on the play (▶) button for IIS Manager.
  5. Go to the applicationHost.xdt tab
  6. Enter the following contents:
warning: HEAP[fontforge.exe]:
warning: Heap block at 0476DFC8 modified at 047A17C8 past requested size of 337f
8
Program received signal SIGTRAP, Trace/breakpoint trap.
0x76faeeab in ntdll!RtlpNtSetValueKey () from C:\WINDOWS\SYSTEM32\ntdll.dll
(gdb) bt full
#0 0x76faeeab in ntdll!RtlpNtSetValueKey ()
from C:\WINDOWS\SYSTEM32\ntdll.dll
@jtanx
jtanx / formula_installer.rb
Last active July 21, 2016 05:29
homebrew on roids
require "cxxstdlib"
require "exceptions"
require "formula"
require "keg"
require "tab"
require "utils/bottles"
require "caveats"
require "cleaner"
require "formula_cellar_checks"
require "install_renamed"
@jtanx
jtanx / compile.sh
Created April 23, 2016 01:15
GDK transient test
#!/bin/bash
set -ev
gcc -Wall -Werror -pedantic -std=c99 -g `pkg-config --cflags gdk-3.0` gdktransient.c `pkg-config --libs gdk-3.0` -o gdk
./gdk
@jtanx
jtanx / highlighter.ahk
Last active January 2, 2021 18:12
Acrobat DC Highlighter tool
; Set colour Acrobat DC
; Valid x positions: 20, 35, 55, 75, 90, 111, 128, 146
; Valid y positions: 60, 80, 100, 120, 135
SetColour(x, y)
{
If WinExist("Highlighter Tool Properties ahk_class AVL_AVFloating") or WinExist("Highlight Properties ahk_class AVL_AVFloating")
{
WinActivate
WinWaitActive
if !ErrorLevel
@jtanx
jtanx / gist:d62c55137435e85f149c1538bd4924ac
Created March 30, 2016 11:06
Visual Studio 2015 fix missing libcpmt.lib/libcpmtd.lib

This fixes linking when using the v120 toolset.

You will need to download the installation files for Visual Studio 2013. This link should work: https://www.microsoft.com/en-au/download/details.aspx?id=44914 (download the ISO)

Note that you don't have to install Visual Studio 2013.

  1. Extract the contents of D:\packages\vc_libraryDesktop\x86\vc_LibraryDesktopX86.msi and D:\packages\vc_libraryDesktop\x64\vc_LibraryDesktopX64.msi. Use something like the Universal Extractor.
  2. Copy the contents into C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib and C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib\amd64 respectively.