Skip to content

Instantly share code, notes, and snippets.

View kevinholler's full-sized avatar

Kevin Holler kevinholler

View GitHub Profile
@kevinholler
kevinholler / orchestra-temp-upload.php
Created November 11, 2011 11:37 — forked from anonymous/orchestra-temp-upload.php
WordPress plugin for Orchestra.io to set the upload path to sys_get_temp_dir().
<?php
/*
Plugin Name: Orchestra.io Upload to Temp
Plugin URI:
Description: Sets the upload path to sys_get_temp_dir(), allowing uploads to be stored temporarily, presumably before being moved elsewhere (like Amazon S3 via the tantan-s3 plugin).
Version: 0.1
Author: Dylan Kuhn
Author URI: http://www.cyberhobo.net/
Minimum WordPress Version Required: 3.0
License: GPL2+
@kevinholler
kevinholler / index.php
Created January 6, 2012 19:47
Testing something
<?php
echo $_SERVER['HTTP_HOST'];
echo PHP_EOL;
echo $_SERVER['REQUEST_URI'];
print_r($_SERVER);
?>
@kevinholler
kevinholler / index.php
Created January 27, 2012 16:01
keep script alive
<?php
ini_set('user_ignore_abort', true);
?>
<?php
$host = "";
$port = 3909;
$db = "";
$user = "";
$pass = "";
echo "<pre>";
@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');
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
<?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" />
@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 phpinfo(); ?>
### Symphony 2.3.x ###
Options +FollowSymlinks -Indexes
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /<!-- REWRITE_BASE -->
### SECURITY - Protect crucial files
RewriteRule ^manifest/(.*)$ - [F]