Skip to content

Instantly share code, notes, and snippets.

View bjarkirafn's full-sized avatar

Bjarki Rafn Gudmundsson bjarkirafn

View GitHub Profile
@bjarkirafn
bjarkirafn / pycurses.py
Created April 9, 2019 19:08 — forked from claymcleod/pycurses.py
Python curses example
import sys,os
import curses
def draw_menu(stdscr):
k = 0
cursor_x = 0
cursor_y = 0
# Clear and refresh the screen for a blank canvas
stdscr.clear()
@bjarkirafn
bjarkirafn / my-gitgist.json
Last active May 22, 2019 20:05
misc info
{
"first-entry": {"info": "something"}
}
@bjarkirafn
bjarkirafn / HuddledTricks.psm1
Created July 4, 2019 14:53 — forked from Jaykul/HuddledTricks.psm1
Stupid PowerShell Tricks
#Requires -version 2.0
## Stupid PowerShell Tricks
###################################################################################################
add-type @"
using System;
using System.Runtime.InteropServices;
public class Tricks {
[DllImport("user32.dll")]
private static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);
@bjarkirafn
bjarkirafn / CapsLock-Enter.reg
Created January 25, 2020 15:02
Keyboard Scan Codes
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1c,00,3a,00,00,00,00,00
@bjarkirafn
bjarkirafn / regexpatterns.md
Last active November 3, 2020 20:26
Regex Misc

github: gistUri: ''

Name Pattern
github `(?^http.//)(?.?)/(?.?)/((?.?#file-._$)
csv `(?<=^
@bjarkirafn
bjarkirafn / ImageBase64.ps1
Last active September 29, 2020 16:12
ImageBase64
$base64 = [convert]::ToBase64String((Get-Content D:\Images\image1.jpg -Encoding byte))
@bjarkirafn
bjarkirafn / hello.git.io.ps1
Last active October 1, 2020 22:34
git.io test
Write-Host "`e[33;1mHello World!`e[0m with update"
@bjarkirafn
bjarkirafn / get-typedata.ps1
Last active October 10, 2020 23:20
posh:typedata
using namespace System.Management
$ERROR_ACTION = 'SilentlyContinue'
$jaobj = [PSCustomObject]@{
PSTypeName = 'JaHer.Object'
Name = 'Bjarki'
Language = 'PowerShell'
Country = 'Iceland'
}
@bjarkirafn
bjarkirafn / KeymapRegistry.ps1
Last active October 5, 2020 16:21
posh:keymap
$null = Add-Type -AssemblyName System.Windows.Forms -PassThru
function ConvertFrom-Enum {
param([String]$TypeName)
$Type = [Type]$TypeName
$obj = [pscustomobject]@{}
@bjarkirafn
bjarkirafn / index.html
Last active October 9, 2020 20:50
test
<div class="">hi there</div>