Skip to content

Instantly share code, notes, and snippets.

@sooop
sooop / strupr.h
Last active December 12, 2015 12:09
strupr 함수는 윈도용 c 컴파일러에만 포함되어 있음. mac 용으로 대체 함수 추가.
/* strupr : make uppercase string. exist in win32 c includes but not in mac's one */
#include <ctype.h> // for toupper()
void strupr(char *origin) { while(*origin != '\0') *origin = toupper(*origin++); }
@sooop
sooop / .vimrc
Last active December 14, 2016 07:56
Just My $VIMRC
"===============================================================================
"FILE: myvimrc
"CREATED BY: sooop
"LAST UPDATEd: 2014. 04. 23.
"DESCRIPTION:
" my vimrc settting
" github repository : https://github.com/sooop/myvimrc.git
"===============================================================================
@sooop
sooop / mkTable.vim
Last active April 14, 2016 10:46
# mkTable vim script for making HTML Table
"""" remove empty lines
function! remove_empty_lines()
execute "%g/^[ \t\s]*$/normal dd"
endfunction
"" function to embrace line with tag.
function! embrace_tag(el)
call setline(line('.'), "<".a:el.">".getline('.')."</".a:el.">")
"""" call : call a function
"""" setline > set given line to text.
@sooop
sooop / memoUtils.js
Created February 13, 2013 13:58
memoUtils.js
/* memoUtils.js */
var ls = null;
var docs = new Array();
var keys = new Array();
var currentDoc = null;
var getStorage = function()
{
@sooop
sooop / enablejQuery.js
Created February 13, 2013 15:03
enable jQuery - the bookmarklet
javascript:
(function(){
var v = '1.9.1';
if (window.jQuery == undefined || window.jQuery.fn.jquery <; v) {
var done = false;
var script = document.createElement("script");
script.src = "http://ajax.googleapis.com/ajax/libs/jquery/"+v+"/jquery.min.js";
document.getElementsByTagName("head")[0].appendChild(script);
script.onload = script.onreadystatechange =
function(){
@sooop
sooop / checkURL.py
Created February 14, 2013 14:16
getpage.py : connect some URL and print html source
#!/usr/bin/python
#-*-coding:utf-8
import urllib
import sys
def printHTML():
if len(sys.argv) < 2:
print("usage checkURL.py http://some.site.addr")
exit(1)
@sooop
sooop / markdown.css
Created February 15, 2013 02:30
css for markdown preview
html { font-size: 88%; overflow-y: scroll; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
body{
color:#444;
font-family:Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman',
"Hiragino Sans GB", "STXihei", "微软雅黑", "바탕체", serif;
font-size:88%;
line-height:1.5em;
background:#fefefe;
width: 45em;
@sooop
sooop / hangulSound.js
Created February 15, 2013 06:48
한글 초/중/종성을 구하는 자바스크립트 함수
/**
초성 중성 종성 분리 하기
유니코드 한글은 0xAC00 으로부터
초성 19개, 중상21개, 종성28개로 이루어지고
이들을 조합한 11,172개의 문자를 갖는다.
한글코드의 값 = ((초성 * 21) + 중성) * 28 + 종성 + 0xAC00
(0xAC00은 'ㄱ'의 코드값)
@sooop
sooop / HangulSound.h
Last active March 8, 2021 09:22
[Objective-C] 한글 초성, 중성, 종성을 분리해주는 클래스
//
// hangulSound.h
// firstcode
//
// Created by sooop on 12. 1. 31..
// Copyright (c) 2012년 soooprmx.com All rights reserved.
//
#import <Foundation/Foundation.h>
@sooop
sooop / metaWeblog.py
Last active December 13, 2015 22:48
MetaWeblog API Wrapper for python
#!/usr/local/bin/python
#filename:metaWeblog
'''
MetaWeblog API wrapper for python
Copyright 2013. All right reserved to sooop.
'''
import xmlrpclib