Skip to content

Instantly share code, notes, and snippets.

View drypot's full-sized avatar

Kyuhyun Park drypot

View GitHub Profile
@drypot
drypot / rename-web.js
Last active January 29, 2019 23:20
rename for web
var fs = require('fs');
var pathl = require('path');
function traverse(path, next) {
fs.stat(path, function (err, stat) {
if (err) return next(err);
if(stat.isFile()) {
return func(path, next);
}
if(stat.isDirectory()) {
@drypot
drypot / table-name.md
Last active February 5, 2019 23:37
테이블 이름, 단수, 복수
@drypot
drypot / callback.js
Last active April 25, 2019 09:57
waterfalls
expb.core.put('/api/posts/:tid([0-9]+)/:pid([0-9]+)', expu.handler(function (req, res, done) {
userb.checkUser(res, function (err, user) {
if (err) return done(err);
var form = postn.getForm(req);
mysql2.queryOne('select * from thread where id = ?', form.tid, (err, thread) => {
if (err) return done(err);
if (!thread) return done(error('INVALID_THREAD'));
mysql2.queryOne('select * from post where id = ?', form.pid, (err, post) => {
if (err) return done(err);
postb.unpackPost(post);
@drypot
drypot / gist:14ced2aa65d4668b4fe7dd1889e2b04d
Last active September 20, 2019 09:29
User, Room Sketch
// User
class User {
userId;
}
class UserManager {
IRepository repo;
List<User> users = new List<User>();