Skip to content

Instantly share code, notes, and snippets.

@sculouis
sculouis / machine.js
Created April 21, 2020 01:32
Generated by XState Viz: https://xstate.js.org/viz
const stateMachine = Machine({
id: 'toggle',
context: {
test:"test data"
/* some data */
},
initial: 'QuoteBasic',
states: {
QuoteBasic: {
on: {
@sculouis
sculouis / machine.js
Created April 20, 2020 06:14
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@sculouis
sculouis / machine.js
Created April 18, 2020 03:28
Generated by XState Viz: https://xstate.js.org/viz
const lightMachine = Machine({
id: 'light',
initial: 'green',
states: {
green: {
on: {
TIMER: 'yellow'
}
},
@sculouis
sculouis / machine.js
Created April 18, 2020 03:27
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
DECLARE
@Option int = 1, --排序
@PageNum INT = 2, --頁次
@PageSize INT = 5, --每頁筆數
@TotalRows INT; --總筆數
select FormKind,
FillInEmpNum,
TotalRows = COUNT(*) OVER() from FormMaster
@sculouis
sculouis / C# chain func
Created March 14, 2020 14:46
C# chain func
void Main()
{
Func<string, string> f1 = x => x.Replace("*", string.Empty);
Func<string, string> f2 = x => x.Replace("--", string.Empty);
Func<string, string> f3 = x => x.ToUpper();
//Func<string, string> pipeline = x => f3(f2(f1(x)));
Func<string, string> pipeline = Pipeline(f1, f2, f3);
pipeline.Invoke("te-*-st").Dump(); // prints "TEST"
@sculouis
sculouis / webpack.config.js
Created July 23, 2019 08:51
bootstrap及vue的webpack設定
const path = require('path')
const VueLoaderPlugin = require('vue-loader/lib/plugin');
module.exports = {
mode:'development',
entry:'./src/index.js',
devtool:'inline-source-map',
devServer: {
contentBase: './dist'
},
@sculouis
sculouis / package.json
Created July 23, 2019 08:48
bootstrap及vue的套件檔
{
"name": "test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack",
"watch": "webpack --watch",
"start": "webpack-dev-server --open"
@sculouis
sculouis / webpack.config.js
Last active July 22, 2019 08:37
webpack設定檔
const path = require('path')
module.exports = {
mode:'development',
entry:'./src/index.js',
output:{
filename:'main.js',
path:path.resolve(__dirname,'dist')
},
devtool:'inline-source-map',
@sculouis
sculouis / package.json
Last active July 22, 2019 08:35
nodejs 安裝的相關套件
{
"name": "test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack",
"watch": "webpack --watch",
"start": "webpack-dev-server --open"