Skip to content

Instantly share code, notes, and snippets.

View grafoo's full-sized avatar
✌️

Manuel Graf grafoo

✌️
View GitHub Profile
@grafoo
grafoo / keybase.md
Created January 16, 2022 21:30
keybase prove

Keybase proof

I hereby claim:

  • I am grafoo on github.
  • I am grafoo (https://keybase.io/grafoo) on keybase.
  • I have a public key whose fingerprint is 1CFA 722C 1EF7 F75E 5125 9251 D2AD 9DEE B709 B6E0

To claim this, I am signing this object:

@grafoo
grafoo / c_sharp_for_python.md
Created June 16, 2021 08:15 — forked from ikem-krueger/c_sharp_for_python.md
An intro to C# for a Python developer. Made for one of my coworkers.

C# For Python Programmers

Syntax and core concepts

Basic Syntax

  • Single-line comments are started with //. Multi-line comments are started with /* and ended with */.

  • C# uses braces ({ and }) instead of indentation to organize code into blocks. If a block is a single line, the braces can be omitted. For example,

@grafoo
grafoo / c_sharp_for_python.md
Created June 16, 2021 08:01 — forked from mrkline/c_sharp_for_python.md
An intro to C# for a Python developer. Made for one of my coworkers.

C# For Python Programmers

Syntax and core concepts

Basic Syntax

  • Single-line comments are started with //. Multi-line comments are started with /* and ended with */.

  • C# uses braces ({ and }) instead of indentation to organize code into blocks. If a block is a single line, the braces can be omitted. For example,

@grafoo
grafoo / macos-ramdisk.md
Created May 6, 2021 11:51 — forked from htr3n/macos-ramdisk.md
Creating RAM disk in macOS

Built-in

diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nobrowse -nomount ram://XXXXX`

where XXXXX is the size of the RAM disk in terms of memory blocks.

Notes:

@grafoo
grafoo / extract-mtm-ansible-playbooks.sh
Created April 18, 2021 14:12
Make use of the Master the Mainframe Ansible challenge playbooks on LinuxONE
#!/bin/sh
sudo dnf -y install ansible podman jq
podman save docker.io/masterthemainframe/ansible >masterthemainframe-ansible-image.tar
mkdir tmp-tarballs
tar -xf masterthemainframe-ansible-image.tar -C tmp-tarballs
mkdir tmp-rootfs
podman inspect docker.io/masterthemainframe/ansible |
jq '.[0]["RootFS"]["Layers"][]' |
cut -d: -f2|tr -d '"' |
while read -r layer; do
@grafoo
grafoo / split-git-commit-with-orig-head.md
Created November 18, 2020 10:25 — forked from scmx/split-git-commit-with-orig-head.md
How to split a Git commit and preserve message using ORIG_HEAD #git #commit #ORIG_HEAD https://twitter.com/albertarv/status/954389020758495233

How to split a Git commit and preserve message using ORIG_HEAD

A colleague told me he'd accidentally committed something. Now he wanted to remove it from the previous commit and then put in a new commit. This is called splitting a commit, and here's the best way I know of how to do it.

Solution

  1. git reset --soft HEAD~ Undo the last commit, but preserve "Changes to be committed"
  2. git reset <some/path> Exclude what you want
  3. git commit -C ORIG_HEAD Commit with the same message as before, which was stored in ORIG_HEAD

Example

@grafoo
grafoo / sc-dl.js
Created January 8, 2014 00:35 — forked from pheuter/sc-dl.js
(function(d) {
var dl = d.createElement('a');
dl.innerText = 'Download MP3';
dl.href = "http://media.soundcloud.com/stream/"+d.querySelector('#main-content-inner img[class=waveform]').src.match(/\.com\/(.+)\_/)[1];
dl.download = d.querySelector('em').innerText+".mp3";
d.querySelector('.primary').appendChild(dl);
dl.style.marginLeft = '10px';
dl.style.color = 'red';
dl.style.fontWeight = 700;
})(document);