Skip to content

Instantly share code, notes, and snippets.

Chris Jamieson jamiesoncj

Block or report user

Report or block jamiesoncj

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jamiesoncj
jamiesoncj / gist:cccaa992c59ac991c1d7
Last active Aug 29, 2015
Drush commands for standard new site (favourite setup)
View gist:cccaa992c59ac991c1d7

This is a list of favourite Drush commands to quickly get a fresh D7 site up and running as I like it:

  • drush dl views ctools pathauto token delta admin_menu omega_tools omega-3.1 imagefield_focus
  • drush en views views_ui ctools pathauto token delta delta_blocks delta_ui admin_menu admin_menu_toolbar omega_tools imagefield_focus
  • drush dis overlay toolbar color comment dashboard shortcut
  • drush omega-subtheme customtheme
@jamiesoncj
jamiesoncj / gist:479bb5c671add623c1de
Created Aug 21, 2014
Boilerplate for Drupal Omega main menu
View gist:479bb5c671add623c1de
/**
* Main menu
*/
#block-system-main-menu{
}
#block-system-main-menu ul.menu{
list-style: none;
text-align: right;
@jamiesoncj
jamiesoncj / gist:e187010227a0f88bcfd0
Created Aug 27, 2014
self-invoking jQuery function
View gist:e187010227a0f88bcfd0
(function($) {
// plugin code
})(jQuery);
@jamiesoncj
jamiesoncj / gist:caf6bb73ab76970e8500
Created Aug 30, 2014
Standard messages to filter / hide using Drupal 7 "disable messages" module
View gist:caf6bb73ab76970e8500
.*Strict warning.*
.*There is a security update available for your version of Drupal.*
.*There are security updates available for one or more of your modules or themes.*
.*One or more problems were detected with your Drupal installation.*
@jamiesoncj
jamiesoncj / gist:b2ce50331cef3aee969b
Created Sep 24, 2014
Chaplaincy events helper JS walkthrough for Adam
View gist:b2ce50331cef3aee969b
/* campus events (this is custom.js line 71) */
// first, select each views row on the campus events products view (first view as per email)
$(".view-id-campus_events.view-display-id-page .views-row, .view-id-campus_events_products.view-display-id-page .views-row").each(function(index) {
// examine the current URL.get the page id we are currently on (from the URL). Get only the query parameters (the bits after the "q" in the URL) - NB this means the function will fail if Drupal clean URLs is enabled.
var pathname = window.location.search;
// using the query parameters, get the page number by getting the value of the "page" parameter
var pageNumber = pathname.split('page=')[1];
// if we haven't found anything, this is the first page (but it's zero-indexed, so it's page 0)
@jamiesoncj
jamiesoncj / U.S. and Europe
Last active Aug 29, 2015
ISO Currency Codes allowed by Stripe
View U.S. and Europe
stripeAllowedCurrencies = ["aed", "afn", "all", "amd", "ang", "aoa", "ars", "aud", "awg", "azn", "bam", "bbd", "bdt", "bgn", "bif", "bmd", "bnd", "bob", "brl", "bsd", "bwp", "bzd", "cad", "cdf", "chf", "clp", "cny", "cop", "crc", "cve", "czk", "djf", "dkk", "dop", "dzd", "eek", "egp", "etb", "eur", "fjd", "fkp", "gbp", "gel", "gip", "gmd", "gnf", "gtq", "gyd", "hkd", "hnl", "hrk", "htg", "huf", "idr", "ils", "inr", "isk", "jmd", "jpy", "kes", "kgs", "khr", "kmf", "krw", "kyd", "kzt", "lak", "lbp", "lkr", "lrd", "lsl", "ltl", "lvl", "mad", "mdl", "mga", "mkd", "mnt", "mop", "mro", "mur", "mvr", "mwk", "mxn", "myr", "mzn", "nad", "ngn", "nio", "nok", "npr", "nzd", "pab", "pen", "pgk", "php", "pkr", "pln", "pyg", "qar", "ron", "rsd", "rub", "rwf", "sar", "sbd", "scr", "sek", "sgd", "shp", "sll", "sos", "srd", "std", "szl", "thb", "tjs", "top", "try", "ttd", "twd", "tzs", "uah", "ugx", "usd", "uyu", "uzs", "vnd", "vuv", "wst", "xaf", "xcd", "xof", "xpf", "yer", "zar", "zmw"];
@jamiesoncj
jamiesoncj / gist:c81443fcfbe19ea34630
Created Jan 23, 2015
GoCardless Incorrect token error
View gist:c81443fcfbe19ea34630
import gocardless
from api import settings
# set environment to sandbox
gocardless.environment = settings.GOCARDLESS_ENVIRONMENT
gocardless.set_details(
app_id=settings.GOCARDLESS_MERCHANT_APP_ID,
app_secret=settings.GOCARDLESS_MERCHANT_APP_SECRET,
access_token=settings.GOCARDLESS_MERCHANT_ACCESS_TOKEN,
@jamiesoncj
jamiesoncj / gist:dd6047be45bcaaccc718
Last active Aug 29, 2015
GoCardless bad request error
View gist:dd6047be45bcaaccc718
# when get_gc_partner_authorization_url() is called, returns a URL
# when that URL is visited in the browser, error occurs
# error is: "invalid client_id or redirect_uri for sandbox environment"
gocardless.environment = settings.GOCARDLESS_ENVIRONMENT
gocardless.set_details(
app_id=settings.GOCARDLESS_MERCHANT_APP_ID, # taken from https://dashboard-sandbox.gocardless.com/developer/api-keys
app_secret=settings.GOCARDLESS_MERCHANT_APP_SECRET, # taken from https://dashboard-sandbox.gocardless.com/developer/api-keys
access_token=settings.GOCARDLESS_MERCHANT_ACCESS_TOKEN, # taken from https://dashboard-sandbox.gocardless.com/developer/api-keys
View gist:f595e77f9096a829a546

Some general reading and resources you may find helpful

When people ask me to give them advice about getting into startups, I direct them to these bits of writing.

There is loads of stuff out there which can help get an understanding of how "startups" are different from other service businesses, and how to approach trying to start one. Here are my top picks:

View app.js
(function(){
var $ = document.getElementById.bind(document);
var $$ = document.querySelectorAll.bind(document);
var App = function($el){
this.$el = $el;
this.load();
this.$el.addEventListener(
You can’t perform that action at this time.