Skip to content

Instantly share code, notes, and snippets.

View carrotsword's full-sized avatar

Carrotsword carrotsword

View GitHub Profile
@carrotsword
carrotsword / gist:cf4af590ab4a6b70921e
Created September 9, 2014 07:02
WSH(JS) からExcelのセル読み取ったりなんだりする
function err(message){
WScript.Echo(message);
}
function isSuffix(target, suffix){
return target.indexOf(suffix, target.length - suffix.length) !== -1;
}
@carrotsword
carrotsword / template.js
Created August 6, 2015 08:54
Usage : cscript template.js infile outfile binding
// Usage : cscript template.js infile outfile binding
function trim(str){
return str.replace(/^\s+/,'').replace(/\s+$/,'');
}
function buildContext(path){
var fs = new ActiveXObject('Scripting.FileSystemObject');
var ts = fs.OpenTextFile(path,1)
@carrotsword
carrotsword / date-formatted.sh
Created September 29, 2015 12:49
date コマンドで yyyy-MM-dd 文字列を得る
date +%Y-%m-%d
@carrotsword
carrotsword / today.js
Created October 29, 2015 09:28
今日のフォルダを作る
function pad0(base,length){
for(var x=base+'';x.length < length;x='0'+x);
return x;
}
var d = new Date();
var fname = pad0(d.getFullYear(),4) + '-' + pad0(d.getMonth()+1,2) + '-' + pad0(d.getDate(),2);
var target = WScript.ScriptFullName.substring(0,WScript.ScriptFullName.length - WScript.ScriptName.length) + "\\" + fname;
{
"sublimelinter_delay": 0.1,
// If true, lines with errors or warnings will have a gutter mark.
"sublimelinter_gutter_marks": true,
// If true, the find next/previous error commands will wrap.
"sublimelinter_wrap_find": true,
// Use ~/.jshintrc instead
// "jshint_options": {}
@carrotsword
carrotsword / account-convert.py
Created November 8, 2013 05:24
Snippet to convert account data exorted on intra-mart Web platform v5 to iAP ready format
# coding=utf-8
from elementtree.ElementTree import *
from jinja2 import Template
tree = parse("path/to/file")
rootElem = tree.getroot()
elementTemplate = """
<account-data cd="{{userCd}}">
<password>{{password}}</password>
@carrotsword
carrotsword / Gruntfile.js
Created February 10, 2016 01:38
intra-mart Accel Platform のスクリプト開発を普通のエディタ+Node.jsでやるシリーズ
module.exports = function(grunt){
grunt.initConfig({
pkg : grunt.file.readJSON('package.json'),
watch : {
sync : {
tasks : 'sync',
files: ['src/main/**/*']
}
},
sync : {
@carrotsword
carrotsword / package.json
Created February 10, 2016 01:42
intra-mart Accel Platform のスクリプト開発を普通のエディタ+Node.jsでやるシリーズ
{
"name": "projectname",
"version": "0.0.0",
"description": "",
"main": "index.js",
"scripts": {},
"author": "carrotsword",
"license": "other",
"devDependencies": {
"grunt-contrib-copy": "^0.8.2",
@carrotsword
carrotsword / archive.js
Created February 24, 2016 11:58
同じフォルダにあるファイル・フォルダを、./Archive/{日付} のフォルダにしまう
var archiveFolderName = 'Archives';
function pad0(base,length){
for(var x=base+'';x.length < length;x='0'+x);
return x;
}
var currentFolderPath = WScript.ScriptFullName.substring(0,WScript.ScriptFullName.length - WScript.ScriptName.length);
@carrotsword
carrotsword / run-teslogger.bat
Created February 25, 2016 09:30
システムプロパティでドライバーを指定しましょう
java -Dwebdriver.chrome.driver="%~dp0\chromedriver.exe" -jar %~dp0\teslogger-0.2.2-standalone.jar