Skip to content

Instantly share code, notes, and snippets.

@davidruhmann
davidruhmann / eclipse-java-formatter-settings.xml
Last active June 7, 2024 14:04
Sane Java Formatter Settings
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="13">
<profile kind="CodeFormatterProfile" name="SaneJava" version="13">
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
@davidruhmann
davidruhmann / trim.bat
Created April 23, 2022 22:14
avidemux script - trim first and last keyframes for MP4 (see docs to use MKV container if needed)
@echo off
set "avidemux=C:\Program Files\Avidemux 2.7 VC++ 64bits\avidemux.exe"
: %%~nf returns the filename without the extension
for /F "tokens=*" %%f in ('dir /a-d /b *.mp4') do (
"%avidemux%" --load "%%f" --run trim.py --save "%%~nf_edit.mp4" --quit
)
exit /b
  1. Insert the unifying receiver.
  2. Download and Install the latest Unifying Receiver software. (version 250, firmware 024.010.00036 at time of writing)
  3. Download and Install the latest SetPoint software. (version 6.69.126, firmware 041.001.00038 at time of writing)
  4. Sync the T650 to your unifying receiver.
  5. Open SetPoint and make any changes to the SetPoint configuration for your T650.
    • You may need to restart the T650 and SetPoint for initial detection.
  6. Exit/close the SetPoint software (make sure it is fully closed and not in the tasktray)
  7. Open the Properties for C:\Program Files\Logitech\SetPointP\SetPoint.exe
@davidruhmann
davidruhmann / Program.cs
Created March 10, 2018 04:26
fileorurl.cs
using System;
using System.IO;
using System.Net.Http;
using System.Xml.Linq;
namespace wsdl2class
{
class Program
{
public static HttpClient client = new HttpClient();
@davidruhmann
davidruhmann / dynamic_vapp_lease_extender.ps1.bat
Last active June 22, 2019 21:19
VMWare vCloud vApp Lease Extension Script
;@echo off
;echo.>"%Temp%\vcloud.ps1"
;findstr -rbv ; %0 >> "%Temp%\vcloud.ps1"
;powershell -executionpolicy unrestricted -command "%Temp%\vcloud.ps1"
;exit /b
$api = "https://vcloud.example.com/api";
# requires powershell version 4+
# environment variables needed
# VCLOUD_AUTH = base64 encoding of user@org:password
Option Explicit
Dim args
args = """" & WScript.Arguments(0) & """"
Dim i
Dim temp
For i = 1 to WScript.Arguments.Count - 1
temp = WScript.Arguments(i)
temp = Replace(temp, " ", "")
temp = Replace(temp, " ", "")
temp = Replace(temp, "^", "")
@davidruhmann
davidruhmann / EventParams.cs
Last active March 1, 2023 22:03
C# Dynamic EventArgs
// Copyright (c) 2015 David Ruhmann
using System;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Collections.Generic;
namespace ChartedCode
{
@davidruhmann
davidruhmann / Base.cs
Last active June 26, 2020 10:34
C# Numeric Base Conversion
// Copyright (c) 2015 David Ruhmann
using System;
using System.Collections.Generic;
using System.Text;
namespace ChartedCode
{
public static class NumberExtensions
{
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.InvalidOperationException: StandardIn has not been redirected.
at System.Diagnostics.Process.get_StandardInput()
at ShareX.HelpersLib.ExternalCLIManager.WriteInput(String input)
at ShareX.ScreenRecordForm.StopRecording()
at ShareX.ScreenRegionForm.OnStopRequested()
at ShareX.ScreenRegionForm.btnAbort_MouseClick(Object sender, MouseEventArgs e)
@davidruhmann
davidruhmann / MessageDlg.cpp
Created August 3, 2015 21:00
Visual C++ MFC Message Dialog Class
#include "stdafx.h"
#include "MessageDlg.h"
#include <dcp_colorscheme.h> // GetSchemeBrush
#include <Nursing_MsgAPI_Macros.h> // MSGWRITE*
// Static Value Definitions
#define MIN_HEIGHT 50
#define MIN_WIDTH 50
#define MAX_HEIGHT 500
#define MAX_WIDTH 500