Skip to content

Instantly share code, notes, and snippets.

import Data.List (intersect)
import qualified Data.Map as Map
prefs = Map.fromList
[("Lisa Rose", Map.fromList [("Lady in the Water", 2.5)
, ("Snakes on a Plane", 3.5)
, ("Just My Luck", 3.0)
, ("Superman Returns", 3.5)
, ("You, Me and Dupree", 2.5)
, ("The Night Listener", 3.0)])
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#define MAX_DATA 512
#define MAX_ROWS 100
struct Address {
(define-route main ("" :method :get)
(with-html-output-to-string (out)
(:html
(:body
(:h1 (princ-safe "Le Reader"))))))
GIT
remote: git://github.com/pilu/web-app-theme.git
revision: b7310fe5001ed03b965049f293fce3527ae98dae
specs:
web-app-theme (0.8.0)
rails (~> 3.2.0)
thor (~> 0.14)
PATH
remote: vendor/gems/acts-as-taggable-on-2.3.3
@paulogeyer
paulogeyer / gist:3287317
Created August 7, 2012 17:01
parse onibus floripa
import urllib
import urllib2
from bs4 import BeautifulSoup
import re
import time
# expressao regular pra remover a sujeira do campo da linha de onibus
linha_r = re.compile('[\t\n\r\-\|]+')
url = "http://www.pmf.sc.gov.br/servicos/index.php?pagina=onibus"
@paulogeyer
paulogeyer / gist:2778716
Created May 24, 2012 01:02
udacity cs212 unit 6 exercise #7
# -----------------
# User Instructions
#
# Write a function, extend_prefix, nested in find_words,
# that checks to see if the prefix is in WORDS and
# adds that to results if it is.
#
# If not, your function should check to see if the prefix
# is in PREFIXES, and if it is should recursively add letters
# until the prefix is no longer valid.
(defparameter *num-players* 2)
(defparameter *max-dice* 3)
(defparameter *board-size* 2)
(defparameter *board-hexnum* (* *board-size* *board-size*))
(defun board-array (lst)
(make-array *board-hexnum* :initial-contents lst))
(defun gen-board ()
(board-array (loop for n below *board-hexnum*
We couldn’t find that file to show.
-javascript 'post'
= simple_form_for(@post) do |f|
= render 'shared/error_messages', :target => @post
.inputs
= f.input :title
= f.input :sequence
= f.input :description, :input_html => {:rows =>5}
= f.simple_fields_for :sections do |section_f|
@paulogeyer
paulogeyer / versão que funciona.rb
Created October 4, 2010 19:54
equação quadrática
puts "Ola!"
puts "Vamos calcular?"
puts "Coloque uma valor para a em ax2+bx+c=0, sendo a diferente de 0."
a = gets.chomp.to_f
puts "Agora, coloque uma valor para b em ax2+bx+c=0."
b = gets.chomp.to_f
puts "Agora, para finalizar, coloque uma valor para c em ax2+bx+c=0."
c = gets.chomp.to_f
x = (b*b) - (4*a*c)
puts ''