Skip to content

Instantly share code, notes, and snippets.

View eungjun-yi's full-sized avatar

Yi EungJun eungjun-yi

View GitHub Profile
@eungjun-yi
eungjun-yi / Markdown.java
Created July 29, 2015 08:55
마크다운 렌더러에서 어쩔 수 없이 Thread.stop() 사용함
// Try to render and wait at most 5 seconds.
final String[] rendered = new String[1];
@SuppressWarnings("deprecation")
Thread marked = new Thread() {
@Override
public void run() {
try {
rendered[0] = (String) ((Invocable) engine).invokeFunction(
"marked", source, options);
} catch (Exception e) {
@eungjun-yi
eungjun-yi / gfm.coffee
Created April 10, 2012 08:53
Coffeescript port of gfm at https://gist.github.com/118964
crypto = require 'crypto'
gfm = (text) ->
# Extract pre blocks
extractions = {}
text = text.replace /<pre>(\n|.)*?<\/pre>/gm, (match) ->
md5 = crypto.createHash('md5').update(match).digest('hex')
extractions[md5] = match
'{gfm-extraction-' + md5 + '}'
@eungjun-yi
eungjun-yi / settings.py
Created November 18, 2015 11:51
/etc/zulip/settings.py
# Settings for Zulip Voyager
### MANDATORY SETTINGS
#
# These settings MUST be set in production. In a development environment,
# sensible default values will be used.
# The user-accessible Zulip hostname for this installation, e.g.
# zulip.example.com
EXTERNAL_HOST = 'zulip.example.com'
@eungjun-yi
eungjun-yi / mattermost.log
Created November 20, 2015 10:01
WARNs while import slack messages
[2015/11/20 10:00:10 UTC] [WARN] Unsupported post type: message, channel_join
[2015/11/20 10:00:10 UTC] [WARN] Unsupported post type: message, channel_join
[2015/11/20 10:00:10 UTC] [WARN] Unsupported post type: message, channel_join
[2015/11/20 10:00:10 UTC] [WARN] Unsupported post type: message, channel_join
[2015/11/20 10:00:10 UTC] [WARN] Unsupported post type: message, channel_join
[2015/11/20 10:00:10 UTC] [WARN] Unsupported post type: message, channel_join
[2015/11/20 10:00:10 UTC] [WARN] Unsupported post type: message, channel_join
[2015/11/20 10:00:10 UTC] [WARN] Unsupported post type: message, channel_join
[2015/11/20 10:00:10 UTC] [WARN] Unsupported post type: message, channel_join
[2015/11/20 10:00:10 UTC] [WARN] Unsupported post type: message, channel_join
@eungjun-yi
eungjun-yi / check.sh
Last active November 26, 2015 01:08
Detecting broken links
#!/bin/sh
while getopts v OPTION ;
do
case "$OPTION" in
v) VERBOSE=true ; shift ;;
esac
done
urls=$(grep -i -E -o 'https?://[^ )]*[^), ]' $1)
@eungjun-yi
eungjun-yi / star-101.sh
Last active December 26, 2015 21:19
https://gist.github.com/benelog/7204216 쉘스크립트 101자 버전하고 71자 버전
echo ' *
*
* *
* *
* *
** **
* *
* *
* *
*

Keybase proof

I hereby claim:

  • I am npcode on github.
  • I am eungjun (https://keybase.io/eungjun) on keybase.
  • I have a public key ASDyM5qWg2nlsp-CterP6XvNqEjGkJMr1HGeUCopFlNR6Ao

To claim this, I am signing this object:

@eungjun-yi
eungjun-yi / numbering.sh
Last active April 13, 2017 08:57
Correct numbers of list
#!/bin/bash
number=1
while read line
do
echo $line | grep -E '^[0-9][0-9]*' > /dev/null
if [ "$?" = "0" ]; then
echo $line | sed "s/^[0-9][0-9]*\./$number\./"
number=`echo $number+1|bc`
echo "hello"
echo "https://api.github.com/orgs/naver/repos
https://api.github.com/organizations/6589568/repos?page=2
https://api.github.com/organizations/6589568/repos?page=3
https://api.github.com/organizations/6589568/repos?page=4
https://api.github.com/organizations/6589568/repos?page=5" | xargs -i curl {} | jq '.[].stargazers_count' | awk '{sum+=$1}; END {print sum}'