Skip to content

Instantly share code, notes, and snippets.

Avatar
🎹
Focusing

Bohyung kim dsdstudio

🎹
Focusing
View GitHub Profile
View vertical-enable.iscroll.js
var point, pointStartX, pointStartY, deltaX, deltaY;
var scroller = new iScroll('scrollerId', {
vScroll: false,
vScrollbar: false,
hScrollbar: false,
snap: 'li',
momentum: false,
onBeforeScrollStart: function(e) {
point = e.touches[0];
pointStartX = point.pageX;
@dsdstudio
dsdstudio / d3-doughnutchart.js
Created Mar 4, 2014
D3를 이용한 도넛 차트와 레전드
View d3-doughnutchart.js
var data = [{
title: "KOSPI",
jisu: "1,965",
change: 3.22,
percent: "0.22%",
collections: [{
l: "상한",
v: 5
}, {
l: "상승",
@dsdstudio
dsdstudio / d3-horizontal-barchart.js
Last active Aug 29, 2015
d3 바차트 프로토타이핑
View d3-horizontal-barchart.js
var data = [
{l:"개인", v:55, t:1},
{l:"기관", v:343, t:2},
{l:"외인", v:332, t:1}
];
var margin = {top: 20, right: 20, bottom: 30, left: 40};
var w = 500;
var h = 80 - margin.bottom - margin.top;
var barWidth = w / data.length;
@dsdstudio
dsdstudio / angular.watcher.purge.js
Created Mar 7, 2014
앵귤러쓸때 watcher 들을 꼭 정리하자~
View angular.watcher.purge.js
var watchers = [];
watchers.push($scope.$watch("currentTab", function(newer, older) {
$scope.routing = getRouting(newer);
}));
watchers.push($rootScope.$watch("SR.connected", function(connected) {
if ( connected ) $scope.watchAskingPriceWithMarketPrice();
}, true));
$scope.$on("$destroy", function(){
watchers.forEach(function(fn) { fn(); });
@dsdstudio
dsdstudio / logback.xml
Created Mar 13, 2014
예외로그는 필요한부분(RootCause)만 추려서 보여주는 형태의 설정
View logback.xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>[%d{yyyy/MM/dd HH:mm:ss,SSS}] [%thread] %-5p: %c:%L - %m%n%rEx{5}</pattern>
</encoder>
</appender>
<logger name="net.stockrules">
<level value="debug"/>
@dsdstudio
dsdstudio / gist:9934419
Created Apr 2, 2014
OSX 에서 JAVA_HOME 잡을때 유용
View gist:9934419
bhkim@dsdstudio-MBP ~
 /usr/libexec/java_home -V
Matching Java Virtual Machines (4):
1.8.0, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home
1.7.0_17, x86_64: "Java SE 7" /Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home
1.6.0_65-b14-462, x86_64: "Java SE 6" /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
1.6.0_65-b14-462, i386: "Java SE 6" /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
@dsdstudio
dsdstudio / gist:4555f0e64243bb88e8e7
Created May 15, 2014
QRCode generation prototype
View gist:4555f0e64243bb88e8e7
import com.google.zxing.common.BitMatrix;
import com.google.zxing.qrcode.QRCodeWriter;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@dsdstudio
dsdstudio / unload.js
Created Jul 28, 2014
Page refresh 방지
View unload.js
$(window).bind("beforeunload", function() { return '등록중인 절차가 모두 취소되며 메인 페이지로 돌아갑니다. \n 계속하시겠습니까?'; })
.bind("unload", function(){ $.ajax({ type: 'GET', async: false, url: U.oebu.urlMap.logout }); });
@dsdstudio
dsdstudio / gist:1642773eb256cfd82dc6
Last active Aug 29, 2015
openssl key 파일 비밀번호 제거하기
View gist:1642773eb256cfd82dc6
# openssl key 파일 비밀번호 제거하기
/path/to/openssl rsa -in /path/to/originalkeywithpass.key -out /path/to/newkeywithnopass.key
## 기관별 체인 인증서 뭉치기
# http://www.digicert.com/ssl-certificate-installation-nginx.htm
# https://www.comodossl.co.kr/support/faq/view.aspx?category=SSL&Seq=70
 cat yourdomain.net.crt PositiveSSL.Chain/PositiveSSLCA2.crt PositiveSSL.Chain/AddTrustExternalCARoot.crt >> yourdomain.net.crt
@dsdstudio
dsdstudio / deepcopy.js
Created Sep 16, 2014
Javascript Array in object deep copy
View deepcopy.js
var deepcopiedArray = JSON.parse(JSON.stringify(model.prevdata));