Skip to content

Instantly share code, notes, and snippets.

Avatar

Ohgyun Ahn ohgyun

View GitHub Profile
View 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 Jun 18, 2019
꿀벌개발일지 검색 알프레드
View oh.py
#!/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 Sep 28, 2018
Jupyter notebook template
View notebook.tpl
{%- 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 Feb 3, 2018 — forked from ayastreb/webpack.config.js
Build Chrome Extension with React using Webpack
View webpack.config.js
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 Oct 8, 2015 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.
View what-forces-layout.md

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 Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View 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 Apr 23, 2014
트렐로 추정 시간 표시
View trello.point.js
(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 Apr 3, 2014
초성 비교 (초성과 완성된 문자열을 비교한다)
View isChosungMatch.js
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
// 쿼리가 없으면 모두 매칭했다고 본다
View installation.sh
# 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
You can’t perform that action at this time.