Skip to content

Instantly share code, notes, and snippets.

Shawn Welch shrimpwagon

Block or report user

Report or block shrimpwagon

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@shrimpwagon
shrimpwagon / html5-image-uploader-example.php
Last active Apr 20, 2017
HTML5 Image Uploader Example HTML/PHP
View html5-image-uploader-example.php
<html>
<head>
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="html5-image-uploader.jquery.js"></script>
<script>
$(document).ready(function() {
$('#file').postFile({
url: 'http://example.com/upload',
data: {
View html5_image_upload.example.php
<?php
require_once('html5_image_upload.php');
$file = get_xhr_file();
// Original file name:
$name = $file['name'];
// Size of file:
@shrimpwagon
shrimpwagon / html5_image_upload.php
Last active Apr 20, 2017
HTML5 Image Upload PHP
View html5_image_upload.php
<?php
/*******************************************************************
* Get file sent by HTML5 FileReader/XHR
*******************************************************************/
function get_xhr_file()
{
$file_name = $_SERVER['HTTP_X_FILE_NAME'];
$file_size = $_SERVER['HTTP_X_FILE_SIZE'];
$file_type = $_SERVER['HTTP_X_FILE_TYPE'];
@shrimpwagon
shrimpwagon / html5-image-uploader.jquery.js
Last active Apr 12, 2018
HTML5 Image Uploader jQuery
View html5-image-uploader.jquery.js
$(document).ready(function() {
var IS_IE = (navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') > 0);
$.fn.postFile = function(options) {
var $self = this;
var defaults = {
url: undefined,
type: "POST",
@shrimpwagon
shrimpwagon / Odbc.php
Last active Dec 15, 2015 — forked from ceeram/Odbc.php
(NOT WORKING YET) CakePHP database class for specifically working with MS SQL Server via FreeTDS. Might be able to work with other ODBC databases, not sure. For more info on setting up a Linux/PHP/PDO/FreeTDS/MSSQL connection environment, please visit: https://secure.kitserve.org.uk/content/accessing-microsoft-sql-server-php-ubuntu-using-pdo-odb…
View Odbc.php
<?php
/**
* ODBC layer for DBO
* Helpful for Linux connection to MS SQL Server via FreeTDS
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
You can’t perform that action at this time.