Skip to content

Instantly share code, notes, and snippets.

View devjin0617's full-sized avatar
💻
저는 개발을 합니다

cheongjin kim (김청진) devjin0617

💻
저는 개발을 합니다
View GitHub Profile
@ChangJoo-Park
ChangJoo-Park / score-iterator.js
Last active May 25, 2018 01:22
Score Iterator
/**
* 같으면 0, 다르면 1
* @param (숫자) left
* @param (숫자) right
*/
function scoreNumbers(left, right) {
return left == right ? 0 : 1
}
@ChangJoo-Park
ChangJoo-Park / strong-params.js
Last active May 17, 2018 05:47
Strong Parameter for Express
exports.parameterPermitter = function ({ params = [] }) {
if (!Array.isArray(params)) throw new Error(`Request Parameter ${params} is invalid parameters array`)
return function (req, res, next) {
res.locals.permitted = {}
params.forEach((param) => {
if (!req.body.hasOwnProperty(param)) throw new Error(`${param} is required`)
res.locals.permitted[param] = req.body[param]
})
@firatkucuk
firatkucuk / delete-slack-messages.js
Last active May 1, 2024 04:17
Deletes slack public/private channel messages, private chat messages and channel thread replies.
#!/usr/bin/env node
// Channel ID is on the the browser URL.: https://mycompany.slack.com/messages/MYCHANNELID/
// Pass it as a parameter: node ./delete-slack-messages.js CHANNEL_ID
// CONFIGURATION #######################################################################################################
const token = 'SLACK TOKEN';
// Legacy tokens are no more supported.
// Please create an app or use an existing Slack App
@devxoul
devxoul / swiftkorea.swift
Last active April 8, 2017 02:29
Swift Korea 질문에 대한 답변
/*
뭔가 퍼즐같은 RxSwift 질문입니다.
서버에 3 페이지의 분량을 한꺼번에 요청하려는데,
요청은 동시에 보내고 응답은 순서대로 처리하고 싶습니다.
테스트 시나리오:
각 요청(Observable)들은 subscribe 될 때 request가 시작
각 요청의 request에는 2, 4, 2초씩 걸린다고 가정
-> 2초 후 첫 페이지가 뜨고
-> 추가로 2초 후 나머지가 전부 뜨는
상황을 원하고 있습니다.
@LeoHeo
LeoHeo / var-let-const.md
Last active February 13, 2024 08:21
javascript var, let, const 차이점

var, let, const 차이점은?

  • varfunction-scoped이고, let, constblock-scoped입니다.

  • function-scopedblock-scoped가 무슨말이냐?

var(function-scoped)

jsfiddle 참고주소

@devjin0617
devjin0617 / webpack.base.conf.js
Created January 5, 2017 23:13 — forked from vedovelli/webpack.base.conf.js
webpack base config for vue cli with support for Bootstrap and Font-awesome
var path = require('path')
module.exports = {
entry: {
app: './src/main.js'
},
output: {
path: path.resolve(__dirname, '../dist/static'),
publicPath: '/static/',
filename: '[name].js'
@devxoul
devxoul / ObservableConvertibleType+ActivityIndicator.swift
Last active July 29, 2016 14:33
RxSwift: Filters the elements of an observable sequence based on an ActivityIndicator.
// The MIT License (MIT)
//
// Copyright (c) 2016 Suyeol Jeon (xoul.kr)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions: