Skip to content

Instantly share code, notes, and snippets.

%! program = pdflatex
\documentclass[russian, 12pt]{article}
\usepackage{amsmath, amsthm, amssymb}
\usepackage{geometry} % see geometry.pdf on how to lay out the page. There's lots.
\usepackage{graphics}
\usepackage[percent]{overpic}
\geometry{a4paper} % or letter or a5paper or ... etc
% \geometry{landscape} % rotated page geometry
require 'rmagick'
STR = %w(CF EE E7 E4 F0 E0 E2 EB FF FE 20 F1 20 38 20 EC E0 F0 F2 E0 21 20 C6 E5 EB E0 FE 20 E2 F1 E5 E3 EE 2D E2 F1 E5 E3 EE 20 3A 29)
SIDE = 20
canvas = Magick::Image.new(STR.size*SIDE, SIDE, Magick::HatchFill.new('white', 'lightcyan2'))
gc = Magick::Draw.new
STR.each_with_index do |color, i|
gc.fill("##{color}2")
@DimaD
DimaD / acts_as.rb
Created April 27, 2009 09:02
I want to write acts_as List instead of acts_as_list. Also it help to abstract self.included idiom
module ActsAs
end
class ActiveRecord::Base
def self.const_missing name
if ActsAs.const_defined?(name)
ActsAs.const_get(name.to_s)
else
raise NameError.new("uninitialized constant #{name}", name)
end
" An example for a vimrc file.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last change: 2002 Sep 19
"
" To use it, copy it to
" for Unix and OS/2: ~/.vimrc
" for Amiga: s:.vimrc
" for MS-DOS and Win32: $VIM\_vimrc
class Project
include DataMapper::Resource
property :id, Serial
property :title, Text
property :abstract, Text
property :combined_tsvector, TSvector
#Generates CREATE FUNCTION insert_project
namespace :sunspot do
namespace :solr do
desc 'Start the Solr instance'
task :start => :merb_env do
sunspot_solr = Merb.root / 'vendor' / 'sunspot' / 'bin' / 'sunspot-solr'
pid_path = Merb.root / 'tmp' / 'solr' / 'pids'
data_path = Merb.root / 'tmp' / 'solr' / 'data'
pid_path = Merb.root / 'tmp' / 'solr' / 'pids'
#/!usr/bin/env ruby
module First
def save(*args)
puts "First#save, args are #{args.inspect}"
end
end
module Second
module Merb
module SessionMixin
module RequestMixin
def set_session_cookie_value(value, options = {})
defaults = Mash.new({:domain => Merb::Config[:default_cookie_domain]})
defaults[:expires] = Time.now + _session_expiry if _session_expiry > 0
cookies.set_cookie(_session_id_key, value, defaults.merge(options))
end
end
end
;; gist.el --- Emacs integration for gist.github.com
;; Copyright (C) 2008 Christian Neukirchen <purl.org/net/chneukirchen>
;; Copyright (C) 2008 Chris Wanstrath <chris@ozmm.org>
;; Copyright (C) 2008 Will Farrington <wcfarrington@gmail.com>
;; Licensed under the same terms as Emacs.
;; Version: 0.3.1
;; 26aug2008 +wfarr+
;; 25aug2008 +defunkt+
;; 21jul2008 +chris+
test