Skip to content

Instantly share code, notes, and snippets.

View hanpama's full-sized avatar
๐ŸŽฏ
Focusing

Kyungil Choi hanpama

๐ŸŽฏ
Focusing
View GitHub Profile
@hanpama
hanpama / pgcc.go
Last active January 7, 2020 14:05
SQL implementation of Relay Cursor Connection
package pgcc
import (
"bytes"
"io"
"text/template"
)
// Options defines required and optional settings for building connection query
type Options struct {
@hanpama
hanpama / djargon2i.go
Created October 4, 2019 01:41
Django Argon2PasswordHasher compatible password hasher in Golang
package djargon2i
import (
"crypto/rand"
"crypto/subtle"
"encoding/base64"
"errors"
"fmt"
"strings"
@hanpama
hanpama / multipart-client.ts
Last active December 17, 2018 14:53
NodeJS http client implementation of GraphQL multipart request
import * as http from 'http';
import FormData from 'form-data';
export class MultipartClient {
constructor(public requestOptions: { host: string, port: number } | { socketPath: string }) {}
async request(method: string, path: string, body?: any, headers: any = {}) {
return new Promise<{ res: http.IncomingMessage, body: Buffer }>((resolve, reject) => {
const req = http.request({
@hanpama
hanpama / docker-workspace.md
Created May 9, 2018 14:45
run specific version of node with docker
  1. cd into your workspace

  2. run:

docker run -it --rm -v $(pwd)/:/app node:9 bash
@hanpama
hanpama / how-to-run-blockchain-on-browser.md
Last active June 3, 2019 18:33
๋ธŒ๋ผ์šฐ์ €์—์„œ ๋ธ”๋ก์ฒด์ธ ๊ตฌํ˜„ํ•˜๊ธฐ (์•”ํ˜ธํ™”ํ)

๋ธŒ๋ผ์šฐ์ €์—์„œ ๋ธ”๋ก์ฒด์ธ ๊ตฌํ˜„ํ•˜๊ธฐ (์•”ํ˜ธํ™”ํ)

  • Nimiq (๋‹ˆ๋ฏน)
  • JavaScript (browser / nodejs)
  • WebRTC, Websocket ๊ธฐ๋ฐ˜ ํ†ต์‹ 
  • ์†Œ์Šค์ฝ”๋“œ ์‚ดํŽด๋ณด๊ธฐ https://github.com/nimiq-network/core/
    • ํŒจํ‚ค์ง•์ด๋‚˜ ๋ชจ๋“ˆํ™” ๋ฐฉ์‹์€ ํ‘œ์ค€์ ์ด์ง€๋Š” ์•Š์Œ.
      • ๋ธŒ๋ผ์šฐ์ € - ๋…ธ๋“œ ๋„ค์ดํ‹ฐ๋ธŒ ํ™˜๊ฒฝ์—์„œ ๋ชจ๋‘ ์ž‘๋™ํ•˜๋„๋ก ๋งŒ๋“œ๋Š” ๊ฒƒ์ด ์ฃผ์š” ๋ชฉ์ ์œผ๋กœ ๋ณด์ž„
    • ์ฝ”๋“œ ํ’ˆ์งˆ ์ƒ๋‹นํžˆ ์ข‹์Œ
    • ๋ธŒ๋ผ์šฐ์ € ์œ„์—์„œ ๋Œ๋ฆฌ๊ธฐ ์œ„ํ•ด์„œ์ธ์ง€ ์ฝ”๋“œ๋Š” ๋ฐ”๋‹ฅ๋ถ€ํ„ฐ ์ƒˆ๋กœ ์ž‘์„ฑ๋จ
@hanpama
hanpama / su_group2kmz.md
Created November 16, 2017 08:17
์Šค์ผ€์น˜์—…์—์„œ ๋ฃจํŠธ ๋ ˆ๋ฒจ ๊ทธ๋ฃน๋“ค์„ ๋”ฐ๋กœ KMZ ํŒŒ์ผ๋กœ ์ต์ŠคํฌํŠธํ•ฉ๋‹ˆ๋‹ค.

Sketchup Group2KMZ Script

์‚ฌ์šฉ ๋ฐฉ๋ฒ•

  1. ์Šค์ผ€์น˜์—…์˜ ์ƒ๋‹จ ๋ฉ”๋‰ด์— ์žˆ๋Š” Window > Ruby Console ํ•ญ๋ชฉ์„ ํด๋ฆญํ•˜์—ฌ ๋ฃจ๋น„ ์ฝ˜์†”์„ ์—ฝ๋‹ˆ๋‹ค.
  2. ์•„๋ž˜์˜ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ๋ถ™์—ฌ ๋„ฃ๊ณ  ์—”ํ„ฐ๋ฅผ ์ž…๋ ฅ ํ›„, ํŒŒ์ผ๋“ค์ด ๋“ค์–ด๊ฐˆ ํด๋”๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  3. ํด๋”์— ๊ฐ€๋ณด๋ฉด kmz ํŒŒ์ผ๋“ค์ด ์ƒ๊ฒจ ์žˆ์Šต๋‹ˆ๋‹ค.
groups = Sketchup.active_model.entities.grep(Sketchup::Group)
@hanpama
hanpama / DataCleanupUtils.rb
Created October 30, 2017 06:39
์Šค์ผ€์น˜์—… ๋„์šฐ๋ฏธ
def pick_one_surface()
model = Sketchup.active_model
faces = model.entities.grep(Sketchup::Face)
puts(faces.length)
return faces[0]
end
def groupify()
face = pick_one_surface()
@hanpama
hanpama / FontSelector.js
Created October 19, 2017 04:23
๋””์ž์ธ ํšŒ์˜์šฉ ํฐํŠธ ์…€๋ ‰ํ„ฐ
import { FormControl } from 'material-ui/Form';
import { MenuItem } from 'material-ui/Menu';
import Select from 'material-ui/Select';
import { withStyles } from 'material-ui/styles';
import Input, { InputLabel } from 'material-ui/Input';
import TextField from 'material-ui/TextField';
const ENG_FONTS = [
@hanpama
hanpama / bootstrap-grid-only.css
Created August 5, 2017 14:15
Bootstrap Grid Only
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
article,
aside,
details,
figcaption,
figure,
/**
* NodeJS์—์„œ์˜ ๋น„๋™๊ธฐ ์ž‘์—… ์˜ˆ์ œ
*/
const fs = require('fs');
const util = require('util');
const readdir = util.promisify(fs.readdir);
const writeFile = util.promisify(fs.writeFile);
const readFile = util.promisify(fs.readFile);