Skip to content

Instantly share code, notes, and snippets.

View chalkpe's full-sized avatar
🏳️‍🌈

Seol Park chalkpe

🏳️‍🌈
  • Republic of Korea
View GitHub Profile
@chalkpe
chalkpe / .bash_aliases
Last active July 5, 2016 14:03
.bash_aliases
alias gpom='git push origin master'
alias gpod='git push origin develop'
alias gpgm='git push github master'
alias glog='git log --oneline --graph'
alias gadd='git add'
alias gada='git add .'
alias grmc='git rm --cached'
alias gcam='git commit -a -m'
alias gcAm='git commit -a --amend -m'
alias gsts='git status'
@chalkpe
chalkpe / xyz2z.md
Last active February 10, 2018 16:05

x, y, z를 인자로 받아서 z를 반환하는 함수를 SKI combinator로 구현하기

  T[λx.λy.λz.z]
= T[λx.T[λy.λz.z]]      (by 5)
= T[λx.T[(K T[λz.z])]   (by 3)
= T[λx.T[(K I)]         (by 4)
= T[λx.(T[K] T[I])]     (by 2)
= T[λx.(K I)]           (by 1)
= (S T[λx.K] T[λx.I]) (by 6)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Linear regression</title>
<style media="screen">
body {
margin: 0;
overflow: hidden;
@chalkpe
chalkpe / hangang.js
Last active December 22, 2016 09:52
const chalk = require('chalk');
const moment = require('moment');
const request = require('request');
moment.locale('ko');
let options = {
url: 'http://hangang.dkserver.wo.tc',
json: true, timeout: 500
};
경단
과일
꽈배기
나쵸
녹차
누네띠네
단감
닭강정
@chalkpe
chalkpe / ant.js
Created November 12, 2017 08:12
자바스크립트로 구현한 개미 수열 https://en.wikipedia.org/wiki/Look-and-say_sequence
function* ant (seed = '1') {
while (true) yield (seed = seed.replace(/(\d)\1*/g, (m, s) => s + m.length))
}
const seq = ant()
Array.from(Array(11), seq.next, seq).map(a => a.value)
// ["11",
// "12",
// "1121",
@chalkpe
chalkpe / is-orphan.gs
Last active January 23, 2018 04:03
is-orphan.gs
function onOpen() {
SpreadsheetApp.getUi()
.createMenu('is-orphan')
.addItem('Run', 'run')
.addToUi()
}
function run () {
var myFiles = DriveApp.searchFiles('"me" in owners')
var orphanedFolder = DriveApp.getFoldersByName('Orphaned').next()
#!/bin/bash
sudo apt update && sudo apt upgrade
sudo apt install -y git devscripts build-essential debhelper pkg-config libglib2.0-dev libtool intltool autoconf libaudit-dev libchewing3-dev libhangul-dev librime-dev libxkbcommon-dev libsunpinyin-dev libanthy-dev libqt4-dev qtbase5-dev qtbase5-private-dev libgtk-3-dev libgtk2.0-dev librsvg2-bin libappindicator3-dev
git clone https://github.com/cogniti/nimf.git
cd nimf && ./autogen.sh --with-im-config-data
sudo cp data/im-config/23_nimf.* /usr/share/im-config/data
@chalkpe
chalkpe / range.js
Last active February 10, 2018 15:15
python range function for js
function* range (...args) {
if (args.length === 0) throw new Error('too few parameters')
if (args.length === 1) args.unshift(undefined) // start = 0, stop
const [start = 0, stop, step = 1] = args
for (let k = start; (stop - k) * step > 0; k += step) yield k
}
// [...range(3)] === [0, 1, 2]
// [...range(-5, -1)] === [-5, -4, -3, -2]
@chalkpe
chalkpe / init.coffee
Created March 1, 2018 21:24
Atom fix pipeline operator ligatures
selector = '.syntax--keyword.syntax--operator.syntax--bitwise.syntax--js'
atom.workspace.observeTextEditors (editor) ->
editor.onDidChange ->
pipes = document.querySelectorAll selector
Array.from(pipes).forEach (pipe) ->
return if not pipe or pipe.textContent != '|'
next = pipe.nextSibling