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 / 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);
}
@leppie
leppie / posttags_importer.cs
Created August 2, 2016 15:25
Importing post tags like a boss!
using System;
using System.Data.SqlClient;
using System.Linq;
using System.Text.RegularExpressions;
using System.Xml.Linq;
using System.Xml;
using Dapper;
namespace SOImporter
{
class Program
{
// first argument needs to be a reference type...
public static int Add(object a, int b) => (int) a + b;
static void Main(string[] args)
{
var a = 1;
var add1 = (Func<int, int>)Delegate.CreateDelegate(typeof(Func<int, int>), a, typeof(Program).GetMethod("Add"));
-- setup
CREATE DATABASE test
( EDITION = 'basic', MAXSIZE = 2 GB ); --SERVICE_OBJECTIVE = 'S0',
WAITFOR DELAY '00:01';
ALTER DATABASE test
SET QUERY_STORE = ON (OPERATION_MODE = READ_WRITE, INTERVAL_LENGTH_MINUTES = 1);
USE test