"~/.config/oh-my-posh/erhhung.omp.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json
version: 4
iterm_features:
- current_dir
- remote_host| #!/usr/bin/env bash | |
| # @describe | |
| # | |
| # Find words of minimum length containing one or more | |
| # letters given, optionally requiring certain letters. | |
| # @option -n --minimum[=3|2|4|5|6|7|8] Minimum length | |
| # @option -r --required* Required letters | |
| # @arg letters* Contains letters |
| .common_profile: | |
| api_base: "{{ host_url }}/api" | |
| # https://slumber.lucaspickering.me/api/template_functions.html | |
| auth_token: "{{ response('sign_in', trigger='1h') | jsonpath('$.token') }}" | |
| session_user: "{{ response('session_user', trigger='no_history') | json_parse() }}" | |
| admin_user: "{{ session_user | jq('{id, name, email, role, profile_image_url}') }}" | |
| user_id: "{{ admin_user | jsonpath('$.id') }}" | |
| group_list: "{{ response('list_groups', trigger='no_history') | json_parse() }}" | |
| group_id: '{{ group_list | jsonpath(concat([''$[?(@.name=="'',group_name,''")].id''])) }}' | |
| knowledge_list: "{{ response('list_knowledge', trigger='no_history') | json_parse() }}" |
| # https://ghostty.org/docs/config/reference | |
| # https://ghostty.zerebos.com/ | |
| # shell | |
| term = xterm-256color | |
| shell-integration = bash | |
| shell-integration-features = no-cursor | |
| command = /bin/sh -c "printf '\e[2J\e[3J\e[H\n'; exec /usr/local/bin/bash -l" | |
| # window |
This document describes one way to load external JavaScript modules into Postman pre-request or test scripts to augment the functionality of your own scripts.
In the collection pre-request script, export common utility functions (feel free to add additional functions for your own use case as this is a common technique for sharing code among individual requests):
// get latest version
_ = require('lodash');
// export common utility functions
pm.globals.set('util', String(() => ({| /* | |
| * 1. open https://sandcastle.cesium.com/ | |
| * 2. paste this code into the editor | |
| * 3. open debugger and disable cache | |
| * 4. click Run and wait for globe | |
| * 5. click "Run camera sequence" | |
| */ | |
| const URL = 'https://geotest{s}.ixstack.net/wms'; | |
| const LAYER = 'gvdl:eethnhgcjbwvsrwaqfsgyvzzkw'; |
| #!/usr/bin/env node | |
| // | |
| // mkid - Make Object ID | |
| // | |
| // Usage: mkid [type|""] | |
| // type: 3-char type | |
| // | |
| // Requires global NPM modules: | |
| // | |
| // uuid^8.3.2 |
| #!/usr/bin/env bash | |
| # | |
| # empty entire S3 bucket | |
| # usage: emptyb <bucket> | |
| # | |
| # author: Erhhung Yuan <erhhung@alum.mit.edu> | |
| bucket=$1 | |
| if [ -z "$bucket" ]; then |
| #!/usr/bin/env bash | |
| # | |
| # show S3 bucket size/count | |
| # usage: bsize <bucket> | |
| # | |
| # author: Erhhung Yuan <erhhung@alum.mit.edu> | |
| bucket=$1 | |
| if [ -z "$bucket" ]; then |
| #!/usr/bin/perl | |
| # | |
| # chip - add/change/delete IP entry in "/etc/hosts" | |
| # | |
| # Usage: add/change: chip [-q] {host_name} {ip_address} | |
| # delete: chip {host_name} - | |
| # | |
| # -q: quiet - don't validate if Data::Validate::IP | |
| # module cannot be found | |
| # |