Skip to content

Instantly share code, notes, and snippets.

View pythoninthegrass's full-sized avatar

pythoninthegrass

View GitHub Profile
@gruber
gruber / Liberal Regex Pattern for All URLs
Last active March 20, 2024 20:28
Liberal, Accurate Regex Pattern for Matching All URLs
The regex patterns in this gist are intended to match any URLs,
including "mailto:foo@example.com", "x-whatever://foo", etc. For a
pattern that attempts only to match web URLs (http, https), see:
https://gist.github.com/gruber/8891611
# Single-line version of pattern:
(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))
@richkilmer
richkilmer / vmrun
Created November 5, 2010 17:30
vmrun is a command you can execute to externally script vmware fusion VMs
/Library/Application\ Support/VMware\ Fusion/vmrun
vmrun version 3.1.1 build-282344
Usage: vmrun [AUTHENTICATION-FLAGS] COMMAND [PARAMETERS]
AUTHENTICATION-FLAGS
--------------------
@mathiasbynens
mathiasbynens / appify
Created November 12, 2010 13:46 — forked from subtleGradient/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
@thimbl
thimbl / script.sh
Created March 19, 2011 00:43
shell script to create user accounts
#!/bin/bash
ROOT_UID=0
SUCCESS=0
E_USEREXISTS=70
# Run as root, of course. (this might not be necessary, because we have to run the script somehow with root anyway)
if [ "$UID" -ne "$ROOT_UID" ]
then
echo "Must be root to run this script."
exit $E_NOTROOT
@VonC
VonC / .gitconfig
Last active May 19, 2018 08:51
My global git config
[user]
name = VonC
email = vonc@laposte.net
[core]
; just making sure those eol's stay as they are
autocrlf = false
; see http://stackoverflow.com/a/22208863/6309 (Git/Bash is extremely slow in Windows 7 x64, until fix in msysgit 1.9.4)
fscache = true
[alias]
; from http://www.jukie.net/bart/blog/pimping-out-git-log, with author displayed
@virtualstaticvoid
virtualstaticvoid / iptables_rules.sh
Created June 14, 2011 08:58
25 Most Frequently Used Linux IPTables Rules Examples
# Modify this file accordingly for your specific requirement.
# http://www.thegeekstuff.com
# 1. Delete all existing rules
iptables -F
# 2. Set default chain policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
@RobFreiburger
RobFreiburger / removeOffice2011.sh
Created June 16, 2011 04:51
Office 2011 for Mac Uninstaller
#!/bin/sh
# Credit to http://www.officeformachelp.com/office/install/remove-office/
osascript -e 'tell application "Remote Desktop Connection" to quit'
osascript -e 'tell application "Microsoft Document Connection" to quit'
osascript -e 'tell application "Microsoft Messenger" to quit'
osascript -e 'tell application "Microsoft Communicator" to quit'
osascript -e 'tell application "Microsoft Outlook" to quit'
osascript -e 'tell application "Microsoft Excel" to quit'
@cyakimov
cyakimov / gist:1049915
Created June 27, 2011 21:41
CentOS / Fedora 'build-essential' equivalent
yum groupinstall "Development Tools"
@fnichol
fnichol / macosx_bootstrap.sh
Last active January 31, 2022 21:09
Mac OS X 10.7/10.8/10.9 (Lion/Mountain Lion/Mavericks) Bootstrapping
#!/usr/bin/env bash
set -e
# # Mac OS X 10.7/10.8/10.9/10.10 Bootstrapping
#
# ## Pre-requisites
#
# 1. Set your hostname: In **System Preferences** go to **Sharing** and enter
# the name in **Computer Name**
# 2. Run **Software Update** and reboot if necessary