Skip to content

Instantly share code, notes, and snippets.

View deptno's full-sized avatar
:octocat:
midnight coding

Bonggyun Lee deptno

:octocat:
midnight coding
View GitHub Profile
@deptno
deptno / map_load_after.js
Created August 20, 2014 01:45
dynamic reload for sugar logics
/**
* Created by deptno on 2014. 8. 11..
*/
//define(["require", "exports", "text!product_name", "env/config"], function(require, exports, __PRODUCT_NAME__, __CONFIGURATOR__) {
require(["text!product_name", "env/config"], function(__PRODUCT_NAME__, __CONFIGURATOR__) {
var __config__;
require([
"env/conf_" + __PRODUCT_NAME__.toLowerCase(),
"text!product/" + __PRODUCT_NAME__.toLowerCase() + "/data.json"
], function(__OWN_CONFIG__, __OWN_DATA__) {
@deptno
deptno / css_resources.md
Last active August 29, 2015 14:08 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@deptno
deptno / post.js
Last active August 29, 2015 14:19
create .md file, post to jekyll with metadata template in terminal
#!/usr/bin/env node
var __config = { /* author: deptno@gmail.com */
path_root: '/Users/deptno/Workspace/github/deptno.github.io',
path_post: '_posts',
cmd_editor: 'mvim',
ext: '.md'
};
if (process.argv.length < 3) {
console.log(' * configure: $ ' + __config.cmd_editor + ' ' + process.argv[1]);
@deptno
deptno / .vimrc
Created April 21, 2015 12:57
.vimrc [osx]
set autoindent " 자동으로 들여쓰기를 한다.
set cindent " C 프로그래밍을 할때 자동으로 들여쓰기를 한다.
set smartindent " 좀더 똑똑한 들여쓰기를 위한 옵션이다.
"set textwidth=79 " 만약 79번째 글자를 넘어가면
set wrap " 자동으로 를 삽입하여 다음 줄로 넘어간다.
set nowrapscan " 검색할 때 문서의 끝에서 다시 처음으로 돌아가지 않는다.
set nobackup " 백업 파일을 만들지 않는다.
set visualbell " 키를 잘못눌렀을 때 삑 소리를 내는 대신 번쩍이게 한다.
set ruler " 화면 우측 하단에 현재 커서의 위치(줄,칸)를 보여준다.
set shiftwidth=4 " 자동 들여쓰기를 할때 4칸 들여쓰도록 한다.
@deptno
deptno / head.js
Created April 23, 2015 20:49
[js] request HEAD
if (!jQuery) {
throw 'need jQuery';
}
!(function(url, header) {
$.ajax({
type: 'head',
url: url,
headers: header,
success: function(str, num, xhr) {
console.log('success');
@deptno
deptno / mds_ts_restamper.js
Last active August 29, 2015 14:22
[MDS] ts restamper
#!/usr/bin/env node
// @source ts folder, target folder, start today, delete based utc
var pathSrc = 'E:/MDS_1.6/transport_streams';
var pathDst = 'U:/DTG'
var startToDay = false;
var deleteBasedUtc = false;
var spawn = require('child_process').spawn;
var execSync = require('child_process').execSync;
!function(msec, count) {
function tcafe(msec) {
function simulateKeyPress(character, element) {
var e = $.Event('keypress');
e.which = 13;
$(element).trigger(e);
}
var text = $('#tzStr').text()
var target = $(".ment_show")[0];
var i = 0;
@deptno
deptno / test.html
Last active September 25, 2015 16:38
Test html bolilerplate with requirejs
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.20/require.js" data-main="test.js"></script>
<script></script>
<title>Test</title>
</head>
<body>
@deptno
deptno / jekyll_new_post.js
Created January 3, 2016 07:14
jekyll snippet for atom
!function() {
var workspace = atom.workspace;
var editor = workspace.getActiveTextEditor();
var date = (new Date(Date.now() - (new Date()).getTimezoneOffset() * 60000)).toISOString().slice(0,-1);
var text = [
'---',
'layout: post',
'title: ',
'excerpt: ',
'category: draft',
@deptno
deptno / change_file_name.js
Created February 28, 2016 13:04
change files name
const fs = require('fs');
var dirs = fs.readdirSync(__dirname);
var regexp = /[0-9-]+-(.+)/;
dirs.forEach(function(file) {
var stat = fs.lstatSync(file);
if (stat && !stat.isDirectory()) {
if (regexp.test(file)) {
var newName = file.replace(regexp, "$1");