Skip to content

Instantly share code, notes, and snippets.

View carrotsword's full-sized avatar

Carrotsword carrotsword

View GitHub Profile
@carrotsword
carrotsword / project.clj
Created February 25, 2016 09:37
teslogger-server 試し
(defproject teslogger-server "0.1.0-SNAPSHOT"
:description "Collect screenshots"
:url "https://github.com/kawasima/teslogger-server"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[org.clojure/tools.logging "0.3.1"]
[compojure "1.1.9"]
[hiccup "1.0.5"]
[liberator "0.12.2"]
@carrotsword
carrotsword / run-teslogger-db-inspection-SNIPPET.bat
Last active February 25, 2016 09:34
OracleのURL全然覚えられない。サービス名使う場合はまた違う
set TESLOGGER_DB_URL=jdbc:oracle:thin:%USERNAME%/%PASSWORD%@%HOST%:%PORT%:%SID%
"%~dp0\bin\teslogger_db_inspection.bat"
@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
@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 / 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 / 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 / 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;
@carrotsword
carrotsword / date-formatted.sh
Created September 29, 2015 12:49
date コマンドで yyyy-MM-dd 文字列を得る
date +%Y-%m-%d
@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 / 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;
}