Skip to content

Instantly share code, notes, and snippets.

View kieranajp's full-sized avatar
🎧

Kieran kieranajp

🎧
View GitHub Profile
var canvas = document.getElementById("canvas")
, ctx = canvas.getContext("2d")
, x = 1, y = 1;
var colors = [
"9DB0AC",
"829995",
"5D7975",
"3E5D58",
"18332F",
@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%;
@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

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:

"""""
" Colors
"""""
syntax enable
"""""
" Spaces & Tabs
"""""
@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:

@kieranajp
kieranajp / FocusTextBox.cs
Created February 22, 2012 19:30
Creating a System.Windows.Forms.TextBox that automatically selects text on focus (like a browser's URL bar)
public class FocusTextBox : System.Windows.Forms.TextBox
{
private bool _focussed;
protected override void OnEnter(EventArgs e)
{
base.OnEnter(e);
if (MouseButtons == MouseButtons.None)
{
SelectAll();
@kieranajp
kieranajp / gist:1917510
Created February 26, 2012 16:32
Open as TextMate Project
-- Add this in Automator as a Service
-- Service receives selected <folders> in <Finder>
on run {input, parameters}
tell application "TextMate"
open input
end tell
end run
@kieranajp
kieranajp / randIP.php
Created March 28, 2012 15:40
Random IP address
<?php
long2ip(rand(0, "4294967295")); // random up to 255.255.255.255
?>
@kieranajp
kieranajp / hack.sh
Created March 31, 2012 17:13 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with useful tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl https://raw.github.com/gist/2266840/9a55fa74b72089ac8654a48e5988652cfc9f664c/hack.sh | sh
#