Skip to content

Instantly share code, notes, and snippets.

View ramn's full-sized avatar

ramn ramn

View GitHub Profile
/**
* <b>Fixed Point Combinator is:</b>
* Y = λf.(λx.f (x x)) (λx.f (x x))
*
* <b>Proof of correctness:</b>
* Y g = (λf . (λx . f (x x)) (λx . f (x x))) g (by definition of Y)
* = (λx . g (x x)) (λx . g (x x)) (β-reduction of λf: applied main function to g)
* = (λy . g (y y)) (λx . g (x x)) (α-conversion: renamed bound variable)
* = g ((λx . g (x x)) (λx . g (x x))) (β-reduction of λy: applied left function to right function)
* = g (Y g) (by second equality) [1]
@ramn
ramn / cgi.rb
Created September 1, 2012 10:51 — forked from kek/gist:3153275
Writing a CGI script with templates. For PHP programmers
#!/usr/bin/ruby
require 'cgi'
require 'erb'
cgi = CGI.new('html')
template = <<TEMPLATE
<html>
<head>
@ramn
ramn / dot_ctags
Last active October 2, 2015 22:08 — forked from awl/dot_ctags
scala regular expressions for ctags and tagbar in vim
--langdef=Scala
--langmap=Scala:.scala
--regex-Scala=/^[ \t]*(((implicit|private|protected)?[ \t]*)*(\[[a-zA-Z0-9_]*\])?[ \t]*)*object[ \t]*([a-zA-Z0-9_]+)/\5/o,objects/
--regex-Scala=/^[ \t]*(((implicit|private|protected|sealed)?[ \t]*)*(\[[a-zA-Z0-9_]*\])?[ \t]*)*trait[ \t]*([a-zA-Z0-9_]+)/\5/t,traits/
--regex-Scala=/^[ \t]*(((implicit|private|protected|sealed)?[ \t]*)*(\[[a-zA-Z0-9_]*\])?[ \t]*)*(case[ \t]*)?class[ \t]*([a-zA-Z0-9_]+)/\6/c,classes/
--regex-Scala=/^[ \t]*abstract[ \t]*class[ \t]*([a-zA-Z0-9_]+)/\1/a,aclasses/
--regex-Scala=/^[ \t]*((implicit|override|lazy|private|protected|private\[[a-zA-Z]+\])[ \t]*)*def[ \t]*([a-zA-Z0-9_=]+)[ \t]*/\3/m,methods/
--regex-Scala=/^[ \t]*(((override|lazy|private|protected)?[ \t]*)*(\[[a-zA-Z0-9_]*\])?[ \t]*)*val[ \t]*([a-zA-Z0-9_]+)[ \t]*[:=]/\5/V,values/
--regex-Scala=/^[ \t]*(((override|lazy|private|protected)?[ \t]*)*(\[[a-zA-Z0-9_]*\])?[ \t]*)*var[ \t]*([a-zA-Z0-9_]+)[ \t]*[:=]/\5/v,variables/
--regex-Scala=/^[ \t]*type[ \t]*([a-zA-Z0-9_]+)[ \t]*[\[<>=]/\1
@ramn
ramn / MinimalSoapServer.scala
Created February 4, 2011 11:06 — forked from kings13y/MinimalSoapServer.scala
Soap server in Scala
/*
CHANGELOG
- add annotation for param names
*/
import javax.jws.{WebService, WebParam}
import javax.jws.soap.SOAPBinding
import SOAPBinding.Style
import javax.xml.ws.Endpoint