Skip to content

Instantly share code, notes, and snippets.

View 6londe's full-sized avatar

Changhoon Lee 6londe

View GitHub Profile
const fs = require('fs');
const rootPath = require('app-root-path');
const composite = async () => {
const total = compositeInfo.length;
let current = 0;
for (const { background, hair, earrings, mouth, eyes, clothes } of compositeInfo) {
if (!fs.existsSync(`${rootPath}/images/${current}.png`)) {
const result = await compositeImage(
current,
const imagemagick = require('imagemagick');
const rootPath = require('app-root-path');
const compositeImage = async (imageName, imageList) => new Promise((resolve, reject) => {
try {
const commands = [imageList[0]];
for (let i = 1; i < imageList.length; i += 1) {
commands.push('-coalesce', 'null:', imageList[i], '-layers', 'composite');
}
commands.push(`${rootPath}/images/${imageName}.png`);
🌞 Morning 106 commits ██▌░░░░░░░░░░░░░░░░░░ 12.0%
🌆 Daytime 399 commits █████████▍░░░░░░░░░░░ 45.1%
🌃 Evening 326 commits ███████▋░░░░░░░░░░░░░ 36.9%
🌙 Night 53 commits █▎░░░░░░░░░░░░░░░░░░░ 6.0%

Set timezone of docker containers

1. Set timezone of host OS

$ sudo ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime

2. Fix docker-compose.yml to use timezone of host OS

...
@6londe
6londe / license-badges.md
Last active August 1, 2023 08:51 — forked from lukas-h/license-badges.md
Markdown License Badges for your Project

마크다운 라이센스 배지 (Markdown License badges)

프로젝트의 README 파일에 표시할 라이센스 배지(License badges) 모음입니다. 아래 목록은 가장 흔히 사용되는 오픈소스오픈 데이터 라이센스입니다. 간단하게 배지 아래에 있는 코드를 복사해서 마크다운 파일에 붙여넣기하면 됩니다.

주의사항

Install docker & docker-compose

on Linux

Docker

$ curl -fsSL https://get.docker.com/ | sudo sh
$ sudo usermod -aG docker $USER
$ sudo reboot
@6londe
6londe / go-mysql-crud.go
Created December 21, 2017 07:52
MySQL CRUD Function in Go Language
package main
import (
"fmt"
"database/sql"
_ "github.com/go-sql-driver/mysql"
)
var MYSQL_IP = "localhost"
var MYSQL_PORT = "3306"
@6londe
6londe / Configuration.java
Last active September 7, 2017 04:24
Java set configuration from text file
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Properties;
public class Configuration {
private String resource = null;
@6londe
6londe / ethereum-webapp.js
Last active May 17, 2016 01:31
ethereum contract example in java
IP = "10.113.63.183";
ETHEREUM_ACCOUNT_NUMBER = 0;
/* static contract info */
CONTRACT_ADDRESS = '0x1d4B7B3386AD2f221C641f6EED3bb7D3f6d8eDCB';
CONTRACT_ABI = JSON.parse('[{"constant":false,"inputs":[],"name":"kill","outputs":[],"type":"function"},{"constant":false,"inputs":[],"name":"changeMsg","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"greet","outputs":[{"name":"","type":"string"}],"type":"function"},{"inputs":[{"name":"_greeting","type":"string"}],"type":"constructor"}]');
$(document).ready(function () {
if (typeof web3 === 'undefined') {
@6londe
6londe / bypass.jsp
Last active January 8, 2016 04:41
url: bypass.jsp?http://some.url
<%@page session="false"%>
<%@page import="java.net.*,java.io.*"%>
<%
try {
String reqUrl = request.getQueryString();
URL url = new URL(reqUrl);
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setDoOutput(true);
con.setRequestMethod(request.getMethod());