Skip to content

Instantly share code, notes, and snippets.

View ohgyun's full-sized avatar

Ohgyun Ahn ohgyun

View GitHub Profile
@ohgyun
ohgyun / Makefile
Created April 25, 2019 13:28 — forked from isaacs/Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@ohgyun
ohgyun / oh.py
Last active June 18, 2019 06:21
꿀벌개발일지 검색 알프레드
#!/usr/bin/python
# encoding: utf-8
import sys
import os
from workflow import Workflow3, web
reload(sys)
sys.setdefaultencoding("utf-8")
@ohgyun
ohgyun / notebook.tpl
Created September 28, 2018 16:13
Jupyter notebook template
{%- extends 'basic.tpl' -%}
{%- block header -%}
<!DOCTYPE html>
<html>
<head>
{%- block html_head -%}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no,target-densitydpi=medium-dpi,viewport-fit=cover">
<meta name="format-detection" content="telephone=no,address=no,email=no"/>
@ohgyun
ohgyun / webpack.config.js
Created February 3, 2018 18:35 — forked from ayastreb/webpack.config.js
Build Chrome Extension with React using Webpack
const path = require('path')
const webpack = require('webpack')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
module.exports = {
// Entry files for our popup and background pages
entry: {
popup: './src/popup.js',
@ohgyun
ohgyun / what-forces-layout.md
Created October 8, 2015 06:30 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@ohgyun
ohgyun / 0_reuse_code.js
Last active August 29, 2015 14:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ohgyun
ohgyun / README.md
Last active August 29, 2015 14:10 — forked from evandrix/README.md

Here are a list of headless browsers that I know about:

  • [HtmlUnit][1] - Java. Custom browser engine. JavaScript support/DOM emulated. Open source.
  • [Ghost][2] - Python only. WebKit-based. Full JavaScript support. Open source.
  • [Twill][3] - Python/command line. Custom browser engine. No JavaScript. Open source.
  • [PhantomJS][4] - Command line/all platforms. WebKit-based. Full JavaScript support. Open source.
  • [Awesomium][5] - C++/.Net/all platforms. Chromium-based. Full JavaScript support. Commercial/free.
  • [SimpleBrowser][6] - .Net 4/C#. Custom browser engine. No JavaScript support. Open source.
  • [ZombieJS][7] - Node.js. Custom browser engine. JavaScript support/emulated DOM. Open source.
  • [EnvJS][8] - JavaScript via Java/Rhino. Custom browser engine. JavaScript support/emulated DOM. Open source.
@ohgyun
ohgyun / trello.point.js
Created April 23, 2014 07:57
트렐로 추정 시간 표시
(function () {
var rPoint = /\[([0-9.]+)\]/g;
$('.list').each(function (i, list) {
var $title = $(list).find('.list-card-title:visible');
var total = 0;
$title.each(function (j, title) {
var str = $(title).text();
while (rPoint.test(str)) {
@ohgyun
ohgyun / isChosungMatch.js
Created April 3, 2014 06:54
초성 비교 (초성과 완성된 문자열을 비교한다)
function isChosungMatch(query, target) {
var lq = query.length; // length of query
var lt = target.length; // length of target
var ldiff = lt - lq; // length diff
var it = 0; // index of target
var iq = 0; // index of query
var cq; // character of query
var ct; // character of target
// 쿼리가 없으면 모두 매칭했다고 본다
# NOTICE: to get Nginx+Unicorn best-practices configuration see the gist https://gist.github.com/3052776
$ cd /usr/src
$ wget http://nginx.org/download/nginx-1.2.1.tar.gz
$ tar xzvf ./nginx-1.2.1.tar.gz && rm -f ./nginx-1.2.1.tar.gz
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz
$ tar xzvf pcre-8.30.tar.gz && rm -f ./pcre-8.30.tar.gz
$ wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz