Skip to content

Instantly share code, notes, and snippets.

@Tyriar
Tyriar / DualKeyMap.ts
Created May 12, 2022
A map where the value is accessed via 2 independent keys
View DualKeyMap.ts
interface IDualKeyMap<K, V> {
clear(): void;
delete(keyA: K, keyB: K): boolean;
forEach(callbackfn: (value: V, keyA: K, keyB: K, map: IDualKeyMap<K, V>) => void, thisArg?: any): void;
get(keyA: K, keyB: K): V | undefined;
has(keyA: K, keyB: K): boolean;
set(keyA: K, keyB: K, value: V): this;
readonly size: number;
}
View keybase.md

Keybase proof

I hereby claim:

  • I am tyriar on github.
  • I am tyriar (https://keybase.io/tyriar) on keybase.
  • I have a public key ASBPqLKvzlxIHJ9NcPB7FC4MVKS9PdBzNcasvWdi5PCapgo

To claim this, I am signing this object:

@Tyriar
Tyriar / random_from_list.sql
Created Jul 17, 2014
Various T-SQL database obfuscation scripts
View random_from_list.sql
-- randomise a column's values using a list of specified values
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'ShuffleTable')
DROP TABLE [ShuffleTable];
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'InsertDataListTable')
DROP TABLE [InsertDataListTable];
GO
CREATE TABLE [InsertDataListTable] ([TargetColumn] NVARCHAR(50));
@Tyriar
Tyriar / TypeNameToString.cs
Created Jun 25, 2014
Converts a type/enum name to a string as sentence case.
View TypeNameToString.cs
using System;
using System.Text;
public static class TypeNameToString
{
public static string TypeNameToString(this string text)
{
var builder = new StringBuilder();
var typeName = text;
int index = -1;
@Tyriar
Tyriar / SassMeister-input.scss
Created Feb 9, 2014
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// Sass (v3.3.0.rc.3)
// Compass (v1.0.0.alpha.18)
// ----
@media screen {
%icon {
transition: background-color ease .2s;
margin: 0 .5em;
}