Skip to content

Instantly share code, notes, and snippets.

View edbond's full-sized avatar
🗽
Working from home

Eduard Bondarenko edbond

🗽
Working from home
View GitHub Profile
-module(shop).
-author('Eduard Bondarenko <edbond@gmail.com>').
-compile(export_all).
main(_) ->
io:format("Welcome to shop you need.").
## application.rb
before_filter :subdomain_settings
def subdomain_settings
subdomains = request.host.split('.')
@is_admin = subdomains.first.match(/^admin-/) ? true : false
@domain = subdomains.first.gsub(/^admin-/,'')
# AV/base.rb
def render(options = {}, local_assigns = {}, &block) #:nodoc:
local_assigns ||= {}
"<!--DBG #{options[:layout]} #{options[:file]} #{options[:partial]} #{options[:text]}-->"+
if options.is_a?(String)
ActiveSupport::Deprecation.warn(
"Calling render with a string will render a partial from Rails 2.3. " +
"Change this call to render(:file => '#{options}', :locals => locals_hash)."
)
<html>
<head>
<script src="http://mapia.com.ua/api/0.9.0/mapiaapi.js?apikey=1c4ed601350edbc1e5a55fbafab5da8e"></script>
</head>
<body>
<div style="display:block; width:420px; height:314px">
<div id="mapContainer" style="width:100%;height:100%"></div>
</div>
<script>
map = new Mapia('mapContainer');
get '/' do
haml :index
end
post '/unwind' do
@url, @unwound_url, @unwind_error = unwind(params[:url])
haml :index
end
get '/unwind.json' do
@edbond
edbond / gist:51126
Created January 23, 2009 18:32 — forked from peterc/gist:33337
# SUPER DARING APP TEMPLATE 1.0
# By Peter Cooper
# Link to local copy of edge rails
inside('vendor') { run 'ln -s ~/dev/rails/rails rails' }
# Delete unnecessary files
run "rm README"
run "rm public/index.html"
run "rm public/favicon.ico"
#!/usr/bin/ruby
$KCODE='u'
require 'jcode'
require 'rubygems'
require 'bindata'
class NDSHeader < BinData::MultiValue
array :header, :type => :uint8, :initial_length => 0x68
/* This is a template command */
CmdUtils.CreateCommand({
name: "Yandex.Slovari",
icon: "http://lingvo.yandex.ru/favicon.ico",
homepage: "http://slovari.yandex.ru/",
author: { name: "Eduard Bondarenko", email: "edbond@gmail.com"},
license: "GPL",
description: "Translate selection on yandex slovari",
help: "Input text for translation",
takes: {"word": noun_arb_text},
2009-02-10 10:27:52 EET LOG: statement: SELECT tablename
FROM pg_tables
WHERE schemaname IN (E'"$user"',E'public')
2009-02-10 10:27:52 EET ERROR: permission denied: "pg_ts_dict" is a system catalog
2009-02-10 10:27:52 EET STATEMENT: ALTER TABLE "news_categories" ENABLE TRIGGER ALL;ALTER TABLE "news_articles_categories" ENABLE TRIGGER ALL;ALTER TABLE "news_articles" ENABLE TRIGGER ALL;ALTER TABLE "taggings" ENABLE TRIGGER ALL;ALTER TABLE "tags" ENABLE TRIGGER ALL;ALTER TABLE "todos" ENABLE TRIGGER ALL;ALTER TABLE "user_addresses" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "vegetations" ENABLE TRIGGER ALL;ALTER TABLE "vertices_tmp" ENABLE TRIGGER ALL;ALTER TABLE "words" ENABLE TRIGGER ALL;ALTER TABLE "raw_roads" ENABLE TRIGGER ALL;ALTER TABLE "raw_stations" ENABLE TRIGGER ALL;ALTER TABLE "roles" ENABLE TRIGGER ALL;ALTER TABLE "raw_street_segments" ENABLE TRIGGER ALL;ALTER TABLE "roles_users" ENABLE TRIGGER ALL;ALTER TABLE "raw_streets" ENABL
default: -b -r features/support/env.rb -r features/support/simple.rb -r features/step_definitions features/simple
selenium: -b -r features/support/env.rb -r features/support/enhanced.rb -r features/step_definitions features/enhanced
Then /^should be user "(\w+)" in system$/ do |login|
User.first(:conditions => {:login => login}).should_not be_nil
end
Then should be user "bob" in system # features/step_definitions/new_client_registration_steps.rb:9