This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// function | |
function log(){ console.log.apply(console, Array.prototype.slice.call(arguments, 0)); } | |
// as a shortcut | |
log(1,2,3); | |
// 1 2 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// -------------------------------------------------------------------------------- | |
// project | |
"projectName" : "Haven", | |
"projectDescription" : "New Haven site, built using Mixture", | |
// -------------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Wildcard patterns: | |
* | |
* . - period (converts to regexp \. ) | |
* / - folder delimiter (converts to regexp \/ ) | |
* + - wildcard (converts to regexp .+? ) | |
* * - wildcard (converts to regexp .*? ) | |
*/ | |
var patterns = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Image Load</title> | |
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 & "'") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM you can use any resolvable address, such as local.yourdomain.com | |
start "" "http://localhost:8000" | |
php -S localhost:8000 |
OlderNewer