Skip to content

Instantly share code, notes, and snippets.

View andrewkolesnikov's full-sized avatar

Andrew Kolesnikov andrewkolesnikov

View GitHub Profile
get %r{^/([a-zA-Z0-9_/-]+\.coffee)\.js} do |filename|
content_type :js
base_name = options.public + '/' + filename
if File.exists? base_name
haml File.open(base_name, 'r'){|f| f.read }, :layout => false
else
File.open(base_name + '.js', 'r'){|f| f.read }
end
end
:coffeescript
ready_handler = ->
if GBrowserIsCompatible
map = new GMap2 document.getElementById "map"
map.setCenter new GLatLng(37.4419, -122.1419), 13
mapTypes = new GMapTypeControl
map.addControl mapTypes
map.addMapType G_PHYSICAL_MAP
map.removeMapType G_SATELLITE_MAP
map.addControl new GSmallZoomControl
require "rubygems"
require "dm-core"
require "dm-tags"
require "dm-validations"
require "spec"
class Contact
include DataMapper::Resource
property :id, Serial
http://www.sendspace.com/file/yvxrme
@andrewkolesnikov
andrewkolesnikov / gist:896607
Created March 31, 2011 15:44
Helper for DoubleClick tracking codes tags in ruby on rails Rails3 with haml
#
# Helper
#
module ApplicationHelper
#
# DoubleClick tracking codes
#
def doubleclicksrc
'xxxxxx'
echo 'export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH' > ~/.profile
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH
# Gemfile
gem 'dm-active_model', :git => 'https://github.com/datamapper/dm-active_model.git', :branch => 'master'
gem 'dm-rails', :git => 'http://github.com/andrewkolesnikov/dm-rails.git', :branch => 'master'
# $ bundle list | grep active
* dm-active_model (1.1.1 5758780)
$ git push heroku
$ g df HEAD
diff --git a/Gemfile b/Gemfile
index 59c78aa..8d1e5cc 100644
--- a/Gemfile
+++ b/Gemfile
@@ -3,7 +3,7 @@ source 'http://rubygems.org'
gem 'rails'
gem 'will_paginate'
gem 'aws-s3'
-# gem 'dm-active_model', :git => 'https://github.com/datamapper/dm-active_model.git', :branch => 'master'
$ grep active_model Gemfile.lock
dm-active_model (~> 1.1.0)
remote: https://github.com/datamapper/dm-active_model.git
dm-active_model (1.1.1)
dm-active_model!
@andrewkolesnikov
andrewkolesnikov / gist:1489041
Created December 17, 2011 03:27
NeroPopoverBackgroundView
//
// NeroPopoverBackgroundView.m
// poc
//
// Created by Andrew Kolesnikov on 11/22/11.
// Copyright (c) 2011 Isobar. All rights reserved.
//
#import "NeroPopoverBackgroundView.h"