Skip to content

Instantly share code, notes, and snippets.

View RupertAvery's full-sized avatar

David Khristepher Santos RupertAvery

View GitHub Profile
@RupertAvery
RupertAvery / CaseChangingCharStream.cs
Last active December 11, 2021 01:05
ANTLR4 TSQLParser Sample Project
using Antlr4.Runtime;
using Antlr4.Runtime.Misc;
namespace TSQLParser
{
/// <summary>
/// This class supports case-insensitive lexing by wrapping an existing
/// <see cref="ICharStream"/> and forcing the lexer to see either upper or
/// lowercase characters. Grammar literals should then be either upper or
/// lower case such as 'BEGIN' or 'begin'. The text of the character
@RupertAvery
RupertAvery / Program.cs
Created October 30, 2021 02:20
Text Adventure
using System;
using System.Collections.Generic;
using System.Linq;
namespace TextAdventure
{
class Program
{
static void Main(string[] args)
{
@RupertAvery
RupertAvery / ConditionExpression.cs
Last active September 28, 2021 09:07
Rule-based filtered Select
public class ConditionExpression<TFilter>
{
public Func<TFilter, bool> Condition { get; }
public Expression Expression { get; }
public ConditionExpression(Func<TFilter, bool> condition, Expression expression)
{
Condition = condition;
Expression = expression;
}
namespace WINKCrossViewX
{
public class AppSettings
{
public string Forges { get; set; }
public string APIUsername { get; set; }
public string APIPassword { get; set; }
public string RefreshInterval { get; set; }
}
@RupertAvery
RupertAvery / EasyTripClient.cs
Created April 29, 2021 00:36
EasyTrip Rest Client
public class Account
{
public string Result { get; set; }
public long CustAccountID { get; set; }
public int AccountType { get; set; }
public int CustomerID { get; set; }
public string Status { get; set; }
public float Balance { get; set; }
public float InitBalance { get; set; }
public float ThresholdAmount { get; set; }
// Implement WndProc in your own form, using the pattern below
public partial class Form1 : Form
{
private MediaPlayer mediaPlayer;
public Form1()
{
InitializeComponent();
// Subscribe to Form's OnClosing event
Closing += OnClosing;
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Threading.Tasks;
namespace LstSerializer
{
public class CompressedListSerializer<T> where T : new()
{
@RupertAvery
RupertAvery / Program.cs
Last active November 19, 2020 05:10
Drawing flicker-free on Windows forms with threaded loop
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;
using System.Windows.Forms;
using System.Drawing;
using System.Windows.Input;
using System.Threading;
@RupertAvery
RupertAvery / Celcius.ini
Last active April 9, 2026 00:06
Ageo date and time weather fix
[Rainmeter]
Update=1000
Author=Connect-R
BackgroundMode=2
SolidColor=0,0,0,1
DynamicWindowSize=1
AccurateText=1
MouseScrollUpAction=[!SetVariable Scale "(#Scale#+#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#+#ScrollMouseIncrement#)"][!Refresh]
MouseScrollDownAction=[!SetVariable Scale "(#Scale#-#ScrollMouseIncrement# < 0.2 ? 0.2 : #Scale#-#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#-#ScrollMouseIncrement# < 0.2 ? 0.2 : #Scale#-#ScrollMouseIncrement#)"][!Refresh]
LeftMouseDoubleClickAction=!ToggleConfig "Ageo\Settings" "Settings.ini"