Skip to content

Instantly share code, notes, and snippets.

This is a test.
Hello, world!
@kendfrey
kendfrey / strtoascii.cs
Created April 23, 2012 23:22
String to ASCII
string str = "Hello!";
byte[] ascii = new byte[str.Length];
for (int i = 0; i < ascii.Length; i++)
{
ascii[i] = (byte)str[i];
}
@kendfrey
kendfrey / skeet.js
Last active December 11, 2015 07:19
Skeetify stars
var css = '.vote-count-container.stars span.img, .vote-count-container.stars.user-star span.img, .vote-count-container.stars.owner-star span.img, .vote-count-container.stars.owner-star.user-star .img { background-image: url("http://0.gravatar.com/avatar/6d8ebb117e8d83d74ea95fbdd0f87e13?s=16&d=identicon&r=PG"); background-position: 0px 0px; height: 16px; width: 16px; }'; var style = document.createElement('style'); style.textContent = css; document.head.appendChild(style);
@kendfrey
kendfrey / ob.js
Created April 25, 2013 18:29
Deobfuscation Challenge
function t(h){function e(g){function a(m,e){e=m&(-~[]<<l)+~[];m?(a(m>>l|[]),c+=e):c}b=k("\"\\"+(c="",a(g),c)+"\"");}k=eval;for(I=!(__=(!(l=-~(O=($=[])+[]),x=~-(l-=~l))+O)[x]+(!O+O)[l]+(t+O)[x++]+(++x+
x++ /* ~@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O~ */ ,e(
( x /* O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ */ = (
l<< /* @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@I ~IOO@@@@@@@@@@@@@@@@ */ x++
) + /* @@@@@@@@@@@@@@@@@@@@@@@@: Z@@@@@@@@@@@ @@@@@@@ */ ++x
)), /*
@kendfrey
kendfrey / Test.cs
Last active December 17, 2015 22:59
INotifyPropertyChanged
class Test : INotifyPropertyChanged
{
private string foo;
public string Foo
{
get
{
return foo;
}
@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 / 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 / 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 / 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 / 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)(?!))$