Skip to content

Instantly share code, notes, and snippets.

View icanhasjonas's full-sized avatar
🎩
crunching

Jonas Frost icanhasjonas

🎩
crunching
  • Bombsquad Inc, FRST Corp
  • Los Angeles, Chicago, Copenhagen, Stockholm, Bangkok
View GitHub Profile
@icanhasjonas
icanhasjonas / 00-demo.md
Last active May 22, 2025 04:26

🎟️ RepBets Ticket Demo

This page shows example event tickets used to demonstrate the RepBets Scanner app in demo mode.

Each ticket is available as a QR code in .svg format. You can scan them using the RepBets Scanner app (available for iOS and Android). In demo mode, the app simulates a real ticket validation flow.

🔍 How to Test

  • Open the RepBets Scanner app.
  • Switch to Demo Mode.

Using a scalar string value works fine

mutation SomeMutation($someValue: String!) {
  hello( a: ["some value"]) { a, b, c}
}

Ntro client parser breaks the whole document when referencing a $variable in an array

mutation SomeMutation($someValue: String!) {
type ExtractArgType<T> = T extends ArgBuilder<infer U> ? U : T
type ExtractTypeBuilderType<T> = T extends TypeBuilder<infer U> ? U : T
type ExtractFieldType<T> = T extends FieldBuilder<string, {}, infer U, boolean> ? U : T
type AcceptedType = string | number | boolean | TypeBuilder<any>
class SchemaBuilder<T = {}> {
query<Builder extends TypeBuilder<{}>>(builder: (typeBuilder: TypeBuilder) => Builder) {
const result = builder(new TypeBuilder())
return (this as unknown) as SchemaBuilder<T & ExtractTypeBuilderType<Builder>>
@icanhasjonas
icanhasjonas / QueryFilterAttribute.cs
Last active March 6, 2019 23:59
Self Formatting SQLish Filters... for the lazy
[AttributeUsage( AttributeTargets.Property )]
public class QueryFilterAttribute : Attribute {
public QueryFilterAttribute( string fieldName )
{
FieldName = fieldName;
}
public QueryFilterAttribute() { }
public string FieldName { get; }

THE WORLD'S BEST CHILI

The recipe was originally found in a book by the Texas journalist Francis X Tolbert, a man who devoted his life to this fiery meat pot.

It all began in the early 60's when Tolbert wrote an article like got the title "The Hunt for the Real Chilin".

In the coming years, he received 48,000 letters from all of the world corner. He read, prepared, traveled, tested, and interviewed living legends

@icanhasjonas
icanhasjonas / decorated-queries.ts
Created November 1, 2018 16:35
Example of decorated interfaces...
interface Query {
query(sql: string): Promise<any>
}
class QueryImplementation implements Query {
query(sql: string) {
return new Promise<string>(resolve => {
setTimeout(() => resolve('Hello'), 2000)
})
@icanhasjonas
icanhasjonas / fully-typed-context.ts
Created October 31, 2018 04:59
Fully Type Checked and Filtered configuration context for components
type PropertyNames<T> = keyof T
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>
type Filtered<T, C> = { [K in keyof T]: T[K] extends C ? K : never }[keyof T]
class ConfigurationPageContext<T> {
addTextSetting<K extends PropertyNames<T>>(
field: Extract<K, Filtered<T, string>>,
title: string,
defaultValue: string = null
): ConfigurationPageContext<Omit<T, K>> {
@icanhasjonas
icanhasjonas / webcrawler.cs
Last active February 22, 2023 10:49
Web Crawler in C#
using System;
using System.Buffers;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
@icanhasjonas
icanhasjonas / AwaitableCancellationTokenExtensions.cs
Last active June 7, 2017 19:05
Awaitable Cancellation Tokens
public static class AwaitableCancellationTokenExtensions
{
public struct CancellationTokenAwaiter : ICriticalNotifyCompletion, INotifyCompletion
{
private readonly CancellationToken _cancellationToken;
public CancellationTokenAwaiter(CancellationToken cancellationToken)
{
_cancellationToken = cancellationToken;
}
@icanhasjonas
icanhasjonas / glitter.asm
Last active April 7, 2017 16:47 — forked from a904guy/fucked_it_all.batch
Upgraded Jonathan Moo's ANY Window's problem fixing script. (Everyone needs glitter. WARNING: DO NOT RUN!.. My assembly skills may have deteriorated over the years)
mov ax, 0320h ; Load glitter pixels
mov dx, 0080h ; 80 pixels wide screen glitter
xor cx, cx ; Big fan of Xorn/marvel(c)
mov bx, cx ; Make sure glitter is Baxed and Counxted
int 13h ; Interest 13