This file contains hidden or 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
| <% @results.each do |key, value| %> | |
| <%= render :partial => 'result', :locals => { :object => value } %> | |
| <% end %> |
This file contains hidden or 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
| # List all listening ports together with the PID of the associated process | |
| sudo netstat -plunt | |
| # -p Tell me the name of the program and it's PID | |
| # -l that is listening | |
| # -u on a UDP port. | |
| # -n Give me numeric IP addresses (don't resolve them) | |
| # -t oh, also TCP ports |
This file contains hidden or 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
| require 'rational' | |
| class Numeric | |
| def to_r(rounding = 10_000) | |
| Rational((self * rounding).to_i, rounding) | |
| end | |
| end | |
| class Rational | |
| def to_proper |
This file contains hidden or 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 | |
| # Unattended REE/Passenger installation | |
| # Source: http://weblog.brightlight-ict.nl/2008/12/unattended-passenger-ruby-enterprise-installation-on-ubuntu-8/ | |
| # 15/03/09 Updated to use latest r.e.e. and passenger 2.1 and rewrote bits thanks to the comments left on my blog. Thanks guys | |
| if [ "$(whoami)" != "root" ]; then | |
| echo "You need to be root to run this!" | |
| exit 2 | |
| fi | |
This file contains hidden or 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
| if (Global.url_array.length > 4 && !(parseInt(section))) { | |
| // stuff | |
| } |
This file contains hidden or 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
| var Organizations = { | |
| setupAll: function() { | |
| var section = Global.url_array[Global.url_array.length -1]; | |
| if (Global.url_array.length > 4 && !(parseInt(section))) { | |
| console.log('before doSetupShow'); | |
| // Organizations.doSetupShow(); | |
| console.log('after doSetupShow'); | |
| } | |
| setupOrgChooser('sidebar_organization_name', 'sidebar_organization_list', 'sidebar_org_id', 'sidebar_fullsearch', Application.goToOrganization); |
This file contains hidden or 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 apt-get install -y apache2-mpm-prefork \ | |
| apache2-prefork-dev \ | |
| build-essential \ | |
| checkinstall \ | |
| gcc \ | |
| git-core \ | |
| gsfonts \ | |
| imagemagick \ | |
| irb \ | |
| libapache2-mod-passenger \ |
This file contains hidden or 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 LegislatorsController < ApplicationController | |
| def search | |
| respond_to do |format| | |
| if cookies["zip"].to_s.blank? | |
| format.html # search.html.erb | |
| else | |
| format.html { redirect_to legislators_url } | |
| end | |
| end |
This file contains hidden or 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
| ActionMailer::Base.delivery_method = :smtp | |
| ActionMailer::Base.smtp_settings = { | |
| :address => "smtp.gmail.com", | |
| :port => 587, | |
| :authentication => :plain, | |
| :user_name => "[email protected]", | |
| :password => "somepass" | |
| } |
This file contains hidden or 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
| <html> | |
| <head> | |
| <title>This title and shit</title> | |
| </head> | |
| <body> | |
| <script type="text/javascript"> | |
| function someFunc() { | |
| var title = document.title; | |
| var loc = document.location.href; |