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 / refs.sql
Created March 15, 2024 10:18
Getting all transistive project references with DependenSee and SQL
drop table if exists Reference
drop table if exists Source
declare @json NVARCHAR(MAX) = (select Data from Deps); -- output from `DependenSee . -P -T ConsoleJson`
select *
into Source
from
(
SELECT Id, Name, Source = 'Project' from OPENJSON(JSON_QUERY(@json, '$.Projects')) WITH (Id nvarchar(255), Name nvarchar(255))

IronScheme's Implementation of map

The actual implementation of map in IronScheme is as follows:

(define map
  (case-lambda 
    [(proc list1)
      (let f ((lst list1)(a '()))
        (if (null? lst)
 (reverse! a)
@leppie
leppie / results.md
Last active November 30, 2022 12:40
IronScheme bench runtimes precompiled JIT testing
@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}