Skip to content

Instantly share code, notes, and snippets.

View binarysprocket's full-sized avatar

Binary Sprocket binarysprocket

View GitHub Profile
@craigeley
craigeley / doing_timer.sh
Created December 2, 2015 02:15
A script that shows elapsed time of the current `doing` task in TextBar. Change the path to your doing in line 5.
if [[ `/usr/local/bin/doing last` == *"@done"* ]]; then
echo "💬";
else
name=`/usr/local/bin/doing last | sed 's/@.*//g'`;
start=`grep -o -m 1 "\d*-\d*-\d*\s\d*:\d*\s" /path/to/what_was_i_doing.md`;
date1=`date -j -f '%Y-%m-%d %H:%M ' "$start" +"%s"`;
now=`date -j +"%s"`;
diff=$(($now-$date1));
echo "$name 🕗$(printf "%02d" $(($diff / 3600))):$(printf "%02d" $((($diff / 60) % 60)))"
fi
@gooddadmike
gooddadmike / Slackbot Responses - rock paper scissors lizard spock.md
Last active May 10, 2016 18:02
Slackbot Responses - rock, paper, scissors, spock, lizard.

This was inspired by Big Bang Theory and Sam Kass

Supports both my standard rock paper scissors and the "lizard spock expansion (this gist)

Follow directions for standard rock paper scissors first to set up emoji.

update: I decided ✂️ is nothing like ✌️ so should not be part of this

Emoji Alias for Expansion update: There is now a :spock-hand: emoji (doesn't show in github yet)

@jaredatch
jaredatch / gist:1562aa6de1bc33db0bb3
Created February 13, 2015 17:20
Change author box title text in Genesis
<?php
/**
* Change "About" text in author box titles for single posts
*
* @since 1.0.0
* @param string $title
* @param string $context
* @return string
*/
function ja_author_box_title( $title, $context ) {
@blogjunkie
blogjunkie / functions.php
Last active March 16, 2019 01:06
Custom page titles for co-authors with WordPress SEO
<?php
/**
* Custom page titles for Guest Authors with WordPress SEO
* Returns "[author name]&#39;s articles on [site name]"
*
*/
add_filter('wpseo_title', 'my_co_author_wseo_title');
function my_co_author_wseo_title( $title ) {
@bekarice
bekarice / edit-woocommerce-checkout-template.php
Last active March 27, 2023 23:12
Add content and notices to the WooCommerce checkout - sample code
/**
* Each of these samples can be used - note that you should pick one rather than add them all.
*
* How to use WC notices: https://github.com/woothemes/woocommerce/blob/master/includes/wc-notice-functions.php#L96
* Tutorial: http://www.skyverge.com/blog/edit-woocommerce-templates/
**/
/**
* Add a content block after all notices, such as the login and coupon notices.
*
// Smooth scrolling anchor links
function ea_scroll( hash ) {
var target = $( hash );
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
var top_offset = 0;
if ( $('.site-header').css('position') == 'fixed' ) {
top_offset = $('.site-header').height();
}
if( $('body').hasClass('admin-bar') ) {
@mutewinter
mutewinter / FantasticReminders.md
Last active May 27, 2018 06:12
Fantastic Reminders - An Alfred Workflow to Add Reminders to Reminders.app via Fantastical

Workflow icon Fantastic Reminders

Alfred Workflow to add reminders to Reminders via Fantastical's amazing natural language processing.

Usage

r put laundry in dryer in 35 min
r wake up at 6:30am every day
r party on 1/1/2025 at 12am
@n8henrie
n8henrie / txt_to_reminders.applescript
Last active March 11, 2024 17:04
Demonstration of using AppleScript with Reminders.app
--taken from http://benguild.com/2012/04/11/how-to-import-tasks-to-do-items-into-ios-reminders/#comment-1346894559
--set theFileContents to (read file "Users:n8henrie:Desktop:Reminders.txt") -- Change this to the path to your downloaded text file with your tasks in it! (Note the : instead of a / between folders) Or, just name them Reminders.txt and put them in your downloads folder
--set theLines to paragraphs of theFileContents
set theLines to {"task name 1", "task name 2"}
repeat with eachLine in theLines
tell application "Reminders"
set mylist to list "Your List Name"
tell mylist
make new reminder at end with properties {name:eachLine, due date:date "7/10/2014 3:00 PM"}
@jaredatch
jaredatch / gist:9376496
Created March 5, 2014 21:01
Customize comment heading
<?php
/**
* Custom comment heading
*
* @since 1.0.0
* @param string $title
* @return string
*/
function ja_comment_heading( $title ) {
return '<h3><strong>' . get_comments_number() . ' Responses to</strong> ' . get_the_title() . '</h3>';
@jaredatch
jaredatch / gist:9376451
Created March 5, 2014 20:59
Add new default avatar option
<?php
/**
* Add new avatar to be select as a default
*
* @since 1.0.0
* @param array $defaults
* @return array
*/
function ja_add_avatar_default( $defaults ) {
$new = get_stylesheet_directory_uri() . '/images/default-avatar.jpg';