Skip to content

Instantly share code, notes, and snippets.

View w3guy's full-sized avatar
✍️
Typing...

Collins Agbonghama w3guy

✍️
Typing...
View GitHub Profile
@virtualstaticvoid
virtualstaticvoid / iptables_rules.sh
Created June 14, 2011 08:58
25 Most Frequently Used Linux IPTables Rules Examples
# Modify this file accordingly for your specific requirement.
# http://www.thegeekstuff.com
# 1. Delete all existing rules
iptables -F
# 2. Set default chain policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
@balupton
balupton / ajaxify-html5-native.js
Created August 15, 2011 06:38
Ajaxify a Website with the HTML5 History API, jQuery and ScrollTo
// https://gist.github.com/1145804
(function(window,undefined){
// Prepare our Variables
var
history = window.history,
$ = window.jQuery,
document = window.document;
// Check to see if the HTML5 History API is enabled for our Browser
@dnaber-de
dnaber-de / editor_plugin.js
Created January 22, 2012 18:33
Wordpress TinyMCE Popup-Dialog. German Tutorial on http://dnaber.de/p1477
// js/editor_plugin.js
/**
* an example tinyMCE Plugin
*/
tinymce.create(
'tinymce.plugins.myPlugin',
{
/**
* @param tinymce.Editor editor
* @param string url
@rantastic
rantastic / mail.php
Created April 16, 2012 22:17
PHP: Send email using amazon SES
<?php
//class docs: http://www.orderingdisorder.com/aws/ses/
require_once('ses.php');
//get credentials at http://aws.amazon.com My Account / Console > Security Credentials
$ses = new SimpleEmailService('ACCESSkeyID', 'SECRETaccessKEY');
$m = new SimpleEmailServiceMessage();
@masak
masak / explanation.md
Last active June 18, 2024 08:24
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.

@craigchristenson
craigchristenson / gist:2869509
Created June 4, 2012 16:51
Example PHP script to check fraud status on a sale.
<?php
if ($_POST['message_type'] == 'FRAUD_STATUS_CHANGED') {
$insMessage = array();
foreach ($_POST as $k => $v) {
$insMessage[$k] = $v;
}
$hashSecretWord = "tango"; # Input your secret word
<?php
/**
* Database emtpying and file removing class.
*
* Truncates all necessary tables in the defined database and removes
* any files uploaded by the demo user.
*
* @since 1.0.0
*
* @author Thomas Griffin
@robinsloan
robinsloan / langoliers.rb
Last active June 25, 2024 17:12
The Langoliers, a tweet deletion script
require "rubygems"
require "twitter"
require "json"
# things you must configure
TWITTER_USER = "your_username"
MAX_AGE_IN_DAYS = 1 # anything older than this is deleted
# get these from dev.twitter.com
CONSUMER_KEY = "your_consumer_key"
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
@craigchristenson
craigchristenson / gist:3841142
Last active December 30, 2015 08:06
2Checkout Return
<?php
$hashSecretWord = 'tango'; //2Checkout Secret Word
$hashSid = 1303908; //2Checkout account number
$hashTotal = '1.00'; //Sale total to validate against
$hashOrder = $_REQUEST['order_number']; //2Checkout Order Number
$StringToHash = strtoupper(md5($hashSecretWord . $hashSid . $hashOrder . $hashTotal));
if ($StringToHash != $_REQUEST['key']) {
$result = "Fail - Hash Mismatch";
} else {