A tiny (265 byte) utility to create state machine components using two pure functions.
The API is a single function that accepts 2 pure functions as arguments:
| #!/bin/zsh | |
| :<<'ABOUT_THIS_SCRIPT' | |
| ----------------------------------------------------------------------- | |
| Written by:William Smith | |
| Partner Program Manager | |
| Jamf | |
| bill@talkingmoose.net | |
| https://gist.github.com/b6637160b65b751824943ede022daa17 |
| // per https://docs.npmjs.com/misc/scripts, npm exposes a bunch of variables to | |
| // the environment prefixed with npm_config_*, npm_package_* and npm_lifecycle_*. | |
| // Here's a list of all variables exposed in my setup. | |
| npm_config_access= | |
| npm_config_allow_same_version= | |
| npm_config_also= | |
| npm_config_always_auth= | |
| npm_config_argv='{"remain":[],"cooked":["run","foo"],"original":["run","foo"]}' | |
| npm_config_auth_type=legacy |
| /** | |
| * @license | |
| * Copyright (c) 2017, Luca Bertolasi. All Rights Reserved. | |
| * | |
| * This source code is licensed under the terms of the MIT license, | |
| * a copy of which can be found at https://choosealicense.com/licenses/mit/ | |
| */ | |
| function urlParser(url) { | |
| // fallback to location object if no arg has been provided |
A tiny (265 byte) utility to create state machine components using two pure functions.
The API is a single function that accepts 2 pure functions as arguments:
| Procedure followed by Pepijn to run the high sierra firmware installer: | |
| 1. get the FirmwareUpdate.pkg file from the OS installer app's installESD.dmg | |
| 2. extract the contents using pkgutil --expand /path/to/FirmwareUpdate.pkg <path somewhere else>/FirmwareUpdate | |
| 3. in terminal, cd to the Scripts directory inside the expanded FirmwareUpdate pkg directory. | |
| 4. with Scripts as your working directory, run these 2 commands, then reboot: | |
| sudo /usr/libexec/FirmwareUpdateLauncher -p "$PWD/Tools" | |
| sudo /usr/libexec/efiupdater -p "$PWD/Tools/EFIPayloads" | |
| 5. at the reboot, firmware will be updated if there are any updates to be applied. |
| #!/bin/bash | |
| # Author: @radekk | |
| # List of vulnerable packages is from https://twitter.com/iamakulov/status/892485192883073024 | |
| # ---------------------- | |
| _IFS=$IFS | |
| _COUNTER=0 | |
| _COUNTER_ALL=0 | |
| _SCAN_PATH=${1:-~/} | |
| _VULN_PACKAGES="babelcli crossenv cross-env.js d3.js fabric-js ffmepg gruntcli http-proxy.js jquery.js mariadb mongose mssql.js mssql-node mysqljs nodecaffe nodefabric node-fabric nodeffmpeg nodemailer-js nodemailer.js nodemssql node-opencv node-opensl node-openssl noderequest nodesass nodesqlite node-sqlite node-tkinter opencv.js openssl.js proxy.js shadowsock smb sqlite.js sqliter sqlserver tkinter" | |
| _REGEXP="(babelcli|crossenv|cross-env\.js|d3\.js|fabric-js|ffmepg|gruntcli|http-proxy\.js|jquery\.js|mariadb|mongose|mssql\.js|nodecaffe|nodefabric|node-fabric|nodeffmpeg|nodemailer-js|nodemailer\.js|nodemssql|node-opencv|node-opensl|node-openssl|noderequest|nodesass|nodesqlite|node-sqlite|node-tkinter|opencv\.js|openssl\.js|proxy\.js|shadowsock|smb|sqlite\.js|sqliter|sqlserver|tkinter)" |
If you hate git submodule, then you may want to give git subtree a try.
When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.
When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.
Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this:
| #!/usr/bin/env node | |
| const fs = require('fs'); | |
| const http = require('http'); | |
| const home = process.env.HOME; | |
| const options = { | |
| host: 'example.com', | |
| path: '/', |