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/bash | |
## | |
## A simple little shell script that will return the current | |
## fingerprint on the SSL certificate. It's crude but works :D | |
## | |
## Author: Bob Saska (r35krag0th) <[email protected]> | |
openssl s_client -connect tuner.pandora.com:443 < /dev/null 2> /dev/null | \ | |
openssl x509 -noout -fingerprint | tr -d ':' | cut -d'=' -f2 |
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
# Collection of helpers for math-related ARel NamedFunctions. | |
# | |
# Include this in classes that need to do trig with DB functions. Lets you write | |
# cleaner code, like: | |
# | |
# dist = acos(sin(lat) * sin(arel_lat_field) + | |
# cos(lat) * cos(arel_lat_field) * cos(arel_lng_field)) * EARTH_RADIUS_KM | |
# band_num = round(dist / ring_width, 0) | |
# band_num.to_sql | |
# # => round(abs(acos( |
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
#!/usr/bin/perl | |
# Emacs starter for Emacs mac port | |
# Thanks to Aquamacs Project and David Reitter | |
my $args = ""; | |
my $tmpfiles = ""; | |
for my $f (@ARGV) { |
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
-- | |
-- applescript to toggle connection state of vpn | |
-- http://markupboy.com/blog/view/toggling-vpn-with-applescript | |
-- http://www.plankdesign.com/blog/2012/06/toggle-your-network-settings-with-launchbar/ | |
-- | |
tell application "System Events" | |
tell current location of network preferences | |
-- set this to the name of your VPN config | |
set VPNservice to service "vpn service name" | |
set isConnected to connected of current configuration of VPNservice |
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
sudo cp netmonitor.sh /usr/bin/netmonitor.sh | |
sudo chmod 755 /usr/bin/netmonitor.sh | |
sudo crontab -e | |
Add to crontab: | |
*/2 * * * * /usr/bin/netmonitor.sh 2>&1 | /usr/bin/logger -t netmonitor |
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
(defun toggle-maximize-buffer () "Maximize buffer" | |
(interactive) | |
(if (= 1 (length (window-list))) | |
(jump-to-register '_) | |
(progn | |
(set-register '_ (list (current-window-configuration))) | |
(delete-other-windows)))) | |
;; Bind it to a key. |
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
<% flash.each do |type, message| %> | |
<div class="alert <%= bootstrap_class_for(type) %> fade in"> | |
<button class="close" data-dismiss="alert">×</button> | |
<%= message %> | |
</div> | |
<% 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
# -*- encoding : utf-8 -*- | |
set :assets_dependencies, %w(app/assets lib/assets vendor/assets Gemfile.lock config/routes.rb) | |
namespace :deploy do | |
namespace :assets do | |
desc <<-DESC | |
Run the asset precompilation rake task. You can specify the full path \ | |
to the rake executable by setting the rake variable. You can also \ |
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
class ActiveRecord::Base | |
mattr_accessor :shared_connection | |
@@shared_connection = nil | |
def self.connection | |
@@shared_connection || ConnectionPool::Wrapper.new(:size => 1) { retrieve_connection } | |
end | |
end | |
ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection |
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 playbook has been removed as it is now very outdated. |