Skip to content

Instantly share code, notes, and snippets.

Avatar
🦄
What a mess I've made

Stephen Jennings jennings

🦄
What a mess I've made
View GitHub Profile
@jennings
jennings / git-cheatsheet.md
Last active Sep 27, 2015
Miscellaneous Git commands
View git-cheatsheet.md

Rebase the changes branch-base..branch-head onto the master branch

git rebase --onto master branch-base branch-head

Cherry-pick the changes in B since it diverged from A onto the current branch

git checkout base-branch
git cherry-pick A..B
@jennings
jennings / BatchfileTricks.cmd
Last active Jun 15, 2020
Stupid batch file tricks
View BatchfileTricks.cmd
:: Sleep for N seconds:
ping localhost -n N -w 1
:: Get the date and time (US LOCALE ONLY)
set YEAR=%DATE:~-4,4%
set TWOYEAR=%DATE:~-2,2%
@jennings
jennings / install-rhodecode.rst
Last active Oct 31, 2018
Step-by-step instructions for installing RhodeCode 1.3.6 on Ubuntu Server 12.04 with Nginx 1.2.1 as the reverse proxy. This was written when these were the latest versions; add a comment if the scripts need to change to accommodate changes in newer versions.The script assumes you want to use a SQLite database. Sorry, you'll need to find another …
View install-rhodecode.rst

Setting up RhodeCode on Ubuntu Server 12.04

Goal

  • Everything running on a single Ubuntu Server
  • RhodeCode running in a virtualenv
  • Use SQLite as the database
@jennings
jennings / UpdateQuery.sql
Created Jul 31, 2012
Composing an update query
View UpdateQuery.sql
--- While composing an update query, it's useful to use
--- a SELECT statement first to make sure you're going to
--- update the correct rows. Formatting the query in
--- this manner lets you alternate between SELECT and UPDATE
--- without commenting and uncommenting parts of the query.
SELECT *
FROM
-- UPDATE TableToUpdate --- Use ALT + Drag to highlight this update
@jennings
jennings / osx-setup.sh
Last active Dec 9, 2015
Various OS X setup commands
View osx-setup.sh
# Lots of these are from https://github.com/pangratz/osx-defaults
# Allow key repeat instead of pop-up accent selector in OS X 10.8
defaults write -g ApplePressAndHoldEnabled -bool false
# Always show scrollbars
defaults write NSGlobalDomain AppleShowScrollBars -string "Always"
# Show the ~/Library folder
chflags nohidden ~/Library
@jennings
jennings / UpdateSysinternals.cmd
Created Jan 12, 2013
Automatically update a folder full of Sysinternals tools
View UpdateSysinternals.cmd
@echo off
pushd \\live.sysinternals.com\tools
xcopy * %~dp0 /Y /D
popd
@jennings
jennings / biggitstuff.sh
Created May 22, 2013
Lists all objects in a Git database and lists them in descending order of size.
View biggitstuff.sh
# From: http://naleid.com/blog/2012/01/17/finding-and-purging-big-files-from-git-history/
git rev-list --objects --all | sort -k 2 > allfileshas.txt
git gc && git verify-pack -v .git/objects/pack/pack-*.idx | egrep "^\w+ blob\W+[0-9]+ [0-9]+ [0-9]+$" | sort -k 3 -n -r > bigobjects.txt
for SHA in `cut -f 1 -d\ < bigobjects.txt`; do
echo $(grep $SHA bigobjects.txt) $(grep $SHA allfileshas.txt) | awk '{one=$1; three=$3;$1=$2=$3=$4=$5=$6=""; print one,three,$0}' >> bigtosmall.txt
done;
@jennings
jennings / combine-unrelated-branches.sh
Last active Dec 17, 2015
Tools I'm using to join a few unrelated repositories into one
View combine-unrelated-branches.sh
#!/bin/sh
# Combines together unrelated branches into the current commit.
#
# Usage: combine-unrelated-branches.sh <merge-head>+
#
# combine-unrelated-branches.sh repo1/stuff repo2/stuff
NEW_TREE=$(mktemp -t $(basename $0))
@jennings
jennings / AtlassianWidthTweaks.md
Last active Dec 31, 2015
Makes the repository selectors in Bitbucket wider so long repository names don't get cut off. Works in Chrome or (hopefully) Firefox with Greasemonkey.
View AtlassianWidthTweaks.md

Chrome installation

  1. Click here
  2. Click OK on the warning, the file will be downloaded.
  3. Open chrome://extensions and drag the downloaded file onto the extensions page.

Firefox installation

  1. Install Greasemonkey
  2. Click here and install the script.
@jennings
jennings / web.config
Created Mar 11, 2014
Enable WCF message logging
View web.config
<system.diagnostics>
<sources>
<source name="System.ServiceModel"
switchValue="Critical,Information,ActivityTracing"
propagateActivity="true">
<listeners>
<add name="messages"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData="c:\inetpub\logs\messages.svclog" />
</listeners>
You can’t perform that action at this time.