Skip to content

Instantly share code, notes, and snippets.

View kossnocorp's full-sized avatar
Shipping

Sasha Koss kossnocorp

Shipping
View GitHub Profile
select_tag :language,
options_for_select(I18n.available_locales.to_a.map{ |locale| [t('name', :locale => locale), locale] },
I18n.locale.to_sym)
#! /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
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
// ==UserScript==
// @name Turbomilker!
// @namespace -
// @include http://turbomilk.ru/*
// ==/UserScript==
// Для начала получим необходимые объекты, и замерим нужные нам велечины
var top_div = document.getElementsByClassName('top_div')[0], // Верхняя плашка
menu_div = document.getElementsByClassName('menu')[0], // Меню
# 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 kossnocorp@gmail.com
# Nice to MIT you!
class I18nJs
def initialize app, options = {}
@app = app
@options = options
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,
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
# 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 kossnocorp@gmail.com
# Nice to MIT you!
class Staging
def initialize app, options = {}
@app = app
@options = {
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
# 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 kossnocorp@gmail.com
# Nice to MIT you!
require(File.dirname(__FILE__) + '/../config/environment') unless defined?(Rails)
class RoutesJs
def initialize app, options = {}