- Authoring Ebooks: http://www.authoringebooks.com/
- Create Your Own Programming Language: http://createyourproglang.com/
- Exceptional Ruby: http://exceptionalruby.com/
- JavaScript Performance Rocks: http://javascriptrocks.com/performance/
- Redmine Tips: http://www.redminetips.com/
- The SPDY Book: http://spdybook.com/
- Rails 3 Upgrade Handbook: http://www.railsupgradehandbook.com/
- Refactoring Redmine: http://www.refactoringredmine.com/book/
- Bootstrapping Design: http://bootstrappingdesign.com/
- Recipes With Backbone:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UILabel_Adjustable | |
# Borrowed and modified the excellent example at http://www.11pixel.com/blog/28/resize-multi-line-text-to-fit-uilabel-on-iphone/ | |
# adapting it for RubyMotion | |
# This applies only to a multi-line label. You can use '.adjustsFontSizeToFitWidth = true' for a single-line label | |
# usage is: | |
# text = "It's bad luck to be superstitious" | |
# text_label = UILabel.alloc.initWithFrame([[20, 20], [70, 120]]) | |
# text_label.numberOfLines = 0 # set 0 for word wrap | |
# text_label.lineBreakMode = UILineBreakModeWordWrap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/markdown_handler.rb | |
module MarkdownHandler | |
def self.erb | |
@erb ||= ActionView::Template.registered_template_handler(:erb) | |
end | |
def self.call(template) | |
compiled_source = erb.call(template) | |
"Kramdown::Document.new(begin;#{compiled_source};end, auto_ids: false).to_html" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.fn.extend insertAtCaret: (myValue) -> | |
@each (i) -> | |
if document.selection | |
# For browsers like Internet Explorer | |
@focus() | |
sel = document.selection.createRange() | |
sel.text = myValue | |
@focus() | |
else if @selectionStart or @selectionStart is "0" | |
# For browsers like Firefox and Webkit based |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# bring up the vagrant VM | |
sudo apt-get install vagrant | |
git clone https://bitbucket.org/puffnfresh/vagrant-haskell-heroku.git | |
cd vagrant-haskell-heroku | |
vagrant up | |
vagrant ssh | |
# run this in vagrant shell | |
cabal update | |
cabal install cabal-install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Capybara::Poltergeist | |
class Client | |
private | |
def redirect_stdout(to) | |
prev = STDOUT.dup | |
prev.autoclose = false | |
$stdout = to | |
STDOUT.reopen(to) | |
prev = STDERR.dup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@charset "UTF-8"; | |
@mixin grab-cursor { | |
// http://www.google.com/intl/en_ALL/mapfiles/openhand.cur | |
cursor: url('data:image/vnd.microsoft.icon;base64,AAACAAEAICACAAcABQAwAQAAFgAAACgAAAAgAAAAQAAAAAEAAQAAAAAAAAEAAAAAAAAAAAAAAgAAAAAAAAAAAAAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD8AAAA/AAAAfwAAAP+AAAH/gAAB/8AAA//AAAd/wAAGf+AAAH9gAADbYAAA2yAAAZsAAAGbAAAAGAAAAAAAAA//////////////////////////////////////////////////////////////////////////////////////gH///4B///8Af//+AD///AA///wAH//4AB//8AAf//AAD//5AA///gAP//4AD//8AF///AB///5A////5///8='), all-scroll; | |
// cursor: -webkit-grab; | |
cursor: -moz-grab; | |
cursor: -o-grab; | |
cursor: -ms-grab; | |
cursor: grab; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install vagrant | |
git clone https://bitbucket.org/puffnfresh/vagrant-haskell-heroku.git | |
cd vagrant-haskell-heroku | |
vagrant up | |
vagrant ssh | |
cabal update | |
cabal install cabal-install | |
cabal --version | |
> cabal-install version 0.14.0 | |
> using version 1.14.0 of the Cabal library |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :assets do | |
task :check do | |
root_dir = File.join(File.dirname(__FILE__),"..","..") | |
assets_last_modified_at = Dir["#{root_dir}/app/assets/**/**"].map { |p| File.mtime(p) }.sort.last | |
assets_last_compiled_at = Dir["#{root_dir}/public/assets/**/**"].map { |p| File.mtime(p) }.sort.last | |
if assets_last_modified_at > assets_last_compiled_at | |
fail "Assets need to precompiled; last asset modified at #{assets_last_modified_at}" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I created a generic Rails like ApplicationController so that you can just | |
# run this code via a command line prompt without the need for Rails | |
module Recorder | |
def self.included(base) | |
base.send(:before_filter, :some_method) | |
base.send(:after_filter, :another_method) | |
end |
OlderNewer