Skip to content

Instantly share code, notes, and snippets.

View jdennes's full-sized avatar

James Dennes jdennes

View GitHub Profile
@jdennes
jdennes / gist:1925019
Last active October 1, 2015 04:58
A more valuable git log.
# A more valuable git log
alias gl='git log --graph --pretty="format:%C(yellow)%h%Cblue%d%Creset %s %C(white) %an, %ar%Creset"'
@jdennes
jdennes / cm-basic-subscribe.html
Created August 7, 2012 14:47
The most basic Campaign Monitor subscribe form
<!-- The most basic Campaign Monitor subscribe form -->
<form action="http://jamesd.createsend.com/t/r/s/hujtkt/" method="post" id="subForm">
<label for="hujtkt-hujtkt">Email:</label><br />
<input type="text" name="cm-hujtkt-hujtkt" id="hujtkt-hujtkt" /><br />
<input type="submit" value="Subscribe" />
</form>
@jdennes
jdennes / HISTORY.md
Created October 24, 2012 15:09
Generates a HISTORY.md file for your repo based on tags and commits

createsend-ruby history

v2.3.0 - 10 Oct, 2012 (6639c1f6)

  • Added support for creating campaigns from templates.
  • Updated shoulda dependency.
  • Added support for unsuppressing an email address.
  • Adding custom field data to expected output from getting active subscribers. This clearly documents the data structure to be expected for multi option multi select fields.
  • Removed Alt field from Singleline elements in test (singleline tags don't support alt text).
  • Version 2.3.0
@jdennes
jdennes / Gemfile
Last active December 12, 2015 06:38
Rack application to demonstrate authenticating with the Campaign Monitor API using OAuth. Uses the sinatra, omniauth-createsend, and createsend gems.
source :rubygems
gem 'sinatra'
gem 'omniauth-createsend'
gem 'createsend'
@jdennes
jdennes / Procfile
Last active December 12, 2015 10:48
Another example Flask application to demonstrate authenticating with the Campaign Monitor API using OAuth. This example only uses the createsend and Flask packages.
web: python app.py
@jdennes
jdennes / createsend-oauth.php
Last active December 13, 2015 20:58
A PHP application to demonstrate authenticating with the Campaign Monitor API using OAuth. Uses the createsend-php library as well as the Slim PHP micro framework (but could easily be adapted for use with any PHP framework).
<?php
# 1. Ensure you have Slim installed and in your include path.
# 2. Ensure you have createsend-php installed and in your include path.
# 3. Set CREATESEND_CLIENT_ID, CREATESEND_CLIENT_SECRET,
# and CREATESEND_REDIRECT_URI environment variables for
# your registered OAuth application.
require 'createsend/csrest_general.php';
require 'Slim/Slim.php';
\Slim\Slim::registerAutoloader();
@jdennes
jdennes / CreateSendOAuthTest.java
Last active December 14, 2015 00:09
A Java application to demonstrate authenticating with the Campaign Monitor API using OAuth. Uses the createsend-java library as well as the Spark micro web framework (but could easily be adapted for use with any Java web application framework).
// Ensure you set the CREATESEND_CLIENT_ID, CREATESEND_CLIENT_SECRET,
// and CREATESEND_REDIRECT_URI environment variables for your registered
// OAuth application.
import static spark.Spark.*;
import spark.*;
import com.createsend.General;
import com.createsend.models.clients.ClientBasics;
import com.createsend.models.OAuthTokenDetails;
import com.createsend.util.AuthenticationDetails;
@jdennes
jdennes / link-header.sh
Last active December 26, 2015 20:58
Demonstrate repository url by ID included in the pagination details in the Link header.
@jdennes
jdennes / buienradar-sparkline
Last active April 29, 2016 16:56
Example of how to pipe output from `script/scrape` provided by https://github.com/jdennes/buienalarm into `spark`
$ script/scrape enschede
===> Scraping Buienalarm.nl...
Projected rainfall for the next two hours in enschede:
18:40 - 0.05mm/hour (light)
18:45 - 0.05mm/hour (light)
18:50 - 0.09mm/hour (light)
18:55 - 0.11mm/hour (light)
19:00 - 0.13mm/hour (light)
@jdennes
jdennes / .gitignore
Created October 19, 2011 08:05
Prototype of a super-simple feedparser web service
.DS_Store
*.pyc
web
feedparser.py
sgmllib3.py