Skip to content

Instantly share code, notes, and snippets.

View joaomilho's full-sized avatar
🐫

Yo Lulkin joaomilho

🐫
  • Choco.com
  • Berlin, Germany
View GitHub Profile
@joaomilho
joaomilho / boss.config
Created December 7, 2013 15:26
boss.config
%%%
%%% CHICAGO BOSS PROJECT SKELETON
%%%
%%% This file can be modified by you to avoid you needing to reenter
%%% defaults when creating new projects. For full configuration
%%% details, please visit
%%% https://github.com/evanmiller/ChicagoBoss/wiki/Configuration
%%% When running tests, you may want to create a separate configuration file
%%% "boss.test.config" which, if present, will be read instead of boss.config.
# >---------------------------------------------------------------------------<
#
# _____ _ _ __ ___ _
# | __ \ (_) | \ \ / (_) | |
# | |__) |__ _ _| |___\ \ /\ / / _ ______ _ _ __ __| |
# | _ // _` | | / __|\ \/ \/ / | |_ / _` | '__/ _` |
# | | \ \ (_| | | \__ \ \ /\ / | |/ / (_| | | | (_| |
# |_| \_\__,_|_|_|___/ \/ \/ |_/___\__,_|_| \__,_|
#
# This template was generated by RailsWizard, the amazing and awesome Rails
@joaomilho
joaomilho / qs.hs
Created May 4, 2014 15:17
Classical quicksort in haskell for didactic purposes
qs [] = []
qs (x:xs) = qs (filter (<= x) xs) ++ [x] ++ qs (filter (> x) xs)
@joaomilho
joaomilho / operation.hs
Last active August 29, 2015 14:01 — forked from softa/operation.hs
module Main where
import Text.ParserCombinators.Parsec
runop :: Char -> Integer -> Integer -> Integer
runop '+' firstOperand secondOperand = firstOperand + secondOperand
runop '-' firstOperand secondOperand = firstOperand - secondOperand
runop '*' firstOperand secondOperand = firstOperand * secondOperand
runop '^' firstOperand secondOperand = firstOperand ^ secondOperand
operation :: Parser Integer
module ChameleonBass where
import Haskore.Music
import Haskore.Melody
import Haskore.Basic.Pitch
import Haskore.Basic.Duration
import Haskore.Music.GeneralMIDI
import Haskore.Interface.MIDI.Render
pitch_line = map (\(x,y,z) -> x (y :: Octave) z () )
-- relational.hs
import Database.HDBC
import Database.HDBC.PostgreSQL
import Data.List
printTuples conn rel = quickQuery' conn ("SELECT DISTINCT * FROM " ++ rel) []
(⋈) = intercalate " NATURAL JOIN "
(π) fields rel1 = "(SELECT " ++ (intercalate "," fields) ++ " FROM " ++ rel1 ++ ") a"
(¬) True = False
(¬) False = True
True ∧ x = x
False ∧ x = False
True ∨ x = True
False ∨ x = x
True → x = x
brew install erlang
wget http://www.chicagoboss.org/ChicagoBoss-0.8.7.tar.gz
tar -xvf ChicagoBoss-0.8.7.tar.gz
cd ChicagoBoss
make
make app PROJECT=petster
cd ../petster