...s the default for switching input languages (i.e. keyboard layouts). If you use only 1 language/layout, you will not notice except for the key not working.
...ibus-setup (e.g. from a terminal). This will open a GUI dialog. In the 1st tab you should see "Next Input Method" followed by " space". Click the "..." button on the...
If you get a message like this: Jan 21 13:42:38 foobar syslogd: /var/log/authlog : no such file or directory But you are sure the file exists and it have...
...the correct permissions: # example for Solaris 9 -rw-r--r-- 1 root sys 8,0K 21. Jan 13:51 /var/log/authlog Then you perhaps have a trailing whitespace after /var/log/authlog in...
...with each option explained. About Hello, This site contains 29761 parsed manpages from sections 1 and 8 found in Ubuntu's manpage repository. A lot of heuristics were used to...
...will open an debugging IRB right away, like this: require File.dirname(__FILE__) + '/../config/boot' (rdb:1) _ Enter c to continue and reach your actual debugger call. Then, debug away.
...can feed it to block-taking methods by prefixing it with &: printer = method(:puts) [1, 2, 3].each(&printer) # will print one line per number
...due to a conflict, for example), you may want to know the current commit. [1]\ Luckily, there is lots of useful stuff in the .git directory. Commit hash that you...
...Handy when you want to look at that branch's state of the file. [1] While git shows the commit when stopping at conflicts, for example, that information may have...
stats = {} ObjectSpace.each_object {|o| stats[o.class].nil? ? stats[o.class] = 0 : stats[o.class] += 1 }; stats => {String=>192038, Array=>67690, Time=>2667, Gem::Specification=>2665, Regexp=>491, Gem::Requirement=>16323...
Make sure the daemon is running. Error: Process /usr/lib/sflphone/sflphoned exited with status 1 This mean the last process didn't shut down properly and let a PID file...
...If you've shut sflphone down some seconds ago, you just have to wait 10 seconds and don't have to remove the pid file manually...
...and no special hardware. On our production frontend machines, SSL/TLS accounts for less than 1% of the CPU load, less than 10KB of memory per connection and less than...
...With a block, it counts the number of elements yielding a truthy value. ary = [1, 2, 4, 2] ary.count #=> 4 ary.count(2) #=> 2 ary.count { |x| x...
The following snippet will convert a string with wildcards to a appropriate regexp, i.e. parse_wildcards("foobar") # => /\Afoo.bar\z/
execute "SET @pos := 0;" update " UPDATE pages SET position = ( SELECT @pos := @pos + 1 ) ORDER BY updated_at DESC...
When your block takes an argument that should have an default, only in Ruby 1.9 you can say: block = lambda do |message, options = {}| # ... end If you are on Ruby 1.8.6...
...or 1.8.7 you must resort to the following workaround: block = lambda do |*args| message = args[0] options = args[1] || {}
...to a variable and further want to use it. Example: irb(main):001:0> 1 + 2 => 3 irb(main):002:0> _ => 3 irb(main):003:0> a...
...weekdays (Monday to Friday) between to given dates, try this: require 'date' a = Date.parse "11.04.2014" b = Date.parse "31.12.2014" (a..b).count {|date| (1..5).include?(date.wday...
...and many more you'll need when reading weird code. Regex $~ (last MatchData) $1 $2 $3 $4 (match groups from the last pattern match) $& (last matched string) $+ (last match...
...Import the icon-font by adding a file icon_font.sass: $icon-prefix: '-' @import "generated/icon_font_icons" $size: 1em * $line-height-base // only works with bootstrap .icon // adjust some styles display: inline-block
height: 1em font-size: $size -moz-osx-font-smoothing: grayscale -webkit-font-smoothing: antialiased text-rendering: auto font-style: normal font-weight: normal line-height: 1 // We can not...
...invert the pattern. @include texture(green, 34, 0); // color, texture-number, 0=inverted or 1=normal If you have ever done this manually you know how much pain this can...
...list all branches matching your query as input options for git checkout greckout ar 1) ar/cache-api-keys-1098 2) ar/add-categories-object-to-tv-show-1382...
When a directory has more than a few thousand entries, ls will start taking really long to list its content...
I've encountered a Ubuntu 16.04 today, where localhost resolved to ::1 instead of 127.0.0.1. This will not usually make a difference, but could be relevant for firewall policies...
...from your current database state. The generated db/seeds.rb will look this: Product.create!([ { category_id: 1, description: "Long Sleeve Shirt", name: "Long Sleeve Shirt" }, { category_id: 3, description: "Plain White Tee...
...Shirt", name: "Plain T-Shirt" } ]) User.create!([ { password: "123456", username: "test_1" }, { password: "234567", username: "test...
...to a certain maximum, you can just compare against the modulus of that maximum + 1. \ For example, the following will yield results between 0 and 9: echo $(($RANDOM % 10...
...echo $(($RANDOM % 10)) 9 Note that this skews random numbers to the lower regions of your boundaries in most cases...
Dir.glob(File.join RAILS_ROOT, 'app', 'models', '*.rb').collect{ |path| path[/.+\/(.+).rb/,1] }.collect(&:camelize).collect(&:constantize...