- Connect printer, install printer drivers, and enable Printer Sharing.
- Open terminal, run:
dns-sd -Z _ipp._tcp
. You'll see a few lines of repeated text. Look for your printer's name, next to that record you will see aTXT
, copy everything afterTXT
into a notepad. - In that TXT line, you'll see a line like this:
"pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png,image/pwg-raster"
Change that, to add,image/urf
. So it'll look like:"pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png,image/pwg-raster,image/urf"
- Now take that entire TXT line, and add it to this:
dns-sd -R "name_to_be advertised" _ipp._tcp.,_universal . 631 URF=none pdl=application/pdf,image/urf YOUR_TXT_STRING
- Run that line in the terminal, and Airprint should be enabled.
@tenderlove asked "Is it good to teach RSpec (vs t/u) to people who are totally new to Ruby?" I have experience suggesting that it is a good thing; after a short back and forth, it seemed useful to write it up in detail.
This goes back several years, to when I was the primary Ruby/Rails trainer for Relevance from 2006-2009. I'm guessing that worked out to probably 6-8 classes a year during those years. Since then, RSpec has changed a fair amount (with the addition of expect
) and test/unit has changed radically (it has an entirely new implementation, minitest, that avoids some of the inconsistencies that made test/unit a bit confusing during the time I'm writing about here).
I started out as an RSpec skeptic. I've never been afraid of what a lot of people denigrate as "magic" in Ruby libraries … to me, if you take the trouble to understand it, that stuff's just pr
I want to write plugins for Atom's editor in Ruby. Opal makes this possible. Atom is one of several projects in recent times to combine Chromium with Node.js for a desktop app. While it utilizes chromium for it's gui, and boasts "[e]very Atom window is essentially a locally-rendered web page", writing Atom plugins is more like writing a server-side node.js app than a typical single-page client-side app (albeit with really awesome integration with Chrome Devtools). Opal development, on the other hand, has to-date been focused primarily on the browser use-case.
Because of this, I had to make a choice between using the opal-node package from npm, using Opal via Ruby w/ a compile step, or packaging up opal-parser.js, including it with the app, and writing in compilation on the fly. Each choice came with compromises. Using opal-node would have been easiest, just create a top level index.coffee that required opal-node, and then require in your ruby
module Wrapping | |
def wrap(method_name, &block) | |
# Alternative implementations: either will do the trick. | |
wrap_with_prepend(method_name, &block) | |
#wrap_with_bind(method_name, &block) | |
end | |
private | |
def wrap_with_prepend(method_name) |
namespace :haml do | |
desc "Watch the site's HAML templates and recompile them when they change" | |
task :watch do | |
require File.join(File.dirname(__FILE__), 'lib', 'haml_watcher') | |
HamlWatcher.watch ENV['SOURCE'], ENV['DEST'] | |
end | |
end |
If you're like me who uses Safari, and finds Gmail in browser most comfortable to use, you might want to enable notification from Gmail in Safari 6. Notification Center in Mountain Lion does support websites in Safari to send notifications, but by now Gmail does not ask for permission to send notifications. Fortunately Gmail uses html5 notification, which is supported in Safari 6. We can manually request permission from Safari for Gmail.
- Enable Develop menu. Safari->Preferences->Advanced: Check "Show Develop menu in menu bar".
- Open
mail.google.com
. - Develop->Show Web Inspector. The console will show at bottom. Paste in following command in the console and press Enter. [1]
window.webkitNotifications.requestPermission(function(){alert(window.webkitNotifications.checkPermission());})
- If the alert box shows
0
, it meansmail.google.com
successfully gets notification permission. Send yourself an email with a different email addre
source "https://rubygems.org" | |
gem 'sprockets' | |
gem 'sprockets-sass' | |
gem 'sass' | |
gem 'compass' | |
gem 'bootstrap-sass' | |
gem 'handlebars_assets' | |
gem 'coffee-script' |
// How to use this: | |
// 1. Go to the desired profile page on coderwall, like http://coderwall.com/marcinbunsch | |
// 2. Paste this gist in the JS console | |
// | |
// You can also probably use this in greasemonkey and dot.js | |
// | |
// Also, it was tested in Chrome, Firefox and Safari, it probably will | |
// not work in IE, but I just don't care about it ;) | |
// | |
// UPDATE: Coderwall made changes to the site and I cannot retrieve the achievements, so they are hardcoded, taken from a cached version of the achievements page |
# config/initializers/active_admin_mongoid_patch.rb | |
require "active_admin" | |
require "active_admin/resource_controller" | |
require 'ostruct' | |
module ActiveAdmin | |
class Namespace | |
# Disable comments | |
def comments? |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |