Skip to content

Instantly share code, notes, and snippets.

View vbalien's full-sized avatar
🇰🇷

엘련(Jisu Kim) vbalien

🇰🇷
View GitHub Profile

엘련의 Atom에디터 설정

이 설정은 엘련 개인의 설정이며 이 설정을 누구든지 사용해도 좋으나, 이 설정을 사용함으로서 생기는 문제에 대해선 책임지지 않습니다.

@vbalien
vbalien / guess_encoding.py
Last active May 9, 2016 17:59
문자 byte배열 인코딩 타입 추측
def guess_encoding(text):
guess_list = ['euc-kr', 'utf-8', 'utf-16']
for best_enc in guess_list:
try:
str(text, best_enc, "strict")
except UnicodeDecodeError:
pass
else:
break
return best_enc
<?php
$descriptorspec = array(
0 => array("pipe", "r"), // stdin 스트림
1 => array("pipe", "w"), // stdout 스트림
2 => array("file", "/tmp/error-output.txt", "a") // stderr 스트림 -> 파일로 씀
);
$cwd = '/tmp'; // 실행할 디렉터리
// $env = array('some_option' => 'aeiou'); // 변수 설정
std::wstring utf8_to_utf16(const std::string& utf8)
{
std::vector<unsigned long> unicode;
size_t i = 0;
while (i < utf8.size())
{
unsigned long uni;
size_t todo;
bool error = false;
unsigned char ch = utf8[i++];
@vbalien
vbalien / .bash_profile
Last active December 11, 2015 07:55
add library path
# Mac
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/your/path/lib
# Linux
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/your/path/lib
@vbalien
vbalien / change_current_dir_to_app_resource.cpp
Created December 11, 2015 03:09
using compile flag ' -framework CoreFoundation'
#ifdef __APPLE__
#include "CoreFoundation/CoreFoundation.h"
#endif
#include <iostream>
int main() {
#ifdef __APPLE__
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle);
@charset "utf-8";
@import url(http://fonts.googleapis.com/earlyaccess/nanumgothic.css);
*
{
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
@vbalien
vbalien / .vimrc
Created October 23, 2015 09:00
my .vimrc setting
set cindent
set tabstop=4
set shiftwidth=4
set nu
set ruler
set title
set hlsearch
syntax on
@vbalien
vbalien / my_html_base.html
Created October 23, 2015 08:57
html base
<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8">
<meta name="description" content="My Description">
<meta http-equiv="imagetoolbar" content="no">
<meta http-equiv="X-UA-Compatible" content="IE=10,chrome=1">
<meta name="viewport" content="user-scalable=no, initial-scale=1.0,maximum-scale=1.0, minimum-scale=1.0, width=device-width" />
<title>Title</title>
<link rel="stylesheet" type="text/css" href="/css/common.css">
Scanner scan = new Scanner(System.in);
// Desktop 지원 여부 체크
if(Desktop.isDesktopSupported())
{
Desktop.getDesktop().browse(new URI(
"http://search.naver.com/search.naver?where=nexearch&query=" +
URLEncoder.encode(scan.next(), "UTF-8") + // URL 인코딩
"&sm=top_hty&fbm=2&ie=utf8"));
}