most of these require logout/restart to take effect
# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Set a shorter Delay until key repeat| # this is the easiest way to use partials from model I could find so far | |
| class Entry < AR::Base | |
| def as_json | |
| context = ApplicationController.new.view_context | |
| context.render('/api/entries/entry.json', entry: self) | |
| end | |
| end |
Web fonts are pretty much all the rage. Using a CDN for font libraries, like TypeKit or Google Fonts, will be a great solution for many projects. For others, this is not an option. Especially when you are creating a custom icon library for your project.
Rails and the asset pipeline are great tools, but Rails has yet to get caught up in the custom web font craze.
As with all things Rails, there is more then one way to skin this cat. There is the recommended way, and then there are the other ways.
Here I will show how to update your Rails project so that you can use the asset pipeline appropriately and resource your files using the common Rails convention.
| #!/usr/bin/env ruby | |
| require "srt" | |
| require "sanitize" | |
| REJECT_LINES = [/Best watched using Open Subtitles MKV Player/, | |
| /Subtitles downloaded from www.OpenSubtitles.org/, /^Subtitles by/, | |
| /www.tvsubtitles.net/, /subtitling@bbc.co.uk/, /addic7ed/, /allsubs.org/, | |
| /www.seriessub.com/, /www.transcripts.subtitle.me.uk/, /~ Bad Wolf Team/, | |
| /^Transcript by/, /^Update by /, /UKsubtitles.ru/ | |
| ] |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
A list of resources that aspiring Rails developers can use to learn Rails and other relevant technologies. This list includes some resources that I see recommended all over the web--not all of which I like--as well as some hidden gems that I've found valuable. This list is intended to supplement my blog post here.
It's a common misconception that [William Shakespeare][1] and [Miguel de Cervantes][2] died on the same day in history - so much so that UNESCO named April 23 as [World Book Day because of this fact][3]. However because England hadn't yet adopted [Gregorian Calendar Reform][4] (and wouldn't until [1752][5]) their deaths are actually 10 days apart. Since Ruby's Time class implements a [proleptic Gregorian calendar][6] and has no concept of calendar reform then there's no way to express this. This is where DateTime steps in:
>> shakespeare = DateTime.iso8601('1616-04-23', Date::ENGLAND)
=> Tue, 23 Apr 1616 00:00:00 +0000
>> cervantes = DateTime.iso8601('1616-04-23', Date::ITALY)
=> Sat, 23 Apr 1616 00:00:00 +0000
This post shows how to make sitemap.xml for your web site. The sitemap will be accessible by URL http://mysite.com/sitemap.xml
Myrails::Application.routes.draw do