Skip to content

Instantly share code, notes, and snippets.

View ainvyu's full-sized avatar
๐Ÿ”ฅ
Beating burnout

Yongjin Jung ainvyu

๐Ÿ”ฅ
Beating burnout
  • Samsung Electronics
  • Korea, Republic of
View GitHub Profile
@ainvyu
ainvyu / test.java
Last active February 25, 2016 01:28
@Test
public void timezoneTest() throws Exception {
long slotSize = 86400000; // ms -> 1day
Calendar caldendar = Calendar.getInstance();
long origCurTime = caldendar.getTimeInMillis();
caldendar.setTimeZone(TimeZone.getTimeZone("Asia/Seoul"));
long curTime = caldendar.getTimeInMillis();
long tzOffset = TimeZone.getDefault().getRawOffset();
@ainvyu
ainvyu / gist:e9dbfbf56278748a4c5d
Created December 29, 2015 04:37
Date sample rev.3 (Java 8 ver.)
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
/**
* Created by vine on 15. 12. 29..
*/
@ainvyu
ainvyu / gist:4b2f190b3379dfaadb00
Created December 29, 2015 02:56
Date sample rev.2
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
/**
* Created by vine on 15. 5. 27..
*/
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
/**
* Created by vine on 15. 5. 27..
*/
/**
* Created by eniv on 2015. 12. 27..
*/
let fetch = require('node-fetch');
let _ = require('lodash');
async function getCurrency(from, to) {
let res = await fetch('http://finance.yahoo.com/webservice/v1/symbols/allcurrencies/quote?format=json');
let currency_data = await res.json();
@ainvyu
ainvyu / gist:6978367
Created October 14, 2013 16:30
์ดˆ๊ธฐ์„ค์ •

์„ค์ •

PATH ๋ณ€์ˆ˜์— Java ๊ฒฝ๋กœ์™€ Android SDK ๊ฒฝ๋กœ ์„ค์ •์ด ํ•„์š”ํ•˜๋‹ค.

ํ™˜๊ฒฝ ๋ณ€์ˆ˜์— JAVA_HOME์„ ์ถ”๊ฐ€ํ•œ๋‹ค. JAVA_HOME์˜ ๊ฐ’์€ jdk๊ฐ€ ์„ค์น˜๋œ ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ ๋„ฃ๋Š”๋‹ค.

setx -m JAVA_HOME "C:\Program Files\Java\jdk1.7.0_21"

ํ™˜๊ฒฝ ๋ณ€์ˆ˜์— ANDROID_HOME ์„ ์ถ”๊ฐ€ํ•œ๋‹ค. ์ด๊ฒƒ์€ ๋ฐ˜๋“œ์‹œ ํ•„์š”ํ•˜์ง„ ์•Š๊ณ  ์•„๋ž˜ PATH ๋ณ€์ˆ˜ ์ถ”๊ฐ€์˜ ํŽธ์˜๋ฅผ ์œ„ํ•ด ๋„ฃ๋Š”๋‹ค.

@ainvyu
ainvyu / gist:6978354
Created October 14, 2013 16:29
plugin

config.xml์— ์ถ”๊ฐ€

phonegap document ์ƒ์—๋Š” config.xml ์— ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์‹์œผ๋กœ ์ถ”๊ฐ€ํ•˜๋ฉด ๋œ๋‹ค๊ณ  ํ•˜๋‚˜ ์ €๋Œ€๋กœ ํ•˜๋ฉด ์•ˆ๋œ๋‹ค.

<plugin name=PluginName value="org.apache.cordova.plugin.PluginClassName>

์‹ค์ œ ์ฝ”๋“œ(org/apache/cordova/PluginManager.java์˜ loadPlugins ๋ฉ”์†Œ๋“œ)๋ฅผ ๋ณด๋ฉด plugin element์˜ service๋ช…์„ ์–ป์–ด์™€์•ผ ํ•˜๋Š”๋ฐ ์ฝ”๋“œ ์ƒ์— ๊ฑธ๋Ÿฌ์ฃผ๋Š” ๋ถ€๋ถ„์ด ์—†๋‹ค. ๋•Œ๋ฌธ์— feature๋ฅผ ์จ์•ผํ•œ๋‹ค.

๊ทธ๋ž˜์„œ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ถ”๊ฐ€ํ•˜๋ฉด ๋œ๋‹ค.

@ainvyu
ainvyu / gdm_downloader_with_coro.pl
Created September 29, 2013 18:25
Game Developer Magazine Digital Edition Archives downloader
#!/usr/bin/env perl
use common::sense;
use Web::Query;
use Readonly;
use Coro;
use Coro::LWP;
use Coro::Semaphore;
use WWW::Mechanize;
1. ๋ช…๋ น์–ด ํ”„๋กฌํ”„ํŠธ๋ฅผ ์—ฐ๋‹ค.
2. diskpart๋ฅผ ์ž…๋ ฅํ•˜๊ณ  ์—”ํ„ฐ
3. diskpart์— ๋“ค์–ด๊ฐ€์„œ
list disk (์—ฌ๊ธฐ์„œ USB ๋ฉ”๋ชจ๋ฆฌ์˜ ํŒŒํ‹ฐ์…˜ ๋ฒˆํ˜ธ๋ฅผ ํ™•์ธํ•œ๋‹ค.)
select disk 1 (์œ„์—์„œ ํ™•์ธํ•œ ๋ฒˆํ˜ธ๋ฅผ ๋„ฃ๋Š”๋‹ค.)
clean
create partition primary
select partition 1
active
async.waterfall([
function(callback){
callback(null, 'one', 'two');
},
function(arg1, arg2, callback){
callback(null, 'three');
},
function(arg1, callback){
// arg1 now equals 'three'
callback(null, 'done');