gem 'tire'
ENV['ELASTICSEARCH_URL'] = ENV['BONSAI_URL']
// While you can edit this file, it's best to put your changes in | |
// "User/Preferences.sublime-settings", which overrides the settings in here. | |
// | |
// Settings may also be placed in file type specific options files, for | |
// example, in Packages/Python/Python.sublime-settings for python files. | |
{ | |
// Sets the colors used within the text area | |
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", | |
// Note that the font_face and font_size are overriden in the platform |
# Renders an ItemContainer as a <ul> element and its containing items as <li> elements. | |
# Prepared to use inside the topbar of Twitter Bootstrap http://twitter.github.com/bootstrap/#navigation | |
# | |
# Register the renderer and use following code in your view: | |
# render_navigation(level: 1..2, renderer: :bootstrap_topbar_list, expand_all: true) | |
class BootstrapTopbarList < SimpleNavigation::Renderer::Base | |
def render(item_container) | |
if options[:is_subnavigation] | |
ul_class = "dropdown-menu" |
.blah { | |
<% I18n.available_locales.map(&:to_s).sort.each do |locale| %> | |
&.<%= locale %> { | |
background-url: asset-url('localized/test.<%= locale %>.png'); | |
} | |
<% end %> | |
} |
map('/pulse') { run -> _ { [200, {}, []] } } |
if [ -f "$rvm_path/scripts/rvm" ]; then | |
source "$rvm_path/scripts/rvm" | |
if [ -f ".rvmrc" ]; then | |
source ".rvmrc" | |
fi | |
if [ -f ".ruby-version" ]; then | |
rvm use `cat .ruby-version` | |
fi |
You seem to be confusing two very different things here: the Ruby Programming Language and the specific threading model of one specific implementation of the Ruby Programming Language. There are currently around 11 different implementations of the Ruby Programming Language, with very different and unique threading models. | |
(Unfortunately, only two of those 11 implementations are actually ready for production use, but by the end of the year that number will probably go up to four or five.) (Update: it's now 5: MRI, JRuby, YARV (the interpreter for Ruby 1.9), Rubinius and IronRuby). | |
The first implementation doesn't actually have a name, which makes it quite awkward to refer to it and is really annoying and confusing. It is most often referred to as "Ruby", which is even more annoying and confusing than having no name, because it leads to endless confusion between the features of the Ruby Programming Language and a particular Ruby Implementation. | |
It is also sometimes called "MRI" (for "Matz's Ruby Implementati |
gg=G | |
gg => go to start of file | |
= => apply autoformatting | |
G => ... to the end of file |
# A string is a palindrome if it has exactly the same sequence of characters when read left-to-right as it has when read right-to-left. For example, the following strings are palindromes: | |
# "kayak", | |
# "codilitytilidoc", | |
# "neveroddoreven". | |
# A string A is an anagram of a string B if A can be obtained from B by rearranging the characters. For example, in each of the following pairs one string is an anagram of the other: | |
# | |
def anagram(s) |
var phi = (1 + Math.sqrt(5)) / 2; | |
var fib_gr = function (n) { | |
return Math.floor((Math.pow(phi, n) / Math.sqrt(5)) + (1 / 2)); | |
}; | |
for (var i = 1; i < 20; ++i) { | |
console.log(i, '->', fib_gr(i)); | |
} |