Skip to content

Instantly share code, notes, and snippets.

View dlimpid's full-sized avatar
๐Ÿ˜„
Hello!

์ด์„ฑ์› (Seongwon Lee) dlimpid

๐Ÿ˜„
Hello!
View GitHub Profile
@dlimpid
dlimpid / string-md5.kt
Created July 7, 2017 09:34
Get MD5 hash of the string (of length 32, with leading zeros) in Kotlin
import java.math.BigInteger
import java.security.MessageDigest
fun String.md5(): String {
val md = MessageDigest.getInstance("MD5")
return BigInteger(1, md.digest(toByteArray())).toString(16).padStart(32, '0')
}
@dlimpid
dlimpid / highlight-js-plain.html
Created January 11, 2015 17:32
Add `plain` style for highlight.js: no syntax highlight but apply same css style with highlighted code block
<pre><code class="c">Block 1</code></pre>
<pre><code class="nohighlight">Block 2: The style of this block is different from Block 1.</code></pre>
<pre><code class="language-plain">Block 3: The style is the same with Block 1! :)</code></pre>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<!-- ... load another languages ... -->
<script>
hljs.registerLanguage('plain', function(hljs) {
return { case_insensitive: true, keywords: '', contains: [] };
});
@dlimpid
dlimpid / sublime-text-latextools-shell-escape.md
Created December 5, 2014 13:30
Fix or workaround of LaTeXTools package of Sublime Text 3 for using -shell-escape option in windows. (The reason simplliy setting LaTeXTools options is not working is maybe python Popen's "whitespace in argument problem in Windows.")
  • traditionalBuilder.py

     DEFAULT_COMMAND_LATEXMK = ["latexmk", "-cd",
    -    "-e", "$pdflatex = '%E -interaction=nonstopmode -synctex=1 %S %O'",
    +    "-e", "$pdflatex='%E -interaction=nonstopmode -shell-escape -synctex=1 %S %O'",
         "-f", "-pdf"]
  • latexmk-with-shell-escape.bat

# usage:
#
# ```
# md = new Remarkable()
# md.use remarkableMath()
# parsedText = md.render text
# ```
remarkableMath = ->
parser = (state, silent) ->
@dlimpid
dlimpid / firefox-userchrome.md
Last active August 29, 2015 13:56
Firefox custom css stylesheets

Firefox style

@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);

#PopupAutoCompleteRichResult  {
  background: rgba(0, 0, 0, 0.2) !important;
  border: 0;
}
#PopupAutoCompleteRichResult .autocomplete-richlistbox{
@dlimpid
dlimpid / autohotkey-macros.ahk
Last active November 20, 2018 12:38
My AutoHotkey Macros - volume, window position and z-position
; variables
; TODO:
; Variables should be at the very top of the script, before any hotkeys.
; Use `gosub` or something else and wrap in the windows size block
narrowWidth := 2 / 5
normalWidth := 1 / 2
wideWidth := 1 - narrowWidth
; Volume
@dlimpid
dlimpid / finish.m
Created July 16, 2013 22:15
my MATLAB startup/finish setting files
% close pool of parallel computation
if matlabpool('size') > 0
matlabpool close;
end
@dlimpid
dlimpid / galileo-s2-ep7-rocking-chair
Last active December 19, 2015 15:20
๊ฐˆ๋ฆด๋ ˆ์˜ค ์‹œ์ฆŒ 2 7ํ™” ใ€ˆ์œ„์žฅํ•˜๋‹คใ€‰ ใ‚ฌใƒชใƒฌใ‚ช ็ฌฌ2ใ‚ทใƒผใ‚บใƒณ ็ฌฌไธƒ็ซ ใ€Œๅฝ่ฃ…ใ†ใ€ ํŽธ ํ”๋“ค์˜์ž ์‹œ๋ฎฌ๋ ˆ์ด์…˜ ํ™”๋ฉด์— ๋‚˜์˜ค๋˜ ์ฝ”๋“œ. ์ •ํ™•ํžˆ๋Š” ๊ธฐ์–ต ์•ˆ ๋‚˜์ง€๋งŒ, ์‹œ์ฆŒ 1์—์„œ array์˜ bubble sortํ•˜๋Š” ์ฝ”๋“œ์˜€๋˜๊ฐ€๊ฐ€ ๋‚˜์™”์—ˆ๋Š”๋ฐ, ๊ทธ๊ฒƒ๋ณด๋‹ค๋Š” ๋ฐœ์ „ํ–ˆ์ง€๋งŒ ๊ทธ๋ž˜๋„ ๋ญ”๊ฐ€ ์•„์‰ฌ์šด ๋Š๋‚Œ.
uadArray RockingChair = new QuadArray(
myCoords.length, GeometryArray.COORDINATES |
GeometryArray.TEXTURE_COORDINATE_2 );
myQuads.setCoordinates( 0, 180 );
myQuads.setTurn( 0, myNormals );
myQuads.setTurnaround( 180, 0 );
myTrans.set( new Vector3f( 0, 180, 0.5f ) );
myTA.setBringback( RockingChair );
Alpha RandC = new RandC( );
@dlimpid
dlimpid / hangul_without_kotex.tex
Last active September 6, 2024 04:58
ko.TeX ์—†์ด ํ•œ๊ธ€ LaTeX ๋ฌธ์„œ ๋งŒ๋“ค๊ธฐ
\documentclass[a4paper]{article}
% XeTeX ๊ด€๋ จ =================================================================
% xltxtra Package๊ฐ€ fontspec์„ ๋ถ€๋ฅผ ๋•Œ no-math ์˜ต์…˜์„ ์ฃผ์–ด ์ˆ˜์‹์—” ์˜ํ–ฅ์„ ์ฃผ์ง€ ์•Š๊ฒŒ ํ•จ.
\PassOptionsToPackage{no-math}{fontspec}
\usepackage{xltxtra}
% Western๊ณผ CJK์— ๋‹ค๋ฅธ ๊ธ€๊ผด์„ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•œ ํŒจํ‚ค์ง€
\usepackage{xeCJK}
@dlimpid
dlimpid / my-template.tex
Last active December 16, 2015 09:49
My LaTeX template files
%!TEX program = pdflatex
% -*- coding: utf-8 -*-
\documentclass[a4paper]{article}
% ko.TeX
\PassOptionsToPackage{no-math}{fontspec}
\usepackage{kotex}
\usepackage{iftex}