If you're on Ubuntu: sudo apt-get install ruby-dev On other platforms: Look for a package containing ruby header files. On Red Hat that's "ruby-devel" likely...

To force a check on your next reboot (here for your root partition), simply: touch /forcefsck To manually do this, here is how to do it for the first partition...

...on sda, when you are using ext4: fsck.ext4 -fn /dev/sda1 -f forces the check, even if everything seems okay. -n is a "read only" check, where nothing is changed and...

cyberciti.biz

Bash stores the exitcodestatus of piped commands in the environment variable PIPESTATUS So you can just echo ${PIPESTATUS[@]} to get them all. 13:52:30 ✔ claus:~$ ps ax | grep /usr/bin/ruby...

...PIPESTATUS is an array, so you can get the exitcode of an specific command (first pipe): 13:54:20 ✔ claus:~$ echo ${PIPESTATUS...

...warning after upgrading to rails >= 2.3.10 DEPRECATION WARNING: The :overwrite_params option is deprecated. Specify all the necessary parameters instead. that is for example caused by url_for( :overwrite_params...

...link_to uses url_for internally, so you can can use params.merge {...

...} as the second parameter of link_to...

Stop MySQL: sudo service mysql stop Move (or copy) your mysql directory. If you want /mnt/mysql to be the new directory, do it like this:

.../var/lib/mysql /mnt/ Open your MySQL configuration (sudo vim /etc/mysql/my.cnf) and change the datadir value to your new path (e.g. /mnt/mysql) Modify your AppArmor configuration: sudo vim /etc/apparmor.d/usr.sbin.mysqld Change/copy the lines...

httpd.apache.org

...you are done and all is well: remember to remove those entries again, or set the log level to 0, to switch off rewrite logging...

...update your window title whenever you switch directories, simply specify a PROMPT_COMMAND environment variable. set-window-title() { echo -en "\033]0;$(pwd | sed -e "s;^$HOME;~;")\a" } if [[ "$PROMPT...

...COMMAND" ]]; then export PROMPT_COMMAND="$PROMPT_COMMAND;set-window-title" else export PROMPT_COMMAND=set-window-title fi You may put that into your ~/.bashrc to persist and automatically activate...

This card compares patterns to store trees in a relation database like MySQL or PostgreSQL. Implementation examples are for the ActiveRecord ORM used with Ruby on Rails, but the techniques...

We will be using this example tree (from the acts_as_nested_set docs): root | +-- Child 1 | | | +-- Child 1.1 | | | +-- Child 1.2 | +-- Child 2 | +-- Child 2.1 | +-- Child 2.2

This step will pass if the specified select is sorted. Then /^the "(.*?)" select should be sorted$/ do |label, negate| select = find_field(label) options = select.all('option').reject { |o| o.value.nil? } options.collect...

...this custom matcher, the each_cons block can be replaced with: options.should be_naturally_sorted Usage Then the "Organizations" select should be sorted Depends on Capybara. This step is now...

evilmartians.com

...or not to gem": Gem is really needed (prefer writing your own code for simple requirements without many edge cases) Gem is tested well (coverage and quality)

...the project requirement Try to avoid gems that do much more than your requirement scope needs Gem has a good maturity and maintenance Gem has a good / familiar DSL

Stepping forward from JavaScript Basics, the goal of this card is for you to be able to read and write more complex ES6+ code. The JavaScript Object Model

...s also a video of that talk in our internal library. The first three sections of the article Inheritance and the prototype chain on mdn also gives a good introduction...

PostgreSQL supports the SQL OVERLAPS operator. You can use it to test if two date ranges overlap: => SELECT ('2001-02-16'::date, '2001-12-21'::date) OVERLAPS...

overlaps -------- true An important caveat is that the date ranges are defined as start <= time < end. As such the later date is not included in the range:

After a recent Ubuntu update I didn't see the main menu bar of the RubyMine IDE (File | Edit | View | ...) anymore. This could be solved by changing a RubyMine registry...

Search "registry" within the "Actions" search press ctrl + alt + n > click on Actions > type registry > click on Registry... Scroll down to linux.native.menu and disable the checkbox After rebooting RubyMine...

Sometimes, due to git or other "accidents", important files get deleted or overwritten. At a state when even Ctrl+Z doesn't work anymore, you maybe can rescue your files...

...that file in the editor Go to RubyMine and click on VCS -> Local History -> Show History In the now open window, you should see all greater changes made to the...

makandra dev

...handy when values have an implicit ordering. Let's imagine a record Issue(criticality: string). criticality should have the following three possible values: critical, medium, low. Sorting with Issue.all.order(criticality...

...critical' issue This happens because the database column backing the criticality attribute is a string and PG will use a collation to determine the result of comparisons. In most collations...

makandra dev

Never use raise_error without specifying the Error you expect. expect { do_a_lot_of_complicated_stuff }.to raise_error will be green if you make any error in programming...

...E.g. a simple typo would make the test above green. The block will catch the Spec:: exception and the test will be happy. Be sure to always have custom errors...

svnweb.freebsd.org

If you have trouble updating something on FreeBSD you should always take a look in the UPDATING file. For this error there is this solution which worked perfectly for me...

...There was a nasty bug introduced in the update below, it was introduced in svn revision 373476 and corrected in 373485. If you get errors looking like this one: ===> Registering...

While RSpec 1 and 2 decided that specs inside spec/model are model specs, and those inside spec/features are feature specs (and so on), RSpec 3 will no longer do that...

...such as missing routing helpers, etc. There are 2 ways to fix this: Explicitly set the type on each spec. For example: describe '...', type: 'feature' do # ... end

blog.bigbinary.com

...behavior, you can explicitely tell ActiveRecord how to preload associations with either JOINs or separate queries. This card gives an overview of the different options to preload associations, but

...for preloading! Please have a look on on our card why you should be super careful with complex eager_load or includes queries. Thus, as a general guideline.includes or .eager...

When debugging slow SQL queries, it’s helpful to understand the database engine's query plan. Whenever you execute a declarative SQL query, the database generates a "query plan" that...

...outlines the exact steps the engine will take to execute the query. Most of the time, we don’t need to worry about this plan because SQL engines are highly...

Postgres supports multiple built-in range datatypes: int4range int8range numrange tsrange (range with timestamp without timezone) tstzrange (range with timestamp with timezone) daterange They represent a start and endpoint of...

...something in a single column. Image you're building a vacation booking feature: create_table :events do |t| t.date :starts_on t.date :ends_on end This is how you would...

...It must be fixed by patching the Jasmine sources. Fix for Webpacker Add the package string-replace-loader to your package.json. If you're on Webpacker 5 (Webpack 4) the...

...your config/webpack/environment.js: environment.loaders.prepend('fix-jasmine4-global-detection', { test: /jasmine-core\/lib\/jasmine-core\/jasmine\.js$/, use: [{ loader: 'string-replace-loader', options: { search: 'window.toString() === \'[object GjsGlobal]\'', replace: 'window.toString() === \'[object Window]\'' } }] }) Fix for ESBuild...

...the everyday use without any parameter tweaking I'm using a collection of tiny scripts in my ~/bin folder that can then be used as bash functions. And: It's...

...video-to-audio /path/to/cake.mp4 cake.mp3 audio-to-audio /path/to/cake.mp3 cake.aac image-to-image /path/to/cake.png cake.jpg stateDiagram-v2 text --> image: Dall-E 3 text --> audio: GPT TTS image --> text: GPT Vision...

makandra dev
docs.google.com

WebRTC HTTP/2 is here, let’s optimize! or, why (some) yesterday's best-practices are today's HTTP/2 anti-patterns...