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 March 28, 2025 08: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 December 15, 2024 01:07
javascript var, let, const 차이점

var, let, const 차이점은?

  • varλŠ” function-scoped이고, let, constλŠ” block-scopedμž…λ‹ˆλ‹€.

  • function-scoped와 block-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: