Skip to content

Instantly share code, notes, and snippets.

View 1gor's full-sized avatar

1gor

  • Rational Decisions
  • London
View GitHub Profile
@1gor
1gor / canine.rb
Created December 16, 2009 07:31 — forked from h0rs3r4dish/canine.rb
class Canine
VERSION = '1.3'
def initialize(&block)
@commands = Hash.new
@default = @latest = :commands
@empty = nil
@auto = {
:commands => hash_command("commands","Show a list of commands",Proc.new {
@commands.each { |cmd| c = cmd[1]
name = c[:name].to_s
@1gor
1gor / Gemfile
Created September 23, 2011 14:27
Errors with Padrino::Contrib::Helpers::AssetsCompressor
source :rubygems
# Server requirements
gem 'unicorn'
# Project requirements
gem 'rake'
gem 'rack-flash'
gem 'heroku'
@1gor
1gor / README.md
Created December 21, 2011 06:35 — forked from dsokolowski/README.md
Integration capybara with minitest

##Integration capybara with minitest

Requirements:

  • ruby 1.9
  • gem capybara

All you have to do is to require file test_helper.rb at the beginning of your test files.

@1gor
1gor / admin.less
Created April 8, 2012 22:04 — forked from nikcub/admin.less
example bootstrap file
// to build:
// lessc <filename> > site.css
// lessc <filename> > site.min.css --compress
// the swatch
@color1: #55626b;
@color2: #6c9380;
@color3: #c1ca55;
@color4: #f07d6b;
@color5: #ad5472;
@1gor
1gor / app.rb
Created May 5, 2012 07:32 — forked from nu7hatch/app.rb
OmniAuth login in popup
require 'rubygems'
require 'sinatra'
require 'omniauth/oauth'
set :sessions, true
set :layout, true
use OmniAuth::Builder do
provider :twitter, 'key', 'secret'
end
@1gor
1gor / gist:2631942
Created May 8, 2012 01:53 — forked from jamiehodge/gist:1327195
Warden and Sinatra example
require 'sinatra/base'
require 'rack/flash'
require 'warden'
require 'slim'
require 'sequel'
require 'sqlite3'
DB = Sequel.sqlite
DB.create_table :users do
primary_key :id
# Build an inverted index for a full-text search engine with Redis.
# Copyright (C) 2009 Salvatore Sanfilippo. Under the BSD License.
# USAGE:
#
# ruby invertedindex.rb add somedir/*.c
# ruby invertedindex.rb add somedir/*.txt
# ruby search your query string
require 'rubygems'
require 'redis'
@1gor
1gor / about.md
Created June 1, 2012 02:26 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
@1gor
1gor / gist:3134795
Created July 18, 2012 07:21
Nanoc helper to display blog post summary and a link to the full post
module My
module Helpers
# Nanoc helper to display blog post summary and a link to the full post.
# Used inside <% sorted_articles.each do |item| %>...<% end %> block etc.
#
# @example Put the following in your layout:
#
# <%= article_summary(item,'Read the full article>>') %>
#
# To customize the link text you can add 'read_more' attribute to your
@1gor
1gor / file.inc
Created October 23, 2012 17:00
AppFog fix for Drupal 7's /tmp location error
/**
* Force location of /tmp
*/
$AF_tmp = realpath($_SERVER['DOCUMENT_ROOT'].'/../tmp');
variable_set('file_temporary_path', $AF_tmp);
return $AF_tmp;
/* END */