This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# strona.rb | |
require 'rubygems' | |
require 'sinatra' | |
get '/' do | |
'Cze!' | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'sinatra' | |
get '/' do | |
erb :index | |
end | |
use_in_file_templates! | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get '/:permalink' do | |
# dopasowany wzorzec bedzie w params[:permalink] | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Yeti | |
def self.included(base) | |
base.send :extend, ClassMethods | |
end | |
module ClassMethods | |
def crud(klass,opts = {}) | |
class_variable_set(:@@model,klass) | |
self.class_eval CRUD_CODE | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Comatose::Page < ActiveRecord::Base | |
end | |
desc "load pages" | |
task :load_pages_to_db => :environment do | |
YAML::add_private_type("Comatose::Page") do |type, value| | |
Comatose::Page.new(value) | |
end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(void) | |
{ | |
int ch; | |
while ((ch = getchar()) != EOF) | |
putchar(ch); | |
putchar('\n'); | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <pcreposix.h> | |
#include <stdio.h> | |
int main(void) | |
{ | |
regex_t rx; | |
char *pat = "([0-2]?\\d{1,2})\\.([0-2]?\\d{1,2})\\.([0-2]?\\d{1,2})\\.([0-2]?\\d{1,2})"; | |
// More "ambitious" expression - "(?:([0-2]?\\d{1,2})\\.){3}([0-2]?\\d{1,2})"; | |
char *str = "123.45.67.89"; | |
regmatch_t match [6]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (pmatch el) | |
(lambda (parser) | |
(p-cond parser | |
((lambda (parser) | |
(if (eqv? (p-car parser) el) | |
(p-advance parser) | |
(p-fail-parser parser))))))) | |
(define (pmany op) | |
(lambda (parser) | |
(letrec ((loop (lambda (cur-stream) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <pcrecpp.h> | |
#include <string> | |
#include <map> | |
#include <fstream> | |
#define LINE_SIZE 256 | |
typedef std::map<std::string,std::string> Hash; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
development: &defaults | |
# These are the settings for repository :default | |
# adapter: sqlite3 | |
# database: sample_development.db | |
adapter: couchdb | |
database: database | |
host: localhost | |
port: 4004 |
OlderNewer