Skip to content

Instantly share code, notes, and snippets.

View sakai-memoru's full-sized avatar

sakai memoru sakai-memoru

  • japan
View GitHub Profile
@sakai-memoru
sakai-memoru / map-loop.js
Last active July 23, 2022 02:32
## JScript environment
// map-loop.jse
// + sakura macro folder
// + lib
// + StringUtil.jse
// + DateUtil.jse
// + Dialog.jse
// + File.jse
// + FileUtil.jse
// + json2.js
// + mustache.js
@sakai-memoru
sakai-memoru / map-loop.js
Last active July 21, 2022 03:47
## object foreach loop with js - ts
// import { fileURLToPath } from "url";
/**
* @param {string} str
* @returns {number} ret
*/
// const doMain = (str:string):number => {
const doMain = (str) => {
// --------------------- begin.
console.info("// ------------------ begin.");
@sakai-memoru
sakai-memoru / helloworld.go
Created July 19, 2022 06:01
Golang Basic
package main
import (
"fmt"
)
func getMessage(name string) string{
ret := fmt.Sprintf("Hello, %v!", name)
return ret
}
@sakai-memoru
sakai-memoru / 091-dictionary.csx
Created July 18, 2022 23:47
## C# Dictionary
#!/usr/bin/env dotnet-script
using System;
using System.Reflection;
using System.Diagnostics;
using System.Collections.Generic;
static int doMain(string str)
{
// -------------------- begin.
var info = MethodBase.GetCurrentMethod();
@sakai-memoru
sakai-memoru / Do-Hashtable.ps1
Created July 18, 2022 22:32
# operating [hashtable] on powershell
function doMain() {
## function spec
[OutputType([int])]
Param(
[string]$str
)
## -------------- begin.
begin
(function(){
///////////////////////////////////////
// here-string CRLF
// ↓↓↓↓↓↓↓↓↓
var herestrings = function(){
/*
## memo : yy/MM/dd(ddd)hh:mm :
Public Sub run()
''' /********************************************************
Console.info "----- Try Code start--------------!"
Call getParamArray(1, 2, 3, 4, 5)
Console.info "----- Try Code -------------- end!"
End Sub
Private Sub getParamArray(ParamArray ary() As Variant)
''' /********************************************************
Dim i As Integer
@sakai-memoru
sakai-memoru / Tool_ModuleExporter.cls
Created March 21, 2020 01:52
For Excel VBA, To export module files into the current folder.
Option Explicit
''' /****************************************
''' * @file Tool_ModuleExporter.cls
''' * @version 1.00
''' * @since 2020/03/31
''' */
'
''' /********************************************************
''' * @class T_ModuleExporter
''' * @classdesc Module Exporter
const Shell = require("node-powershell");
const pwsh = new Shell({
executionPolicy: "Bypass",
noProfile: true
});
let cmd_statement1 = 'echo "Hello node and powershell"';
let cmd_statement2 = 'ls';

Sakura Macro::execute_with_wsh.jse

  • 編集ファイルを保存後に、scriptを実行する。
    • ctrl+F5で、外部プログラム(cscript.exe, node.js, etc)を起動して、jsの動作確認をするが、この際、複数のスクリプト(wshとnodeとpowershell)を並行で開発している際に利用できる。
    • node用、powershell用も作ると分けて起動できる。

image