Skip to content

Instantly share code, notes, and snippets.

View ctborg's full-sized avatar
💭
{Status.NULL}

ctborg

💭
{Status.NULL}
View GitHub Profile
@ctborg
ctborg / airprint.md
Last active January 18, 2022 09:00
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.
@ctborg
ctborg / gist:4cf7087c7f86d5401550a7a30fd12c32
Created April 26, 2018 00:18
Adding a shared MacOs printer to a Chromebook
As of ChromeOS 66, chromebooks have the ability to print to any CUPS based printer on your network.
To add simply enter your Chromebook settings page, search for printers, then click 'add printer'
Name: this can be anything
Address: the IP address for the remote printer
Protocol: IPP
Queue: the printer path. e.g. /printers/(your_printer_name)
To find your printer path. Go to: http://localhost:631/ Click Printers,

Keybase proof

I hereby claim:

  • I am ctborg on github.
  • I am ctborg (https://keybase.io/ctborg) on keybase.
  • I have a public key whose fingerprint is 2EEA BB2A D2E2 B649 A32B 99C7 26CF 1AAB 5098 526D

To claim this, I am signing this object:

@ctborg
ctborg / gist:04cabebaf5909216654b
Created December 17, 2014 16:28
Simple slack bot client
Client = require('slack-client');
var client = new Client(process.env.BOT_SLACK_TOKEN);
client.on( 'error', function(e){console.log(e)});
client.on( 'loggedIn', function(e){console.log(e)});
client.on( 'open', function(e){console.log(e)});
client.on( 'close', function(e){console.log(e)});
client.on( 'message', function(e){console.log(e)});
@ctborg
ctborg / Eventghost_PS3_Config.xml
Last active August 29, 2015 14:05
Eventghost PS3 Bluetooth remote with hibernate config. Useful for xmbc or other media players.
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1544" Guid="{82508F58-8549-4C7E-91DE-56135A1FB77F}" Time="1326646344.61">
<Autostart Name="Autostart" Expanded="True">
<Plugin Identifier="HIDPS3" Guid="PS3" File="PS3">
gAIoWAAAAABxAIiJiImJRwAAAAAAAAAARwAAAAAAAAAAR0AUAAAAAAAAR0BOAAAAAAAAiVV8XFw/XGhpZCN7MDAwMDExMjQtMDAwMC0xMDAwLTgwMDAtMDA4MDVmOWIzNGZifV92aWQmMDAwMjA1NGNfcGlkJjAzMDYjOCZmNWJiMDYwJjAmMDAwMCN7NGQxZTU1YjItZjE2Zi0xMWNmLTg4Y2ItMDAxMTExMDAwMDMwfXEBTUwFWB8AAABTb255IENvbXB1dGVyIEVudGVydGFpbm1lbnQgSW5jcQJNBgNYEQAAAEJEIFJlbW90ZSBDb250cm9scQNLAIl0cQQu
</Plugin>
<Plugin Identifier="Timer" Guid="{6149CA99-1FCD-4450-9160-7543BC20CFD3}" File="Timer">
gAIpLg==
</Plugin>
</Autostart>
register/#/validate-email?token=f10f3e9ce96b0b554e157694b5f1749d&username=16048891980
<!DOCTYPE html>
<html ng-app="FormSync">
<head>
<title>GoAngular Form Synchronization</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
<script src="https://cdn.goinstant.net/v1/platform.min.js"></script>
<script src="https://cdn.goinstant.net/integrations/goangular/latest/goangular.min.js"></script>
<script>
// Create our AngularJS application module & require the goinstant module
var app = angular.module('FormSync', ['goinstant']);
@ctborg
ctborg / gist:6146523
Created August 3, 2013 13:49
Auto-fill captcha
// ==UserScript==
// @name Auto-fill captcha
// @version 0.1.1
// @description Auto-fills the captcha and auto-starts download
// @copyright 2009 Shaun Friedle
// @license GPL version 3; http://www.gnu.org/copyleft/gpl.html
//
// ==/UserScript==
function Block()
@ctborg
ctborg / rspec_rails_cheetsheet.rb
Created August 15, 2012 21:37 — forked from them0nk/rspec_rails_cheetsheet.rb
Rspec Rails cheatsheet (include capybara matchers)
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
@ctborg
ctborg / dabblet.css
Created July 25, 2012 19:36
Untitled
.checkered {
background-image:
-webkit-gradient(
linear, 0 0, 100% 100%,
color-stop(.25, #eee),
color-stop(.25, transparent), to(transparent)),
-webkit-gradient(
linear, 0 100%, 100% 0,
color-stop(.25, #eee),