Skip to content

Instantly share code, notes, and snippets.

View mattclements's full-sized avatar

Matt Clements mattclements

View GitHub Profile
http://127.0.0.1:1337/
@mattclements
mattclements / install.sh
Created June 22, 2013 21:15
SM Install for Prepros
rm -Rf ~/.sm
curl -L https://raw.github.com/sm/sm/master/bin/sm-installer | sh
export PATH="$HOME/.sm/bin:$HOME/.sm/pkg/active/bin:$PATH"
sm ext install tokaidoapp tokaido/tokaido-build
sm tokaidoapp dependencies
sm tokaidoapp packages
sm tokaidoapp install
cd $HOME/.sm/pkg/versions/tokaidoapp/active/
./bin/gem install --version '= 3.2.9' sass --no-rdoc --no-ri
PPAPIService: Request: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="urn:ebay:api:PayPalAPI" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:ed="urn:ebay:apis:EnhancedDataTypes" ><soapenv:Header><ns:RequesterCredentials><ebl:Credentials><ebl:Username>paypaltest_api1.mydomain.com</ebl:Username><ebl:Password>XXXXXXX</ebl:Password><ebl:Signature>XXXXXXX</ebl:Signature></ebl:Credentials></ns:RequesterCredentials></soapenv:Header><soapenv:Body><ns:DoDirectPaymentReq><ns:DoDirectPaymentRequest><ebl:DoDirectPaymentRequestDetails><ebl:PaymentDetails><ebl:OrderTotal currencyID="GBP">59.18</ebl:OrderTotal><ebl:ShipToAddress><ebl:Name>Fred Bloggs</ebl:Name><ebl:Street1>XXXX</ebl:Street1><ebl:Street2>XXXX</ebl:Street2><ebl:CityName>XXXX</ebl:CityName><ebl:StateOrProvince>XXXX</ebl:StateOrProvince><ebl:Country>United Kingdom</ebl:Country><ebl:PostalCode>XXX XXX</ebl:PostalCode></ebl:ShipToAddress></ebl:PaymentDetails><ebl:CreditCard><e
@mattclements
mattclements / sftp_bank_download.sh
Created August 31, 2012 09:52
SFTP Bank Download
#!/bin/bash
#FILE="/tmp/out.$$"
#GREP="/bin/grep"
clear
#Make sure only root can run our script
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
@mattclements
mattclements / encodingnew.php
Created August 23, 2012 08:58
Encoding New
function Unaccent($string)
{
return preg_replace('~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml|caron);~i', '$1', htmlentities($string, ENT_QUOTES, 'UTF-8'));
}
echo Unaccent('ľľščťžýáíŕďňä'); // llsctzyairdna
echo Unaccent('Iñtërnâtiônàlizætiøn'); // Internationalizaetion
@mattclements
mattclements / .htaccess
Created August 10, 2012 20:55
Sample HTAccess File
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
ErrorDocument 400 /error_pages/400.php
ErrorDocument 401 /error_pages/401.php
ErrorDocument 403 /error_pages/403.php
ErrorDocument 404 /error_pages/404.php
ErrorDocument 410 /error_pages/410.php
@mattclements
mattclements / README.md
Created August 5, 2012 11:49 — forked from oodavid/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@mattclements
mattclements / pflogsumm.pl
Created June 9, 2012 20:46
Postfix Log Summary
#!/usr/bin/perl -w
eval 'exec perl -S $0 "$@"'
if 0;
=head1 NAME
pflogsumm.pl - Produce Postfix MTA logfile summary
Copyright (C) 1998-2010 by James S. Seymour, Release 1.1.3.
<?php
$mailq = "Error";
$output = array();
$result = "";
//Connect to DB1
$dbcon = mysql_connect('remote_ip','username','password');
mysql_select_db('dbname',$dbcon);
exec('mailq',$output);
@mattclements
mattclements / CLAlert.h
Created April 14, 2012 05:42 — forked from 0xced/CLAlert.h
CLAlert
/*
* CLAlert is a drop-in replacement for NSAlert
*
* A CLAlert is exactly the same as a NSAlert, except for the alert style behavior
*
* - An alert with the informational style (NSInformationalAlertStyle) will always display a "Note icon" (kAlertNoteIcon)
* - An alert with the warning style (NSWarningAlertStyle) will always display a "Caution icon" (kAlertCautionIcon)
* - An alert with the critical style (NSCriticalAlertStyle) will always display a "Stop icon" (kAlertStopIcon)
*
* Tested on Mac OS X 10.5.8 and 10.6.1