Skip to content

Instantly share code, notes, and snippets.

View junho85's full-sized avatar
💭
Working

JunHo Kim (김준호) junho85

💭
Working
View GitHub Profile
@junho85
junho85 / osx_configuration.md
Last active August 28, 2015 04:53
osx configuration

Home and End Key Maping

edit (if not exists create a file)

~/Library/KeyBindings/DefaultKeyBinding.dect
{
/* Remap Home / End keys to be correct */
"\UF729" = "moveToBeginningOfLine:"; /* Home */
var page= require('webpage').create(),
system = require('system');
var url = 'http://www.ingress.com/intel';
var date = (new Date()).toISOString();
var output = '{{PATH}}' + date + '.png';
phantom.addCookie({
name: 'ACSID',
value: '{{ACSID}}',
@junho85
junho85 / jackson.java
Last active August 29, 2015 14:15
Jackson json parse from URL
JsonFactory jsonFactory = new JsonFactory();
ObjectMapper objectMapper = new ObjectMapper();
try {
JsonParser jp = jsonFactory.createParser(new URL("http://somewhere/test.json"));
JsonNode root = objectMapper.readTree(jp);
System.out.println(root.get("status"));
System.out.println(root.get("data"));
System.out.println(root.toString());
// json array to list
@junho85
junho85 / gist:79fd7077e2fb55deed11
Last active August 29, 2015 14:21
IntelliJ Useful Plugins

IntelliJ Useful Plugins

  • lombok
  • FindBugs-IDEA
@junho85
junho85 / my.ahk
Created July 3, 2015 01:46
my autohotkey
; CapsLock to ESC
classname = ""
keystate = ""
*CapsLock::
WinGetClass, classname, A
if (classname = "PuTTY" or classname = "Vim" or classname="mintty" or "TMobaXtermForm") {
SetCapsLockState, Off
send,{ESC}
}
@junho85
junho85 / hello.c
Created July 14, 2015 12:01
hello.c
#include <stdio.h>
int main() {
printf("hello world!");
return 0;
}
@junho85
junho85 / split.java
Last active August 29, 2015 14:25
file read line by line and split empty
try (Stream<String> stream = Files.lines(Paths.get("list.txt"), Charset.defaultCharset())) {
stream.forEach((line) -> {
String[] array = line.split("\\s+");
String name = array[0];
String userid = array[1];
log.info("name={}; userid={}", name, userid);
});
} catch (IOException e) {
@junho85
junho85 / trim.pl
Created August 5, 2015 04:52
trim.pl
# trim
sub trim {
my @result = @_;
foreach (@result) {
s/^\s+//; # 앞쪽 공백 지우기
s/\s+$//; # 뒤쪽 공백 지우기
}
return wantarray ? @result : $result[0];