Skip to content

Instantly share code, notes, and snippets.

View yeonsh's full-sized avatar

Seunghoon Yeon yeonsh

View GitHub Profile
from Foundation import *
from AppKit import *
from PyObjCTools import AppHelper
start_time = NSDate.date()
class MyApplicationAppDelegate(NSObject):
state = 'idle'
@yeonsh
yeonsh / libssh2-build-steps.rst
Created September 15, 2022 09:36 — forked from jpluimers/libssh2-build-steps.rst
Building `libssh2` for Windows (Win32/Win64) is a lot harder than I hoped for
@yeonsh
yeonsh / DateProgress.scriptable
Last active January 31, 2021 08:42 — forked from SDuck4/DateProgress.js
Date Progress - Progress bar widget for days, weeks, months and years
/**
* Date Progress - Progress bar widget for days, weeks, months and years
* - This widget run by Scriptable(https://scriptable.app).
* - This widget is optimized for 4x2 size.
* - Author: SDuck (https://twitter.com/sduck4)
* - Source: https://gist.github.com/SDuck4/a655230ec214083e432566a84e24c5f8
*
* Parameters:
* - Each parameter is separated by `|`(vertical bar) and must be entered in the following order.
* - If you do not use the parameters, you can skip them.
@yeonsh
yeonsh / Capture OpenGL ES View as an Image
Created January 30, 2011 21:27
Capture OpenGL ES View as an Image
- (UIImage*)snapshot:(UIView*)eaglview
{
// Get the size of the backing CAEAGLLayer
GLint backingWidth, backingHeight;
glBindRenderbufferOES(GL_RENDERBUFFER_OES, _colorRenderbuffer);
glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &backingWidth);
glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &backingHeight);
NSInteger x = 0, y = 0, width = backingWidth, height = backingHeight;
NSInteger dataLength = width * height * 4;
@yeonsh
yeonsh / # neovim - 2016-03-23_07-30-45.txt
Created March 22, 2016 22:35
neovim (neovim/neovim/neovim) on OS X 10.11.3 - Homebrew build logs
Homebrew build logs for neovim/neovim/neovim on OS X 10.11.3
Build date: 2016-03-23 07:30:45
sudo pip install virtualenv-clone --upgrade
@yeonsh
yeonsh / gist:6833951
Created October 4, 2013 22:32
OS X Mavericks GM Seed로 업데이트한 후
stevedore.extension Could not load 'user_scripts': virtualenv-clone
stevedore.extension virtualenv-clone
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/stevedore/extension.py", line 89, in _load_plugins
invoke_kwds,
File "/usr/local/lib/python2.7/site-packages/stevedore/extension.py", line 101, in _load_one_plugin
plugin = ep.load()
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/distribute-0.6.40-py2.7.egg/pkg_resources.py", line 2030, in load
if require: self.require(env, installer)
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/distribute-0.6.40-py2.7.egg/pkg_resources.py", line 2043, in require
@yeonsh
yeonsh / gist:5791444
Last active December 18, 2015 13:39
Find file path of system font on OS X
...
NSLog(@"%@", [self getSystemFontPath:18]);
NSLog(@"%s", [self getSystemFontPathCString:18]);
...
- (const char *)getSystemFontPathCString:(CGFloat)argFontSize
{
NSString *path = [self getSystemFontPath:argFontSize];
const char *path_cstring = [path cStringUsingEncoding:[NSString defaultCStringEncoding]];
return path_cstring;
@yeonsh
yeonsh / listdir.py
Created January 25, 2013 04:48
List directories only under given directory
import os
dir = []
def listDirectory(directory):
for f in os.listdir(directory):
path0 = os.path.join(directory, f)
if os.path.isdir(path0):
dir.append(path0)
listDirectory(path0)
@yeonsh
yeonsh / gist:962129
Created May 9, 2011 06:09
Change UINavigationBar Button Color
for (UIView *view in self.navigationController.navigationBar.subviews) {
NSLog(@"%@", [[view class] description]);
LOG_EXPR([[view class] description]);
if ([[[view class] description] isEqualToString:@"UINavigationButton"]) {
[(UINavigationButton *)view setTintColor:[UIColor brownColor]];
}
}