Skip to content

Instantly share code, notes, and snippets.

Tommy Marshall tommymarshall

Block or report user

Report or block tommymarshall

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
@tommymarshall
tommymarshall / gist:2659957
Created May 11, 2012
Stripe starter template
View gist:2659957
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Getting Started Form</title>
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>
<!-- jQuery is used only for this example; it isn't required to use Stripe -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
// this identifies your website in the createToken call below
View gist:2660194
.hide-text {
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}
@tommymarshall
tommymarshall / gist:2661495
Created May 11, 2012 — forked from boucher/gist:1750375
Stripe PHP simple example
View gist:2661495
<?php
require 'path-to-Stripe.php';
if ($_POST) {
Stripe::setApiKey("YOUR-API-KEY");
$error = '';
$success = '';
try {
if (!isset($_POST['stripeToken']))
throw new Exception("The Stripe Token was not generated correctly");
@tommymarshall
tommymarshall / gist:2702941
Created May 15, 2012
Javascript: jQuery Plugin Starter Template
View gist:2702941
/*
* 'Highly configurable' mutable plugin boilerplate
* Author: @markdalgleish
* Further changes, comments: @addyosmani
* Licensed under the MIT license
*/
// Note that with this pattern, as per Alex Sexton's, the plugin logic
// hasn't been nested in a jQuery plugin. Instead, we just use
// jQuery for its instantiation.
@tommymarshall
tommymarshall / uri.js
Created May 25, 2012 — forked from jlong/uri.js
URI Parsing with Javascript
View uri.js
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@tommymarshall
tommymarshall / gist:2845462
Created May 31, 2012
htaccess sql, gitignore, example.
View gist:2845462
# secure .htaccess file
<Files ~ ".htaccess|README|\.(sql)|.gitignore|Capfile|Gemfile|Guardfile|Rakefile$">
order allow,deny
deny from all
</Files>
@tommymarshall
tommymarshall / DateFormat.php
Created Jun 3, 2012 — forked from cviebrock/DateFormat.php
DateFormat class for Laravel (or anyone)
View DateFormat.php
<?php
class DateFormat {
const DATE_SHORT = 'Y-m-d';
const DATE_LONG = 'F j, Y';
const DATETIME_SHORT = 'Y-m-d H:i';
const DATETIME_LONG = 'F j, Y, g:i a';
View gist:3125132
update: function() {
this.target.image.attr('src', this.photo);
this.target.name.text(this.name);
this.target.url.attr('href', this.url);
this.target.title.text(this.title);
// Check if image loaded
var profile = this.target.image.imagesLoaded();
profile.fail(function(){
View gist:3144321
public function put_files_new($id)
{
$filename = Input::file('file.name');
$temp_name = Input::file('file.tmp_name');
if ( S3::put_object($temp_name, 'laravel-test', $filename, S3::ACL_PUBLIC_READ) )
{
$new_file = array(
'name' => Input::get('name'),
@tommymarshall
tommymarshall / gist:3353506
Created Aug 14, 2012 — forked from greypants/gist:3185028
SCSS: keyframe mixins
View gist:3353506
// ======================================================================
// Animation.scss
// - Contains helpers for keyframes animation in css3
// - Only functionally with Sass 3.2.0 Alpha and Compass 0.13.alpha
// ======================================================================
@mixin animation-name($name) {
-webkit-animation-name: $name;
-moz-animation-name: $name;
-ms-animation-name: $name;
You can’t perform that action at this time.