Skip to content

Instantly share code, notes, and snippets.

View dan-bennett's full-sized avatar

Daniel Bennett dan-bennett

  • Perkz Ltd
  • Northants, UK.
View GitHub Profile
@Ultrabenosaurus
Ultrabenosaurus / chrome-colours.php
Last active February 26, 2016 12:17
A quick demo of the "theme-color" meta tag that can be used to colour the UI of Chrome for Android.
<?php
$colour = "#" . ( ( isset( $_GET['colour'] ) ) ? $_GET['colour'] : "000000" );
?>
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
@joepie91
joepie91 / 1_changelog.md
Last active March 27, 2018 00:20
Remove Wired / V3 "ad-blocker veil"

Supported sites:

  • Wired
  • V3.co.uk

Requests for other sites are welcome ([email protected]).

Changelog

  • July 25, 2016: Added support for V3.co.uk.
@walkerstone
walkerstone / index.html
Created October 28, 2014 15:39
Single page template
<html>
<head>
<style>
html { height: 101%; }
body { margin: 0; padding: 0; font-family: sans-serif;}
h1, h2, h3 { margin: 0; }
a { font-weight: ; text-decoration: none; color: #586FB2;}
.active { background: #586FB2; color: white;}
@Ultrabenosaurus
Ultrabenosaurus / README.md
Last active September 14, 2017 21:50
githash - get the short or full SHA for any commit in your current branch's history

githash

Easily get the short or full SHA for any commit in your current branch's history, useful for reverting and sharing specific code states with others.

Why?

Because typing out git rev-list --max-count=1 --abbrev-commit --skip=# HEAD takes far too much effort.

Installation

@Ultrabenosaurus
Ultrabenosaurus / VagrantMySQL.rb
Last active August 29, 2015 14:06
VagrantMySQL - transfer and run SQL files in a single line, make a queue of SQL files/commands to process at once and in multiple boxes!
#
# VagrantMySQL
#
# A helper for interfacing with MySQL from your Vagrantfile
#
# @author Dan Bennett <http://about.me/d.bennett>
# @package Vagrant\Helpers
# @version 1.0.0
# @license BSD 3-Clause <http://opensource.org/licenses/BSD-3-Clause>
# @todo function DocBlocks!!!!
@Ultrabenosaurus
Ultrabenosaurus / clog-php.sublime-snippet
Created September 18, 2014 09:07
basic logging of PHP values in Dev Tools console
<snippet>
<content><![CDATA[
echo "<script type='text/javascript'>if( window.console && console.log ){ var thing = " . json_encode( ${1:thing} ) . "; try{ console.log( JSON.parse(thing) ); }catch(e){ console.log( thing ); } }</script>";
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>clog</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
<!--
@chrisl8888
chrisl8888 / querySelector.polyfill.js
Created February 12, 2014 17:39
IE document.querySelector() polyfill
if (!document.querySelectorAll) {
document.querySelectorAll = function (selectors) {
var style = document.createElement('style'), elements = [], element;
document.documentElement.firstChild.appendChild(style);
document._qsa = [];
style.styleSheet.cssText = selectors + '{x-qsa:expression(document._qsa && document._qsa.push(this))}';
window.scrollBy(0, 0);
style.parentNode.removeChild(style);
@ejdyksen
ejdyksen / mini-console.html
Last active September 18, 2017 22:13
A tool for getting at a JS console when there is none available.
<div id="consolelog" style="font-family: 'Courier New', Courier, monospace; font-size: 12px; margin: 40px 30px 0px; background-color: white; border: 2px solid black; padding: 10px;"></div>
<input type="text" id="consoleinput" style="margin: 0px 30px; width: 400px;" onkeypress="return evalConsoleInput(event, this.value);" />
<script type="text/javascript">
var appendConsole = function(message, type) {
var color = "black";
if (type === "error") {
color = "red";
} else if (type === "debug") {
@iambibhas
iambibhas / scopes.txt
Last active January 25, 2025 20:07
Sublime Text 2: Snippet scopes
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee
@bentruyman
bentruyman / Custom.css
Created August 17, 2011 00:30
IR_Black Theme for Chrome Developer Tools
/**********************************************/
/*
/* IR_Black Skin by Ben Truyman - 2011
/*
/* Based on Todd Werth's IR_Black:
/* http://blog.toddwerth.com/entries/2
/*
/* Inspired by Darcy Clarke's blog post:
/* http://darcyclarke.me/design/skin-your-chrome-inspector/
/*