Skip to content

Instantly share code, notes, and snippets.

☎️
call me on my #!/bin/sh phone

Matthew Loberg mloberg

☎️
call me on my #!/bin/sh phone
Block or report user

Report or block mloberg

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
View contact.php
<?php
// get a recaptcha api key at http://www.google.com/recaptcha/whyrecaptcha
require_once("path/to/recaptchalib.php");
$publickey = "";
$privatekey = "";
// see if the form has been submitted
if($_POST['submit']){
// error checking
$errors = '';
@mloberg
mloberg / example.php
Created Mar 10, 2011
A simple Postmark PHP Class
View example.php
<?php
require("postmark.php");
$postmark = new Postmark("your-api-key","from-email","optional-reply-to-address");
if($postmark->to("reciver@example.com")->subject("Email Subject")->plain_message("This is a plain text message.")->send()){
echo "Message sent";
}
@mloberg
mloberg / index.php
Created Apr 18, 2011
Last.fm Simple PHP Class
View index.php
<?php
include_once('lastfm.php');
$lastfm = new LastFm('your-api-key');
$params = array(
'user' => 'mloberg'
);
print_r($lastfm->call('user.getInfo', $params));
View watermark.html
<img src="watermark.php?watermark=watermark.png&src=test.jpg" />
@mloberg
mloberg / jquery.loader.js
Created Jun 29, 2011
Simple jQuery Plugin Loader
View jquery.loader.js
(function($){
$.load = function(options){
// check for something to load
if(options.src === undefined) return;
// load dependencies
if(options.deps !== undefined){
$.each(options.deps, function(key, value){
var type = value.split(".")[value.split(".").length - 1];
if(type === "js"){
$.getScript(value);
@mloberg
mloberg / mysql.php
Created Aug 30, 2011
Simple PHP MySQL Class
View mysql.php
<?php
class Mysql{
static private $link = null;
static private $info = array(
'last_query' => null,
'num_rows' => null,
'insert_id' => null
);
@mloberg
mloberg / postmark.php
Created Sep 23, 2011
Postmark PHP Library
View postmark.php
<?php
/**
* Send emails with Postmark (http://postmarkapp.com)
*
* Author: Matthew Loberg
* Author Twitter: @mloberg
* Author Website: http://mloberg.com
*/
@mloberg
mloberg / File.Upload.js
Created Nov 6, 2011
MooTools Ajax File Upload
View File.Upload.js
/*
name: [File.Upload, Request.File]
description: Ajax file upload with MooTools.
license: MIT-style license
author: Matthew Loberg
requires: [Request]
provides: [File.Upload, Request.File]
credits: Based off of MooTools-Form-Upload (https://github.com/arian/mootools-form-upload/) by Arian Stolwijk
@mloberg
mloberg / Popcorn.SourceCode.js
Created Nov 14, 2011
Popcorn Source Code Plugin
View Popcorn.SourceCode.js
/**
* Popcorn SourceCode Plugin v0.1
* http://mattwritescode.com/2011/11/popcorn-source-code-plugin/
*
* Copyright 2011 Matthew Loberg (http://mloberg.com)
* Licensed under the MIT license
*
* Description:
* Add source code pre/code element to the page.
* If Google Code Prettify <http://code.google.com/p/google-code-prettify/>
View aacinfo.rb
##
# Name: AACInfo
# Author: Matthew Loberg
# Author URL: http://twitter.com/mloberg
# Description:
# I couldn't get MP4Info to read the tags of my iTunes music files, so I created this little class.
# It uses faad to get the tag info, so make sure it's installed (brew install faad2)
require 'iconv'
class AACInfo
You can’t perform that action at this time.