Skip to content

Instantly share code, notes, and snippets.

namespace WorldDomination.Web.Authentication.OpenId
{
using System;
using System.Collections.Specialized;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId;
using DotNetOpenAuth.OpenId.Extensions.SimpleRegistration;
using DotNetOpenAuth.OpenId.RelyingParty;
/// <summary>
@Buildstarted
Buildstarted / openidprovider.cs
Created January 31, 2013 03:21
sample openid provider for world domination
namespace WorldDomination.Web.Authentication.OpenId
{
using System;
using System.Collections.Specialized;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId;
using DotNetOpenAuth.OpenId.Extensions.SimpleRegistration;
using DotNetOpenAuth.OpenId.RelyingParty;
/// <summary>
@Buildstarted
Buildstarted / uri.js
Created January 30, 2013 01:50 — forked from jlong/uri.js
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@Buildstarted
Buildstarted / BloomFilter.cs
Last active January 3, 2019 04:05
Basic Bloom Filter implementation inspired by Kellabyte
namespace BST
{
using System;
using System.Collections;
public class BloomFilter<T>
{
private readonly int _size;
//how many times to run the hash method
@Buildstarted
Buildstarted / paste.html
Last active December 12, 2024 17:31
Used to capture the clipboard in both mozilla and webkit browsers
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
</head>
<body>
<!-- normally you wouldn't show this -->
<div id="paste" contenteditable="true"></div>
<script type="text/javascript">
<html>
<head>
<style type='text/css'>
#container {
width: 1240px;
border-top: solid 1px #282828;
border-left: solid 1px #282828;
overflow: auto;
}
(function ($, undefined) {
var parrot = {
parse: function(params) {
var defaults = { host: [], model: null, source: "" };
$.extend(defaults, params);
var parser = new Parser();
var view = new ParrotDocumentView(parser.parse(params.source));
return view.render(params.host, params.model);
}
};
namespace ConsoleApplication403
{
using System;
using System.ComponentModel;
using System.IO;
class Program
{
static void Main()
{
@Buildstarted
Buildstarted / tpl-tests.cs
Created November 28, 2012 18:55
Testing how cpu intensive operations are handled via TPL
class Program
{
static void Main()
{
//This method will cause the CPU to be at 100%
//However it will only create enough threads
//based on the # of cores in your system.
//(As long as you don't pass LongRunning as an option
Run(SpinWait);
public class SafeCollection<T> : ICollection<T>
{
private readonly ConcurrentDictionary<T, bool> _inner = new ConcurrentDictionary<T, bool>();
public void Add(T item)
{
_inner.TryAdd(item, true);
}
public void Clear()