I hereby claim:
- I am ericjsilva on github.
- I am ericjsilva (https://keybase.io/ericjsilva) on keybase.
- I have a public key whose fingerprint is 4E30 8D75 9F24 3C48 315C D9AA 1DD8 AF6F 305E 289D
To claim this, I am signing this object:
<?php | |
function checkOctober() { | |
$endYear = 1800; | |
$currentYear = intval(date("Y")); | |
for ($i = $currentYear; $i >= $endYear; $i--) { | |
$d = strtotime("01 October ".$i); | |
$w = date("w", $d); | |
if ($w == 1) { | |
echo date("Y", $d) . "<br/>"; |
from lxml import etree | |
import sys | |
def indent(elem, level=0): | |
i = "\n" + level*" " | |
if len(elem): | |
if not elem.text or not elem.text.strip(): | |
elem.text = i + " " | |
for e in elem: | |
indent(e, level+1) |
<?php | |
/** | |
* Quickly and easily backup your MySQL database and have the .tgz copied to | |
* your Dropbox account. | |
* | |
* Copyright (c) 2012 Eric Silva | |
* | |
* 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 |
<?xml version="1.0" encoding="UTF-8"?> | |
<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:jenkins="http://www.mulesoft.org/schema/mule/jenkins" xmlns:vm="http://www.mulesoft.org/schema/mule/vm" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd | |
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd | |
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd | |
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd | |
http://www.mulesoft.org/schema/mule/jenkins http://www.mulesoft.org/schema/mule/jen |
/* | |
* Full credit to Byron Salau at http://byronsalau.com/ for this script. | |
*/ | |
function createUUID() { | |
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { | |
var r = Math.random() * 16 | 0, | |
v = c === 'x' ? r : (r & 0x3 | 0x8); | |
return v.toString(16); | |
}); | |
} |
I hereby claim:
To claim this, I am signing this object:
<?php | |
/* | |
Plugin Name: Instagrate to WordPress | |
Plugin URI: http://www.polevaultweb.com/plugins/instagrate-to-wordpress/ | |
Description: Plugin for automatic posting of Instagram images into a WordPress blog. | |
Author: polevaultweb | |
Version: 1.2.3 | |
Author URI: http://www.polevaultweb.com/ | |
Copyright 2012 polevaultweb (email : info@polevaultweb.com) |
# Description: | |
# When hubot hears druplicon, an ASCII art druplicon will appear. | |
# | |
# Dependencies: | |
# None | |
# | |
# Configuration: | |
# None | |
# | |
# Commands: |
You can encode a URL like so:
http://yourserver.com/unsubscribe/<encoded-email>/<signature>
Where <signature>
is something like hash_hmac('sha256', $email, $secret_key)
. Encoded-email
can just be a URL-encoding of the email, or it can be an actually encrypted (AES+CBC+Base64 or similar) version of the email. Using full encryption would seem to be of little use though - since the person receiving this has their own email address anyway.
This signature scheme has the advantage of not needing any database storage, while remaining secure against malicious attempts to unsubscribe someone.
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using System.Security.Cryptography; | |
using System.Text; | |
public class SHA256Test | |
{ | |
public static void Main(string[] args) |