Fix permissions of temporary RTeX files (which are group and world-readable)
We use RTeX for PDF exports.
While converting LaTeX to PDF, RTeX opens a temporary file which has problematic permissions: Both group and world can read those files.
Although the temp files should go away they sometimes live longer than one would expect.
We patched RTeX to fix this (and have more secure permissions). Place the code below into config/initializers/rtex.rb
Related cards:
A saner alternative to SimpleForm's :grouped_select input type
SimpleForm is a great approach to simplifying your forms, and it comes with lots of well-defined input types. However, the :grouped_select
type seems to be overly complicated for most use cases.
#...
Video transcoding: Web and native playback overview (April 2020)
Intro
Embedding videos on a website is very easy, add a <video>
tag to your source code and it just works. Most of the time.
The thing is: Both the **operating system and Browser of your client must support the container ...
How to find out which type of Spec you are
When you need to find out in which kind of spec you are during run-time, it's definitely possible. It's a lot easier in RSpec 2+.
For example, consider this global before
block where you'd want to run some code for specific specs only:
c...
Capistrano: Finding out who deployed which revision of your application and when
Capistrano automatically logs each (successful) deployment into a file on your application servers.
It is located at the root of your server's project folder, i.e. the parent of releases
and current
, like so:
/var/www/your-project$ ls
cu...
Operators "in" and "of" are very inconsistent between CoffeeScript and JavaScript
CoffeeScript and JavaScript (ECMAScript) both have operators in
and of
. Each language use them for more than one purpose. There is not a single case where the same operator can be used for the same purpose in both languages.
Check if an objec...
Ruby, Ruby on Rails, and _why: The disappearance of one of the world’s most beloved computer programmers
Nice article to educate your non-geek girlfriend/boyfriend about the joys of programming.
How to fix: Gems are unavailable although they are installed
- If Rails or Rake are complaining about a missing gem that is listed in your
Gemfile.lock
and the listed version is properly installed, something is seriously wrong and needs to be fixed. - If you accidently executed
bundle install some_gem
a...
RubyMine: Find and Replace with Regex (Capture Groups and Backreferences)
tl;dr
In RubyMine you can use find and replace with capture groups
(.*?)
and backreferences$1
(if you have several groups:$[Capture-Group ID]
).
Named captures(?<text>.*)
are also supported.
Examples
Replace d...
How to fix "Too many authentic authentication failures" with SSH and/or Capistrano
You are getting when connecting via SSH or deploying with Capistrano (which uses SSH):
Too many authentication failures for username
This is caused by having too many SSH keys added to your keyring or ssh-agent. Your ssh-agent will throw all...
Sync confidential files between unixes using cloud storage and encfs
Note: You might also want to check out BoxCryptor which does pretty much the same, and is supported across many more platforms. I just didn't want to use Dropbox...
I use Ubuntu One to automatically sync confidential...