Skip to content

Instantly share code, notes, and snippets.

View howlowck's full-sized avatar

Hao Luo howlowck

View GitHub Profile
@howlowck
howlowck / notes.md
Last active May 3, 2022 15:53
GitHub Actions Certs Notes

Types of Actions

Actions come in two types: container actions and JavaScript actions.

Docker container actions allow the environment to be packaged with the GitHub Actions code and can only execute in the GitHub-Hosted Linux environment.

JavaScript actions decouple the GitHub Actions code from the environment allowing faster execution but accepting greater dependency management responsibility.

@howlowck
howlowck / machine.js
Created July 20, 2021 19:12
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@howlowck
howlowck / machine.js
Last active February 5, 2021 13:30
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@howlowck
howlowck / machine.js
Created February 6, 2020 15:56
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@howlowck
howlowck / action-a.ts
Last active January 28, 2020 17:41
"Yet Another Redux+Typescript Approach" Example
const createTestAction = (payload: string) => ({
type: 'TEST',
fooPayload: payload
} as const)
const createTest2Action = (payloadNum: number) => ({
type: 'TEST2',
barPayload: payloadNum
} as const)
@howlowck
howlowck / docker-alias.md
Created March 26, 2019 23:27
Docker Notes

Delete all exited containers

docker ps -a -f status=exited -q | awk '{print $1}' | xargs docker rm

Delete all images with no name

docker images | grep "" | awk '{print $3}' | xargs docker rmi

Endpoint=sb://ndcflysimns.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=dp6DiycLDrt0anmDILQsHONwgg2yGA19CsuESKOqp6E=;EntityPath=flysim-shared-input-hub
-- Distinct Count
SELECT
COUNT(DISTINCT deviceId) AS distinctCount,
0 AS MinCount,
60 AS MaxCount
INTO
DeviceCount
FROM
NodebotsIothub
GROUP BY
//generate a big array parses the BASIC syntax
//generate javascript
function getParameter(brokenUpArray) {
var param = brokenUpArray.join(' ')
if (param[0] === '"') // assume it's string
{
return {
type: 'string',
value: param.substr(1, param.length-2)
//generate a big array parses the BASIC syntax
//generate javascript
function getParameter(brokenUpArray) {
var param = brokenUpArray.join(' ')
if (param[0] === '"') // assume it's string
{
return {
type: 'string',
value: param.substr(1, param.length-2)
}