Skip to content

Instantly share code, notes, and snippets.

@m2ym
m2ym / brainfuck.lisp
Created January 11, 2011 08:55
Brainfuck Interpreter for Common Lisp with JIT compiler
(defpackage :brainfuck (:use :cl))
(in-package :brainfuck)
(defun string->brainfuck (source)
(let* ((fragments
(map 'list
(lambda (c)
(case c
(#\> "(incptr 1)")
@adulau
adulau / hn2bookmarks.pl
Created April 24, 2011 15:32
Perl script to dump the urls submitted by an HN user (news.ycombinator.com)
#!/usr/bin/perl
#
#
# This perl script is dumping the urls submitted
# by an HN user. Sometime it's better than any
# del.icio.us stream when the HN user has some
# special interests.
#
# Usage:
#
@jcasimir
jcasimir / sessions_and_conversations.markdown
Created September 11, 2011 23:07
Sessions and Conversations in Rails 3

Sessions and Conversations

HTTP is a stateless protocol. Sessions allow us to chain multiple requests together into a conversation between client and server.

Sessions should be an option of last resort. If there's no where else that the data can possibly go to achieve the desired functionality, only then should it be stored in the session. Sessions can be vulnerable to security threats from third parties, malicious users, and can cause scaling problems.

That doesn't mean we can't use sessions, but we should only use them where necessary.

Adding, Accessing, and Removing Data

@cqpx
cqpx / .Xdefaults
Created December 6, 2011 03:33
urxvt xterm zenburn theme
URxvt*termName: rxvt-256color
URxvt*xftAntialias: true
URxvt*background: #3f3f3f
URxvt*foreground: #dcdccc
URxvt*cursorColor: #aaaaaa
URxvt*colorUL: #366060
URxvt*underlineColor: #dfaf8f
URxvt*color0: #3f3f3f
URxvt*color1: #cc9393
URxvt*color2: #7f9f7f
@fogus
fogus / forth.rb
Created January 26, 2012 03:32 — forked from deadprogram/forth.rb
Forth interpreter in 64 lines of Ruby
#!/usr/bin/env ruby
def pop; $stack.pop || raise(StackUnderflow); end
def push(expression); $stack << expression; end
def unary; -> { push(yield pop) }; end
def binary; -> { push(yield pop, pop) }; end
def unary_boolean; -> { push(if yield pop then 1 else 0 end) }; end
def binary_boolean; -> { push(if yield pop, pop then 1 else 0 end) }; end
def swap; $stack[-2,2] = $stack[-2,2].reverse; end
$stack = []
@daurnimator
daurnimator / app.lua
Created September 14, 2012 10:11
Sinatra like clone for lua
if not sinatra.incoming ( ngx.req.get_method() , ngx.var.uri ) then
return ngx.exit ( 404 )
end
@ndarville
ndarville / business-models.md
Last active January 13, 2024 17:27
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@dockimbel
dockimbel / brainfuck.red
Created November 29, 2013 23:08
This is a complete (but not fully tested) implementation of a Brainfuck interpreter in Red language, only using the Parse dialect. The extra verbosity comes from the current lack of built-in reversed input parsing. Once reverse parsing will be implemented in the dialect, the `jump-back` rule should be simplified a lot. Note: this is not meant to…
Red [
Author: "Nenad Rakocevic"
Date: 29/11/2013
]
bf: function [prog [string!]][
size: 30000
cells: make string! size
append/dup cells null size
@sandcastle
sandcastle / install-teamcity.md
Last active December 7, 2023 18:02
Install TeamCity 9.0.3 on Ubuntu with Nginx