Skip to content

Instantly share code, notes, and snippets.

View rally25rs's full-sized avatar

Jeff Valore rally25rs

View GitHub Profile
@phette23
phette23 / current-dir-in-iterm-tab-title.sh
Last active January 4, 2024 10:20
Set the iTerm tab title to the current directory, not full path.
# put this in your .bash_profile
if [ $ITERM_SESSION_ID ]; then
export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND";
fi
# Piece-by-Piece Explanation:
# the if condition makes sure we only screw with $PROMPT_COMMAND if we're in an iTerm environment
# iTerm happens to give each session a unique $ITERM_SESSION_ID we can use, $ITERM_PROFILE is an option too
# the $PROMPT_COMMAND environment variable is executed every time a command is run
# see: ss64.com/bash/syntax-prompt.html
@MrSwitch
MrSwitch / saveAs.js
Created August 31, 2012 13:55
FileSaver window.saveAs shim
// window.saveAs
// Shims the saveAs method, using saveBlob in IE10.
// And for when Chrome and FireFox get round to implementing saveAs we have their vendor prefixes ready.
// But otherwise this creates a object URL resource and opens it on an anchor tag which contains the "download" attribute (Chrome)
// ... or opens it in a new tab (FireFox)
// @author Andrew Dodson
// @copyright MIT, BSD. Free to clone, modify and distribute for commercial and personal use.
window.saveAs || ( window.saveAs = (window.navigator.msSaveBlob ? function(b,n){ return window.navigator.msSaveBlob(b,n); } : false) || window.webkitSaveAs || window.mozSaveAs || window.msSaveAs || (function(){
@runesoerensen
runesoerensen / RequireHttpsAttribute.cs
Created April 12, 2011 16:40
RequireHttpsAttribute using X-Forwarded-Proto header
using System;
using System.Web.Mvc;
using RequireHttpsAttributeBase = System.Web.Mvc.RequireHttpsAttribute;
namespace AppHarbor.Web
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true,
AllowMultiple = false)]
public class RequireHttpsAttribute : RequireHttpsAttributeBase
{
#!/bin/sh
# Use BeyondCompare as difftool for git in cygwin.
# git config --global difftool.bc3.cmd "beyondcompare-diff.sh \"\$LOCAL\" \"\$REMOTE\""
# git difftool -t bc3 branch1..branch2
# Reference: http://www.tldp.org/LDP/abs/abs-guide.pdf
library=githelperfunctions.sh
#[ -f $library ] && . $library