$.li18n.currentLocale = 'xxx';
Default is "en"
.
# Bad, because declarative code without business logic should NOT be absolutely DRY. | |
%w[Bob Alice].each do |first_name| | |
%w[Black White].each do |second_name| | |
Person.create(first_name: first_name, second_name: second_name) | |
end | |
end | |
# Good, because it's clear, what results the code produces. Declarative, baby! | |
# Not perfect, because the naming of the params is |
Dunno...
#!/usr/bin/env ruby | |
require 'tmpdir' | |
unless gem_name = ARGV.first | |
puts 'Usage: check-gem GEM_NAME' | |
exit 1 | |
end | |
Dir.mktmpdir("check-gem-#{gem_name}") do |tmpdir| |
#!/usr/bin/env ruby | |
# | |
# Visual dialog for "Kick it!" (https://github.com/infopark/kick-it) | |
# | |
# Requires http://mstratman.github.io/cocoadialog | |
# Useful for example in combination with http://fitztrev.github.io/shuttle | |
# | |
cocoa_dialog_command = '~/Applications/CocoaDialog.app/Contents/MacOS/CocoaDialog' \ |
require 'fileutils' | |
include FileUtils | |
def sh(cmd) | |
puts %x{#{cmd}} | |
end | |
puts "What's your app's name? " | |
app_name = STDIN.gets.chomp |
module Customer | |
class BaseController < ApplicationController | |
# ... | |
before_filter :enable_live_notifications, only: [:waiter_home, :cook_home] | |
# ... | |
private | |
User = require '../models/user' | |
exports.index = (req, res, next) -> | |
[page, perPage] = [parseInt(req.query.page, 10) or 0, 5] | |
require('async').parallel [ | |
(next) -> User.count next, | |
(next) -> User.find({}).sort(username: 1).skip(page * perPage).limit(perPage).exec next | |
], (err, [count, users]) -> | |
return next err if err? | |
res.render 'users/index', {users, page, perPage, count} |
diff --git a/Library/Formula/elasticsearch.rb b/Library/Formula/elasticsearch.rb | |
index bed30bf..054c9ce 100644 | |
--- a/Library/Formula/elasticsearch.rb | |
+++ b/Library/Formula/elasticsearch.rb | |
@@ -105,7 +105,11 @@ class Elasticsearch < Formula | |
<key>EnvironmentVariables</key> | |
<dict> | |
<key>ES_JAVA_OPTS</key> | |
- <string>-Xss200000</string> | |
+ <string>-Xss200000 -XX:PermSize=500m -XX:MaxPermSize=500m</string> |
~ vi --version | |
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jun 20 2012 13:16:02) | |
Compiled by root@apple.com | |
Normal version without GUI. Features included (+) or not (-): | |
-arabic +autocmd -balloon_eval -browse +builtin_terms +byte_offset +cindent | |
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments | |
-conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con +diff +digraphs | |
-dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path | |
+find_in_path +float +folding -footer +fork() -gettext -hangul_input +iconv | |
+insert_expand +jumplist -keymap -langmap +libcall +linebreak +lispindent |