Skip to content

Instantly share code, notes, and snippets.

View schittli's full-sized avatar

Tom-- schittli

  • Biel / Bienne, Switzerland
  • 10:33 (UTC +02:00)
View GitHub Profile
@ksafranski
ksafranski / Common-Currency.json
Last active September 3, 2025 06:52
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
@schakko
schakko / check_microsoft_windows_software_raid.ps1
Last active January 31, 2025 15:56
A simple PowerShell script for retrieving the RAID status of volumes with help of diskpart. The nicer solution would be using WMI (which does not contain the RAID status in the Status field of Win32_DiskDrive, Win32_LogicalDisk or Win32_Volume for unknown reason) or using the new PowerShell API introduced with Windows 8 (wrong target system as o…
# A simple PowerShell script for retrieving the RAID status of volumes with help of diskpart.
# The nicer solution would be using WMI (which does not contain the RAID status in the Status field of Win32_DiskDrive, Win32_LogicalDisk or Win32_Volume for unknown reason)
# or using the new PowerShell API introduced with Windows 8 (wrong target system as our customer uses a Windows 7 architecture).
#
# diskpart requires administrative privileges so this script must be executed under an administrative account if it is executed standalone.
# check_mk has this privileges and therefore this script must only be copied to your check_mk/plugins directory and you are done.
#
# Christopher Klein <ckl[at]neos-it[dot]de>
# This script is distributed under the GPL v2 license.
@micahasmith
micahasmith / process-async-await.cs
Created March 4, 2013 19:51
.NET Process via Async/Await
public class Runner
{
public async Task<RunResults> Run(ProcessStartInfo info)
{
var process = new Process();
var runResults = new RunResults();
//some defaults that HAVE to be in place
info.RedirectStandardOutput = true;
info.RedirectStandardError = true;
@atifaziz
atifaziz / md5.ps1
Last active October 14, 2017 12:44
PowerShell script to compute an MD5 hash for files
# Copyright (c) 2013 Atif Aziz. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@itzg
itzg / ListUIDefaultsKeys.java
Last active June 17, 2025 18:05
Java Swing UIDefaults keys
import java.util.Enumeration;
import java.util.SortedSet;
import java.util.TreeSet;
import javax.swing.UIDefaults;
import javax.swing.UIManager;
public class ListUIDefaultsKeys {
public static void main(String args[]) throws Exception {
UIManager.LookAndFeelInfo looks[] = UIManager
@shawndumas
shawndumas / .gitconfig
Created August 5, 2013 19:08
Using WinMerge as the git Diff/Merge Tool on Windows 64bit
[mergetool]
prompt = false
keepBackup = false
keepTemporaries = false
[merge]
tool = winmerge
[mergetool "winmerge"]
name = WinMerge
import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import javax.swing.plaf.basic.BasicTextFieldUI;
import javax.swing.text.JTextComponent;
public class JTextFieldHintUI extends BasicTextFieldUI implements FocusListener {
@xiongjia
xiongjia / uia-sample.ps1
Last active November 29, 2022 18:44
A simple sample for access the MS UIAutomation in PowerShell. #devsample #win
#REQUIRES -Version 3.0
# This is a simple sample for access the MS UIAutomation in PowerShell.
# In this sample:
# 1. Load the MS UIA via System.Reflection.Assembly
# 2. Launch the AUT ( calc.exe )
# 3. Find the AutomationElement via the AUT Process Id
# 4. Find buttons via 'ClassName' and 'Name' property
# 5. Click the '1', '+', '1', '=' buttons.
# At last, we will get '2' in the result of calc App.
@hofmannsven
hofmannsven / README.md
Last active October 2, 2025 20:17
Git CLI Cheatsheet
@oliverheilig
oliverheilig / PointInsidePolygon.cs
Last active March 19, 2020 15:17
PointInsidePolygon
// This snippet shows how to check whether a point is
// contained in a polygon. Works for all polygons, even for
// OGC-invalid ones, corresponding to "fill mode" alternate.
// You can use this for geo-fencing or UI hit-testing.
using System;
using System.Collections.Generic;
using JSIL;
using JSIL.Meta;
public class Program