Firefox
Set default home page
edit /etc/firefox/syspref.js
At the bottom of the file add:
user_pref("browser.startup.homepage", "http://google.com");
Obviously change "http://google.com" to the page of your choice (or not).
#!/bin/bash | |
wget -r -q -nH --cut-dirs=2 --no-parent --reject="index.html*" http://mysite.com/dir1/dir2/data |
require 'octokit' | |
require 'csv' | |
require 'date' | |
# Github credentials to access your private project | |
USERNAME="USER_NAME" | |
PASSWORD="SEKRIT" | |
# Project you want to export issues from | |
USER="REPO_OWNER" | |
PROJECT="REPO_NAME" |
class ComparableMixin(object): | |
def _compare(self, other, method): | |
try: | |
return method(self._cmpkey(), other._cmpkey()) | |
except (AttributeError, TypeError): | |
raise NotImplementedError("_cmpkey not implemented") | |
def __lt__(self, other): | |
return self._compare(other, lambda s,o: s < o) |
Firefox
Set default home page
edit /etc/firefox/syspref.js
At the bottom of the file add:
user_pref("browser.startup.homepage", "http://google.com");
Obviously change "http://google.com" to the page of your choice (or not).
#!/usr/lib/env ruby | |
# Acquires a shared lock on a SQLite database file and copies it to a backup | |
# usage: backup-db.rb DBFILE.db BACKUPFILE.db | |
# author: William Benton ([email protected]) | |
# Public domain. | |
require 'sqlite3' | |
require 'fileutils' |
Use raw(string), as described in the release notes.
7.4.3 Other Changes
You no longer need to call h(string) to escape HTML output, it is on by default in all view templates. If you want the unescaped string, call raw(string).
Basically, where you did
<%=h @model.attr %>
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: APPLICATION | |
# Required-Start: $all | |
# Required-Stop: $network $local_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start the APPLICATION unicorns at boot | |
# Description: Enable APPLICATION at boot time. | |
### END INIT INFO |
For custom queries that require basically a whole custom SQL statement (your find above doesn't exactly abstract much from you) I like to set up a quick little new model that represents the new information. i.e.
class OperatingExpenseReportDatum
attr_accessor :type, :heading, :total
def initialize(row)
# set values from row, like
@total = row["total"].to_f
end
# Tasks to start/stop/restart a daemonized clockwork instance | |
namespace :clockwork do | |
desc "Start clockwork" | |
task :start, :roles => [:app] do | |
run "cd #{current_path} && RAILS_ENV=#{rails_env} bundle exec clockworkd -c #{current_path}/config/clock.rb --pid-dir #{shared_path}/pids --log --log-dir #{shared_path}/log start" | |
end | |
task :stop, :roles => [:app] do | |
run "cd #{current_path} && RAILS_ENV=#{rails_env} bundle exec clockworkd -c #{current_path}/config/clock.rb --pid-dir #{shared_path}/pids --log --log-dir #{shared_path}/log stop" | |
end |
(Usually occurs when running Vagrant Up
(Evolution v1.3.16) = Vagrant 1.6.5 Virtual Box 4.3)
There are errors in the configuration of this machine. Please fix
the following errors and try again:
vm:
* The 'ssh-cleanup' provisioner could not be found.