Skip to content

Instantly share code, notes, and snippets.

@adamturtle
adamturtle / blogger-password-protect
Last active June 14, 2022 02:05
Password protect for Blogger. Paste this snippet before the closing </body> tag in your blogger template. It's a simple jQuery login box, so not very secure at all (a simple 'view-source' will reveal the password…) but is effective for at least partial privacy. Customize the password on line 64.
<style type='text/css'>
#custom_overlay {
background: #222;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 3000;
}
@adamturtle
adamturtle / tampermonkey-copy-jira-number-to-clipboard.js
Last active November 26, 2021 15:30
Copy Jira issue number to clipboard
AJS.$(document).ready(function () {
function copyStringToClipboard (str) {
var el = document.createElement('textarea');
el.value = str;
el.setAttribute('readonly', '');
el.style = {position: 'absolute', left: '-9999px'};
document.body.appendChild(el);
el.select();
document.execCommand('copy');
@adamturtle
adamturtle / tampermoney-open-jira-issue-link-in-new-tab.js
Last active July 3, 2020 15:50
Open Jira issue links in new tab
@adamturtle
adamturtle / ToggleZoomAudio.script
Last active February 6, 2019 15:10
Toggle the microphone audio in Zoom
set appName to "zoom.us"
if not is_running(appName) then
return
end if
focus(appName)
set menuName to "Meeting"
set mute to "Mute Audio"
@adamturtle
adamturtle / bookmarklet.js
Last active March 10, 2017 15:34
A bookmarklet to set the speed of any HTML5 video (Youtube, Laracasts, etc)
javascript:!function(){function c(b){a.playbackRate=parseFloat(b)}let a=document.getElementsByTagName("video")[0],b=a.playbackRate;c(prompt("Enter playback speed",null===b?1.5:b))}();
@adamturtle
adamturtle / gist:5fdd7a6b24533958a7e3
Last active March 21, 2016 17:56
Sublime Text Configuration
{
"auto_complete": true,
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"detect_indentation": false,
"dfont_face": "InputMono-Regular",
"fade_fold_buttons": false,
"font_face": "Consolas",
"font_options":
/*
Theme Name: Example Child Theme Name
Theme URI: http://child-theme-homepage.tld
Description: A description of your child theme.
Author: Child Theme Author Name
Author URI: http://child-theme-author-homepage.tld
Version: 1.0
Tags: translation-ready, ...
#!/usr/bin/env bash
#
# simple recursive search and replace string in files
# setup: alias replace='~/replace.sh'
# notes: you will need to escape special chars! eg: replace '\/dir1' '\/dir2' .
# usage: replace <oldstring> <newstring> <path> <depth>
# examples:
# replace "([^\s]+.php)" "\/\1" .
# replace "\"\/([^\/]+.php)" "\"\/dir\/\1" .
@adamturtle
adamturtle / 0_reuse_code.js
Created September 27, 2013 15:18
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@adamturtle
adamturtle / functions.php
Created June 7, 2013 14:12
Replaces the standard "Error with submission" message in Gravity Forms with a more useful summary of the errors.
<?php
function gf_custom_validation_message($message, $form){
return '<div class="validation_error">Please correct the following errors:<br/><div id="error_list"></div></div>';
}
add_filter("gform_validation_message", "gf_custom_validation_message", 10, 2);