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
- options = options_for_select(Landing::TYPES.collect{ |name| [ t(".#{name}"), name ] }, @landing.landing_type) | |
= f.select :landing_type, options |
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
class @App | |
@kb_suggest = (request, response) -> | |
response [{ | |
label: 'label' | |
value: 'key' | |
}] | |
$('#landing_iata_one').autocomplete | |
source: App.kb_suggest |
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
$ -> | |
$('.flash_msgs').on 'click', 'a.close', -> | |
$(@).parent().hide() |
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
ECHO OFF | |
cls | |
ECHO. | |
ECHO FILE NAME | |
ECHO %0 | |
ECHO. |
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
Prepare | |
apt-get update && apt-get upgrade | |
apt-get -f install | |
apt-get install dialog | |
Base | |
apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxslt1.1 libxslt1-dev libxml2 libxml2-dev libxslt-dev autoconf libc6-dev -y | |
ImageMagick | |
apt-get install aptitude -y |
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/sh | |
### BEGIN INIT INFO | |
# Provides: unicorn_<%= application %> | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Manage unicorn server | |
# Description: Start, stop, restart unicorn server for a specific application. | |
### END INIT INFO |
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
1.8.7 :009 > Benchmark.bm{ |b| b.report{ 100_000.times{ Rails.root + 'a/b/c' } } } | |
user system total real | |
4.890000 0.010000 4.900000 ( 5.407428) | |
=> true | |
1.8.7 :010 > Benchmark.bm{ |b| b.report{ 100_000.times{ Rails.root.to_s + 'a/b/c' } } } | |
user system total real | |
0.220000 0.000000 0.220000 ( 0.272255) | |
=> true | |
1.8.7 :011 > Benchmark.bm{ |b| b.report{ 100_000.times{ "#{Rails.root}/a/b/c" } } } | |
user system total real |
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
@log = -> console.log.apply(console, arguments) | |
class @Animal | |
constructor: (name = 'Abstract animal') -> | |
@name = name | |
Animal::eat = (food) -> | |
log(food) | |
class @Dog extends Animal |
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
lng_corr = 250 / (Math.cos(coordinates[1] * Math.PI / 180) * 111.11) / 2 | |
lat_corr = 250 / 111.11 / 2 | |
query = City.find().where('coordinates.lng').gt(coordinates[0] - lng_corr).lt(coordinates[0] + lng_corr).where('coordinates.lat').gt(coordinates[1] - lat_corr).lt(coordinates[1] + lat_corr) |
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 'fileutils' | |
ROOT_PATH = File.dirname File.absolute_path(__FILE__) | |
src_dir = ROOT_PATH + "/src" | |
dest_dir = ROOT_PATH + "/dest" | |
src_dirs = Dir.glob(src_dir + '/*').select{|f| File.directory? f } | |
src_dirs.each do |dir| | |
dir_name = dir.split('/').last |