Skip to content

Instantly share code, notes, and snippets.

View kieranajp's full-sized avatar
🎧

Kieran kieranajp

🎧
View GitHub Profile
@kieranajp
kieranajp / bug report.md
Last active August 29, 2015 14:17
PerchAPI_Base.class.php hotfix

When posting a comment on a perch blog, we were receiving the following error:

ErrorException: Trying to get property of non-object in /Library/WebServer/Documents/dsear/public_html/perch/core/lib/api/PerchAPI_Base.class.php on line 19

This is on Perch 2.8.2 with the latest Blog app.

The comment was saving okay, but the error was thrown regardless. I did some digging and found it was due to Perch's logging.

To fix the error I modified the aforementioned class:

"""""
" Colors
"""""
syntax enable
"""""
" Spaces & Tabs
"""""

Keybase proof

I hereby claim:

  • I am kieranajp on github.
  • I am kieranajp (https://keybase.io/kieranajp) on keybase.
  • I have a public key whose fingerprint is 3BED 9D38 9A90 7BD4 E6C3 3B46 447F AB09 435F A749

To claim this, I am signing this object:

# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@kieranajp
kieranajp / kieran.conf
Last active August 29, 2015 14:03
My Apache.conf
<VirtualHost *:80>
ServerName dev.vg
ServerAlias *.vg
UseCanonicalName Off
VirtualDocumentRoot "/vagrant/vagrant/%-2+/public_html"
<Directory /vagrant/vagrant>
AllowOverride All
Require all granted
@kieranajp
kieranajp / svg.html
Last active August 29, 2015 14:03
Create colours of varying opacities and very quickly testing them against various backgrounds, using SVG & coffeescript
<!doctype html>
<html>
<head>
<style>
body {
margin: 0;
}
div {
width: 50%;
var canvas = document.getElementById("canvas")
, ctx = canvas.getContext("2d")
, x = 1, y = 1;
var colors = [
"9DB0AC",
"829995",
"5D7975",
"3E5D58",
"18332F",

News pages

Variables & functions

First things first, we're going to want to declare all our variables. We'll begin with caching some selectors so we can put them to good use later (we're going to use these guys a lot so we should keep them around here - beats parsing the DOM every time)

$head = $(".page-header")
$auth = $("#targeted_authority")
$focus = $("#targeted_focus")
@kieranajp
kieranajp / taxCalc.rb
Created September 6, 2012 23:09
Employment Income Tax Calculator in Ruby
class Tax
attr_accessor :threshold
def initialize(threshold)
# There's probably a better way of doing default values
@threshold = threshold.to_i || 7592
end
def parseTaxCode(taxCode)
# Try this bit in ruby 1.9
@kieranajp
kieranajp / hidden.sh
Created June 20, 2012 15:53
Alfred: Toggle Hidden Files
# Paste this as a shell script extension in the Powerpack
SHOW=`defaults read com.apple.finder AppleShowAllFiles`
if [ "${SHOW}x" = "1x" ]; then
defaults write com.apple.finder AppleShowAllFiles -bool FALSE
else
defaults write com.apple.finder AppleShowAllFiles -bool TRUE
fi
killall Finder