Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am psamaan on github.
  • I am petersamaan (https://keybase.io/petersamaan) on keybase.
  • I have a public key ASDUb1FxJjMN3UzTjNipWi1q_cRQBhfo1nrXJQ0vo6h1yAo

To claim this, I am signing this object:

@psamaan
psamaan / FTP2Glacier
Created December 9, 2014 22:03
This PHP script recursively copies all files from a specific FTP location to an AWS Glacier archive. Follow these instructions first for installing dependencies: http://aws.amazon.com/developers/getting-started/php/
<?php
// Include the SDK using the Composer autoloader
require 'vendor/autoload.php';
use Aws\Glacier\GlacierClient;
use Aws\Glacier\Model\MultipartUpload\UploadBuilder;
$client = GlacierClient::factory(array(
'key' => 'key_here',
'secret' => 'secret_here',
'region' => 'region_here', // (e.g., us-west-2)
function validEmail($email, $skipDNS = false)
{
$isValid = true;
$atIndex = strrpos($email, "@");
if (is_bool($atIndex) && !$atIndex)
{
$isValid = false;
}
else
{
@psamaan
psamaan / country
Last active March 14, 2023 06:28
Countries Select Option List
<select name="Country">
<option value="" selected="selected">Select Country</option>
<option value="Afghanistan">Afghanistan</option>
<option value="Albania">Albania</option>
<option value="Algeria">Algeria</option>
<option value="American Samoa">American Samoa</option>
<option value="Andorra">Andorra</option>
<option value="Angola">Angola</option>
<option value="Anguilla">Anguilla</option>
<option value="Antarctica">Antarctica</option>
@psamaan
psamaan / StateCountry
Created August 7, 2013 19:18
From http://jsfiddle.net/hrHWJ/ State dropdown conditional on Country dropdown
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($){
/*The country onchange starts here*/
var orig_html;
var orig_value;
var state_value;