Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
<freightRate:FreightRateResponse xmlns:freightRate="http://www.ups.com/XMLSchema/XOLTWS/FreightRate/v1.0">
<common:Response xmlns:common="http://www.ups.com/XMLSchema/XOLTWS/Common/v1.0">
<common:ResponseStatus>
<common:Code>1</common:Code>
<common:Description>Success</common:Description>
</common:ResponseStatus>
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class FreightRatesAndService {
protected $username = '';
protected $password = '';
protected $accessKey = '';
protected $sandbox = '';
protected $endpointUrl = '';
protected static $endpointUrls = array(
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

Multiple PHP version under Ubuntu 12.04 or 14.04

Update your machine

sudo apt-get update
sudo apt-get upgrade

Install some dependencies

sudo apt-get install build-essential

Install ssmtp

sudo apt-get update
sudo apt-get install ssmtp

Check where the binary and the ssmtp.conf file ended up. You’ll need to know the locations for the following steps:

whereis ssmtp
ssmtp: /usr/sbin/ssmtp /etc/ssmtp /usr/share/man/man8/ssmtp.8.gz
@Evan-R
Evan-R / eclipse_setup_instructions.md
Last active August 29, 2015 14:05
Setting up Eclipse Luna on Ubuntu 12.04 for PHP with Git Plugin
  • download eclipse Luna from eclipse.org

  • if you need to install java 1.7, run sudo apt-get install openjdk-7-jdk openjdk-7-jre, then, edit your eclipse.ini, including the path to java 1.7, mine looked like this, you may want to tweak memory limits:

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20140603-1326
-product
org.eclipse.epp.package.standard.product

Multiple PHP version under Ubuntu 12.04 or 14.04

Update your machine

apt-get update
apt-get upgrade

Install some dependencies

apt-get install build-essential

@Evan-R
Evan-R / htaccess_password_protection
Created April 16, 2014 20:30
.htaccess password protection
# in .htaccess file
AuthType Basic
AuthName "Restricted Access"
AuthUserFile /path/to/passwords/.htpasswd
Require valid-user
# sh
sudo htpasswd -c /path/to/passwords/.htpasswd username
@Evan-R
Evan-R / ssh_too_many_connections
Last active August 29, 2015 13:59
too many authentication failures for root
# thanks to: http://kvz.io/blog/2013/02/12/too-many-authentication-failures-for-root/
ssh -o PubkeyAuthentication=no ...
@Evan-R
Evan-R / delete_svn_dirs.sh
Last active August 29, 2015 13:58
recursively delete .svn directories (and contents)
find . -name .svn -exec rm -rf '{}' \;