Skip to content

Instantly share code, notes, and snippets.

Avatar

Nabil Redmann BananaAcid

View GitHub Profile
@BananaAcid
BananaAcid / _readme.md
Last active Aug 12, 2021
node js simple param parsing
View _readme.md

commandline parsing in nodejs

Parse commandline arguments (common formats) on osx/linux/windows:

    --param1             =>  argv.param1 = true
    --param2 "ab c"      =>  argv.param2 = 'ab c'
    --param3 abc         =>  argv.param3 = 'abc'
    -p4                  =>  argv.p4 = true
    -p4 val              =>  argv.p4 = 'val'
    -p4 "val 2"          =>  argv.p4 = 'val 2'
    /p5                  =>  argv.p5 = true
@BananaAcid
BananaAcid / cache-promise-returns.mjs
Created Aug 12, 2021
simple, ugly and working (should probably be a class)
View cache-promise-returns.mjs
/*
* cache module for promis returns
*
* @author Nabil Redmann <repo+gist@bananaacid.de>
* @license ISC
*
* USE:
* cache.setTTL(10*1000); // optional
*
* let [ret1, ret2, ret3] = await cache.create(
View howto-rpi-pihole.md
  1. RaspberryPi OS

  2. PPI (connect screen and keyboad)

    • login: pi:raspberry
    • sudo raspi-config
      • WLAN ?
        • set it up.
@BananaAcid
BananaAcid / getOutput.mjs
Last active May 17, 2021
get process output / async JS
View getOutput.mjs
/*
* Get output and exitcode from a command
*
* @author Nabil Redmann <repo+gist@bananaacid.de>
* @license ISC
*
* import getOutput from './getOutput.mjs';
* let {out, code} = getOutput('ls', ['-l', '*.txt']);
*/
import { spawn } from 'child_process';
@BananaAcid
BananaAcid / readme.md
Last active Jan 22, 2021
Web-Starter Package on VSCode für Mediengestalter
View readme.md

This is a living-document... immer wenn Änderungen nötig werden, werde ich dies hier updaten.

1. Installieren (Kommandozeile)

win:VSCode (per Win+R und eingeben: cmd )

\>  bitsadmin /transfer vscode /download /priority normal "https://aka.ms/win32-x64-user-stable" "%temp%\vscode.latest.exe" &&  %temp%\vscode.latest.exe /SILENT /NORESTART /MERGETASKS=!runcode
@BananaAcid
BananaAcid / web.config
Last active Jan 2, 2021
contao/iis web.config
View web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<!-- HTTPS !!
<rule name="Redirect to https" stopProcessing="true">
@BananaAcid
BananaAcid / .gitignore
Created Mar 14, 2020
Pack up a project and some couchdb docs
View .gitignore
node_modules
.gitignore
thumbs.db
@BananaAcid
BananaAcid / .gitignore
Last active Mar 14, 2020
compress a folder with 7z using a gitignore list
View .gitignore
node_modules
.git
.gitignore
@BananaAcid
BananaAcid / local-redis-check.ps1
Created Jan 23, 2020
Check if a local redis server is up and running (no redis-cli for https://www.memurai.com/)
View local-redis-check.ps1
tnc 127.0.0.1 -port 6379
View SimplestHttpFileServer.cs
using System;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using System.Net;
namespace SimplestHttpFileServer
{
class Program