Skip to content

Instantly share code, notes, and snippets.

@eonil
eonil / Helper_EEGLDebugStub.h
Created August 14, 2012 20:00
Generate debugging stubs with OpenGL-ES headers.
// Example usage
// fixed and added some codes
//
#define EEGL_DEBUG_STUB_FUNC_DECORATION static
#define EEGL_DEBUG_STUB_EXCEPT_ERROR {HelperAssertGLError();}
static
void
HelperAssertGLError()
@eonil
eonil / Oracle 11g XE on CentOS 6 Pitfalls
Created November 6, 2013 00:10
Oracle 11g XE on CentOS 6 Pitfalls
# Don't trust the fucking manual about minimum requirements.
# You always need 2GB of *swap* space at least and 512MB physical RAM.
# Maybe server can run with less resources, but it fails to create initial database.
# So don't expect it to run on low-end machine.
# Configure hostname properly... Oracle fails if it cannot find the server using hostname.
# Example.
echo "127.0.0.1 oracle11g.local"
# Install requirements properly. Especially, 'bc' is undocumented dependency.
# Ubuntu 12.04 LTS Clang3.3 + libc++
# ==================================
# Do not use old Clang 3.0 for bootstrapping...
# which does not work.
# Perl is required in some LLVM build processes.
set -e
# apt-get sometimes exits with non-zero code even it installed successfully.
# And that makes script to halt. This is nonsense and ridiculous!
@eonil
eonil / gist:eee843700cb271029734
Last active August 29, 2015 14:06
Git How-To

Swift Note

Swift Note #1

@eonil
eonil / gist:1eb1fd993aad2f275f21
Last active August 29, 2015 14:09
Rust Notes

Rust Notes

This Gist is just a note of my current personal understanding, and does not define or claim the actual Rust behaviors. Always can be wrong, and may contain some errors. Do not rely on this information if you're learning Rust.

UIKit Note

Autolayout

  • If you want self-sizing view by its subviews, just do not set its sizing constraint. Then it will become the

LLVM Note

Address Sanitizer Support

@eonil
eonil / gist:4a457009cc8ac2ca9cb7
Last active August 29, 2015 14:12
Unicode Note

Unicode Note

The core part of Unicode is Unicode Scalar Value. This represents core component to build a Unicode text. Also provides most reliable unit to process text data.

Unicode Scalar Value is equal to Code Point except surrogate pairs.

Code Unit is a component of each encoding algorithm. Defined differently by the encodings.

Grapheme Cluster smallest unit to represent human recgonizable symbol.

@eonil
eonil / gist:1aa12ecacf1a4b2566fe
Last active October 31, 2021 12:35
Cocoa Note

Cocoa Note (including AppKit)

  • NSLayoutManager.setTemporaryAttributes(:forCharacterRange:) is far faster than NSTextStorage.setAttributes(:range:). On My iMac, former took about 2 seconds, and latter took about 17 seconds in optimised build of test suit.

  • Anyway, modifying NSTextStorage also took 2 seconds when wrapped by beginEditing/endEditing pair. So this performance drop is mainly due to inefficient layout refresh. You will get same performance