Skip to content

Instantly share code, notes, and snippets.

View greguz's full-sized avatar
🎸
Let's Rock!

Giacomo Gregoletto greguz

🎸
Let's Rock!
View GitHub Profile
@greguz
greguz / split-xiso.sh
Last active March 13, 2023 08:59
Split Xbox ISO files when necessary, also build its attach.xbe
#!/bin/bash
set -e
isoDir="$1"
if ! [ -d "$isoDir" ];
then
echo "$isoDir not a dir"
exit 1
fi
@greguz
greguz / number_to_words.js
Created October 4, 2019 07:18
A function in JavaScript to convert a number between 1 and 999 to words
function text19(value) {
switch (value) {
case 1:
return "one";
case 2:
return "two";
case 3:
return "three";
case 4:
return "four";
@greguz
greguz / stream_parse_xml.js
Last active March 10, 2023 10:33
Node.js XML to objects streaming edition (htmlparser2)
import { Parser } from 'htmlparser2'
import { Transform } from 'stream'
import _ from 'lodash'
export default class XmlParser extends Transform {
constructor (path = [], options = {}) {
super({
...options,
objectMode: true
})