Skip to content

Instantly share code, notes, and snippets.

View manualbashing's full-sized avatar
:shipit:

Manuel Batsching manualbashing

:shipit:
View GitHub Profile
@manualbashing
manualbashing / blog.md
Last active December 4, 2020 11:18
Quickly copy paths from #WSL in windows compatible format

windows_path

Add the following alias to your profile:

alias ii="printf '\"%s\"' \$(wslpath -w \$PWD) | clip.exe;echo \"\u001b[33mCurrent windows path copied to clipboard.\""
@manualbashing
manualbashing / Remove-AzKeyVaultSecretAndPurge.ps1
Created November 27, 2020 10:15
Remove secrets from Azure Key Vault and purge them immediately
function Remove-AzKeyVaultSecretAndPurge {
[CmdletBinding()]
param (
# Name of the key vault
[Parameter(Mandatory)]
[string]
$VaultName,
# Name of the secret in removed state
@manualbashing
manualbashing / blog.md
Last active November 20, 2020 16:13
How a breaking change in Az.Accounts broke my code

It happened like this: I needed to recycle an access token from an existing connection to the azure management plane in order to use the AzureAD PowerShell module in an Azure Function (that.. is another story). I thought I was smart, googled hard and finally came across the following hack:

$ctx = Get-AzContext
    $null = Get-AzADApplication -ApplicationId $env:APP_CLIENT_ID #This fills the token cache.
    $token = $ctx.TokenCache.ReadItems() |
 Where-Object Resource -eq 'https://graph.windows.net/' |
@manualbashing
manualbashing / README.md
Created November 12, 2020 14:08 — forked from akashnimare/README.md
A Beginners Guide to writing a Kickass README ✍

Project title

A little info about your project and/ or overview that explains what the project is about.

Motivation

A short description of the motivation behind the creation and maintenance of the project. This should explain why the project exists.

Build status

Build status of continus integration i.e. travis, appveyor etc. Ex. -

Build Status

@manualbashing
manualbashing / selenium.aci.yaml
Created November 10, 2020 16:09 — forked from roberto-mardeni/selenium.aci.yaml
Selenium on Azure Container Instances Sample
apiVersion: 2018-10-01
location: eastus
name: selenium
properties:
containers:
- name: selenium-hub
properties:
environmentVariables:
- name: 'JAVA_TOOL_OPTIONS'
value: '-Xmx800m'
@manualbashing
manualbashing / install.md
Created November 5, 2020 13:17 — forked from kleo/install.md
Install Go 1.15.3 on Raspberry Pi

Installer

  1. yeet this into your terminal
sh -c "$(curl -fsSL https://gist.githubusercontent.com/kbeflo/9d981573aad107da6fa7ac0603259b3b/raw/35111746659e6146d4985e0ab451c023415f5f1b/install.sh)"
  1. logout
  2. login
@manualbashing
manualbashing / midi_sample_explorer.rb
Created July 8, 2020 23:13
Explore available samples and synths using your midi controller #SonicPi
explore = "synths"
available_keys = 108
set_sched_ahead_time! -0.4
shift = 0
live_loop :midi_player do
note, amp = sync "/midi:digital_piano:0:1/note_on"
if amp != 0 # ignore key released events
if note == 108 # next page
shift = shift + 106
synth :beep, note: 88
@manualbashing
manualbashing / amen_to_that.rb
Created July 8, 2020 21:20
[Amen to that!] Amen break at random sample rates #SonicPi
live_loop :amen_to_that do
rate = rrand(0.1,2)
4.times do
sample :loop_amen, rate: rate
sleep (sample_duration :loop_amen) / rate
end
end
@manualbashing
manualbashing / midi_logger.rb
Last active July 8, 2020 20:36
Midi Logger for #SonicPi
key_pressed_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
key_released_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
amp = 0.5
key_pressed_in_chord = false
midi_device = "/midi/digital_piano/0/1/note_on"
log_file_path = "C:\\Users\\Manuel\\Documents\\sonicpi\\logger.log"
live_loop :midi_logger do
note, velocity = sync midi_device
# File.write(log_file_path, "# debug >> [%d,%d]\n" % [note, velocity], mode: "a")
@manualbashing
manualbashing / rundgang_burzum.rb
Created July 3, 2020 21:58
Rundgang #SonicPi
live_loop :rundgang do
use_synth :hollow
play_pattern_timed [:D2,:G2,:B2], 0.9, release: 1.8
sleep 0.8
play_pattern_timed [:D2,:G2,:B2], 0.37, release: 2
sleep 1.4
end