Skip to content

Instantly share code, notes, and snippets.

@Belphemur
Belphemur / sandbox-winget.ps1
Last active July 17, 2023 00:32
Use Windows Sandboxing to be able to install your WinGet manifest. Source: https://megamorf.gitlab.io/2020/07/19/automating-the-windows-sandbox/
# Parse Arguments
Param(
[Parameter(Mandatory, HelpMessage = "The path for the Manifest.")]
[String] $Manifest
)
if (-not (Test-Path -Path $Manifest -PathType Leaf)) {
throw 'The Manifest file does not exist.'
}
@debovis
debovis / package.json
Last active January 16, 2024 14:13
How to debug gatsby and reactjs with webstorm
{
"name": "project-name",
"version": "1.0.0",
"description": "",
"main": "n/a",
"scripts": {
"serve": "gatsby develop -p 5000",
"dev": "node $NODE_DEBUG_OPTION ./node_modules/.bin/gatsby develop -p 5000",
}
}
@daveyarwood
daveyarwood / radiohead-chords.alda
Created August 6, 2016 15:14
An exercise in randomly generated "Radiohead chord" sequences
# Ben Levin's "Radiohead Chord Generator" video:
# https://www.youtube.com/watch?v=iYU_2hfFPM0
# Rules:
#
# From a MAJOR chord (e.g. C), you can:
# - move to the parallel minor (Cm)
# - move down to the relative minor (Am)
# - move up 1/2 step to a minor chord (Dbm)
@Calinou
Calinou / build_iphone.sh
Last active September 1, 2020 00:19
Compile Godot for iOS easily (from Linux)
#!/bin/sh -x
# This script compiles Godot for iOS in 64-bit and 32-bit.
# It must be run from a GNU/Linux system.
# Place this script at the root of your Godot Git clone.
# CC0 1.0 Universal
# This needs to be set so that SCons detects OS X as a valid option
export OSXCROSS_IOS="anything"
@zg
zg / freebsd-qemu-xhyve-mac-os-x-virtual-machine.md
Last active April 1, 2024 21:47
Create FreeBSD virtual machine using qemu. Run the VM using xhyve.

TL;DR

  • Create 10GB FreeBSD image using QEMU.
  • Run the VM using xhyve.
  • Mount host directory.
  • Resize the image.

Requisites

@mustafaakin
mustafaakin / README.md
Last active May 31, 2023 05:28
Running Windows Server 2k16 with Docker under Linux, KVM or Virtualbox

Are you let down when you saw there is no guide to use Windows Server 2016 under *nix environments? I really loved Microsoft when I heard they are working on Windows containers, but when this week has arrived, it was sad to see that installation requirements were Windows and HyperV. But actually it is not. You just have to modify the VHD file a bit with nicer tools and execute the already available script in the downloaded VM. I will assume you are running a decent version of Linux and accepted EULA and all the legal stuff that I do not care.

1. Getting the required tools:

$ sudo apt-get install qemu-kvm virt-manager // or virtualbox, but we need qemu-kvm for image manipulation
$ sudo apt-get install qemu-utils libguestfs-tools // image manipulation tools

2. Downloading files

@dulacp
dulacp / libz.sh
Created February 28, 2015 01:25
Download & Compile Libz (zlib) for iOS (all architectures)
# Builds a ZLib framework for the iPhone and the iPhone Simulator.
# Creates a set of universal libraries that can be used on an iPhone and in the
# iPhone simulator. Then creates a pseudo-framework to make using libz in Xcode
# less painful.
#
# To configure the script, define:
# IPHONE_SDKVERSION: iPhone SDK version (e.g. 8.1)
#
# Then go get the source tar.bz of the libz you want to build, shove it in the
# same directory as this script, and run "./libz.sh". Grab a cuppa. And voila.
@banksean
banksean / mersenne-twister.js
Created February 10, 2010 16:24
a Mersenne Twister implementation in javascript. Makes up for Math.random() not letting you specify a seed value.
/*
I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace
so it's better encapsulated. Now you can have multiple random number generators
and they won't stomp all over eachother's state.
If you want to use this as a substitute for Math.random(), use the random()
method like so:
var m = new MersenneTwister();