Skip to content

Instantly share code, notes, and snippets.

@jbgo
jbgo / git-recover-branch.md
Last active May 23, 2024 12:29
How to recover a git branch you accidentally deleted

UPDATE: A better way! (August 2015)

As pointed out by @johntyree in the comments, using git reflog is easier and more reliable. Thanks for the suggestion!

 $ git reflog
1ed7510 HEAD@{1}: checkout: moving from develop to 1ed7510
3970d09 HEAD@{2}: checkout: moving from b-fix-build to develop
1ed7510 HEAD@{3}: commit: got everything working the way I want
70b3696 HEAD@{4}: commit: upgrade rails, do some refactoring
@peelman
peelman / bbdiff
Created May 22, 2012 21:12
Use TextMate to impersonate BBEdit for use with GitBox
#!/bin/bash
diff -u $1 $2 | mate -w
@ccstone
ccstone / BBEdit-TextWrangler_RegEx_Cheat_Sheet.txt
Last active October 26, 2024 06:05
BBEdit-TextWrangler Regular Expression Cheat-Sheet
————————————————————————————————————————————————————————————————————————————————————————————————————
BBEdit / BBEdit-Lite / TextWrangler Regular Expression Guide Modified: 2018/08/10 01:19
————————————————————————————————————————————————————————————————————————————————————————————————————
NOTES:
The PCRE engine (Perl Compatible Regular Expressions) is what BBEdit and TextWrangler use.
Items I'm unsure of are marked '# PCRE?'. The list while fairly comprehensive is not complete.
@magnetikonline
magnetikonline / README.md
Last active July 19, 2024 18:48
Install Parallels version 10/11/12/13 tools on Ubuntu server guest.

Install OSX Parallels version 10/11/12/13 tools on Ubuntu server guest

Have tested these instructions successfully under Ubuntu 16.04LTS and 14.04LTS.

  • Create Ubuntu server instance under Parallels (obviously).
  • Start VM, goto Actions - Install Parallels Tools... to mount the ISO image.
    • Note: if this fails, or updating tools for an existing guest you can do the following:
    • Goto Devices > CD/DVD 1 > Connect Image....
    • Select the following ISO image: /Applications/Parallels Desktop/Contents/Resources/Tools/prl-tools-lin.iso.
    • This will mount the tools CD image.
@pudquick
pudquick / word_magic.py
Last active August 29, 2015 14:17
Saturday morning fun.
import sys, os.path, csv
# Run me like: python word_magic.py inputfile.csv output_dir
KEEP_WORD = True
# We're being lazy here - no main for us, it's Saturday
in_filename = sys.argv[1]
out_dir = os.path.abspath(sys.argv[2])
@srpomeroy
srpomeroy / common_functions.rb
Created July 6, 2018 03:23
Commonly used functions in RightScale CATs
# Required prolog
name 'LIB - Common functions'
rs_ca_ver 20160622
short_description "Common functions"
package "common/functions"
# Checks if the account supports the selected cloud
define checkCloudSupport($cloud_name, $param_location) do
# Gather up the list of clouds supported in this account.
@spokanemac
spokanemac / applecare_status.sh
Created November 6, 2024 00:37
If Apple Care is active, there may be a file in the primary Users Library folder.
#!/bin/sh
### If Apple Care is active, there may be a file in the primary Users Library folder.
### Get the current user's username and home folder location
loggedInUser=$(ls -l /dev/console | awk '{ print $3 }')
myUserHome=$(dscl . read /Users/$loggedInUser NFSHomeDirectory | awk '{print $NF}')
echo "The logged in user is $loggedInUser"