Skip to content

Instantly share code, notes, and snippets.

View nidev's full-sized avatar

Changbeom Yun (Nidev) nidev

View GitHub Profile
@nidev
nidev / curse_of_taebo.py
Created January 9, 2019 14:25
태보는 지금 전세계적으로 선풍적인 인기를 끌고 있는데요
# -*- coding: utf-8 -*-
class Sport:
def runtime_minutes(self):
raise NotImplementedError('Please implement this method')
class Taekwondo(Sport):
def __add__(self, other):
if instanceof(other, Boxing):
return Taebo()
@nidev
nidev / index.js
Created August 29, 2018 05:37
Mimicking behavior of document.cookie created by nidev - https://repl.it/@nidev/Mimicking-behavior-of-documentcookie
/*
document.cookie 의 구현을 흉내내보자
var wordJar = new WordJar();
wordJar.cookie = "apple";
// console.log(wordJar.cookie) -> "apple"
wordJar.cookie = "banana";
// console.log(wordJar.cookie) -> "apple, banana"
wordJar.cookie = "kiwi";
// console.log(wordJar.cookie) -> "apple, banana, kiwi"
@nidev
nidev / .vimrc
Created March 13, 2018 13:02
My recent vimrc (Vundle, omnisharp-roslyn, language-server, supertab, syntastic, vim-erlang, powerline)
set nocompatible " be iMproved, required
filetype off " required
set background=dark
set ts=8
set sts=4
set sw=4
set nu
set smartindent
@nidev
nidev / s3recursiveupload.js
Created February 25, 2018 07:26
Recursively upload all content from given path(s)
"use strict";
/*
* AWS S3 Bucket automatic deployment script
* 1. Run 'npm install' first to install aws-sdk
* 2. Run 'hexo generate'
* 3. Run this script (Please configure AWS credentials first)
*
*/
@nidev
nidev / .vimrc
Last active December 3, 2023 18:35
How to use omnisharp-vim with latest omnisharp-roslyn
"All user-dependent configurations are omitted intentionally.
"This gist only includes configurations for omnisharp.
"Original vimrc is available on:
"https://github.com/OmniSharp/omnisharp-vim#example-vimrc
"=========================================================
" **Preparation steps
"1. Install pathogen.vim or preferred plugin manager
"(Will explain procedures with assumption that a user is using pathogen.vim)
" **Main steps

Keybase proof

I hereby claim:

  • I am nidev on github.
  • I am nidev (https://keybase.io/nidev) on keybase.
  • I have a public key whose fingerprint is ED83 C1B8 6873 B6C3 8D29 D74D 7F61 49DC 95D8 798D

To claim this, I am signing this object:

@nidev
nidev / utf8truncate.java
Created April 5, 2017 07:36 — forked from lpar/utf8truncate.java
Truncate a Java string so that its UTF-8 representation will not exceed the specified number of bytes
/**
* Truncate a Java string so that its UTF-8 representation will not
* exceed the specified number of bytes.
*
* For discussion of why you might want to do this, see
* http://lpar.ath0.com/2011/06/07/unicode-alchemy-with-db2/
*/
public static String utf8truncate(String input, int length) {
StringBuffer result = new StringBuffer(length);
int resultlen = 0;
@nidev
nidev / itloops.rs
Created April 1, 2017 05:23
It loops!
use std::mem;
use std::ptr;
type Link<T> = *mut DoubleLinkNode<T>;
struct DoubleLinkNode<T> {
prev: Link<T>,
next: Link<T>,
value: T
}
@nidev
nidev / devilsnest.dart
Created March 24, 2017 13:57
Have you ever imagined array[0.5]? here is the answer
// encoding: utf-8
import "dart:io";
enum ExportDirection {
Integer,
Double
}
class HybridIndex {
final int integer;
@nidev
nidev / platform_util.dart
Last active February 18, 2017 12:58
Provide platform-dependent newline character. This function is not available in Platform class in dart:io package.
// This is also included in https://github.com/nidev/smallservlet
import "dart:io";
class PlatformUtil {
static final _NEWLINE_CRLF = "\r\n";
static final _NEWLINE_LF = "\n";
static String get newLine {
if (Platform.isWindows) {