This file contains hidden or 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
$ = jQuery | |
# An abstract class that provide jQuery plugin setup functionalities. | |
class window.PluginBase | |
# Redefine this dictionary to specify default options | |
@defaultOptions: {} | |
# The default constructor calls the initialize method and set the jQuery element. | |
# Remember to call super in subclasses if you want to maintain this behaviour. |
This file contains hidden or 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
.alert { | |
padding: 10px; | |
left: 50%; | |
margin-left: -300px; | |
padding-right: 35px; | |
position: fixed; | |
top: 10px; | |
width: 600px; | |
z-index: 9999; | |
border: 1px solid transparent; |
This file contains hidden or 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 :data do | |
namespace :import do | |
task :cities do | |
country_codes = Hash[Country.all.map {|c| [c.iata_code, c.id]}] | |
import_csv_to 'cities' do |row| | |
country_code, city_name, city_name_en, city_lat, city_long = [*row] | |
country_id = country_codes[country_code] || nil | |
if city_name |
This file contains hidden or 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 experiment for a capistrano 'stage' that can actually be used to | |
# deploy multiple feature branches at once. | |
# Intended to be installed config/deploy/feature_demo , when using cap | |
# multi-stage support: add 'feature_demo' to 'stages' in `config/deploy.rb` too. | |
# Run from a git feature branch `cap feature_demo deploy` to deploy to | |
# single machine we have all our feature demos on. | |
# Name of feature branch will be taken from current git checkout. |
This file contains hidden or 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 File.join(File.dirname(__FILE__), 'deploy/nginx') | |
require File.join(File.dirname(__FILE__), 'deploy/log') | |
default_run_options[:pty] = true | |
set :ssh_options, { :forward_agent => true } | |
set :application, "appname" | |
set :repository, "git@giturl" | |
set :scm, :git |
This file contains hidden or 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 RetryableTyphoeus | |
require 'typhoeus' | |
include Typhoeus | |
DEFAULT_RETRIES = 1 | |
class Request < Typhoeus::Request | |
def original_on_complete=(proc) | |
@original_on_complete = proc |
This file contains hidden or 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
upstream faye { | |
server 127.0.0.1:9292; | |
} | |
upstream webrick{ | |
server 127.0.0.1:3000; | |
} | |
server { | |
listen 80 default; |
This file contains hidden or 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 | |
echo "Generating an SSL private key to sign your certificate..." | |
openssl genrsa -des3 -out myssl.key 1024 | |
echo "Generating a Certificate Signing Request..." | |
openssl req -new -key myssl.key -out myssl.csr | |
echo "Removing passphrase from key (for nginx)..." | |
cp myssl.key myssl.key.org | |
openssl rsa -in myssl.key.org -out myssl.key |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Pony Test</title> | |
</head> | |
<body> | |
<h1>Задание:</h1> | |
<ul> | |
<li>Необходимо сделать фильтр товаров для магазина игрушечных пони</li> |
OlderNewer