Linux: How to print PDF files from the command line
Command-line PDF printing is useful for batch jobs and headless systems, with lp sending files to the default or a chosen CUPS printer.
Ruby: How to camelize a string with a lower-case first letter
ActiveSupport String#camelize(:lower) turns snake_case into lowerCamelCase for JavaScript-style naming without custom string handling.
Where is that rake task defined?
rake -W [substring_of_task] locates the source file and line for a Rake task when its definition is hard to find.
Listening to bubbling events in Prototype is easy
Prototype event handling on individual elements is brittle and breaks after AJAX replacement. Delegated document.on bindings keep change handlers working on dynamic content.
Test whether Perfect Forward Secrecy (PFS) is enabled on a server (using OpenSSL)
openssl s_client can verify whether a server supports Perfect Forward Secrecy by checking if a cipher handshake succeeds or fails.
Heartbleed test
Checks a server hostname for the Heartbleed vulnerability in OpenSSL (CVE-2014-0160).
The Heartbleed Bug
A flaw in OpenSSL and SSL/TLS can expose protected data to attackers and leak secrets from encrypted internet traffic.
No more file type confusion in TextMate2
TextMate2 can misclassify Cucumber step definition files as plain Ruby, and fileType settings in .tm_properties assign them the correct syntax scope.
PDF Generation in Rails
Generating PDFs in Rails often means choosing between text-based reports, HTML-to-PDF rendering, and different trade-offs in layout control and browser fidelity.
What's new in edge Rails: Active Record enums
Integer-backed model attributes can be queried by symbolic names, making state handling clearer and avoiding hard-coded numeric values.
The MariaDB Foundation Announces General Availability of MariaDB 10
MariaDB 10 adds replication, NoSQL capabilities and sharding for web-scale workloads, bringing features developed with major high-traffic users into general availability.
Why Ruby Class Methods Resist Refactoring
Class methods are harder to refactor into smaller units because they cannot hold state, so shared context must be threaded through repeated parameters.
Obfuscating data in Rails applications for screenshots and demonstrations
Real data makes demos and screenshots look convincing, but names and values need masking to avoid exposing sensitive information. Faker can quickly replace personal details with plausible placeholders.
Introducing ActiveType
A gem supports the form model approach for managing form data and validation with a cleaner object-oriented structure.
IE10 / IE11 Metro mode: How to switch tabs or show the address bar
IE10 and IE11 Metro mode can hide the tab bar and address bar when used with a mouse; right-clicking restores the controls.
Thread Safety With Ruby — Luca Guidi
Ruby threads share a writable heap inside one VM process, so unsynchronized access can cause unexpected behavior in concurrent code.
CSS: Vertically center with margin: auto
Absolute positioning with margin: auto centers an element vertically and horizontally inside a relative container, if the element fits within the available space.
Showcases
Directory of popular GitHub projects for discovering widely used repositories and tools.
Why your previous developer was terrible
Judging legacy code by today’s needs hides the uncertainty faced during initial development, where many architecture and technology choices were made with incomplete information.
BrowserStack has browser plugins for local testing
Private and internal servers can be tested through the BrowserStack cloud without exposing them publicly, even behind firewalls, proxies, or Active Directory.
How to remove/disable the automatic XSS protection helper html escaping for Rails 3
Rails 3 automatically escapes helper output to prevent XSS, but some views need raw HTML instead. Disabling that protection changes how helper values are rendered and can reintroduce injection risk.
Mouse wheel + Shift key = horizontal scrolling
Holding Shift while using the mouse wheel can scroll horizontally on Ubuntu, and many applications support it.
Alternatives to drop-down menus
Drop-down menus can hide choices, slow selection, and be awkward on mobile; radio buttons, checkboxes, autocomplete, and segmented controls often work better.
Count number of weekdays between two dates
Count weekdays between two dates in Ruby by iterating over a Date range and filtering Monday through Friday.