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
select_tag :language, | |
options_for_select(I18n.available_locales.to_a.map{ |locale| [t('name', :locale => locale), locale] }, | |
I18n.locale.to_sym) |
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: nginx | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon |
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 'socket' | |
puts 'Starting server' | |
server = TCPServer.new '127.0.0.1', 3456 | |
puts '...Ok!' | |
while session = server.accept | |
session.print "HTTP/1.1 200/OK\r\nContent-type:text/html\r\n\r\n" | |
begin | |
filename = session.gets.gsub(/GET\ \//, '').gsub(/\ HTTP.*/, '').chomp |
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
// ==UserScript== | |
// @name Turbomilker! | |
// @namespace - | |
// @include http://turbomilk.ru/* | |
// ==/UserScript== | |
// Для начала получим необходимые объекты, и замерим нужные нам велечины | |
var top_div = document.getElementsByClassName('top_div')[0], // Верхняя плашка | |
menu_div = document.getElementsByClassName('menu')[0], // Меню |
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
# Hi! I'am rack middleware! | |
# I was born for return to you valid js on json i18n objects | |
# My author's name was Aleksandr Koss. Mail him at [email protected] | |
# Nice to MIT you! | |
class I18nJs | |
def initialize app, options = {} | |
@app = app | |
@options = 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
RAILS_GEM_VERSION = '2.3.4' unless defined? RAILS_GEM_VERSION | |
require File.join(File.dirname(__FILE__), 'boot') | |
Rails::Initializer.run do |config| | |
config.load_paths << "#{RAILS_ROOT}/app/mailers" | |
config.gem 'echoe', | |
:lib => false, |
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
def generate_ra_form_prawn pdf, ra | |
pdf.text "RA DESCRIPTION FORM", :size => 12, :align => :center | |
pdf.text "#{ra.technician.company.name}", :size => 10, :align => :center | |
pdf.text "#{ra.technician.company.address_line1} #{ra.technician.company.city} #{ra.technician.company.state}, #{ra.technician.company.zip}", :size => 10, :align => :center |
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
# Hi! I'am rack middleware! | |
# I was born for protect you staging application from anonymous and prying | |
# My author's name was Aleksandr Koss. Mail him at [email protected] | |
# Nice to MIT you! | |
class Staging | |
def initialize app, options = {} | |
@app = app | |
@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
require 'socket' | |
puts 'Starting server' | |
server = TCPServer.new '127.0.0.1', 3456 | |
puts '...Ok!' | |
while session = server.accept | |
session.print "HTTP/1.1 200/OK\r\nContent-type:text/html\r\n\r\n" | |
begin | |
filename = session.gets.gsub(/GET\ \//, '').gsub(/\ HTTP.*/, '').chomp |
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
# Hi! I'am rack middleware! | |
# I was born for show right way to you JavaScript | |
# My author's name was Aleksandr Koss. Mail him at [email protected] | |
# Nice to MIT you! | |
require(File.dirname(__FILE__) + '/../config/environment') unless defined?(Rails) | |
class RoutesJs | |
def initialize app, options = {} |
OlderNewer