Skip to content

Instantly share code, notes, and snippets.

@4ox
4ox / split.py
Last active October 22, 2019 05:46
# -*- coding: utf-8 -*-
from time import sleep
num=7
file_name = 'origin'
file_ext = '.csv'
first_line = True
files = {}
file_idx = 0
@4ox
4ox / Date.prototype.Extention.js
Created September 6, 2019 01:13
Javascript Date Format prototype Extention
//Date.prototype
Date.prototype.Format = function( str ){
var date = this;
return str.replace(/%(Y|y|n|m|d|j|a|A|g|G|h|H|i|s|DD|ll|D|l|%)/g, function( word ){
switch( word ){
case "%%": return '%'; break;
case "%Y": return date.getFullYear(); break;
case "%y": return String(date.getFullYear()).substring(2,4); break;
case "%n": return Number(date.getMonth())+1; break;
case "%m": return (date.getMonth() < 9 ? "0" : "" )+(date.getMonth()+1); break;
@4ox
4ox / gist:884257f9aabaea1af0ebcc421c3d225e
Last active November 8, 2017 03:03
대각선 배열 위치구하기
//vars
var width = 12;
var height = 9;
var max = width * height;
//기본배열 만들어보기
function initArray() {
var nums = [];
for( var i = 1, row = []; i < max+1; i++) { nums.push(i); }
$("#reportAddPhoto, #reportAddMovie").change(function(e){
//파일 로드 및 사이즈 관리
var file = e.target.files[0];
var size = ( file.size / 1000 / 1000 ).toFixed(2);
var maxFileSize = 100; //MB
var maxFileLength = 3;
var fileCount = $(".progress-box .progress-wrap").length;
//파일크기부터 체크
if( maxFileSize > size && size > 0 ) {