Skip to content

Instantly share code, notes, and snippets.

@mLuby
mLuby / nodejs_1-liner_server.md
Last active April 27, 2023 21:52
NodeJS Server 1-liners

Submitted for your approval, a NodeJS solution in 123 chars. ⛳

r=require;r("http").createServer((i,o)=>r("stream").pipeline(r("fs").createReadStream(i.url.slice(1)),o,_=>_)).listen(8080)

Run it in bash to serve files relative to that directory, and also any file on your computer if given an absolute path. 😱

node -e 'r=require;r("http").createServer((i,o)=>r("stream").pipeline(r("fs").createReadStream(i.url.slice(1)),o,e=>console.log(i.url,e))).listen(8080)'
@HimDek
HimDek / Hyper-V in Windows 10 and Windows 11 Home Edition.md
Last active June 3, 2026 16:09
Hyper-V is supported in Pro, Enterprise and Education Edition of Windows 10 and Windows 11. This guide will show you how to enable Hyper-V in Home Editions of Windows 10 and Windows 11.

Hyper-V in Windows 10 and Windows 11 Home Edition

Hyper-V in Windows 10 and Windows 11 allows running Virtual Machine. It is supported only in Pro, Enterprise and Education Edition of Windows 10 and Windows 11 by default. But this guide will show you how to enable it in Home Editions of Windows 10 and Windows 11.

Check if virtualization is enabled:

  • Search for Command Prompt in Windows Start Menu and open it.
  • Type systeminfo and press Enter. Wait for the process to finish
  • Once the results appear, search for the Hyper-V Requirements section which is usually the last one. 11
    • If it says A hypervisor has been detected. Features required for Hyper-V will not be displayed. that means Hyper-V is already enabled and there is no reason following this guide anymore.
  • Otherwise, check for Virtualization Enabled in Firmware:.
@boh
boh / Windows command line gui access.md
Created July 12, 2021 11:36 — forked from scotgabriel/Windows command line gui access.md
Common windows functions via rundll user32 and control panel

Rundll32 commands

OS: Windows 10/8/7

Add/Remove Programs

  • RunDll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,0

Content Advisor

  • RunDll32.exe msrating.dll,RatingSetupUI

Control Panel

@douira
douira / convert-waypoints.js
Last active July 19, 2021 07:22
Wynntils waypoint import converter
/*
USAGE:
Do to http://wynnwaypoints.tk/ and look for the download "For Xaero's Map".
Extract the .zip and find a text file with a name like "mw4,0,5_1.txt".
I suggest renaming it to something sane like "waypoint-data.txt".
Then run `node convert-waypoints.js waypoint-data.txt`.
This script will convert the waypoints
into a json format in a file "waypoint-data.txt_converted.json".
Take the copy the contents of this file and paste them into
the text field of this other converter: https://mitalashok.github.io/wynn-waypoints
@varlen
varlen / vjoy.py
Last active February 10, 2022 15:22
Sample of direct communication with virtual game controller using Python. The first file uses PyWin32 and works directly with the Windows API, for older versions of vJoy. The second file uses the DLL of vJoy SDK to command the device.
from win32file import *
import struct, time
CONST_PPJOY_DEVICE = "\\\\.\\PPJoyIOCTL1"
CONST_LOAD_POSITIONS = 0x910
class vJoy(object):
def __init__(self):
self.handle = None
@insin
insin / README.md
Last active May 7, 2025 07:44
Extract Minecraft music

Extract Minecraft music

As of 1.8, assets are stored by hash, which makes it fiddly to listen to Minecraft's amazing ambient soundtrack outside the game.

This script can be used to copy music files to appopriately-named and organised .ogg files for easier listening.

1. Install Node.js or io.js

2. Save extract-music.js to your Minecraft assets directory:

@willurd
willurd / web-servers.md
Last active June 1, 2026 13:16
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@harthur
harthur / orientation.js
Created June 2, 2013 20:59
Firefox scratchpad for simulating `deviceorientation` events
/*
* Run this in a Firefox "Scratchpad" (Tools > Web Developer > Scratchpad)
* With Cmd-R to simulate an orientation event in the current page
*/
function simulateOrientation(alpha, beta, gamma) {
var event = document.createEvent("DeviceOrientationEvent");
event.initDeviceOrientationEvent('deviceorientation',
true, true, alpha, beta, gamma, true);
@angelsl
angelsl / BinkA2WAV.cs
Created May 16, 2013 18:42
Converts ".WAV" aka .binka audios extracted from Scribblenauts Unlimited files to PCM WAV files.
using System;
using System.IO;
using System.Runtime.InteropServices;
namespace BinkA2WAV
{
internal unsafe class Program
{
private static void Main(string[] args)
{
@yaauie
yaauie / hello.jscript.bat
Created May 6, 2011 21:52
A Polyglot for jscript in batch
0</* :hello
@ECHO Hello, batch!
@cscript /nologo /E:jscript %~f0 %*
@goto :EOF
*/0;
WScript.Echo('Hello, jscript!');