Skip to content

Instantly share code, notes, and snippets.

View DarkOoze's full-sized avatar

Anders Hörnfeldt DarkOoze

View GitHub Profile

Keybase proof

I hereby claim:

  • I am DarkOoze on github.
  • I am hornfeldt (https://keybase.io/hornfeldt) on keybase.
  • I have a public key whose fingerprint is 0675 FC4F 2BC6 8534 4DC9 792A 0469 4BA7 0647 B804

To claim this, I am signing this object:

SshProtocolExt:0.0.1
@DarkOoze
DarkOoze / snapshot.sh
Last active January 16, 2022 17:51
Git script to save a snapshot of the current worktree
#!/bin/bash
if [ ! -z $1 ]; then
export GIT_DIR=$1
fi
git rev-parse -q --verify HEAD >/dev/null;
if [ $? -ne 0 ]; then
exit
#cloud-config
groups:
- docker
users:
- default
- name: buildagent
primary_group: buildagent
groups: buildagent, docker
using System;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Windows.Forms;
public static class TaskExtensions
{
/// <summary>
/// Creates an awaitable task that asynchronously yields back to the current context of the control.
/// </summary>
@DarkOoze
DarkOoze / resetToUpstream.sh
Created May 29, 2024 08:28
Git script to reset local changes
#!/usr/bin/env sh
currentFullName=$(git rev-parse --symbolic-full-name HEAD)
branch=$(git rev-parse --abbrev-ref $1)
branchFullName=$(git rev-parse --symbolic-full-name $branch)
upstream=$(git rev-parse --symbolic-full-name $branch@{upstream})
if [ $? -ne 0 ]
then
exit # No tracked branch.