Skip to content

Instantly share code, notes, and snippets.

@dcarney
dcarney / git-svn notes.txt
Created August 3, 2011 23:58
Some hastily-scribbled notes about using git-svn with our existing git repos
Set the SVN_EDITOR var:
# export SVN_EDITOR=vim
==================================
SETTING UP A NEW SVN PROJECT
==================================
Create a new SVN "repo" (aka folder):
(NOTE: https is required for our new SVN, as well as --username)
# svn mkdir https://some/url/path/to/newRepo --username first.last
@arnorhs
arnorhs / gist:1517095
Created December 24, 2011 10:40 — forked from tessro/gist:1515117
gitopen - Open all files from a git diff or show command
#!/bin/bash
# This script will open all files from a git diff or a git show in vim.
# My bash skills are a bit primitive so this can probably be done more intelligently
# Usage:
# gitopen -- opens all added files that have changed since HEAD
# gitopen diff HEAD -- these are the default parameters
# gitopen diff master -- opens files that have changed from master
@luigi
luigi / counter.rb
Last active October 27, 2015 00:24
Calculate the percentage of tweets linking to a website that came from the Tweet button
#
# Before running:
# $ gem install twitter
#
# Register a Twitter application to get auth credentials:
# https://dev.twitter.com/apps
#
# To run:
# $ ruby counter.rb upworthy.com 500
#
githubAccount() { # Syntax: githubAccount <file>
# Check for Github account name
if [[ "$githubAccount" == '' ]]; then
if [[ ! -f "$file" ]]; then
# If .github doesn't exist then ask for the name and save it
echo -n "What is your Github name? "
read githubAccount
touch "$file"
echo "$githubAccount" > "$file"
else
@thesharp
thesharp / ML, Python and virtualenv.md
Created July 25, 2012 22:56
Quick virtualenv fix on Mountain Lion

Quick virtualenv fix on Mountain Lion

Overview

It appears that Apple somehow broke Python in Mountain Lion, so even with the latest Command Line Tools and Xcode 4.4 virtualenv won't properly work. During virtual environment creation it will try to install easy_install inside /Library hierarchy. So let's give it a quick workaround. Let's install custom python into your $HOME-directory using pythonbrew!

Installing proper Command Line Tools

Without the Apple Mac Developer account you won't even see the proper download link for the latest CL Tools and the old one won't work on ML. So here's the link: http://goo.gl/iBTXh. It points towards the Apple website so don't worry.

@ttscoff
ttscoff / rtftomarkdown.rb
Created October 9, 2012 21:05
Convert RTF/DOC files to Markdown via Textutil
#!/usr/bin/ruby
=begin
Usage: rtftomarkdown.rb FILENAME.rtf
Uses textutil, available on Mac only (installed by default)
Outputs to STDOUT
Notes:
Links are replaced with Markdown references (duplicate links combined).

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

#!/bin/bash
echo '#!/bin/bash'
echo ''
echo 'failed_items=""'
echo 'function install_package() {'
echo 'echo EXECUTING: brew install $1 $2'
echo 'brew install $1 $2'
echo '[ $? -ne 0 ] && $failed_items="$failed_items $1" # package failed to install.'
echo '}'
@koreno
koreno / README.md
Last active April 1, 2020 10:44
'rebaser' improves on 'git rebase -i' by adding information per commit regarding which files it touched.

Prebase

git-prebase improves on 'git rebase -i' by adding information per commit regarding which files it touched.

  • Each file gets an alpha-numeric identifier at a particular column, a list of which appears below the commit list. (The identifiers wrap around after the 62nd file)
  • Commits can be moved up and down safely (without conflicts) as long as their columns don't clash (they did not touch the same file).

Installation

Add the executable to your path and git will automatically expose it as

@uraimo
uraimo / dnsovertls.md
Last active March 22, 2024 20:55
Configure your Mac to use DNS over TLS