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
development: | |
adapter: mysql2 | |
encoding: utf8 | |
reconnect: false | |
database: zykin_kupi_bilet_frontend_dev | |
pool: 5 | |
username: zykin | |
password: zykin | |
socket: /var/lib/mysql/mysql.sock |
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
VBOX | |
C:\Users\USER\VirtualBox VMs\Ubuntu>"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd Ubuntu.vdi --resize 10000 | |
BUTTONS | |
gconftool-2 --set "/apps/metacity/general/button_layout" --type string "menu:minimize,maximize,close" | |
gsettings set org.gnome.desktop.wm.preferences button-layout ':minimize,maximize,close' | |
GNOME COMMANDER | |
sudo apt-get install gnome-commander -y |
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 @TagHelper | |
constructor: (test_mode = false) -> | |
if test_mode | |
console.log "h = new document.TagHelper" | |
console.log @cdata_section('<hello world>') | |
console.log @tag('br') | |
console.log @tag('br', null, true) | |
console.log @tag('br', null, false) |
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
# encoding: utf-8 | |
class EmailPatternValidator < ActiveModel::EachValidator | |
def validate_each(record, attribute, value) | |
if value.nil? || !value.match(/\b[A-Z0-9._%a-z\-]+@(?:[A-Z0-9a-z\-]+\.)+[A-Za-z]{2,4}\z/) | |
record.errors[attribute] << "HA HA! Not a valid email address" | |
end | |
end | |
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
<div class='calendar_modern' id='calendar'></div> | |
<div class='time_list'> | |
<p> | |
<b>Click on day for select.</b> | |
</p> | |
<p> | |
<b>Second click for unselect.</b> | |
</p> | |
<p>List of selected days:</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
@trace_mode = false | |
# _log - global log - выводит сообщения всегда | |
# log - выводит сообщения везде кроме production | |
# trace - выводит сообщения только если включен флаг trace_mode | |
# report - отправляет AJAX на сервер с сообщением | |
@_log = -> console.log.apply(console, arguments) | |
@log = -> _log.apply(console, arguments) unless env.production() | |
@trace = -> _log.apply(console, arguments) if trace_mode |
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
$.rails.form_build = (url = '#', method = 'get', opts = {}) -> | |
_method = '' | |
method = method.toLowerCase() | |
# csrf | |
csrf_token = $('meta[name=csrf-token]').attr('content') | |
csrf_param = $('meta[name=csrf-param]').attr('content') | |
# build options | |
_opts = '' | |
_opts += " #{k}=#{v}" for k, v of opts | |
# method addons |
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
@compactArray = (array) -> | |
array.filter (e) -> return e | |
class @OrderedHash | |
constructor: (array = []) -> | |
@data = [] | |
@data = array if array.length > 0 | |
get: -> @data | |
push: (obj) -> |
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
#encoding:utf-8 | |
gets.chomp.encode("utf-8", "cp866") | |
Iconv.iconv('utf8', 'cp866', "Привет!") | |
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 ErbEngine < Haml::Engine | |
def push_script(text, preserve_script, in_tag = false, preserve_tag = false, | |
escape_html = false, nuke_inner_whitespace = false) | |
push_text "<%= #{text.strip} %>" | |
end | |
def push_silent(text, can_suppress = false) | |
push_text "<% #{text.strip} %>" | |
end | |
end |
OlderNewer