Skip to content

Instantly share code, notes, and snippets.

@Gyubin
Gyubin / cltools.sh
Created Nov 26, 2017 — forked from justinbellamy/cltools.sh
Install Autoconf and Automake on OS X El Capitan
View cltools.sh
#!/bin/sh
##
# Install autoconf, automake and libtool smoothly on Mac OS X.
# Newer versions of these libraries are available and may work better on OS X
#
# This script is originally from http://jsdelfino.blogspot.com.au/2012/08/autoconf-and-automake-on-mac-os-x.html
#
export build=~/devtools # or wherever you'd like to build
@Gyubin
Gyubin / multiply3OrPlus5.js
Created Dec 30, 2015
1부터 시작해서 3을 곱하거나, 5를 더해서 특정 수를 만들 수 있느냐. 재귀 활용.
View multiply3OrPlus5.js
// from Eloquent JavaScript book source
function findSolution(target) {
function find(start , history) {
if (start == target)
return history;
else if (start > target)
return null;
else
return find(start + 5, "(" + history + " + 5)") ||
@Gyubin
Gyubin / re_test.py
Last active Nov 26, 2015
Python 정규표현식 search, grouping
View re_test.py
import re
NUM = 0
def re_test(url):
result = re.search("((\w+)\.)+", url)
return result.group(NUM) if result else None
print(re_test("abc.def.ghi."))
# NUM 값에 따른 출력 결과
# 0일 때: abc.def.ghi.
@Gyubin
Gyubin / on_event.js
Created Sep 27, 2015
jQuery DOM 로딩 후 이벤트 핸들러 달기
View on_event.js
// It doesn't work.
$('.item').click(function() {
$(this).remove();
});
// Use .on()
$(document).on('click', '.item', function() {
$(this).remove();
});
View rbenv_install_ubuntu
# 기본 라이브러리 설치
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
# rbenv git으로 받아오기
cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
View ubuntu_server_libraries
출처: ROR Lab, http://rorlab.gitbooks.io/railsguidebook/content/appendices/ubuntu14server.html
# 시스템 업데이트
ubuntu@ubuntu-VirtualBox:~$ sudo apt-get update
# 시스템에 한국어 설치 -> 이 부분은 내 데스크탑에서 한글이 깨져서 안했다.
ubuntu@ubuntu-VirtualBox:~$ sudo apt-get install language-pack-ko language-pack-ko-base -y
ubuntu@ubuntu-VirtualBox:~$ sudo vi /etc/default/locale
LANG="ko_KR.UTF-8"
LANGUAGE="ko_KR:ko:en_US:en"
View ubuntu_grub_setting.txt
sudo grup-install /dev/sda
sudo grup-install --recheck /dev/sda (신중히)
sudo apt-get install grub-pc
sudo apt-get upgrade-from-grub-legacy
from HELLO, SORAPPANG Blog: https://hellosorappang.wordpress.com/tag/ubuntu-14-04/
@Gyubin
Gyubin / commu.py
Last active Aug 29, 2015
자바스크립트로 동작하는 버튼이 있을 때 다음 페이지로 가는 방식을 구현한 scrapy spider, 네이버 지식쇼핑 다음페이지 숫자 링크 클릭할 때 동작하는 스크립트
View commu.py
#출처: https://ide.c9.io/redapple/so_18810850
from scrapy.spider import BaseSpider
from scrapy.http import Request, FormRequest
from scrapy.selector import HtmlXPathSelector
from scrapy.contrib.spiders import Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
class MySpider(BaseSpider):
name = "commu"