Skip to content

Instantly share code, notes, and snippets.

View kevinholler's full-sized avatar

Kevin Holler kevinholler

View GitHub Profile

Keybase proof

I hereby claim:

  • I am kevinholler on github.
  • I am kevinholler (https://keybase.io/kevinholler) on keybase.
  • I have a public key whose fingerprint is 1B7B 92D5 0608 4944 C4FE 4D76 A134 08F0 787E D7F8

To claim this, I am signing this object:

<?php
$exif = exif_read_data('http://kevinholler.com/hack4good/example/IMG_0231.JPG', 'GPS', true);
foreach ($exif as $key => $section) {
foreach ($section as $name => $val) {
echo "$key.$name: $val<br />\n";
echo json_encode($arr);
}
}
<?php
$target = sys_get_temp_dir();
$target = $target . "../" . basename( $_FILES['uploaded']['name']) ;
$ok=1;
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
}
else {
echo "Sorry, there was a problem uploading your file.";
### Symphony 2.3.x ###
Options +FollowSymlinks -Indexes
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /<!-- REWRITE_BASE -->
### SECURITY - Protect crucial files
RewriteRule ^manifest/(.*)$ - [F]
<?php phpinfo(); ?>
@kevinholler
kevinholler / index.php
Created April 18, 2012 17:24
write test
<?php
$structure = sys_get_temp_dir().'/bla';
if (!mkdir($structure, 0, true)) {
die('Failed');
}
?>
<?php
$email = $_POST['email'];
$message = $_POST['message'];
mail("kholler@engineyard.com", "Email Subject", $message, "From: $email");
?>
<form method="post" action="index.php">
Email: <input name="email" type="text" />
SELECT MONTHNAME(Application.created_at) as "Month", YEAR(Application.created_at) as "Year", COUNT(*) as "NUmber of Apps"
FROM Application
JOIN UserApplication ON Application.id = UserApplication.Application_id
JOIN User ON UserApplication.User_id = User.id
AND User.email NOT LIKE '%@engineyard.com'
GROUP BY MONTH(Application.created_at), YEAR(Application.created_at)
ORDER BY YEAR(Application.created_at) DESC, MONTH(Application.created_at) DESC
@kevinholler
kevinholler / upload.php
Created February 16, 2012 16:42
MongoDB GridFS test
<?php
$uploaddir = sys_get_temp_dir()."/";
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
// Connect to Mongo and set DB and Collection
$mongo = new Mongo("mongodb://user:pass@host:port/db");
$db = $mongo->selectDB('db');
<?php
$host = "";
$port = 3909;
$db = "";
$user = "";
$pass = "";
echo "<pre>";