Skip to content

Instantly share code, notes, and snippets.

View bskim45's full-sized avatar

Bumsoo Kim bskim45

View GitHub Profile
@bskim45
bskim45 / simplestack.cpp
Last active November 7, 2023 14:40
Simple Stack Implementation by using Templet in C++ Various Versions
#include <iostream>
using namespace std;
template<typename T>
class Stack {
private:
T* elements;
int top;
int size;
@bskim45
bskim45 / ko.json
Created October 18, 2014 18:06
h5ai Korean Language File
/* only here as a reference, these values are the hardcoded defaults */
{
"lang": "한국어",
"details": "자세히",
"list": "목록",
"grid": "그리드",
"icons": "아이콘",
"name": "파일명",
"lastModified": "최근수정일",
"size": "크기",
@bskim45
bskim45 / singletone.java
Created November 21, 2014 16:28
Simlple Java Singletone Pattern
public class Singletone {
private static Singletone instance = null;
protected Singletone() {
//to prohibit instantiation.
}
public static Singletone getInst() {
if(instance == null) {
instance = new Singletone();
@bskim45
bskim45 / gen_partition.py
Created November 7, 2015 19:28
gensort Partition Generator
# -*- coding: UTF-8 -*-
import argparse
import os
import shlex
import subprocess
import sys
def main(argv):
chunks = 0
@bskim45
bskim45 / check-version.iss
Created March 29, 2016 08:11 — forked from mistic100/check-version.iss
[InnoSetup] Prevent install if newer version is already installed
#define AppId "{INSERT HERE YOUR GUID}"
#define AppName "My App"
#define AppVersion "1.7"
[CustomMessages]
english.NewerVersionExists=A newer version of {#AppName} is already installed.%n%nInstaller version: {#AppVersion}%nCurrent version:
[Code]
// find current version before installation
function InitializeSetup: Boolean;
var Version: String;
@bskim45
bskim45 / example.conf
Last active June 14, 2016 16:27
Apache2 Reverse Proxy (http)
<VirtualHost *:80>
ServerName example.com
ServerAdmin hello@example.com
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
@bskim45
bskim45 / ExceptionParser.java
Created July 18, 2016 09:43 — forked from felipecsl/ExceptionParser.java
Helper class to parse error response body on Retrofit 2
public static class ExceptionParser {
private final ResponseBody body;
private final String bodyString;
private final Converter.Factory converterFactory;
public ExceptionParser(Response response, Converter.Factory converterFactory) {
this.converterFactory = converterFactory;
this.body = cloneResponseBody(response.errorBody());
this.bodyString = getBodyAsString(body);
}
@bskim45
bskim45 / EachDirectoryPath.md
Created August 7, 2016 15:39 — forked from granoeste/EachDirectoryPath.md
[Android] How to get the each directory path.

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories

@bskim45
bskim45 / activity.java
Created August 10, 2016 02:41 — forked from kibotu/activity.java
handle hide keyboard functionality on focus lost properly on android
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
final Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.fragment_container);
if (fragment instanceof IDispatchTouchEvent)
return ((IDispatchTouchEvent) fragment).dispatchTouchEvent(ev) || super.dispatchTouchEvent(ev);
return super.dispatchTouchEvent(ev);
}
@bskim45
bskim45 / vimdiff.md
Created August 24, 2016 02:24 — forked from mattratleph/vimdiff.md
vimdiff cheat sheet

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)