Skip to content

Instantly share code, notes, and snippets.

View TorstenC's full-sized avatar

Torsten C. TorstenC

  • 05:22 (UTC +01:00)
View GitHub Profile
@TorstenC
TorstenC / ymdk_wings_toc.json
Created May 17, 2021 20:54
My YMDK Wings Layout
{
"version": 1,
"notes": "ToC QMK setting. Open this file with the QMK Configurator import QMK Keymap feature.",
"documentation": "\"This file is a QMK Configurator export. You can import this at <https://config.qmk.fm>. It can also be used directly with QMK's source code.\n\nTo setup your QMK environment check out the tutorial: <https://docs.qmk.fm/#/newbs>\n\nYou can convert this file to a keymap.c using this command: `qmk json2c {keymap}`\n\nYou can compile this keymap using this command: `qmk compile {keymap}`\"\n",
"keyboard": "ymdk/wings",
"keymap": "ymdk_wings_toc",
"layout": "LAYOUT_all",
"layers": [
[
"KC_NO",
{
"name": "7 + 7 split v02",
"author": "ToC",
"notes": "https://cdn.discordapp.com/attachments/833450036825948203/833450708917289024/7--7-split-v02.png"
},
[
{
"x": 3.5,
"t": "#000000\n\n#0000FF",
"f": 4,
@TorstenC
TorstenC / HashTestTemp.cs
Created July 20, 2018 18:30
Test of speed of .NET HashAlgorithms
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.IO;
using System.Security.Cryptography;
using System.Diagnostics;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace ConceptTest {
[TestClass]
@TorstenC
TorstenC / stackoverflow_q43421070.cs
Created April 16, 2017 09:08
What does “Zoll” from IntelliSense mean?
namespace stackoverflow.q43421070 {
class stackoverflow<T> {
T Result;
void ZollIsNotCustomsDuty() {
Result = // default(T);
}
}
}
@TorstenC
TorstenC / test.xml
Last active November 18, 2016 00:38
<?xml version="1.0" encoding="utf-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>Name</name>
<description><![CDATA[Description]]></description>
<Folder>
<name>4VbDHQ</name>
<Placemark>
<name>Original</name>
<styleUrl>#line-777777-5-nodesc</styleUrl>
@TorstenC
TorstenC / NotifyBase.cs
Last active November 11, 2016 21:04
Base Class for INotifyPropertyChanged Properties
public class NotifyBase : System.ComponentModel.INotifyPropertyChanged {
protected void OnPropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) {
PropertyChanged?.Invoke(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
}
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
protected bool SetField<T>(ref T field, T value, [System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) {
if(EqualityComparer<T>.Default.Equals(field, value)) return false;
field = value;
OnPropertyChanged(propertyName);
return true;
@TorstenC
TorstenC / RF_24_Remote01.c
Created September 3, 2016 21:41
Remote Control Receiver for NTF24L01+, SE8R01, RFM70/BK2421, BK2423, XN297 etc.
/* RF_24_Remote01.c
* Created: 31.08.2016 21:41:47
* Author : Torsten C
*/
#define F_CPU 800000UL // 3,3V-CPU läuft an 8MHz-Quarz
#include "MyAvrIO.h" // z.B. PORTB, DDRB, SPCR_SPE, uint8_t, …
#include <string.h> // z.B. memcpy()
#include <stdio.h> // z.B. printf(), benötigt stdout (siehe am Ende)
// ToDo: Ausgabe auf Smartphone mit
// https://www.mikrocontroller.net/articles/MCURSES
@TorstenC
TorstenC / main.c
Last active August 29, 2015 14:22
STM32F030F4P6 Module Blink-Test
// STM8S103F3P6 Hardware module see https://github.com/TorstenC/Notizblog/wiki/Mikrocontroller
#include <stm8s.h>
volatile uint32_t counter = 10;
int main( void ) {
GPIO_Init(GPIOD, GPIO_PIN_3, GPIO_MODE_OUT_PP_LOW_FAST);
GPIO_Init(GPIOB, GPIO_PIN_5, GPIO_MODE_OUT_PP_HIGH_FAST);
while (1) {
while (counter) counter--;
GPIO_WriteHigh(GPIOD, GPIO_PIN_3);
GPIO_WriteLow(GPIOB, GPIO_PIN_5);
@TorstenC
TorstenC / wc24h1816tables.c
Last active August 29, 2015 14:14
Word-Arrays for 24h Wordclock 18 x 16 Initialisierung
// Word-Arrays for 24h Wordclock, see http://www.mikrocontroller.net/articles/WordClock24h
// Von-Neumann-Variant, Data from Wc24h1816_1833,16.Mai15-ACHT-VIER, CodeGen v0.15
// Code-Generator see https://gist.github.com/TorstenC/aec0724be4afcd1d7545
#include "tables.h"
const struct Modes tbl_modes[MODES_COUNT] = {
{ MM_8, HM_5, "ES IST HH UHR MM (12)" },
{ MM_8, HM_6, "ES IST HH UHR MM (24)" },
{ MM_9, HM_5, "ES IST HH UHR UND MM MINUTEN (12)" },
{ MM_9, HM_6, "ES IST HH UHR UND MM MINUTEN (24)" },
{ MM_2, HM_3, "ES IST MM MINUTEN NACH HH UHR (12) NACHTS" },
@TorstenC
TorstenC / wc24h1816tables.h
Last active August 29, 2015 14:14
Word-Arrays for 24h 18 x 16 Wordclock Deklaration + Definition
// Word-Arrays for 24h Wordclock, see http://www.mikrocontroller.net/articles/WordClock24h
// Von-Neumann-Variant, Data from Wc24h1816_1833,16.Mai15-ACHT-VIER CodeGen v0.15
// Code-Generator see https://gist.github.com/TorstenC/aec0724be4afcd1d7545
// tbl_modes[MODES_COUNT]: 1152 bytes
// tbl_hours[HOUR_MODES_COUNT][HOUR_COUNT][MAX_HOUR_WORDS]: 800 bytes
// tbl_minutes[MINUTE_MODES_COUNT][MINUTE_COUNT]: 5280 bytes
// illumination[1][WP_COUNT]: 231 bytes
// total (tbl_minutes + tbl_hours + tbl_modes + illumination): 7463 bytes
#ifndef TABLES_H