This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<center id="timer-container"> | |
<div id="times-up"> | |
<div id="its-time">It's time!</div> | |
<div id="its-okay">(it's okay)</div> | |
</div> | |
<div id="timer"> | |
<div id="days"></div> | |
<div id="hours"></div> | |
<div id="minutes"></div> | |
<div id="seconds"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -x | |
sudo sed -i 's/wheezy/testing/g' /etc/apt/sources.list | |
sudo apt-get update | |
sudo apt-get dist-upgrade -y | |
sudo apt-get autoremove -y | |
sudo apt-get install -y build-essential ruby ruby-dev | |
sudo gem update --system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- /etc/init.d/dropbox | |
+++ /etc/init.d/dropbox-fixed | |
@@ -26,7 +34,8 @@ | |
status() { | |
for dbuser in $DROPBOX_USERS; do | |
- dbpid=`pgrep -u $dbuser dropbox` | |
+ HOMEDIR=`getent passwd $dbuser | cut -d: -f6` | |
+ dbpid=`ps -u $dbuser -o pid,cmd | grep "$HOMEDIR"/"$DAEMON"\$ | awk '{ print \$1 }'` | |
if [ -z $dbpid ] ; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Check the total size of each database | |
SELECT | |
tables.TABLE_SCHEMA AS database_name, | |
ROUND(SUM(tables.DATA_LENGTH + tables.INDEX_LENGTH) / POWER(2, 30), 3) AS database_size_in_gb | |
FROM information_schema.TABLES AS tables | |
GROUP BY tables.TABLE_SCHEMA | |
ORDER BY database_size_in_gb DESC; | |
-- List all tables larger than 1 GB | |
SELECT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This crontab is automatically generated on deploy | |
SHELL=/bin/bash | |
[email protected] | |
RAILS_ENV=<%= stage %> | |
RAKE_CMD="<%= "#{bundle_path} rake --rakefile #{current_path}/Rakefile --trace" %>" | |
LOG_FILE="<%= "#{current_path}/log/cron.log" %>" | |
# Note: times are in the user's local time | |
<% if stage == :production && primary_server -%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Pivotal Tracker Info Radiator | |
// @namespace http://kampers.net | |
// @include https://www.pivotaltracker.com/projects/* | |
// ==/UserScript== | |
function addGlobalStyle(css) { | |
var head, style; | |
head = document.getElementsByTagName('head')[0]; | |
if (!head) { return; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The I18n gem included in Rails 2.3.10 deprecates the {{key}} interpolation | |
# syntax in favor of %{key}, but Remarkable still uses the deprecated syntax. | |
# This is fixed in https://github.com/remarkable/remarkable/commit/23177b7ddd, | |
# but not yet released in a gem that's still compatible with Rails 2 and RSpec 1.3. | |
change_string_values_to_new_syntax = lambda do |key, value| | |
case value | |
when String then value.gsub!(I18n::Backend::Base::DEPRECATED_INTERPOLATION_SYNTAX_PATTERN, '%{\2}') | |
when Hash then value.each_pair(&change_string_values_to_new_syntax) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Git doesn't remove submodules from your working tree when you pull. This Rails | |
# initializer will take care of it for you, so developers don't have to do | |
# anything. | |
paths = %w(vendor/gems/first_gem-1.0.0 | |
vendor/gems/another_gem-1.0.0) | |
paths.each do |path| | |
dir = Rails.root.join(path) | |
if File.directory?(dir) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/cucumber_fakeweb_hook.rb | |
# If this looks like a test server process, make its FakeWeb available to other | |
# processes via DRb. That way the test runner (which runs in a separate process) | |
# can dynamically register stubs for this server to use. | |
if Rails.env.cucumber? && defined?(PhusionPassenger) | |
require 'drb' | |
require 'fakeweb' | |
DRb.start_service("druby://localhost:30010", FakeWeb) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check an email address domain's validity using MX records | |
require 'resolv' | |
def known_email_domain?(email) | |
domain = email.match(/\@(.+)/)[1] | |
Resolv::DNS.open { |dns| dns.getresources(domain, Resolv::DNS::Resource::IN::MX) }.any? | |
end |
NewerOlder