Skip to content

Instantly share code, notes, and snippets.

@SangsooNam
SangsooNam / gh-pages-deploy.sh
Created January 6, 2019 23:11
Script to deploy a target directory to `gh-pages` branch.
#!/bin/bash
directory=_site
branch=gh-pages
build_command() {
jekyll build
}
echo -e "\033[0;32mDeleting old content...\033[0m"
rm -rf $directory
@SangsooNam
SangsooNam / BlurTransformation.java
Created December 23, 2018 20:37
Picasso BlurTransformation
package io.github.sangsoonam;
import android.content.Context;
import android.graphics.Bitmap;
import android.renderscript.Allocation;
import android.renderscript.Element;
import android.renderscript.RenderScript;
import android.renderscript.ScriptIntrinsicBlur;
import com.squareup.picasso.Transformation;
@SangsooNam
SangsooNam / publish_gitbook.sh
Last active October 14, 2021 14:10
Publish GitBook to Github Pages(gh-pages)
# install the plugins and build the static site
gitbook install && gitbook build
# checkout to the gh-pages branch
git checkout gh-pages
# pull the latest updates
git pull origin gh-pages --rebase
# copy the static site files into the current directory.
@SangsooNam
SangsooNam / Dummy.java
Created June 18, 2016 13:57
Create a dummy for listeners or callbacks
import com.google.common.base.Defaults;
import com.google.common.primitives.Primitives;
import java.lang.reflect.Array;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
public final class Dummy {
@SangsooNam
SangsooNam / Add to Wunderlist 3.scpt
Last active January 1, 2016 21:32
AppleScript to add a selected text as a new item in Wunderlist3
on run {input, parameters}
tell application "System Events"
keystroke "c" using {command down} -- Copy
end tell
tell application "Wunderlist"
activate
tell application "System Events"
tell process "Wunderlist"
keystroke "n" using {command down} -- Add New Item
@SangsooNam
SangsooNam / GridLayoutQuirksFixedManager.java
Created September 22, 2015 08:49
ScrollToPosition bug fixed version of GridLayoutManager
package android.support.v7.widget;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
/**
* Bug fixed version of GridLayoutManager
* Created by SangsooNam on 20/09/15.
* <p/>