Skip to content

Instantly share code, notes, and snippets.

View elia's full-sized avatar
🦆
quacking!

Elia Schito elia

🦆
quacking!
View GitHub Profile
@elia
elia / airprint.md
Created January 18, 2022 09:00 — forked from ctborg/airprint.md
Enable Airprint for any printer on MacOs (BigSur)
  1. Connect printer, install printer drivers, and enable Printer Sharing.
  2. 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 a TXT, copy everything after TXT into a notepad.
  3. 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"
  4. 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
  5. Run that line in the terminal, and Airprint should be enabled.
class IO
def read
if @eof
''
else
`res = self.read_proc(@path)`
@eof = true
@lineno = res.size
res
end
SPROCKETS_NON_DIGEST = true
# form: https://gist.github.com/ryana/6049833
raise("Sprockets monkey patch for v 2.10.0. Check before moving on") unless Sprockets::VERSION == "2.10.0"
module Sprockets
class Manifest
def compile(*args)
@elia
elia / Questions
Created August 11, 2011 15:12
Frozen Rails Give-away
Day job:
Your Rails contributions (if any):
What's your Ruby/Rail experience?:
How do you use GitHub?:
require 'rubygems'
require 'eventmachine'
require 'em-http' # gem install em-http-request
require 'yajl' # gem install yajl-ruby
module ChatClient
def post_init
@name = "anonymous_#{ChatClient.client_num+=1}"
@sid = ChatClient.channel.subscribe(method(:send_msg))
@buf = ''