Skip to content

Instantly share code, notes, and snippets.

View tkouba's full-sized avatar

Tomas Kouba tkouba

  • Prague, Czech Republic
View GitHub Profile
@GER-NaN
GER-NaN / SourceCombiner.cs
Last active June 25, 2023 06:59
This will combine multiple .cs files from a solution into a single source file.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using Microsoft.Build.Evaluation;
using Microsoft.Build.Construction;
namespace SourceCombiner
@MightyPork
MightyPork / usb_hid_keys.h
Last active May 23, 2024 05:20
USB HID Keyboard scan codes
/**
* USB HID Keyboard scan codes as per USB spec 1.11
* plus some additional codes
*
* Created by MightyPork, 2016
* Public domain
*
* Adapted from:
* https://source.android.com/devices/input/keyboard-devices.html
*/
@alexrainman
alexrainman / ITextMeter
Last active August 1, 2022 07:45
Calculate Xamarin.Forms label height by amount of text
namespace YourNamespace
{
public interface ITextMeter
{
double MeasureTextSize(string text, double width, double fontSize, string fontName = null);
}
}
@gene-pavlovsky
gene-pavlovsky / notepad2-solarized.ini
Last active January 29, 2022 19:11
Solarized Dark and Light color schemes for Notepad2-mod
[Default Text]
FileNameExtensions=txt; text; wtx; log; asc; doc; diz; nfo
Default Style=font:Consolas; size:11; fore:#93a1a1; back:#002b36
Margins and Line Numbers=size:-1; fore:#657b83; back:#073642
Matching Braces=size:+1; bold; fore:#dc322f; back:#073642
Matching Braces Error=size:+1; underline; fore:#dc322f; back:#073642
Control Characters (Font)=size:-1
Indentation Guide (Color)=fore:#073642
Selected Text (Colors)=eolfilled; fore:#eee8d5; back:#586e75
Whitespace (Colors, Size 0-5)=fore:#d33682
@gbaman
gbaman / HowToOTG.md
Last active May 16, 2024 20:10
Simple guide for setting up OTG modes on the Raspberry Pi Zero

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int

@dieseltravis
dieseltravis / PS-BGInfo.ps1
Last active April 23, 2024 15:16
update wallpaper background image with powershell (like Sysinternals BGInfo)
# PS-BGInfo
# Powershell script that updates the background image with a random image from a folder and writes out system info text to it.
# run as a lower priority task
[System.Threading.Thread]::CurrentThread.Priority = 'BelowNormal'
# Configuration:
# Font Family name
$font="Input"
@brisingraerowing
brisingraerowing / CPOL.md
Created June 25, 2015 06:17
Codeproject Open License in Markdown (Converted with html2text)

The Code Project Open License (CPOL) 1.02

Preamble

This License governs Your use of the Work. This License is intended to allow developers to use the Source Code and Executable Files provided as part of the Work in any application in any form.

The main points subject to the terms of the License are:

@eralston
eralston / .tfignore
Created February 26, 2015 19:00
Example ignore file for Team Foundation Server, excluding files from Bin, NuGet packages, etc
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
bin
obj
#include nuget executable
@rudyryk
rudyryk / TextMeter.cs
Last active August 8, 2021 10:53
C# — Measure string size in Xamarin.Forms for iOS and Android platforms
//
// TextMeter.cs
// Created by Alexey Kinev on 11 Feb 2015.
//
// Licensed under The MIT License (MIT)
// http://opensource.org/licenses/MIT
//
// Copyright (c) 2015 Alexey Kinev <alexey.rudy@gmail.com>
//
// Usage example: