Skip to content

Instantly share code, notes, and snippets.

@frankbryce
frankbryce / AESGCM.cs
Last active September 4, 2015 16:31 — forked from jbtule/AESGCM.cs
I have two code examples that I wrote for best practices encrypting a string in c#. They are both using authenticated encryption. http://stackoverflow.com/a/10366194/637783
/*
* This work (Modern Encryption of a String C#, by James Tuley),
* identified by James Tuley, is free of known copyright restrictions.
* https://gist.github.com/4336842
* http://creativecommons.org/publicdomain/mark/1.0/
*/
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace ConsoleApplication13
{
class Program
{
/// <summary>
/// I state my assumptions here for completeness. All assumptions are made to facilitate concise
@frankbryce
frankbryce / voces-remake.sh
Last active September 6, 2015 18:58
Deploy Script for my voces-solis website repo
sudo rm voces-solis -r
git clone https://github.com/jonnyjack7/voces-solis.git
cd voces-solis
sudo apt-get install ruby-full rubygems
sudo apt-get install apt-file
sudo apt-get install psmisc
sudo gem install sass
sudo gem install compass
npm install && bower install
sudo fuser -n tcp -k 80
@frankbryce
frankbryce / Timebox.cs
Last active January 5, 2016 16:53
Timebox Class
using System;
using System.Threading.Tasks;
public class Timebox
{
private readonly TimeSpan _ts;
public Timebox(TimeSpan ts)
{
_ts = ts;
public class DoublyLinkedListNode<T>
{
private T element;
private DoublyLinkedListNode<T> next;
private DoublyLinkedListNode<T> previous;
public DoublyLinkedListNode(T element)
{
this.element = element;
this.next = null;
public class DoublyLinkedList<T> : ICloneable, IEnumerable where T : ICloneable
{
private class Node<U>
{
public U Value;
public Node<U> Next;
public Node<U> Prev;
public Node(U value, Node<U> next, Node<U> prev)
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using WampSharp.V2;
using WampSharp.V2.Client;
using WampSharp.V2.Core.Contracts;
namespace HubUSA.LPR.CameraService
{
@frankbryce
frankbryce / concurrentqueue.go
Last active March 15, 2018 15:31
An simple interface and implementation for concurrent queue in go
// Can be any backing type, even 'interface{}' if desired.
// See stackoverflow.com/q/11403050/3960399 for type conversion instructions.
type IntConcurrentQueue interface {
// Inserts the int into the queue
Enqueue(int)
// Will return error if there is nothing in the queue or if Close() was already called
DequeueNonBlocking() (int, error)
// Will block until there is a value in the queue to return.
// Will error if Close() was already called.
DequeueBlocking() (int, error)
<!DOCTYPE html>
<html>
<head><title>SOUND</title></head>
<body>
<div>Frequence: <span id="frequency"></span></div>
<script type="text/javascript">
var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
var oscillatorNode = audioCtx.createOscillator();
var gainNode = audioCtx.createGain();
// compute probability of landing on tile after certain number of steps of brownian
package main
import (
"flag"
"fmt"
"math/big"
"math/rand"
"os"
"time"