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
upstream phpfpm { | |
server 127.0.0.1:9000; | |
} | |
server { | |
listen 80; | |
server_name _; | |
root /var/www/html; | |
index index.php; |
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
# | |
# A CORS (Cross-Origin Resouce Sharing) config for nginx | |
# | |
# == Purpose | |
# | |
# This nginx configuration enables CORS requests in the following way: | |
# - enables CORS just for origins on a whitelist specified by a regular expression | |
# - CORS preflight request (OPTIONS) are responded immediately | |
# - Access-Control-Allow-Credentials=true for GET and POST requests | |
# - Access-Control-Max-Age=20days, to minimize repetitive OPTIONS requests |
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
/* Modernizr 2.8.2 (Custom Build) | MIT & BSD | |
* Build: http://modernizr.com/download/#-backgroundsize-rgba-cssanimations-csstransforms-csstransforms3d-csstransitions-touch-shiv-cssclasses-prefixed-teststyles-testprop-testallprops-prefixes-domprefixes-css_positionsticky-requestanimationframe | |
*/ | |
; | |
window.Modernizr = (function( window, document, undefined ) { | |
var version = '2.8.2', |
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
/* | |
* Forked from: https://github.com/boblemarin/jQuery.eraser | |
*/ | |
(function( $ ){ | |
var $win = $(window); | |
var Eraser = function(element, options) { | |
this.$element = $(element); | |
this.options = options; |
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
# NOTICE: to get Nginx+Unicorn best-practices configuration see the gist https://gist.github.com/3052776 | |
$ cd /usr/src | |
$ wget http://nginx.org/download/nginx-1.2.1.tar.gz | |
$ tar xzvf ./nginx-1.2.1.tar.gz && rm -f ./nginx-1.2.1.tar.gz | |
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz | |
$ tar xzvf pcre-8.30.tar.gz && rm -f ./pcre-8.30.tar.gz | |
$ wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz |
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
<p class="title" id="target"> | |
<span class="highlight"> | |
DEFAULT: This is how highlighted text usally wraps. It gets tight on the left and right edges. | |
</span> | |
</p> |
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
# The following recipe works with upstream rails proxy for custom 404s and 500s. | |
# Errors are usually handled via rails except if proxy is really down, in which case | |
# nginx needs a bit more configration. | |
server { | |
# ... | |
location / { | |
error_page 404 = @rails; # let rails show a page with suggestions | |
try_files maintenance.html @rails; |
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
class Photo < ActiveRecord::Base | |
module Statues | |
QUEUED = 'queued' | |
NEW = 'new' | |
def self.values | |
constants.map(&method(:const_get)) | |
end | |
# you can define more special methods as you wanted for Statues | |
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
var moscow = [ | |
[[55.82526701551843,37.87487898420691], | |
[55.825342,37.87566605844205], | |
[55.82490198590066,37.876002], | |
[55.82286899363699,37.86894202090486], | |
[55.82236197619592,37.869207025558865], | |
[55.82221,37.868321941252766], | |
[55.82370199523918,37.867472], | |
[55.825242976516364,37.874401949797814], | |
[55.82526701551843,37.87487898420691]], |
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
CREATE TABLE IF NOT EXISTS `county` ( | |
`id` int(10) unsigned NOT NULL AUTO_INCREMENT, | |
`name` varchar(124) NOT NULL, | |
`short_name` varchar(20) NOT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=11 ; | |
INSERT INTO `county` (`id`, `name`, `short_name`) VALUES |