Skip to content

Instantly share code, notes, and snippets.

Avatar

Seunghoon Yeon yeonsh

View GitHub Profile
@yeonsh
yeonsh / DateProgress.scriptable
Last active Jan 31, 2021 — forked from SDuck4/DateProgress.js
Date Progress - Progress bar widget for days, weeks, months and years
View DateProgress.scriptable
/**
* 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 / # neovim - 2016-03-23_07-30-45.txt
Created Mar 22, 2016
neovim (neovim/neovim/neovim) on OS X 10.11.3 - Homebrew build logs
View # neovim - 2016-03-23_07-30-45.txt
Homebrew build logs for neovim/neovim/neovim on OS X 10.11.3
Build date: 2016-03-23 07:30:45
View How to retrieve menubar icon position using pyObjC (From OS X 10.10)
from Foundation import *
from AppKit import *
from PyObjCTools import AppHelper
start_time = NSDate.date()
class MyApplicationAppDelegate(NSObject):
state = 'idle'
@yeonsh
yeonsh / gist:f900fd820e3d0d23b142
Created Sep 11, 2015
cmake --help-policy CMP0042 (About @rpath)
View gist:f900fd820e3d0d23b142
$ cmake --help-policy CMP0042
CMP0042
-------
``MACOSX_RPATH`` is enabled by default.
CMake 2.8.12 and newer has support for using ``@rpath`` in a target's install
name. This was enabled by setting the target property
``MACOSX_RPATH``. The ``@rpath`` in an install name is a more
flexible and powerful mechanism than ``@executable_path`` or ``@loader_path``
@yeonsh
yeonsh / $ brew install $(brew deps owncloud-client)
Created Sep 11, 2015
$ brew install $(brew deps owncloud-client)
View $ brew install $(brew deps owncloud-client)
$ brew install $(brew deps owncloud-client)
Warning: cmake-3.3.1 already installed
Warning: pkg-config-0.28 already installed
==> Downloading https://homebrew.bintray.com/bottles/d-bus-1.8.20.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring d-bus-1.8.20.yosemite.bottle.tar.gz
==> /usr/local/Cellar/d-bus/1.8.20/bin/dbus-uuidgen --ensure=/usr/local/var/lib/dbus/machine-id
==> Caveats
To have launchd start d-bus at login:
ln -sfv /usr/local/opt/d-bus/*.plist ~/Library/LaunchAgents
@yeonsh
yeonsh / gist:811a32f4af42ee98578f
Created Apr 10, 2015
Change log format to make it conform to Linux g++ rules.
View gist:811a32f4af42ee98578f
import os
import re
regex = re.compile(r"(.*)(GLOG[A-Z]*\([A-Z]+::[A-Z_]+\s*,\s*)(__FUNCTION__)\s*(\")([^\"]+\")(\s*,\s*.*){0,1}(\s*\)\s*;){0,1}")
def test_code():
s=[]
s.append(' GLOGNOFLA(LOGLEVEL::LL_DEBUG, __FUNCTION__ " toSign [%s]");')
s.append(' GLOGNOFLA(LOGLEVEL::LL_DEBUG, __FUNCTION__ " toSign [%s]", toSign.c_str());')
s.append('GLOGNOFLA(LOGLEVEL::LL_ERROR, __FUNCTION__ " failed(%s) : %s", rtn.curlerror.c_str(), curl->GetLastURL().c_str());')
View gist:4b3e59d3fc2fdb21c122
import logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
# create a file handler
handler = logging.FileHandler('hello.log')
handler.setLevel(logging.INFO)
@yeonsh
yeonsh / tour_of_go_answers
Last active Aug 29, 2015
Tour of Go exercise solutions
View tour_of_go_answers
// #38
package main
import "code.google.com/p/go-tour/pic"
func Pic(dx, dy int) [][]uint8 {
board := make([][]uint8, dx)
for i := 0; i < dx; i++ {
board[i] = make([]uint8, dy)
View getting-started-1
iex> 1 # integer
iex> 0x1F # integer
iex> 1.0 # float
iex> :atom # atom / symbol
iex> {1,2,3} # tuple
View gist:9438424
@SuppressLint("NewApi")
@SuppressWarnings("unchecked")
public static void executeTaskInParallel(@SuppressWarnings("rawtypes") AsyncTask task, Bundle params) {
if (MyUtil.hasHoneycomb()) {
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, params);
} else {
task.execute(params);
}
}