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
<script type="text/javascript"> | |
function clean(id) { | |
setTimeout('clean2("'+id+'")', 1) | |
} | |
function clean2(id) { | |
el=document.getElementById(id) | |
var savedSel = rangy.saveSelection(); | |
el.innerHTML = el.innerHTML.replace(/(<([^>]+)>)/ig,""); |
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
def home | |
@map = Cartographer::Gmap.new( 'map_canvas' ) # this is 11 line | |
@map.zoom = :bound | |
@icon = Cartographer::Gicon.new() | |
@map.icons << @icon | |
marker1 = Cartographer::Gmarker.new(:name=> "taj_mahal", :marker_type => "Building", | |
:position => [27.173006,78.042086], | |
:info_window_url => "/url_for_info_content", :icon => @icon) | |
marker2 = Cartographer::Gmarker.new(:name=> "raj_bhawan", :marker_type => "Building", | |
:position => [28.614309,77.201353], |
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
var center = #{Geocoder.coordinates(request.location.country + ',' + request.location.city)} | |
console.log(center) | |
#production mode on local machine | |
var center = [50.45, 30.5233333] | |
#on heroku | |
var center = 50.4530.5233333 |
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
Регион Производитель | |
Наименование | |
Крепость Емкость | |
Тип марки Серия | |
Начальный номер Конечный номер | |
------ ---------------------------------------------------------------- | |
----------------------------------------------------------------------- |
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
#!/bin/bash | |
# | |
# => $ sudo apt-get install -y --force-yes curl; sudo su - -c "bash < <(curl -sL http://is.gd/..........)" | |
# | |
# Deploy Fat Free CRM (rails3 branch) to a freshly installed Ubuntu machine. | |
# -------------------------------------------------------------------------- | |
# | |
# Steps: | |
# | |
# *) Install required packages (git, postgresql, etc.) |
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
[ pid=2094 thr=3065830256 file=ext/nginx/HelperAgent.cpp:584 time=2011-06-23 10:35:04.287 ]: Uncaught exception in PassengerServer client thread: | |
exception: An error occured while sending the request body to the request handler: Connection reset by peer (104) | |
backtrace: | |
in 'virtual void Passenger::Session::sendBodyBlock(const char*, unsigned int)' (Session.h:198) | |
in 'void Client::sendRequestBody(Passenger::SessionPtr&, Passenger::FileDescriptor&, const std::string&, long unsigned int)' (HelperAgent.cpp:295) | |
in 'void Client::handleRequest(Passenger::FileDescriptor&)' (HelperAgent.cpp:510) | |
in 'void Client::threadMain()' (HelperAgent.cpp:603) | |
2011/06/23 10:35:04 [error] 2141#0: *73 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 94.76.87.48, serve$ |
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 IntegrationSpecHelper | |
def login_with_oauth(service = :facebook) | |
visit "/auth/#{service}" | |
end | |
end | |
============================================================================ | |
RSpec.configure do |config| | |
config.include IntegrationSpecHelper, :type => :request |
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
$('[placeholder]').focus(function() { | |
var input = $(this); | |
if (input.val() == input.attr('placeholder')) { | |
input.val(''); | |
input.removeClass('placeholder'); | |
} | |
}).blur(function() { | |
var input = $(this); | |
if (input.val() == '' || input.val() == input.attr('placeholder')) { | |
input.addClass('placeholder'); |
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
total_peoples = 0 | |
puts "how much groups?" | |
groups = gets.chomp.to_i | |
majority_of_each_group = Array.new | |
groups.times do | |
puts "how much people in group?" | |
peoples = gets.chomp.to_i | |
majority_of_each_group << peoples/2 + 1 | |
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
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
OlderNewer