This file contains 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
;; gist.el --- Emacs integration for gist.github.com | |
;; Copyright (C) 2008 Christian Neukirchen <purl.org/net/chneukirchen> | |
;; Copyright (C) 2008 Chris Wanstrath <[email protected]> | |
;; Copyright (C) 2008 Will Farrington <[email protected]> | |
;; Licensed under the same terms as Emacs. | |
;; Version: 0.3.1 | |
;; 26aug2008 +wfarr+ | |
;; 25aug2008 +defunkt+ | |
;; 21jul2008 +chris+ |
This file contains 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 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 |
This file contains 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
#/!usr/bin/env ruby | |
module First | |
def save(*args) | |
puts "First#save, args are #{args.inspect}" | |
end | |
end | |
module Second |
This file contains 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
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' |
This file contains 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 Project | |
include DataMapper::Resource | |
property :id, Serial | |
property :title, Text | |
property :abstract, Text | |
property :combined_tsvector, TSvector | |
#Generates CREATE FUNCTION insert_project |
This file contains 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
" An example for a vimrc file. | |
" | |
" Maintainer: Bram Moolenaar <[email protected]> | |
" 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 |
This file contains 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 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 |
This file contains 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 '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") |
This file contains 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
%! 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 |
NewerOlder