Skip to content

Instantly share code, notes, and snippets.

@zestime
zestime / jetbrains-mono.css
Last active September 5, 2022 11:44
JetBrains Mono Css for ChromOS
@font-face{
font-family: 'JetBrains Mono';
src: url('https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/JetBrainsMono/Ligatures/Regular/complete/JetBrains%20Mono%20Regular%20Nerd%20Font%20Complete%20Mono.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
* {
-webkit-font-feature-settings: "liga" on, "calt" on;
-webkit-font-smoothing: antialiased;
@zestime
zestime / vscode-settings.json
Last active July 7, 2020 06:57
VSCode Setting file
{
"workbench.iconTheme": "vscode-icons",
"vim.easymotion": true,
"vim.incsearch": true,
"vim.useSystemClipboard": true,
"vim.useCtrlKeys": true,
"vim.hlsearch": true,
"vim.insertModeKeyBindings": [
{
"before": [
@zestime
zestime / conv.js
Created January 29, 2019 06:35
Decoding chunked and gzipped response
var bufferToString = buf => buf.toString('utf-8');
var conv = arr => bufferToString(zlib.gunzipSync(Buffer.from(arr.join(''), 'hex')));
/* testing
var res = [ '1f8b0800000000000213',
'ab562a4b2d2acecccf2b56b25288562a32d033d03354d25100b10cf50ca02c2338cb18c88a05324bf38a4b12937252e3d352134b4a
8b5241daab9572f57212ab2ae373f21353e273537393804603c54b8a4a536b6b01655b8d116a000000' ];
conv(res); // '{"versions": ["r0.0.1", "r0.1.0", "r0.2.0", "r0.3.0"], "unstable_features": {"m.lazy_load_members": true}}'
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Net;
@zestime
zestime / countChange.js
Created July 21, 2016 00:36
JavaScript ver. of Counting coins
function countChange(money, coins) {
if (money == 0) return 1;
if (money < 0 || coins.length == 0) return 0;
return countChange(money - coins[0], coins) + countChange(money, coins.slice(1));
}
@zestime
zestime / countChange.scala
Created July 21, 2016 00:26
Recursion problem from 'Functional Programming Principles in Scala'
def countChange(money: Int, coins: List[Int]): Int =
money match {
case 0 => 1 // matched, add 1
case n => if (money < 0 || coins.isEmpty) 0 // not matched, ignored
else countChange(money - coins.head, coins) + countChange(money, coins.tail)
}
// test cases
assert(calculateCoins(4, List(1,2)) == 3)
assert(calculateCoins(300, List(5, 10, 20, 50, 100, 200, 500)) == 1022)
@zestime
zestime / git.conf
Created February 18, 2016 04:19
Apache configuration for Git server - Smart HTTP
SetEnv GIT_PROJECT_ROOT /opt/git
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAlias /git/ /Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-http-backend/
RewriteEngine On
RewriteCond %{QUERY_STRING} service=git-receive-pack [OR]
RewriteCond %{REQUEST_URI} /git-receive-pack$
RewriteRule ^/git/ - [E=AUTHREQUIRED]
<Files "git-http-backend">
@zestime
zestime / Environment on Mac.md
Last active October 26, 2015 08:36
맥에서의 작업 환경에 대한 기록...

shortcuts

  • option + space : Alfred2
  • commnad + space : Spotlight Search
  • right option : A key of changing Korean/English
  • caps locks : As control at some programs based emacs
  • option + esc : Speak selected text. Configure this in Dictation & Speech.
  • control + esc : Search selected text in Dictionary, This is set by BetterTouchTool(instead of control + esc or tabbing by three fingers )
> /(aaa)bbb/.exec("aaabbbccc") // lookbehind?
["aaabbb", "aaa"]
> /([^a]{3})bbb/.exec("dddbbbeee") // negative lookbehind?
["dddbbb", "ddd"]
> /bbb(?=ccc)/.exec("aaabbbccc") // lookahead
["bbb"]
> /bbb(?=ccc)/.exec("dddbbbeee")
null
> /bbb(?!ccc)/.exec("aaabbbccc") // negative lookahead
null
> /bbb(?!ccc)/.exec("dddbbbeee")
["bbb"]
> /(?<=aaa)bbb/.exec("aaabbbccc") // lookbehind?
Uncaught SyntaxError: Invalid regular expression: /(?<=aaa)bbb/: Invalid group