Skip to content

Instantly share code, notes, and snippets.

class HelloSbt {
def sayHello() = ""
}
@JohnPlummer
JohnPlummer / lock_osx.txt
Last active August 29, 2015 14:02
Lock OSX (but keep the account logged in.)
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend
@JohnPlummer
JohnPlummer / reboot.txt
Created June 14, 2014 09:22
Cron job to reboot the system at 3:35am
sudo crontab -e
30 3 * * * /sbin/shutdown -r +5 "About to reboot!"
# mute startup chime
sudo nvram SystemAudioVolume=%80
# reenable startup chime.
sudo nvram -d SystemAudioVolume
<FileZilla3>
<Settings>
<Setting name="Config Location">/Users/[Username]/Dropbox/Config/Preferences/filezilla/</Setting>
<Setting name="Kiosk mode">0</Setting>
<Setting name="Disable update check">0</Setting>
</Settings>
<Servers>
</Servers>
</FileZilla3>
@JohnPlummer
JohnPlummer / .autotest
Created January 18, 2011 13:56
Rails Setup
require "autotest/growl"
require "autotest/fsevent"
Autotest.add_hook :initialize do |autotest|
%w{.git .svn .hg .DS_Store ._* vendor tmp log doc}.each do |exception|
autotest.add_exception(exception)
end
end
@JohnPlummer
JohnPlummer / Gemfile
Created January 21, 2011 14:36
Add authentication with devise - install and configure
source 'http://rubygems.org'
gem 'rails', '3.0.3'
gem 'sqlite3-ruby', :require => 'sqlite3'
gem 'haml'
gem 'jquery-rails'
# Authentication
gem 'devise', :git => "git://github.com/JohnPlummer/devise.git"
@JohnPlummer
JohnPlummer / authentication.feature
Created January 31, 2011 16:21
Authentication with devise - Features
Feature: Authentication
So that users can be associated with an account
As the site owner
I want users to login
@JohnPlummer
JohnPlummer / stop.rb
Created February 23, 2011 11:59
Stop in rails console if something fails in cucumber test. From http://railsdog.com/blog/2011/02/22/cucumber-testing-tips/ (Neeraj Singh)
# Usage:
# @wip @stop
# At the end of features/support/env.rb add the following line
# require File.expand_path(File.dirname(__FILE__) + '/stop')
# $ cucumber -p wip
After do |scenario|
if scenario.failed? && scenario.source_tag_names.include?("@wip") && scenario.source_tag_names.include?("@stop")
puts "Scenario failed. You are in rails console becuase of @stop. Type exit when you are done"
@JohnPlummer
JohnPlummer / compass.rb
Created April 14, 2011 16:00
Rails, Compass, and Heroku
require 'compass'
require 'compass/app_integration/rails'
require 'fileutils'
FileUtils.mkdir_p(Rails.root.join("tmp", "stylesheets"))
Compass::AppIntegration::Rails.initialize!
Rails.configuration.middleware.delete('Sass::Plugin::Rack')
Rails.configuration.middleware.insert_before('Rack::Sendfile', 'Sass::Plugin::Rack')