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 January 19, 2024 05: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}