Skip to content

Instantly share code, notes, and snippets.

⚙️
Workin' on Chrome extensions!

Dave Stewart davestewart

⚙️
Workin' on Chrome extensions!
Block or report user

Report or block davestewart

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@davestewart
davestewart / heart-domain-unlock.js
Last active Aug 29, 2015
Unlock all heart domains from their "list domains" page.
View heart-domain-unlock.js
var str = '';
$('a[href^="/domains/"]').each(function(i, e){
var $e = $(e);
var url = $(e).attr('href').replace('index.cgi', 'action.cgi?action=lock_unset');
$(e).attr('href', url);
$.get(url, function(data){
data = data.replace(/^[\s\S]+?<body.+?>|<\/body>[\s\S]+$/g, '');
var $dom = $('<div>').html(data);
str += $dom.find('#yesbox p').text() + '\n';
console.clear();
@davestewart
davestewart / log.js
Last active Aug 29, 2015
Console.log shortcut. Mainly useful for sticking in a jQuery .each() loop...
View log.js
// function
function log(){ console.log.apply(console, Array.prototype.slice.call(arguments, 0)); }
// as a shortcut
log(1,2,3);
// 1 2 3
@davestewart
davestewart / mixture.js
Last active Aug 29, 2015
Commented mixture settings file
View mixture.js
{
// --------------------------------------------------------------------------------
// project
"projectName" : "Haven",
"projectDescription" : "New Haven site, built using Mixture",
// --------------------------------------------------------------------------------
@davestewart
davestewart / open-files-patterns.js
Last active Aug 29, 2015 — forked from Naatan/gist:9231532
Komodo IDE - Open Files patterns
View open-files-patterns.js
/**
* Wildcard patterns:
*
* . - period (converts to regexp \. )
* / - folder delimiter (converts to regexp \/ )
* + - wildcard (converts to regexp .+? )
* * - wildcard (converts to regexp .*? )
*/
var patterns =
View GreenSock-Timeline---Basic-Tween.markdown
@davestewart
davestewart / load-images.html
Created Jul 10, 2014
jQuery asset queing using promises
View load-images.html
<!DOCTYPE html>
<html>
<head>
<title>Image Load</title>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
</head>
<body>
@davestewart
davestewart / ternary-test.js
Last active Aug 29, 2015
Comparison of ternary, if/else, switch and hashed-methods to calculate a value
View ternary-test.js
/**
* Comparison of ternary, if/else, switch and hashed-methods to calculate a value
*
* @author dave stewart
* @date weds 16th january 2014
* @see conversation at http://codepen.io/markmiro/blog/awesome-ternary-operator
*
* Results of 100,000 tests each:
*
* - testIf : 35 ms = 1.52 x
@davestewart
davestewart / get-posts.sql
Created Aug 8, 2014
SQL to select post data by category, tag or post format
View get-posts.sql
SET @slug = "tools";
SET @taxonomy = "category"; # post_tag, category, post_format
SELECT
post_name,
post_title,
post_content,
post_content_filtered,
post_excerpt,
post_status,
@davestewart
davestewart / start server.applescript
Created Aug 25, 2014
Start Server Apple Script
View start server.applescript
# Starts server in current folder
tell application "Finder"
set currentDir to POSIX path of ((container of (path to me)) as text)
end tell
tell application "Terminal" to activate
tell application "Terminal"
do script ("cd '" & currentDir & "'")
@davestewart
davestewart / tidy-expense-categories.js
Created Oct 23, 2014
TamperMonkey script for FreeAgent to hide unused expense categories on Explanation screen
View tidy-expense-categories.js
// ==UserScript==
// @name Hide unused FreeAgent expense categories
// @namespace http://davestewart.uk
// @version 0.1
// @description Hides unused categories on FreeAgent Explanation screen
// @author Dave Stewart
// @match https://davestewart.freeagent.com/bank_accounts/
// @grant none
// ==/UserScript==
You can’t perform that action at this time.