Skip to content

Instantly share code, notes, and snippets.

https://github.com/amix/vimrc
git clone --depth=1 https://github.com/amix/vimrc.git ~/.vim_runtime && sh ~/.vim_runtime/install_awesome_vimrc.sh
# ~/.vim_runtime/my_configs.vim
set guifont=Monaco:h12
set lines=50 columns=100
set nu
set clipboard=unnamed
@qpark99
qpark99 / gugu.scala
Created May 9, 2014 12:20
Scala 구구단
(2 to 9).map(i => (1 to 9).map(j => i + "*" + j + "=" + (i * j)))
@qpark99
qpark99 / csv-to-json.rb
Created December 18, 2013 04:13
CSV to JSON ruby script
require 'csv'
require 'json'
require 'open-uri'
if ARGV[0].nil?
raise "wrong number of arguments (0 for 1..2)"
end
file = open(ARGV[0])
@qpark99
qpark99 / csv_to_json.rb
Last active December 31, 2015 15:19
csv to json convert
require 'csv'
require 'json'
file_name = ARGV[0]
unless file_name.nil?
File.open(file_name) {|f| puts CSV.parse(f.read).to_json }
end
@qpark99
qpark99 / Share.java
Last active December 31, 2015 12:59
Android 이미지 공유하기
// 참고 http://stackoverflow.com/questions/15702891/how-to-share-text-image-in-google-plus-g-from-android-without-using-intent
public void shareImage(String appName, File file) {
List<Intent> targetedShareIntents = new ArrayList<Intent>();
Intent share = new Intent(android.content.Intent.ACTION_SEND);
share.setType("image/jpeg");
List<ResolveInfo> resInfo = mContext.getPackageManager().queryIntentActivities(share, 0);
if ( !resInfo.isEmpty() ) {
for ( ResolveInfo info : resInfo ) {
Intent targetedShare = null;
Log.i(">>>>>>>>", "PackageName : " + info.activityInfo.packageName + " / " + info.activityInfo.name);
@qpark99
qpark99 / CookieSync.java
Last active January 28, 2016 03:25
android loopj http library, WebView Cookie Sync
AsyncHttpClient mClient = new AsyncHttpClient();
CookieSyncManager.createInstance(context);
CookieStore cookieStore = new PersistentCookieStore(c);
mClient.setCookieStore(cookieStore);
public void syncCookie() {
HttpContext httpContext = mClient.getHttpContext();
CookieStore cookieStore = (CookieStore) httpContext.getAttribute(ClientContext.COOKIE_STORE);
List<Cookie> cookies = cookieStore.getCookies();
@qpark99
qpark99 / ubuntu-webdav.sh
Created November 30, 2013 09:14
Ubuntu WebDAV 설치, 설정
# http://ubuntuguide.org/wiki/WebDAV
# install apache
sudo apt-get install apache2
# ufw
# sudo ufw allow 80/tcp
# enable apache dav module
@qpark99
qpark99 / Digest.java
Last active July 26, 2016 22:45
Java MD5, SHA256 Hash
public static String md5(String s)
{
try
{
// Create MD5 Hash
MessageDigest digest = MessageDigest.getInstance("MD5");
digest.update(s.getBytes(Charset.forName("UTF-8")));
byte messageDigest[] = digest.digest();
// Create Hex String
@qpark99
qpark99 / 0_reuse_code.js
Created November 23, 2013 02:53
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@qpark99
qpark99 / rvm-install-and-ruby2-install.sh
Created July 9, 2013 08:58
rvm install; ruby 2.0 install;
# rvm install
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
rvm install 2.0
rvm --default use 2.0