Skip to content

Instantly share code, notes, and snippets.

View bskim45's full-sized avatar

Bumsoo Kim bskim45

View GitHub Profile
@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 / 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)

@bskim45
bskim45 / circle.yml
Last active August 31, 2016 02:33 — forked from h0lyalg0rithm/circle.yml
Android CircleCI Build config
#Install android build tools, platforms
#Supported versions here https://circleci.com/docs/android
dependencies:
override:
- echo y | android update sdk --no-ui --all --filter tools,platform-tools,build-tools-24.0.2,android-23,extra-google-m2repository,extra-google-google_play_services,extra-android-m2repository
- ANDROID_HOME=/usr/local/android-sdk-linux ./gradlew dependencies
#Pull any submodules
checkout:
post:
#
# Circle CI & gradle.properties live in harmony
#
# Android convention is to store your API keys in a local, non-versioned
# gradle.properties file. Circle CI doesn't allow users to upload pre-populated
# gradle.properties files to store this secret information, but instaed allows
# users to store such information as environment variables.
#
# This script creates a local gradle.properties file on current the Circle CI
# instance. It then reads environment variable TEST_API_KEY_ENV_VAR which a user
@bskim45
bskim45 / Android CI.md
Created September 13, 2016 18:41 — forked from JvmName/Android CI
Android CI

#Android and CI and Gradle (A How-To)

There are tech stacks in this world that make it dead simple to integrate a CI build system.
The Android platform is not one of them.

Although Gradle is getting better, it's still a bit non-deterministic, and some of the fixes you'll need will start to feel more like black magic than any sort of programming.

But fear not! It can be done!

Before we embark on our journey, you'll need a few things to run locally:

@bskim45
bskim45 / CryptGenRandom.cpp
Created October 13, 2016 01:24 — forked from kbjorklu/CryptGenRandom.cpp
Sample code for the CryptGenRandom function.
#include <iostream>
#include <windows.h>
#pragma comment(lib, "advapi32.lib")
int main()
{
HCRYPTPROV hProvider = 0;
if (!::CryptAcquireContextW(&hProvider, 0, 0, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT))
return 1;
@bskim45
bskim45 / .profile
Created September 10, 2017 09:10 — forked from bmhatfield/.profile
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else