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
IF = { | |
'true' : function () { | |
alert('true'); | |
}, | |
'false' : function () { | |
alert('false') | |
} | |
}; | |
IF[(5 < 4)](); // should be 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
<?xml version="1.0" encoding="UTF-8"?> | |
<project name="production-build" default="build" basedir="."> | |
<!-- место, куда будем складывать свежескачанные yui-compressor и jslint4java --> | |
<property name="tools.location" value="tools/"/> | |
<!-- какую версию yui compressor'а и откуда качать, а также, какое имя будет у получившегося jar-файла --> | |
<property name="yuicompressor-version" value="2.4.2"/> | |
<property name="yuicompressor-zip" value="yuicompressor-${yuicompressor-version}.zip"/> | |
<property name="yuicompressor-unzip-dir" value="yuicompressor-${yuicompressor-version}"/> | |
<property name="yuicompressor-location" value="http://www.julienlecomte.net/yuicompressor/"/> | |
<property name="yuicompressor-jar" value="yuicompressor-${yuicompressor-version}.jar"/> |
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
// пусть ArrayUtils - это специальная утилита для работы с массивами, | |
// реализующая for…each, map/reduce для всех браузеров, включая ie6. | |
// Что-то наподобие YUI.Array | |
var A = window.ArrayUtils = { | |
map : (Array.prototype.map) ? | |
function (a, fn, c) { | |
return a.map(fn, c || window); | |
} : | |
function (a, fn, c) { | |
var result = [], i = a.length; |
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
" Nathan L Smith's .vimrc file. Based on | |
" John Lam's .vimrc file | |
" General options | |
set nocompatible | |
set autoread | |
filetype on | |
filetype indent on | |
filetype plugin on |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project name="deploy" default="stripFirebugConsoleCalls" basedir="."> | |
<!-- место, где сложены наши еще не сжатые и не слитые в один js-скрипты --> | |
<property name="js" value="js/"/> | |
<!-- регулярка для отлова нездоровых элементов (беззастенчиво утянута с yui builder'a, и слегка доведена напильником) | |
http://github.com/yui/builder/blob/master/componentbuild/shared/properties.xml 79-я строка --> | |
<property name="firebug.console.regex" value="^.*?(?:console.log|console.dir).*?(?:;|\).*;|(?:\r?\n.*?)*?\).*;).*;?.*?\r?\n" /> | |
<property name="firebug.console.regex.flags" value="mg" /> | |
<property name="firebug.console.regex.byline" value="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
require 'rubygems' | |
require 'yaml' | |
require 'ya2yaml' | |
$KCODE = 'u' | |
class Hash | |
def deep_stringify_keys | |
new_hash = {} | |
self.each do |key, value| | |
new_hash.merge!(key.to_s => (value.is_a?(Hash) ? value.deep_stringify_keys : value)) |
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
# usage: | |
# bundle exec rake locale:file RAILS_ENV=production | |
# if you want to export a different locale (not en.yml), provide locale option, as follows: | |
# bundle exec rake locale:file RAILS_ENV=production locale=ru | |
require 'mongo-i18n' | |
def write_to_database(sc, path, value) | |
key = path.join('.') | |
sc[key] = value.to_json |
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
/** | |
* History managment, for ajax-based pages | |
* @class History | |
* @constructor | |
*/ | |
History = function () { | |
var | |
/** | |
* @property currentHash | |
* @private |
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
/** | |
* Page Flow controller - load hash-specific data, show appropriate container and all that | |
* @Class PageFlow | |
*/ | |
var PageFlow = function () { | |
/** | |
* show whole list of goods | |
* @method loadListOfGoods | |
* @private | |
*/ |
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
(function () { | |
var Dom = { | |
get : function (el) { | |
return (el && el.nodeType) ? el : document.getElementById(el); | |
}, | |
addListener : function (el, type, fn) { | |
if (document.body.addEventListener) { | |
return function (el, type, fn) { | |
el.addEventListener(type, fn, false); | |
}; |
OlderNewer