Skip to content

Instantly share code, notes, and snippets.

View rknightuk's full-sized avatar

Robb Knight rknightuk

View GitHub Profile
@rknightuk
rknightuk / Focus Mode
Created August 4, 2013 15:19
Focus Mode now not used on robblewis.me
<a href="#" class="focus">focus</a></p>
<script type="text/javascript">
$(".focus").click(function (e) {
e.preventDefault();
if($(this).text() == 'focus')
{
$("header").slideToggle("slow");
$("nav").slideToggle("slow");
// $(".meta").slideToggle("slow");
@rknightuk
rknightuk / fibonacci
Last active December 22, 2015 08:59
Fibonacci sequence
<?php
$number = 8; // Index of fibonacci number
if ($number < 3) {
$answer = 1;
echo "Answer: " . $answer;
}
else {
@rknightuk
rknightuk / Git log for author with date range.md
Last active July 25, 2018 07:37
Git log for specific date range.

Everything since a specific month or date:

git log --author="Your Name" --since="month || date" --pretty=format:"%ad - %s

Everything in a specific date range:

git log --author="Your Name" --since="month || date" --before="month || date" --pretty=format:"%ad - %s

Output:

@rknightuk
rknightuk / logomarkstyle.css
Last active December 28, 2015 09:49
Robb Lewis Logomark
body {
margin-top: 50px;
}
.logo {
border: 8px solid black;
font-weight: bold;
font-family: Helvetica, Arial, sans-serif;
font-size: 200%;
padding: 10px;

Slimdown

A very basic regex-based Markdown parser. Supports the following elements (and can be extended via Slimdown::add_rule()):

  • Headers
  • Links
  • Bold
  • Emphasis
  • Deletions
@rknightuk
rknightuk / testhtml
Created December 7, 2013 11:41
HTML for testing style at the beginning of development
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
@rknightuk
rknightuk / gist:8702766
Last active August 29, 2015 13:55
Backbone model length
initialize: function() {
this.listenTo(this.model, 'sync', this.render)
}
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Theme - Spacegray/base16-eighties.dark.tmTheme",
"dictionary": "Packages/Language - English/en_GB.dic",
"font_face": "Source Code Pro",
"font_size": 14.0,
"highlight_line": true,
"ignored_packages":
[
@rknightuk
rknightuk / triangle.css
Created May 7, 2014 16:01
CSS triangle
.triangle-topright {
width: 0;
height: 0;
border-top: 12px solid #ffa500;
border-left: 12px solid transparent;
float: right;
margin-top: -16px;
margin-right: -10px;
}
<!DOCTYPE HTML>
<html>
<head>
<title>rbbl.ws share</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link href='http://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>