Skip to content

Instantly share code, notes, and snippets.

@nmoadev
nmoadev / serve.ps1
Last active February 18, 2024 23:01
Zero-dependency Powershell WebServer in a one file.
# A zero-dependency tiny, copy-pasteable powershell web server for quick hacks
# Credit to https://woshub.com/simple-http-webserver-powershell/ for inspiration
# NOTE: If you download this script direclty, you will need to unblock it before running
# Unblock-File .\serve.ps1
param (
$webRoot = (Get-Location), # The folder from which to serve all files RECURSIVELY
$listenHostname = "localhost", # Hostname to listen on. Change at your own risk.
$listenPort = "9090" # The port to listen on.
)
# Needed for Content-Type header
@nmoadev
nmoadev / pom.xml
Created September 21, 2021 17:42
Reproducing docker-maven-plugin short-lived container issue
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com</groupId>
<artifactId>foobar</artifactId>
<version>0.0.0</version>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
@nmoadev
nmoadev / app.js
Last active August 29, 2015 14:08
OAuth in NodeJs with Express
var express = require('express'),
session = require('express-session'),
cookie = require('cookie-parser'),
serveStatic = require('serve-static'),
config,
nodeOAuth;
config = {
requestTokenUrl:'https://oauth.intuit.com/oauth/v1/get_request_token',
accessTokenUrl:'https://oauth.intuit.com/oauth/v1/get_access_token',