Skip to content

Instantly share code, notes, and snippets.

View peteringram0's full-sized avatar
🚀
To the moon

Peter Ingram peteringram0

🚀
To the moon
  • United Kingdom
View GitHub Profile
@peteringram0
peteringram0 / bump.sh
Created June 20, 2019 19:35
bump package.json version number (patch only)
#!/bin/sh
function bump {
# full package version
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g' \
@peteringram0
peteringram0 / hex.ts
Created August 25, 2022 18:32
hex to string and string to hex
/**
* String to Hex
*/
function stringToHex(str: Readonly<string>) {
let hex, i
let result = ''
for (i = 0; i < str.length; i++) {
hex = str.charCodeAt(i).toString(16)
result += hex
}