Skip to content

Instantly share code, notes, and snippets.

@dstyle0210
dstyle0210 / codingdojang_study01.js
Created July 12, 2016 06:53
코딩도장 공부 : Multiples of 3 and 5
// 코딩도장 공부
// http://codingdojang.com/scode/350
var s = 0;
for(i=1;i<1000;i++){
s += (i%3==0 || i%5==0) ? i : 0;
}
console.log(s);
@dstyle0210
dstyle0210 / node.getMyFolder.js
Last active July 12, 2016 02:12
[node] file path에서 자신의 바로상위 폴더명 가져오기.
var path = require('path');
function getFolder(file){
return path.parse( path.parse(file.path).dir ).base;
};
var pathUrl = "/src/css/test.css";
var myFolder = getFolder(pathUrl); // return "css"
console.log(myFolder);
@dstyle0210
dstyle0210 / .csscomb.json
Last active July 11, 2016 05:59
마봉아빠's Gulp Setting
{
"remove-empty-rulesets": true,
"always-semicolon": true,
"quotes": "double",
"color-case": "lower",
"exclude": [
".git/**",
"node_modules/**",
"bower_components/**"
],
@dstyle0210
dstyle0210 / gulp-sass-used.js
Last active July 12, 2016 02:32
[gulp] gulp-sass 사용법.
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
// 자세한 옵션은 "https://github.com/sass/node-sass#options" 에서 확인 필요.
var sass_opt = {
/**
* outputStyle (Type : String , Default : nested)
* CSS의 컴파일 결과 코드스타일 지정
@dstyle0210
dstyle0210 / colorbox_reset.js
Created October 28, 2015 05:00
colorbox 초기화 후에 다시 띄우기
// colorbox 초기화 한 후에 다시 띄우기.
function onlyCallOrderOpen(){
var colorboxOptions = {
inline : true,
width : "100%",
href : "#onlyCallOrder",
onClosed: function () {
clearInterval(timer);
$(".certiInput").hide();
$.colorbox.remove();
@dstyle0210
dstyle0210 / jquery.onoff.js
Created May 22, 2015 08:17
[jquery] 선택된 이미지 배열에서 특정 eq만 on으로 바꿔줌.
// onoff extend
(function($) {
$.fn.onoff = function(n, on, off) {
var n = n;
var on = (!on) ? "On." : on + ".";
var off = (!off) ? "Off." : off + ".";
$(this).each(function(i) {
this.src = (this.src).replace(on, off);
if (i == n) {
this.src = (this.src).replace(off, on);
@dstyle0210
dstyle0210 / jquery.carousel.js
Last active August 29, 2015 14:21
[jquery] carousel
@dstyle0210
dstyle0210 / jquery.runquery.js
Created May 19, 2015 10:00
[jquery] RunQuery
/*
* jQuery runQuery v0.9b - http://dstyle.raonnet.com/runquery_v2/
* Release Date : 2011/10/10 (Date-based Korea)
* Last Modified : 2011/10/27 (Date-based Korea)
*
* Open source under the BSD License.
*
* jQuery 1.6.2 이상에서 정상적으로 동작합니다.
*
* 제작자 : 원용봉(dstyle@reflexion.co.kr) by REFLEXION Web Team.
@dstyle0210
dstyle0210 / textareaToByte.js
Created May 14, 2015 08:14
[jquery] textarea 글자수 , 바이트수 체크하기.
/**
* 글자수(바이트 체크)
* @param oid : 글자를 받을 Textarea ID
* @param tid : 바이트 체크된 값 리턴될 엘리먼트 ID
*/
function pubByteCheckTextarea(oid,tid){
$(oid).on("keyup",function(){
var byteTxt = "";
var byte = function(str){
var byteNum=0;
@dstyle0210
dstyle0210 / tistoryCategoryJson.js
Created April 23, 2015 04:09
[tistory, jquery] Category to JSON (카테고리 목록을 json화)
function tistoryCategoryJson(oId){
var o = {};
// 데이터 추출
function data(tg,dom){
tg.link = $(dom).find(">li>a").attr("href");
tg.cnt = $(dom).find(">li>a>span").text();
$(dom).find(">li>a>span").remove();
tg.title = $(dom).find(">li>a").text();
}