Skip to content

Instantly share code, notes, and snippets.

View sstarr's full-sized avatar
🏠
Working from home

Simon Starr sstarr

🏠
Working from home
View GitHub Profile
class Profile < ActiveRecord::Base
# ...
def format_twitter_url
unless self.twitter_url.blank? || self.twitter_url[/^https?:\/\//]
if self.twitter_url[/twitter\.com/i]
self.twitter_url = 'http://' + self.twitter_url
else
self.twitter_url = "https://twitter.com/#{self.twitter_url.sub(/@/, '')}"

Keybase proof

I hereby claim:

  • I am sstarr on github.
  • I am sstarr (https://keybase.io/sstarr) on keybase.
  • I have a public key whose fingerprint is 0A09 E5BF 1F8E 14F7 B703 53A7 77A7 384A BBA0 C7AE

To claim this, I am signing this object:

## CSV Specification
### Columns
* Applicant Reference => applicant_reference (Required)
* First Name => first_name (Required)
* Last Name => last_name (Required)
* Email => email (Required)
* Stage => stage (Required)
* Applied (Survey 1)
<p>
<span class="add-multi-asset">Add Another File</span>
(<span class="types">Images</span>)
</p>
(function(b) {
var e, d, a = [],
c = window;
b.fn.tinymce = function(j) {
var p = this,
g, k, h, m, i, l = "",
n = "";
if (!p.length) {
return
}
class AvatarUploader < CarrierWave::Uploader::Base
# ...
def public_id
# 'production-profile-simon-starr'
return "#{Rails.env}-#{model.class.to_s.downcase}-#{model.profile.slug}"
end
end
end
Some bits and bobs for sale, available for collection from Bradford on Avon or central Bath...
* 27" Apple Thunderbolt Display, £750
* Lavolta Elevated Riser Monitor Stand (8cm high, black), £23
* Griffin Elevator laptop stand, £15
* Apple Wireless Keyboard (barely used), £49
* Apple Magic Trackpad (barely used), £49
All prices include VAT and I’ll give you a VAT invoice so you can claim it back.
You can pay with cash, bank transfer or credit card (if you're happy to cover Stripe's modest fee).
def possessive_name
# Profile name is a proper noun, so we add an apostrophe with or without 's' as appropriate
# e.g. Bob Smith's project or Bob Edwards' project
# See rule 1c. here: http://www.grammarbook.com/punctuation/apostro.asp
name[-1] == "s" ? "#{name}'" : "#{name}'s"
end
@sstarr
sstarr / Google Apps .zone File
Created February 1, 2017 14:46 — forked from clakeb/Google Apps .zone File
Quick .zone file to import when you are setting up Google Apps. I use it with CloudFlare. Enjoy.
; CNAME
calendar 1 IN CNAME ghs.googlehosted.com
drive 1 IN CNAME ghs.googlehosted.com
mail 1 IN CNAME ghs.googlehosted.com
sites 1 IN CNAME ghs.googlehosted.com
video 1 IN CNAME ghs.googlehosted.com
; MX
@ 1 IN MX 10 aspmx3.googlemail.com
@ 1 IN MX 1 aspmx.l.google.com
@sstarr
sstarr / gb.sh
Created July 17, 2019 15:11
Returns a list of local branches, sorted by latest commit date, with the latest SHA, commit message, author, and age
git for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'