Skip to content

Instantly share code, notes, and snippets.

View josephschmitt's full-sized avatar

Joe Schmitt josephschmitt

View GitHub Profile
@josephschmitt
josephschmitt / push-chunks.sh
Created April 8, 2022 18:15
Splits commits into chunks to push. Useful for when needing to push a ton of commits to a remote all at once.
#!/usr/bin/env bash
# Adjust the following variables as necessary
REMOTE=test-repo
BRANCH=$(git rev-parse --abbrev-ref HEAD)
BATCH_SIZE=500
# check if the branch exists on the remote
if git show-ref --quiet --verify refs/remotes/$REMOTE/$BRANCH; then
# if so, only push the commits that are not on the remote already
@josephschmitt
josephschmitt / 100.fish
Last active February 8, 2021 15:55
Fish config
function 100
echo "
|--------------------------------------------- 100 ------------------------------------------------|
"
end
@josephschmitt
josephschmitt / .gitconfig
Last active February 8, 2021 15:51
Global .gitconfig file
[alias]
am = "!f() { git add .; git commit --amend; }; f"
bl = branch --list
bd = "!f() { git branch -D $1; }; f"
# Create a new branch based off origin/master or switch to a branch if it already exists
br = "!f() { cur_branch=$(git rev-parse --verify refs/heads/$1 2> /dev/null); if [[ -z $cur_branch ]]; then git checkout -b $1 ${2:-origin/master} --no-track; else git checkout $1; fi }; f"
# Switch to a new branch and delete the old branch
brd = "!f() { cur_branch=$(git rev-parse --abbrev-ref HEAD); git br $1 $2; git branch -d $cur_branch --force; }; f"
c = "!f() { if [[ ! -z "$1" ]]; then git commit -m \"$1\"; else git commit; fi; }; f"
ca = "!f() { git add .; git c \"$1\"; }; f"
@igorkulman
igorkulman / CompareTools.plist
Last active November 7, 2020 07:06
Visual Studio Code as a merge tool for Git Tower. Place both files to ~/Library/Application Support/com.fournova.Tower2/CompareTools/ and restart Git Tower
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>ApplicationIdentifier</key>
<string>com.microsoft.VSCode</string>
<key>ApplicationName</key>
<string>Visual Studio Code</string>
@redolent
redolent / renice-audio.sh
Created April 15, 2015 20:50
Fix Bluetooth Audio on Mac
#!/bin/bash
list="$(
sudo ps -A \
| grep -iE '([h]ear|[f]irefox|[b]lue|[c]oreaudiod)' \
| cut -c 1-90
)"
pids=$( cut -c 1-6 <<< "$list" )
@lukehoban
lukehoban / es6features.md
Last active December 6, 2019 01:50
ECMAScript 6 Features

Note: Up to date version now at https://github.com/lukehoban/es6features

ECMAScript 6

Introduction

ECMAScript 6 is the upcoming version of the ECMAScript standard. This standard is targetting ratifcation in December 2014. ES6 is a significant update to the language, and the first update to the language since ES5 was standardized in 2009. Implementation of these features in major JavaScript engines is underway now.

See the draft ES6 standard for full specification of the ECMAScript 6 language.

ES6 includes the following new features:

@davatron5000
davatron5000 / Sublime Text Setup.md
Last active April 15, 2023 15:39
A new user's guide to SublimeText 2. Estimated reading time: 2 mins. Estimated workthrough time: 12 minutes.

Make it useful

  • Install Package Control. For SublimeText 2, paste the following in Terminal:
import urllib2,os; pf='Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler( ))); open( os.path.join( ipp, pf), 'wb' ).write( urllib2.urlopen( 'http://sublime.wbond.net/' +pf.replace( ' ','%20' )).read()); print( 'Please restart Sublime Text to finish installation')

From here on out, use Package Control to install everything. +Shift+P, then type Install to get a list of installable packages you can 'livesearch through. After installing plugins, they should be running.

@robmiller
robmiller / .gitconfig
Created July 17, 2013 07:52
Some useful Git aliases that I use every day
#
# Working with branches
#
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"
@leesmith
leesmith / commit-message-syntax.txt
Created December 31, 2011 06:05
Pivotal Tracker post-commit message syntax
https://www.pivotaltracker.com/help/api?version=v3#github_hooks
https://www.pivotaltracker.com/help/api?version=v3#scm_post_commit_message_syntax
SCM Post-Commit Message Syntax
To associate an SCM commit with a specific Tracker story, you must include a special syntax in the commit message to indicate one or more story IDs and (optionally) a state change for the story. Your commit message should have square brackets containing a hash mark followed by the story ID. If a story was not already started (it was in the "not started" state), a commit message will automatically start it. For example, if Scotty uses the following message when committing SCM revision 54321:
[#12345677 #12345678] Diverting power from warp drive to torpedoes.
@paulirish
paulirish / data-markdown.user.js
Last active February 6, 2024 10:41
*[data-markdown] - use markdown, sometimes, in your HTML
// ==UserScript==
// @name Use Markdown, sometimes, in your HTML.
// @author Paul Irish <http://paulirish.com/>
// @link http://git.io/data-markdown
// @match *
// ==/UserScript==
// If you're not using this as a userscript just delete from this line up. It's cool, homey.