Skip to content

Instantly share code, notes, and snippets.

View edipofederle's full-sized avatar
🏠
Working from home

Édipo Féderle edipofederle

🏠
Working from home
View GitHub Profile
-- Dado um arquivo conta quantas linhas o mesmo tem.
main = interact wordCount
where wordCount input = show( length (lines input)) ++ "\n"
#index controller client
def index
#@clients = Client.where("user_id = ? AND name LIKE ?", current_user.id, "%#{params[:search]}%").order("name ASC")
@clients = current_user.clients.search_by_name(params[:search])
end
#Model Client
def self.search_by_name(name)
@edipofederle
edipofederle / 1.clj
Created February 18, 2012 22:22
1.clj
(println "Hello")
@edipofederle
edipofederle / 2.clj
Created February 18, 2012 22:26
2.clj
(println ))
@edipofederle
edipofederle / math1.clj
Created February 19, 2012 13:42
math1.clj
* (− 10 34) 2
4 − 43 * 11
(class (* 100000 500000))
java.lang.Long
@edipofederle
edipofederle / upper.clj
Created February 19, 2012 14:49
upper.clj
(.toUpperCase "Teste")
"TESTE"
@edipofederle
edipofederle / str.clj
Created February 19, 2012 15:02
str.clj
(str 'Hello ' 10000000 nil ' Testes')
@edipofederle
edipofederle / function.clj
Created February 25, 2012 12:00
function 1
(defn say_hello
"Retorna Hello username, se username for
omitido asume world"
([] (say_hello "world"))
([username]
(str "Hello, " username)))
(say_hello "edipo")
(say_hello)
(ns exploring
(:require [clojure.contrib.string :as str]))
(defn a-function [word]
"Capitaliza todas palavras maiores que 2 chars"
(if (>(count word ) 2) (str/capitalize word)))
(use '[clojure.contrib.str-utils :only (re-split)])
(filter a-function (re-split #"\W+" "A fine day it is"))