$ svn co https://llvm.org/svn/llvm-project/llvm/branches/release_29@127367 llvm-2.9
$ cd llvm-2.9
$ env UNIVERSAL=1 UNIVERSAL_ARCH="i386 x86_64" CC=/usr/bin/gcc CXX=/usr/bin/g++ ./configure --enable-bindings=none --enable-optimized --with-llvmgccdir=/tmp
$ env UNIVERSAL=1 UNIVERSAL_ARCH="i386 x86_64" CC=/usr/bin/gcc CXX=/usr/bin/g++ make
$ sudo env UNIVERSAL=1 UNIVERSAL_ARCH="i386 x86_64" CC=/usr/bin/gcc CXX=/usr/bin/g++ make install
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
# source 'http://rubygems.org' | |
source :gemcutter | |
gem 'rails', '3.1.0.beta1' | |
# Asset template engines | |
gem 'json' | |
gem 'sass' | |
gem 'coffee-script' | |
gem 'uglifier' |
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 'rails' | |
require 'jquery-rails' | |
$:.unshift File.dirname(__FILE__) | |
module MyEngine | |
class Engine < Rails::Engine | |
if defined?(query::Rails::Engine) | |
initializer :after_append_asset_paths, | |
:group => :all, |
This script installs a patched version of ruby 1.9.3-p0 with patches to make ruby-debug work again (#47) and boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84).
Huge thanks to funny-falcon for the performance patches.
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 declOfNum(number, titles) { | |
cases = [2, 0, 1, 1, 1, 2]; | |
return titles[ (number%100>4 && number%100<20)? 2 : cases[(number%10<5)?number%10:5] ]; | |
} | |
use: | |
declOfNum(count, ['найдена', 'найдено', 'найдены']); |
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
#yml: | |
in_count_complex: | |
one: "в %{count} комплексе" | |
few: "в %{count} комплексах" | |
many: "в %{count} комплексах" | |
#view: | |
= t :in_count_complex, :count => projects.count |
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 File.join(File.dirname(__FILE__), 'token') | |
class Lexer | |
attr_reader :grammar_rules, :regex_pattern, :output, :buffer, :priority_hash | |
DEFAULT_GRAMMAR_RULES = { | |
:operators => %w[\+ \- \* \/ \^], | |
:brackets => %w[\( \)], | |
:operands => ['\d*\.\d+|0\.\d+|-0\.\d*[1-9]\d*', '\d+'] | |
} | |
PRIORITY_HASH = { |
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
$('form').on('change', 'input[type="file"]', function(e) { | |
var files = e.target.files, | |
f = files[0], | |
reader = new FileReader(), | |
t = this | |
; | |
reader.onload = (function(file) { |
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 'multi_json' | |
MultiJson.load('{"abc":"def"}') #=> {"abc" => "def"} | |
MultiJson.load('{"abc":"def"}', :symbolize_keys => true) #=> {:abc => "def"} | |
MultiJson.dump({:abc => 'def'}) # в JSON | |
MultiJson.dump({:abc => 'def'}, :pretty => true) # + преобразует в наглядный вид |
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
store_translations(:de, :i18n => { | |
:transliterate => { | |
:rule => { | |
"ü" => "ue", | |
"ö" => "oe" | |
} | |
} | |
) | |
I18n.locale = :en |
OlderNewer