Skip to content

Instantly share code, notes, and snippets.

@Siim
Siim / gist:1031082
Created June 17, 2011 08:45
Nordea banklink (Nordea pangalink)
<?php
/**
* License: GPL3
* (c) Siim Haugas 2011
*/
class Nordea{
protected $fields = array();
function __construct(){
$stamp = time();
$this->fields = array(
FILE1: login.php
function() login
{
$sql = ...;
$data = ...;
//assign data to template...
function assign(...);
server.modules += ( "mod_fastcgi","mod_rewrite","mod_compress" )
server.document-root = "/home/siim/web/pub/ochart/upload"
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
server.dir-listing = "enable"
index-file.names = ("index.php","index.html")
server.port = 3000
server.name = "neoon.mine.nu"
mimetype.assign = (
#include <windows.h>
#include <stdio.h>
void coolSleep(int count)
{
int i;
for(i=count; i>=0; i--){
printf(".",i);
Sleep(1000);
}
@Siim
Siim / cat.hs
Created September 2, 2010 00:27
import System.Environment (getArgs)
main = do
filenames <- getArgs
case null filenames of
True -> interact id
False -> putStr . concat =<< mapM readFile filenames
@Siim
Siim / gist:459357
Created June 30, 2010 23:22
calendar
import Data.Time.Clock
import Data.Time.Calendar
import Data.Time.LocalTime
-- TODO: printMonth with custom args
-- move printMonth to printCurrnentMonth
date :: IO (Integer,Int,Int) -- :: (year,month,day)
date = getZonedTime >>= return . toGregorian . localDay . zonedTimeToLocalTime
leap = date >>= (\(y,_,_) -> return $ isLeap y)
#!/usr/bin/env python
from optparse import OptionParser
parser = OptionParser()
parser.add_option(
"-f","--file",
dest="filename",
help="Convert TomTom CSV contacts to VCF",
metavar="FILE"
@Siim
Siim / split.erl
Created November 4, 2009 21:21
erlang string tokenize
-module(split).
-export([tokens/2]).
-export([len/1]).
-export([substr/3]).
tokens(String, Limiter) ->
tokens(String, Limiter, [], []).
tokens([], _Limiter, Sub, Res) ->
[lists:reverse(Sub)|Res];