Skip to content

Instantly share code, notes, and snippets.

View ffmpeg_hls_for_audio.sh
#!/bin/sh
BASE_URL="https://hls-test-bucket-will-be-removed.s3.ap-northeast-2.amazonaws.com/test3/"
FILE_KEY=file.key
FILE_KEY_INFO=file.keyinfo
openssl rand 16 > $FILE_KEY
echo $BASE_URL$FILE_KEY > $FILE_KEY_INFO
echo $FILE_KEY >> $FILE_KEY_INFO
echo $(openssl rand -hex 16) >> $FILE_KEY_INFO
View gist:1774ed7de5ff121037fe7f7d3dc0d649
"Plugin: vim-plug https://github.com/junegunn/vim-plug"
call plug#begin('~/.vim/plugged')
Plug 'vim-scripts/indentpython.vim'
Plug 'Valloric/YouCompleteMe'
Plug 'scrooloose/nerdtree'
Plug 'jistr/vim-nerdtree-tabs'
Plug 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}
Plug 'leafgarland/typescript-vim'
Plug 'pangloss/vim-javascript'
Plug 'vim-syntastic/syntastic'
View gist:6c4fd1693c28bce1fc545429a0de9470
setw -g mode-keys vi
set -g mouse on
bind m set -g mouse on
bind M set -g mouse off
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
View sensitive_level.java
// MainActivity.java 100
private void subscribe() {
subscription = subject
.filter(i -> this.isCanBlow)
.filter(i -> {
Log.d("BLOW", String.valueOf(i));
final int BASE_THRESHOLD = 60;
return i >= BASE_THRESHOLD * 3; // 이곳을 수정하시면 됩니다.
})
@moltak
moltak / tecyle_scheme.json
Last active Jan 14, 2017
tecyle_scheme.json
View tecyle_scheme.json
{
"Teracode": {
"district": "강남구",
"name": "name",
"code": "code",
"position": {
"lng": "lng",
"lat": "lat"
}
},
@moltak
moltak / input.py
Created Nov 18, 2016
Read multiple stdin string data
View input.py
a = input()
b = input()
print('a={0}, b={1}'.format(a, b))
@moltak
moltak / multiple_stdin.sh
Created Nov 18, 2016
Write multiple stdin string data
View multiple_stdin.sh
#!/bin/bash
python3 input.py <<STDIN -o other —options
first
second
STDIN
View test.py
import solve
def test_first():
arg = []
arg.append((1, 3))
arg.append([3])
result = solve.kSums(arg)
assert result[0] == 1
@moltak
moltak / try_solve.py
Last active Nov 18, 2016
try_solve.py
View try_solve.py
def createFormula(K, list, i):
formula = [0 for _ in range(K)]
for i in range(K):
formula[i] = list[0]
formula[K - 1] = 0
return formula
def calc(list, formula, permutation, i):
@moltak
moltak / HttpImageTagExtractor.java
Created Jun 9, 2016
Http image tag extractor using regular expression
View HttpImageTagExtractor.java
public class HttpImageTagExtractor {
public static List<String> extract(String text) {
//regular expression for extract image tag
Pattern pattern = Pattern.compile("<img[^>]*src=[\"']?([^>\"']+)[\"']?[^>]*>");
Matcher matcher = pattern.matcher(text);
List<String> lists = new ArrayList<>();
while(matcher.find()) {
lists.add(matcher.group(1));
}