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
# This is just a basic sample of a controller needed to work with popups.js | |
class AddressesController < ApplicationController | |
before_filter :load_addressable | |
def new | |
@address = @addressable.addresses.build(:name => params[:name]) | |
render :partial => 'form' | |
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
# config/initializers/active_record.rb | |
# Loads the monkey patch. | |
require 'active_record' | |
require 'active_record/schema_dumper' | |
require 'schema_dumper' | |
ActiveRecord::SchemaDumper.class_eval do | |
include Nepco::SchemaDumper | |
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
<ShipmentInformation> | |
<ShipperNumber>#####</ShipperNumber> | |
<ServiceType>GND</ServiceType> | |
<NumberOfPackages>1</NumberOfPackages> | |
<BillingOption>PP</BillingOption> | |
<QVNOption> | |
<QVNRecipientAndNotificationTypes> | |
<EMailAddress>[email protected]</EMailAddress> | |
<Ship>Y</Ship> | |
<Exception>Y</Exception> |
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
### | |
Twitter Bootstrap compatible pagination view. | |
Relies on an ArrayController being in place that implements | |
refreshData(page_num) | |
### | |
# Names of previous and next buttons can be adjusted: | |
PREV = "Prev" | |
NEXT = "Next" |
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
# Throttle LO interface | |
sudo tc qdisc add dev lo root handle 1: htb default 12 | |
sudo tc class add dev lo parent 1:1 classid 1:12 htb rate 20kbps ceil 20kbps | |
sudo tc qdisc add dev lo parent 1:12 netem delay 1000ms | |
# Go back to the way things were. | |
sudo tc qdisc del dev lo root |
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
#!/usr/bin/env bash | |
# Step 5b. (for Network Connection) Configure your printer on the cups web interface | |
# 5b-1. Open a web browser and go to "http://localhost:631/printers". | |
# 5b-2. Click "Modify Printer" and set following parameters. | |
# | |
# - "LPD/LPR Host or Printer" or "AppSocket/HP JetDirect" for Device | |
# - lpd://192.168.1.8/binary_p1 for Device URI | |
# - Brother for Make/Manufacturer Selection | |
# - Your printer's name for Model/Driver Selection |
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 route add -host irc.freenode.net gw 192.168.1.1 |
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
#!/usr/bin/env bash | |
# Exit on any error (non-zero return code) | |
set -e | |
# Create swapfile of 2GB with block size 1MB | |
/bin/dd if=/dev/zero of=/swapfile bs=1024 count=2097152 | |
# Set up the swap file | |
/sbin/mkswap /swapfile |
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 route add -host irc.freenode.net gw 192.168.1.1 |
OlderNewer