Enable JavaScript to use search. / 検索を使用するには JavaScript を有効にしてください。
Posts
Tue, January 29, 2013
1 min read
[Ruby] Removing Half-width and Full-width Spaces from Strings
A short Ruby gsub snippet for stripping both half-width and full-width spaces from a string.
read more →
[Git] Installation Steps for CUI Tool tig
brew install tig to get the Git CUI browser tig set up on Mac quickly.
DOCTYPE Declaration and Character Encoding Issues for Supporting Three Mobile Carriers
Fixing mojibake on Japan's three-mobile-carrier sites with a Shift_JIS Content-Type meta tag in HTML and XHTML.
[Sublime Text 2] Solution for Package Control: Install Packages Not Working
Fixing a broken Package Control: Install Packages in Sublime Text 2 by removing the whole config directory.
[Sublime Text] How to Set Up Package Control
Installing Package Control in Sublime Text 2 via the console bootstrap and verifying it in the Command Palette.
Mon, January 28, 2013
[Mac] Installing nkf with Homebrew
Installing the nkf character encoding converter on macOS with brew install nkf.
Thu, January 24, 2013
2 min read
[Ruby on Rails] CSV Import/Export
Reference links and notes for CSV import/export in Ruby on Rails.
Wed, January 23, 2013
[Chrome] SPDY indicator - Extension to Check SPDY Enable/Disable Status
A quick note on installing the Chrome extension SPDY indicator to check SPDY enable/disable status.
[Ruby on Rails] Setting Conditions for before_filter
Reference links for setting conditions on before_filter in Ruby on Rails.
[RSpec] How to Test Private Methods
How to test private methods in Rails + RSpec by invoking them via Object#send.
Tue, January 22, 2013
Minimum specifications required for Windows 7 operation
Windows 7 minimum system requirements quoted from Microsoft's official spec.
[Ruby on Rails] Grouping validations using with_options
Using with_options to group conditional Active Record validations under a single :if block.
Mon, January 21, 2013
[Ruby on Rails] form_for and form helper summary
A personal cheat sheet of Ruby on Rails form_for and form helpers such as f.select.
Sun, January 20, 2013
[Ruby on Rails] ArgumentError (invalid byte sequence in US-ASCII)
Fixing `ArgumentError (invalid byte sequence in US-ASCII)` in Rails by adding `# encoding: utf-8` to the file header.
[MySQL] Getting stuck with reserved words - ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'xxx' at line 1
MySQL threw ERROR 1064 on a query because the column name primary is a reserved word.
[Node.js] Sanitize and validate with node-validator
A quick pointer to node-validator, a handy Node.js package for sanitizing and validating input.
Thu, January 17, 2013
[Ruby] Introduction to state_machine
Reference links for getting started with state_machine, a Ruby gem for managing object state transitions.
Tue, January 15, 2013
[Sublime Text 2] Customizing tab switching command with Ctrl+Tab
A small Sublime Text 2 keybinding tweak that switches `Ctrl+Tab` to walk tabs in order instead of by MRU.
[JavaScript][jQuery] Checking for the existence of DOM elements
Six ways to check DOM element existence in JavaScript and jQuery, ranked by execution speed.
Sat, January 12, 2013
[Facebook] Handling Revoked Permissions - 失効権限の取り扱い
A quick reference from Facebook's Handling Revoked Permissions doc on dealing with declined or revoked scopes.
Thu, January 10, 2013
[Ruby on Rails] How to change title for each page
Per-page title and meta tags in Rails using content_for and yield, with ERB and Haml examples.
Sat, January 5, 2013
[MongoDB] Display all records with find().forEach(printjson) or .toArray()
Two ways around mongo shell's 'has more' cutoff: .forEach(printjson) and .toArray().
Sat, December 29, 2012
[Chrome] Chrome extension 'jsoff' that can turn off JavaScript with one click
A quick pointer to 'jsoff', a Chrome extension for toggling JavaScript on and off with one click.
Tue, December 25, 2012
[Ruby] Use 'sunspot' for full-text search engine Solr
Reference links for the sunspot gem, which connects Rails apps to the Solr full-text search engine, including RSpec testing tips.
Mon, December 24, 2012
[Linux] About Memory Management
A quick reference note on Linux memory management and memory leak detection.
Sat, December 22, 2012
Image compression sites and tools summary
A short roundup of JPEGmini for JPEG, TinyPNG for PNG, and ImageOptim for the Mac.
JsDoc Toolkit Introduction
Intro notes on JsDoc Toolkit — reference sites, Homebrew install, and templates.
[WordPress] Steps to add a 'Send with LINE' button to WPTouch
Adding a 'Send with LINE' share button to WPTouch, and making it open in a new tab.
Fri, December 21, 2012
[Ruby] For file uploads, use 'CarrierWave'
Notes on the CarrierWave gem for file uploads in Rails, plus how to test uploads with RSpec.
Thu, December 20, 2012
[Ruby on Rails] How to limit default actions with 'only' while adding custom actions
Restrict Rails `resources` with `only:` and still add a custom collection action like `search`.
Wed, December 19, 2012
[Ruby on Rails] How to use acts_as_list
Reference links for using acts_as_list with jQuery UI Sortable in Rails.
[Ruby] Development HTTP Server 'Pow' by 37signals
Using 37signals' Pow — a zero-config Rack dev server for macOS — with Rails and Sinatra apps.
[Ruby on Rails] Converting line breaks to br tags
A custom Rails helper for converting line breaks to br tags, without the p tags that simple_format inserts.
Summary of Google Chrome Developer Tools Introduction Articles
A short link roundup of introductory articles for Google Chrome Developer Tools.
Tue, December 18, 2012
[Ruby on Rails] How to get the current URL (including parameters)
Getting the current URL with url_for(params) in Rails 3, plus adding and removing query parameters.
Haml Tips
Handy Haml tips: conditional class names and repeating ul/li output with in_groups_of.
Mon, December 17, 2012
[Capistrano] Recipe for executing rake tasks
A Capistrano recipe for invoking rake tasks on a remote server, with a namespace-collision workaround.
Sat, December 15, 2012
[Node.js] How to resolve Error: Cannot find module 'express'
Fixing Node.js Cannot find module 'express' by reinstalling dependencies with npm install -d.
Thu, December 13, 2012
[RSpec] Various ways to use Devise in test code
Rails + RSpec notes on testing Devise-protected controllers by stubbing current_user in a before block.
[Node.js] gyp ERR! configure error Error: EACCES, mkdir '/Users/name/.node-gyp'
Working around node-gyp's EACCES mkdir '/Users/name/.node-gyp' error with mkdir and chmod.
[Mac] Steps to install GMP with Homebrew
Install GMP, the arbitrary precision arithmetic library, on macOS with a single `brew install gmp`.
[Mac] Steps to install ImageMagick with Homebrew
A quick note on installing ImageMagick on macOS with a single Homebrew command.
[Mac] Installing MongoDB with Homebrew
Installing MongoDB with Homebrew on macOS and setting it up as a launchd auto-start service.
Wed, December 12, 2012
[Ruby on Rails] How to use helper methods in controllers and models
How to call Rails helper methods from controllers and models by including ActionView::Helpers.
[Ruby on Rails] How to use arel_table
Reference links for learning how to use Rails' arel_table.
Tue, December 11, 2012
[Ruby on Rails] Use blank? or present? instead of nil? to check model attributes
Use blank? or present? instead of nil? when checking Rails model attributes.
[Ruby] Differences between count, size, and length
A link roundup on the differences between count, size, and length in Ruby.
Mon, December 10, 2012
[Ruby] RSpec Beginner Articles Summary
A curated list of beginner references for RSpec, grouped by topic (views, requests, syntax, config).
Sun, December 9, 2012
[cURL] GET/POST/PUT/DELETE
A short memo on using cURL's -X option to send GET / POST / PUT / DELETE requests.
[PHP] How to Use Excel_Reviser
Reference links for working with the Excel_Reviser PHP library, which even supports PHP 4.