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 / filtered-index-weirdness.sql
Last active October 15, 2021 08:40
What is going on with the SQL Server query optimizer/planner?
drop table if exists [dbo].[Simple]
go
CREATE TABLE [dbo].[Simple](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Name] [nvarchar](50) NOT NULL,
[Extra] [bit] NULL,
[Data] [nvarchar](max) NULL,
CONSTRAINT [PK_Simple] PRIMARY KEY CLUSTERED ( [Id] ASC )
)
0:000> !gcroot 5cbb60a4
Thread 350c:
0337ED80 0CA4D42E System.Threading.Tasks.Task.SpinThenBlockingWait(Int32, System.Threading.CancellationToken)
ebp+28: 0337ed88
-> 0555F510 System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib],[Microsoft.AspNetCore.Hosting.WebHostExtensions+<RunAsync>d__4, Microsoft.AspNetCore.Hosting]]
-> 04E3A9A8 Microsoft.AspNetCore.Hosting.Internal.WebHost
-> 04E39444 Microsoft.Extensions.DependencyInjection.ServiceCollection
-> 04E39450 System.Collections.Generic.List`1[[Microsoft.Extensions.DependencyInjection.ServiceDescriptor, Microsoft.Extensions.DependencyInjection.Abstractions]]
-> 04E79E20 Microsoft.Extensions.DependencyInjection.ServiceDescriptor[]
-> 04E0AC5C Microsoft.Extensions.DependencyInjection.ServiceDescriptor
#!/usr/bin/env ruby -wKU
require "pp"
require 'fileutils'
require "gruff"
require 'rmagick'
def read_cal(file)
data_segment = false
@leppie
leppie / HomeController.cs
Last active January 29, 2020 12:00
Wat am I doing wrong????
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc;
using Wat.Models;
namespace Wat.Controllers
{
public class HomeController : Controller
{
[HttpGet]
public IActionResult Index()
@leppie
leppie / APL.cs
Last active March 9, 2020 03:00
unsafe class Program
{
delegate int? bar(int* i);
static void Main(string[] args)
{
int[] ω = {};
var Ʃ = 42;
int? Φ = null;
bar ϼ = default;
@leppie
leppie / test.sps
Created August 28, 2019 19:11
Test
(import (rnrs))
(display "Hello world")
(newline)
@leppie
leppie / google_login.py
Created March 13, 2017 18:36
Google login via PhantomJS
mail_address = ''
password = ''
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
UA = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.57 Safari/537.36'
PHANTOMJS_ARG = {'phantomjs.page.settings.userAgent': UA}
@leppie
leppie / bench.cs
Last active October 29, 2016 00:46
int32 rotation in ironscheme
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
public class Program
{
static void Main(string[] args)
{
BenchmarkRunner.Run<Program>();
}
@leppie
leppie / report.tab
Created September 27, 2016 10:56
IronScheme issues for .NET Standard 2.0
Target type Target member Assembly .NET Standard Recommended changes
T:System.CodeDom.Compiler.CompilerResults T:System.CodeDom.Compiler.CompilerResults IronScheme Not supported
T:System.CodeDom.Compiler.CompilerResults M:System.CodeDom.Compiler.CompilerResults.get_Errors IronScheme Not supported
T:System.Security.CodeAccessPermission T:System.Security.CodeAccessPermission IronScheme Not supported Remove usage.
T:System.Security.CodeAccessPermission M:System.Security.CodeAccessPermission.Demand IronScheme Not supported Remove usage.
T:System.Runtime.Remoting.ObjectHandle T:System.Runtime.Remoting.ObjectHandle IronScheme Not supported
T:System.Runtime.Remoting.ObjectHandle M:System.Runtime.Remoting.ObjectHandle.#ctor(System.Object) IronScheme Not supported
T:System.CodeDom.Compiler.CompilerErrorCollection T:System.CodeDom.Compiler.CompilerErrorCollection IronScheme Not supported
T:System.CodeDom.Compiler.CompilerParameters T:System.CodeDom.Compiler.CompilerParameters IronScheme Not supported
T:System.Cod
class Foo
{
public string Bar {get;set;}
}
string Baz<T>(T t, Func<T, string> sel)
{
return sel(t);
}