Skip to content

Instantly share code, notes, and snippets.

View leppie's full-sized avatar
🤡

Llewellyn Pritchard leppie

🤡
  • Cape Town, South Africa
View GitHub Profile
@leppie
leppie / results.md
Last active November 30, 2022 12:40
IronScheme bench runtimes precompiled JIT testing
@akarpov89
akarpov89 / InterpolatedParsing.cs
Created October 1, 2021 14:58
Interpolated parsing technique
using System.Runtime.CompilerServices;
using static ParsingExtensions;
string input = "Name: Andrew; Age: 31";
string? name = null;
int age = 0;
if (input.TryParse($"Name: {Placeholder(ref name)}; Age: {Placeholder(ref age)}"))
{
#!/usr/bin/env ruby -wKU
require "pp"
require 'fileutils'
require "gruff"
require 'rmagick'
def read_cal(file)
data_segment = false
public static bool ContainsTokenUnroll(string value, string token, char delimiter = ';')
{
if (string.IsNullOrEmpty(token)) return false;
if (string.IsNullOrEmpty(value)) return false;
var valueLength = value.Length;
var tokenLength = token.Length;
if (tokenLength > valueLength) return false;
public class Startup : IStartup
{
private static readonly Assembly[] ControllerAssemblies = { typeof(Startup).GetTypeInfo().Assembly };
public Startup(IHostingEnvironment environment, ILoggerFactory logging)
{
Environment = environment;
ConfigureLogging(logging);
}
@alirobe
alirobe / reclaimWindows10.ps1
Last active April 26, 2024 17:59
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@leppie
leppie / foo.cmd
Last active February 10, 2016 18:04
Command line parsing in a batch file (or scripting for the mildly insane)
@echo off
setlocal EnableDelayedExpansion
:: user settings
set VERBOSE=0
set ERRORS=0
:: arg parsing settings
set ARGS=verbose debug-mode
@joeduffy
joeduffy / ndisasm.bat
Created December 11, 2015 17:59
A handy .NET disassembler script
@ECHO OFF
REM A handy, dandy script for disassembling .NET programs.
SETLOCAL EnableDelayedExpansion
ECHO .NET Program Disassembler
ECHO =========================
REM Pluck out arguments and validate paths.
SET BINARY=%1
IF [%BINARY%]==[] (
ECHO error: missing program binary to disassemble
@ktakashi
ktakashi / ChangeLog
Last active May 3, 2018 10:31
Portable(?) R6RS er-macro-transformer
2015-10-24
- Changed comment
- Walk though returning form to wrap. Racket still doesn't work.
- Fixed incorrect example on definition of macro and usage environment.
Comment of: https://twitter.com/anohana/status/657865512370634753
@naikrovek
naikrovek / visascope.cs
Created May 28, 2014 22:15
Simple little test app I wrote to test VISA instrument control. This will require changes in order to be useful. BONUS: Dumper class, useful for many things around the house!
using Ivi.Visa.Interop;
using System;
using System.IO;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Runtime.Remoting;
using System.Runtime.Serialization;
namespace ConsoleApplication1 {