Skip to content

Instantly share code, notes, and snippets.

@keithws
keithws / trash.sh
Last active August 29, 2015 14:14
trash bash script
#
# trash command
# move files to the trash
#
function trash {
if [[ "$@" == "" ]]
then
echo "usage: trash file ..."
return 64
fi
@keithws
keithws / gist:7648530
Last active December 29, 2015 09:09
Clear Mac OS X Terminal with Control+L
<?xml version="1.0"?>
<root>
<item>
<name>Clear Terminal with standard control code</name>
<item>
<name>Command+L to Control+L (only in Terminal)</name>
<identifier>private.l_plus_command_to_l_plus_control</identifier>
<only>TERMINAL</only>
<autogen>__KeyToKey__ KeyCode::L, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_COMMAND, KeyCode::L, ModifierFlag::CONTROL_L</autogen>
</item>
@keithws
keithws / getBlogContributors.ftl
Created April 25, 2013 01:41
FreeMarker template code to create a list of users sorted by their last blog post publish date across many blogs or a single blog in Jive SBS. Tested on version 4.5.5.2 in the blog-macros.ftl file.
<#function getBlogContributors blogs>
<#local contributors = [ ]>
<#local contributorsWithDate = [ ]>
<#local blogPostObjectType = 38>
<#local resultFilter = action.getResultFilter()>
<#if blogs?has_content>
<#list blogs as blog>
<#list blog.contributors as contributor>
<#if (!(contributors?seq_contains(contributor)))>
<#-- check if user is blocked -->