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
<?php | |
$filename = dirname(__FILE__) . '/allCountries.txt'; | |
$file = new SplFileObject($filename ,'r'); | |
$map = array( | |
0 => 'id', | |
1 => 'name', | |
2 => 'asciiName', | |
3 => 'alternateNames', | |
4 => 'latitude', |
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 | |
set -o errexit | |
# Author: David Underhill | |
# Script to permanently delete files/folders from your git repository. To use | |
# it, cd to your repository's root and then run the script with a list of paths | |
# you want to delete, e.g., git-delete-history path1 path2 | |
if [ $# -eq 0 ]; then | |
exit 0 |
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
<?php | |
class Application_Date | |
extends Zend_Date | |
{ | |
public static function nextDay($dayWanted) | |
{ | |
$weekdays = array('sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'); | |
if (!in_array($dayWanted, $weekdays)) { | |
throw new Zend_Exception("'{$dayWanted}' not found in array of possible weekdays"); | |
} |
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
ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/' |
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/python | |
# | |
# Query and display EC2 metadata related to the AMI instance | |
# Copyright (c) 2009 Canonical Ltd. (Canonical Contributor Agreement 2.5) | |
# | |
# Author: Alon Swartz <[email protected]> | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or |
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 | |
# | |
# ec2-run-user-data - Run instance user-data if it looks like a script. | |
# | |
# Only retrieves and runs the user-data script once per instance. If | |
# you want the user-data script to run again (e.g., on the next boot) | |
# then add this command in the user-data script: | |
# rm -f /var/ec2/ec2-run-user-data.* | |
# | |
# History: |
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
server { | |
listen 80; | |
server_name localhost; | |
error_page 404 = @fallback; | |
error_page 400 = @fallback; | |
proxy_intercept_errors on; | |
location / { |
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
<?php | |
$jsonp = false; | |
if ($_GET["callback"]) { | |
$jsonp = $_GET["callback"]; | |
} | |
$memcached = new Memcached(); | |
$memcached->addServer("127.0.0.1", 11211); |
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
.project | |
.buildpath | |
.settings |
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
# Rewrite non www urls to www | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} ^example\.com$ [NC] | |
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L] |
OlderNewer