Skip to content

Instantly share code, notes, and snippets.

View statianzo's full-sized avatar
🎯
Focusing

Jason Staten statianzo

🎯
Focusing
View GitHub Profile
(defn stack-eating-fibo [n]
(cond
(= n 0) 0
(= n 1) 1
:else (+ (stack-eating-fibo (- n 1))
(stack-eating-fibo (- n 2)))))
(defn tail-fibo [n]
(letfn [(fib
[current next n]
//Anonymous Mapper
//Map any object to an anonymous type
public static T AnonMap<T>(this object source, T anonType)
{
var sourceType = source.GetType();
var destinationType = typeof(T);
if (!destinationType.Name.StartsWith("<>"))
throw new ArgumentException("Destination type must be anonymous", "anonType");
var ctor = destinationType.GetConstructors().First();
using System;
using System.Net;
using System.Threading;
internal class Program
{
private static void Main(string[] args)
{
Random random = new Random();
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Reflection;
using Autofac;
//Proof of Concept for a Service Agent implementation using dynamic
namespace ActionContainer
syntax on
colorscheme wombat
filetype plugin indent on
set nocompatible " We don't want vi compatibility.
map th :tabfirst<CR>
map tj :tabnext<CR>
map tk :tabprev<CR>
map tl :tablast<CR>
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Text;
namespace CSharpFourScratch
{
internal class Program
{
#Color table from: http://www.understudy.net/custom.html
fg_black=%{$'\e[0;30m'%}
fg_red=%{$'\e[0;31m'%}
fg_green=%{$'\e[0;32m'%}
fg_brown=%{$'\e[0;33m'%}
fg_blue=%{$'\e[0;34m'%}
fg_purple=%{$'\e[0;35m'%}
fg_cyan=%{$'\e[0;36m'%}
fg_lgray=%{$'\e[0;37m'%}
fg_dgray=%{$'\e[1;30m'%}
## Configuration file for a typical Tor user
## Last updated 12 April 2009 for Tor 0.2.1.14-rc.
## (May or may not work for much older or much newer versions of Tor.)
##
## Lines that begin with "## " try to explain what's going on. Lines
## that begin with just "#" are disabled commands: you can enable them
## by removing the "#" symbol.
##
## See 'man tor', or https://www.torproject.org/tor-manual.html,
## for more options you can use in this file.
require 'sinatra'
require 'dm-core'
require 'dm-validations'
require 'dm-timestamps'
require 'dm-serializer'
require 'syntaxi'
require 'haml'
require 'sass'
DataMapper.setup(:default, "sqlite3://#{Dir.pwd}/pastebin.sqlite3")
@statianzo
statianzo / editregion.js
Created May 18, 2011 00:04
Editable regions in javascript
//BEGIN SerializeAnything
/* @projectDescription jQuery Serialize Anything - Serialize anything (and not just forms!)
* @author Bramus! (Bram Van Damme)
* @version 1.0
* @website: http://www.bram.us/
* @license : BSD
*/
(function($) {
$.fn.serializeAnything = function() {