Skip to content

Instantly share code, notes, and snippets.

require 'rack/utils'
require 'hpricot'
module Rack
class Codehighlighter
include Rack::Utils
# for logging use
FORMAT = %{%s - [%s] [%s] "%s %s%s %s" (%s) %d %d %0.4f\n}
require 'rubygems'
require 'sinatra'
require 'coderay'
require 'rack-codehighlighter'
use Rack::Codehighlighter, :coderay,
:element => "pre", :pattern => /\A:::(\w+)\s*\n/
get "/" do
erb :index
@wbzyl
wbzyl / literatura.bib
Created December 25, 2009 18:42
Szablon pracy mgr: xelatex + amsrefs
%%% Skróty
%%% czasopisma:
@String{j-LECT-NOTES-COMP-SCI = "Lecture Notes in Computer Science"}
%%% wydawcy:
@String{pub-PH = "Pren{\-}tice-Hall"}
@String{pub-PH:adr = "Englewood Cliffs, NJ 07632, USA"}
@wbzyl
wbzyl / literatura.ltb
Created December 25, 2009 18:45
Szablon pracy mgr: xelatex + amsrefs
\documentclass[12pt]{amsbook}
\usepackage{amsrefs}
\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text}
\usepackage{xunicode}
\usepackage{xltxtra}
\usepackage[polish]{polyglossia}
\raggedbottom
// *stdio.h* declares *puts*
#include <stdio.h>
//### code hello world
// every C program contains function *main*.
int main (int argc, char *argv[]) {
puts("hello world");
return 0;
}
require 'rubygems'
$LOAD_PATH.unshift File.dirname(__FILE__) + '/lib'
require 'sinatra'
require 'erubis'
set :erubis, :pattern => '\{% %\}'
require 'rdiscount'
@wbzyl
wbzyl / X-cz.txt
Created April 22, 2011 16:17 — forked from karmi/X-cz.txt
Playing with Language Classification with N-Grams in Ruby
Druhá světová válka
Z Wikipedie, otevřené encyklopedie
Druhá světová válka
Animace vývoje války v Evropě
Trvání: 1. září 1939 – 2. září 1945
Místo: Evropa, Středomoří, Afrika, Tichomoří, Jihovýchodní Asie, Čína, Střední východ
Výsledek: Vítězství Spojenců
Strany
@wbzyl
wbzyl / 2dqueries.js
Created May 10, 2011 10:51 — forked from glyphobet/2dqueries.js
Example showing that MongoDB uses native units for regular 2d queries, and radians for spherical 2d queries
> db.dropDatabase();
{ "dropped" : "test", "ok" : 1 }
>
> // These points are one degree apart, which (according to Google Maps) is about 110 km apart
> // at this point on the Earth.
> db.points.insert({location: [-122, 37]});
> db.points.insert({location: [-122, 38]});
> db.points.ensureIndex({location:"2d"});
>
>
@wbzyl
wbzyl / rails3-template.rb
Created July 6, 2011 22:03
An example of Rails template file.
remove_file 'README'
create_file "README.md" do
"# Fortunka\n\nTODO"
end
remove_file "public/index.html"
gem "simple_form"
generate "simple_form:install"
@wbzyl
wbzyl / mongod
Created September 15, 2011 18:53
MongoDB init.d script for Linux / Fedora 15
chkconfig —add mongodb
chkconfig mongodb on