Skip to content

Instantly share code, notes, and snippets.

View claudianus's full-sized avatar
๐Ÿ 
Working from home

Claudianus Mamertus claudianus

๐Ÿ 
Working from home
  • Modumaru
  • South Korea
  • 15:46 (UTC +09:00)
View GitHub Profile
@claudianus
claudianus / a.vb
Created November 25, 2018 13:16
vb.net ๋‹จ์–ด ๊ฐฏ์ˆ˜ ์ƒˆ๊ธฐ
Module Module1
Sub Main()
Const source = "ํ…Œ์ŠคํŠธ1,ํ…Œ์ŠคํŠธ1,ํ…Œ์ŠคํŠธ2,ํ…Œ์ŠคํŠธ1,ํ…Œ์ŠคํŠธ3,ํ…Œ์ŠคํŠธ2,ํ…Œ์ŠคํŠธ3,ํ…Œ์ŠคํŠธ1,ํ…Œ์ŠคํŠธ2,ํ…Œ์ŠคํŠธ3,ํ…Œ์ŠคํŠธ4"
'๋‹จ์–ด ํŒŒ์‹ฑ
dim arr = Split(source, ",")
'๊ฐฏ์ˆ˜ ์ €์žฅ์šฉ ๋”•์…”๋„ˆ๋ฆฌ
Dim dic as new Dictionary(Of String, Integer)
@claudianus
claudianus / source.cpp
Created November 25, 2018 15:02
c++ ๋ฌธ์ž์—ด ์ •ํ•ด์ง„ ๊ธธ์ด๋กœ ์ชผ๊ฐ  ํ›„ ๊ฐฏ์ˆ˜ ์ƒˆ๊ธฐ
#include <iostream>
#include <string>
#include <map>
using namespace std;
int main(void) {
int wordLength;
string source;
map<string, int> dictionary;
@claudianus
claudianus / source.c
Created December 11, 2018 06:56
question 2
#include <stdio.h>
#include <string.h>
struct info {
char name[5];
char homeNumber[12];
char phoneNumber[12];
char email[100];
} info;
@claudianus
claudianus / gulpfile.js
Last active March 18, 2025 15:43
build obfuscated tampermonkey user script and publish to put.re from ES6+ with gulp automator
const gulp = require("gulp")
const babel = require("gulp-babel")
const javascriptObfuscator = require('gulp-javascript-obfuscator')
const rename = require('gulp-rename')
const header = require('gulp-header')
const footer = require('gulp-footer')
const upload = require('gulp-upload')
const package = require('./package.json')
@claudianus
claudianus / crontab.md
Last active October 30, 2024 09:01
crontab ์‚ฌ์šฉ๋ฒ•

cron

cron์€ ํŠน์ • ์‹œ๊ฐ„์— ํŠน์ • ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•˜๊ฒŒ ํ•˜๋Š” ์‹œ์Šคํ…œ ๋Œ€๋ชฌ์ž…๋‹ˆ๋‹ค. ์ฃผ๊ธฐ์ ์œผ๋กœ ์–ด๋–ค ์ž‘์—…์„ ํ•ด์•ผํ•  ๋•Œ ์œ ์šฉํ•ฉ๋‹ˆ๋‹ค.

crontab

crontab์€ ์‹œ๊ฐ„๊ณผ ์ž‘์—…์„ ์ ์€ ํ…์ŠคํŠธ ํŒŒ์ผ์ž…๋‹ˆ๋‹ค. ์‚ฌ์šฉ์ž๋ณ„๋กœ ํŒŒ์ผ์ด ์กด์žฌํ•ฉ๋‹ˆ๋‹ค. cron์€ ๋ชจ๋“  ์‚ฌ์šฉ์ž์˜ crontab ํŒŒ์ผ์„ ์ฐพ์•„์„œ, ์ ํ˜€์ง„ ์ผ์ •๋Œ€๋กœ ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค.

์ž‘์—… ๋ชฉ๋ก ๋ณด๊ธฐ

์˜ˆ์•ฝ ์ž‘์—… ๋ชฉ๋ก์„ ๋ณด๊ณ  ์‹ถ๋‹ค๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๋ช…๋ นํ•ฉ๋‹ˆ๋‹ค.

function solution(board, moves) {
const basket = [];
let deleteItemCount = 0;
moves.forEach((v, i) => {
const item = grab(board, v);
if(item) {
if(item === basket[basket.length-1]) {
deleteItemCount += 2;
basket.splice(basket.length-1, 1);
return;