Skip to content

Instantly share code, notes, and snippets.

@kendfrey
kendfrey / hangman.js
Created September 6, 2019 14:31
hangman
"use strict";
const words = require("./words.json");
const faces = [":grin:", ":smile:", ":grinning:", ":slight_smile:", ":neutral_face:", ":slight_frown:", ":worried:", ":persevere:", ":tired_face:", ":dizzy_face:", ":skull:"];
module.exports = class Hangman
{
constructor()
{
this.guesses = new Set();
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetCapsLockState, AlwaysOff
#If GetKeyState("CapsLock","P")
{
; Superscript & subscript
1::Send {U+00B9} ; ¹ 1 superscript
@kendfrey
kendfrey / LOGIC.cs
Created June 28, 2016 14:29
System.LOGIC
using System;
namespace System
{
internal static class LOGIC
{
internal static bool IMPLIES(bool p, bool q)
{
return !p || q;
}
@kendfrey
kendfrey / shortener.js
Last active August 29, 2015 14:22
Title Shortener
// ==UserScript==
// @name Title Shortener
// @namespace http://kendallfrey.com/
// @version 1.0
// @description Removes cruft from page titles
// @author Kendall Frey
// @include *
// @grant none
// ==/UserScript==
@kendfrey
kendfrey / regex.txt
Last active August 3, 2016 11:45
HTML Regex
^(?:\<(?<T>[A-Za-z][\w:.-]*)(?:\s+[A-Za-z][\w:.-]*=(?:"[^"]*"|'[^']*'))*\s*(?<-T>/)?\>|\</(?<-T>\k<T>)\>|(?:[^<&]|&(?:[A-Za-z]+|#\d+|#x[\da-fA-F]+);)+|<!--(?:[^-]|-(?!-))*-->|<!\[CDATA\[(?:[^\]]|](?!]>))*]]>)*(?(T)(?!))$
@kendfrey
kendfrey / darkchat.css
Last active January 2, 2016 21:39
Dark Chat
body {
background-color : #000 !important;
background-image : url("http://raw.github.com/oliversalzburg/se-chat-dark-theme/master/img/skewed_print.png") !important;
color : #ddd !important;
}
.messages {
background-color : #222 !important;
border : none !important;
color : #ddd !important;
@kendfrey
kendfrey / surfer.c
Created August 29, 2013 13:18
IOCCC
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#include <fcntl.h>
#define lOOO char*
#define O0Ol(s) setmode(fileno(s),O_BINARY)
#define\
l010(i)((\
lOOO )&\
@kendfrey
kendfrey / sarcasm.css
Last active December 21, 2015 17:38
Sarcasm for Chat
i>code
{
font-family: Verdana,Arial,sans-serif !important;
font-style: normal;
display: inline-block;
transform: skewX(15deg);
}
@kendfrey
kendfrey / Json.cs
Created July 24, 2013 18:03
JSON asserting
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Script.Serialization;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Test
{
@kendfrey
kendfrey / Test.cs
Last active December 17, 2015 22:59
INotifyPropertyChanged
class Test : INotifyPropertyChanged
{
private string foo;
public string Foo
{
get
{
return foo;
}