Skip to content

Instantly share code, notes, and snippets.

View pokehanai's full-sized avatar

HANAI Tohru pokehanai

  • Pokelabo Inc.
  • Fukuoka, Japan
View GitHub Profile
@pokehanai
pokehanai / 30-markdown-mode.el
Created July 22, 2016 09:35
Emacs config for markdown-mode with orgtbl-mode
(use-package markdown-mode
:defer t
:commands (org-table-begin org-table-end orgtbl-mode)
:config
(progn
(require 'org-table)
(eval-when-compile
(require 'whitespace))
(defun advice:org-table-align:markdown ()
@pokehanai
pokehanai / Makefile
Created February 10, 2017 02:19
Makefile for building Unity3d C# managed DLL on Mac
# Boilarplate: Makefile for building Unity3d C# managed DLL on Mac
#
# [Usage]
# If Unity is installed in the default directory /Applications/Unity/Unity.app, simply:
# $ make
# Or either:
# $ UNITY_NAME=UnityXXX make
# $ UNITY_DIR=/Applications/UnityXXX/UnityYYY.app make
#
# [library directory layout]
@pokehanai
pokehanai / normalize_image_orientation.m
Last active November 11, 2018 08:12
image orientation correction
// simple but not performance wise
- (UIImage *)normalizeImageOrientation:(NSString *)path {
UIImage *image = [UIImage imageWithContentsOfFile:path];
if (image.imageOrientation != UIImageOrientationUp) {
CGSize size = image.size;
UIGraphicsBeginImageContext(size);
[image drawInRect:CGRectMake(0, 0, size.width, size.height)];
image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();