Skip to content

Instantly share code, notes, and snippets.

View chris-jamieson's full-sized avatar

Chris Jamieson chris-jamieson

View GitHub Profile
@chris-jamieson
chris-jamieson / gist:f595e77f9096a829a546
Last active April 25, 2017 15:07
Startup reading list

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:

@chris-jamieson
chris-jamieson / gist:dd6047be45bcaaccc718
Last active August 29, 2015 14:14
GoCardless bad request error
# 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
@chris-jamieson
chris-jamieson / gist:c81443fcfbe19ea34630
Created January 23, 2015 15:04
GoCardless Incorrect token error
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,
@chris-jamieson
chris-jamieson / U.S. and Europe
Last active August 29, 2015 14:13
ISO Currency Codes allowed by Stripe
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"];
@chris-jamieson
chris-jamieson / gist:b2ce50331cef3aee969b
Created September 24, 2014 12:35
Chaplaincy events helper JS walkthrough for Adam
/* 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)
@chris-jamieson
chris-jamieson / gist:caf6bb73ab76970e8500
Created August 30, 2014 18:48
Standard messages to filter / hide using Drupal 7 "disable messages" module
.*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.*
@chris-jamieson
chris-jamieson / gist:e187010227a0f88bcfd0
Created August 27, 2014 11:51
self-invoking jQuery function
(function($) {
// plugin code
})(jQuery);
@chris-jamieson
chris-jamieson / gist:479bb5c671add623c1de
Created August 21, 2014 15:25
Boilerplate for Drupal Omega main menu
/**
* Main menu
*/
#block-system-main-menu{
}
#block-system-main-menu ul.menu{
list-style: none;
text-align: right;
@chris-jamieson
chris-jamieson / gist:cccaa992c59ac991c1d7
Last active August 29, 2015 14:05
Drush commands for standard new site (favourite setup)

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
@chris-jamieson
chris-jamieson / gist:e10676442c9a0aae09ec
Created August 12, 2014 11:26
Disable pingbacks for Wordpress (SQL query)
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'post';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'page';