Skip to content

Instantly share code, notes, and snippets.

View nclark's full-sized avatar
💭
wu tang is for the children

Neal Clark nclark

💭
wu tang is for the children
View GitHub Profile
<?xml version="1.0" ?><!DOCTYPE service-group SYSTEM 'avahi-service.dtd'><service-group><name replace-wildcards="yes">AirPrint HL2270DW @ %h</name><service><type>_ipp._tcp</type><subtype>_universal._sub._ipp._tcp</subtype><port>631</port><txt-record>txtvers=1</txt-record><txt-record>qtotal=1</txt-record><txt-record>Transparent=T</txt-record><txt-record>URF=none</txt-record><txt-record>rp=printers/HL2270DW</txt-record><txt-record>note=HL2270DW</txt-record><txt-record>product=(GPL Ghostscript)</txt-record><txt-record>printer-state=3</txt-record><txt-record>printer-type=0x821014</txt-record><txt-record>pdl=application/octet-stream,application/pdf,application/postscript,application/vnd.cups-raster,image/gif,image/jpeg,image/png,image/tiff,image/urf,text/html,text/plain,application/vnd.adobe-reader-postscript,application/vnd.cups-command</txt-record></service></service-group>
@nclark
nclark / end.scpt
Created May 21, 2011 03:36
applescripts for pomodoro.app
tell application "Finder"
if (name of every application process) contains "Skype" then
tell application "Skype"
send command "SET USERSTATUS ONLINE" script name "pomodoro"
send command "SET PROFILE MOOD_TEXT " script name "pomodoro"
end tell
end if
end tell
tell application "Twitter" to activate
@nclark
nclark / macos-cancer.md
Last active November 28, 2018 21:45
MacOS cancer cure

praise the gods

MacOS spaces switching going f-ing crazy

Issue

defaults write com.apple.dock workspaces-auto-swoosh -bool NO ; killall Dock

Use different network password from iPhone and mac

# root and users in group wheel can run anything on any machine as any user
root ALL = (ALL) ALL
%admin ALL = (ALL) ALL
nclark ALL = (ALL) ALL, NOPASSWD: /usr/local/bin/svc,/usr/local/bin/svstat

Keybase proof

I hereby claim:

  • I am nclark on github.
  • I am nclark (https://keybase.io/nclark) on keybase.
  • I have a public key whose fingerprint is EAB5 1E08 38D8 000F 0267 B21D A118 BC05 B671 610A

To claim this, I am signing this object:

Here's what you get.

Some CoffeeScript (verbosely commented for clarity)

# Override Rails handling of confirmation

$.rails.allowAction = (element) ->
  # The message is something like "Are you sure?"
  message = element.data('confirm')
@nclark
nclark / run
Created May 18, 2012 22:01 — forked from riywo/run
unicorn with daemontools
#!/bin/bash
# mkdir /service/redmine-unicorn
# cd /service/redmine-unicorn
# mkdir env
# echo "production" > env/RAILS_ENV
# echo "/home/riywo/redmine" > env/RAILS_ROOT
# echo "/home/riywo/.rbenv" > env/RBENV_ROOT
# echo "riywo" > env/USER
exec 2>&1 \
--- pjax.orig.rb 2012-05-04 22:46:22.000000000 -0700
+++ pjax.rb 2012-05-04 22:46:57.000000000 -0700
@@ -13,6 +13,10 @@
headers = HeaderHash.new(headers)
if pjax?(env)
+ request_parameters = env['action_dispatch.request.parameters']
+ controller_name = request_parameters[:controller]
+ action_name = request_parameters['action']
+
@nclark
nclark / .osx
Created December 18, 2011 20:04 — forked from dennmart/.osx
Sensible defaults for Mac OS X Lion
# Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
# Enable the 2D Dock
defaults write com.apple.dock no-glass -bool true
# Make Dock icons of hidden applications translucent
defaults write com.apple.dock showhidden -bool true
# Disable menu bar transparency
@nclark
nclark / ultemplate.rb
Created October 24, 2011 21:06 — forked from Lytol/ultemplate.rb
Rails 3 Application Template
# Rails application template for Rails 3 + Postgres + Git + haml + JQuery + Rspec + Cucumber + Capybara + FactoryGirl
# by Brian Smith <bsmith@swig505.com>
# Create a default README
file "README.md", <<-EOF
#{app_name}
#{"=" * app_name.length}
TODO: description