Skip to content

Instantly share code, notes, and snippets.

@sooop
sooop / _vimrc.vim
Last active December 21, 2015 08:38
my vimrc for windows
""settings for comportable use
set nocp
set bs=2
""set visualbell
set showmatch
""Character encoding and GUI Font settings
"""" set encoding to UTF-8
set enc=utf-8
set fenc=utf-8
@sooop
sooop / emmetTextarea.js
Created August 30, 2013 06:26
make TEXTAEAR into emmit-enabled html editor
//javascript:
;
(function() {
function _initTextArea() {
emmet.require('textarea').setup({
pretty_break: true,
use_tab: true
});
console.log('ready');
@sooop
sooop / clear-all-cookies.js
Last active February 24, 2016 07:41
clear all cookies : 모든 쿠키 삭제하기
;(function(){
var ok = confirm("Clear All Cookies, proceed?");
if(ok) clearCookies();
function clearCookies ()
{
var a,b,c,d,e,f,g;
a = document.cookie.split(';').map(function(e){return e.trim();});
g = new Date(new Date().getTime() - 1e11).toUTCString();
for(b=0;b<a.length;b++) {
@sooop
sooop / fill_empty_cell.vba
Last active December 24, 2015 01:29
Excel VBA Routines
Sub FillEmptyCell()
' Fill empty cell with specified string to selection
Dim str As String
str = InputBox("Enter the string", ,"&nbsp;")
For Each Cell In Selection
If IsEmpty(Cell) Then Cell.Value = str
Next
End Sub
@sooop
sooop / UICheckGestureRecognizer.m
Created October 16, 2013 02:23
체크 마크를 인식하는 UIGestureRecognizer 서브클래스
#import <UIKit/UIGestureRecognizerSubclass.h>
// Implemented in your custom subclass
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[super touchesBegan:touches withEvent:event];
@sooop
sooop / DBInterface.h
Last active December 25, 2015 18:19
SQLite3 - iOS Sample
#import <Foundation/Foundation.h>
@interface DBInterface : NSObject
-(id)initWithDataBaseFilename:(NSString*)databaseFilename;
-(NSArray *)searchWithKeyword:(NSString *)keyword;
-(void)updateRecordWithName:(NSString *)name description:(NSString*)description atID:(int)recordID;
@end
@sooop
sooop / test.m
Created October 20, 2013 13:44
NSScanner 사용법
#import <Foundation/Foundation.h>
int main(int argc, const char *argv[]) {
@autoreleasepool{
NSString *str = @"Person::first:last:123";
NSScanner *sc = [NSScanner scannerWithString:str];
[sc setCharactersToBeSkipped:[NSCharacterSet characterSetWithCharactersInString:@":"]];
NSString *a, *b;
b = [[NSString alloc] init];
@sooop
sooop / PXHashTable.c
Last active December 26, 2015 09:29
해시 테이블 구현
/*
* file: PXHashTable.c
* HashTable Definition File
* by sooop
* 2013. 10. 24.
*
*/
#include "PXHashTable.h"
@sooop
sooop / mylib.c
Created November 14, 2013 15:39
Create C implemented Python Module (using c api)
#include "Python.h"
static PyObject* _sayHello(PyObject *self)
{
return Py_BuildValue("s", "Hello World!");
}
static PyMethodDef methods[] = {
{"sayHello", _sayHello, METH_NOARGS, NULL},
@sooop
sooop / gets.py
Created January 15, 2014 05:12
get install script of setuptools, pip
#!C:/pypy/pypy.exe
import urllib2
def main():
# get ezsetup.py
e_url = "https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py"
u = urllib2.urlopen(e_url)
with open('ez_setup.py','w') as f:
f.write(u.read().encode('utf-8'))