Skip to content

Instantly share code, notes, and snippets.

View nathos's full-sized avatar

Nathan Henderson nathos

View GitHub Profile
@peff
peff / git-du
Last active May 17, 2019 07:43
git-du script
#!/usr/bin/perl
#
# Generate a listing of all paths ever used in the repository, along with the
# disk space used by the path throughout the entire history. Note that sizes
# for trees are cumulative; they include the sizes of all of the paths below
# them, in addition to the tree storage itself. All sizes are in bytes, and
# reflect git's delta and zlib compression.
#
# One caveat is that this is just the _current_ on-disk size. The on-disk size
# of each object may change if git repacks and chooses different delta bases,
@traumverloren
traumverloren / switch-to-rbenv.md
Last active March 29, 2024 00:54
Switch from RVM to rbenv

Switch from RVM to rbenv:

Get Rid of RVM if it's installed:

rvm implode

Cleanup your .bash_profile/.bashrc/.zshrc file to remove RVM from the path:

You should have something like this left from RVM. Delete it from the file. ``[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"```

@Vj3k0
Vj3k0 / .gitignore
Created January 4, 2016 11:32
Gitignore for Electron application development
#directories
bower_components
node_modules
dist
#files
*.tgz
*.log
@btoews
btoews / github_keychain.sh
Created August 14, 2015 18:43
Store GitHub access token in keychain
#!/bin/bash
echo -n "GitHub username: "
read username
echo -n "GitHub personal access token: "
read token
echo "Storing GitHub access token in keychain."
security add-generic-password -s github_access_token -a $username -w $token
@alexisg
alexisg / Gruntfile.js
Last active September 23, 2015 08:05
Webhook.com libsass, autoprefix with css livereload flow.
// This setup will compile sass, run autoprefixer and then launch webhook's default grunt tasks.
// I also uses webhook's build-static task so that it only builds the css and
// allows livereload to refresh the css alone instead of refreshing the entire page.
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
sass: {
@skingsland
skingsland / GithubPullRequestDeficiencies.md
Last active April 1, 2022 05:04
Reasons why Crucible/Fisheye is better than Github (Enterprise) Pull Requests for reviewing code

GENERAL:

  • You can't include commits from different repos in a single code review using github pull requests, whereas you can with Crucible code reviews.
  • It's risky to use a pull request for code that isn't ready to be merged yet. What if someone doesn't see the "DON'T MERGE" comment/title, and clicks the big green merge button?

VIEWING:

  • You can't adjust the line width in which files are displayed, even if you make your browser window wider than the page. Some XML/HTML content extends well past 80 characters.
    • There are numerous Chrome extensions which purport to provide this feature, but I haven't been able to get any of them to work for Github:Enterprise.
  • There is no toggle in the Github UI that lets you ignore white space, so if a change involved indenting a lot of lines, you'll have a hard time figuring out what changed. In Crucible, you can choose to ignore white space.
  • You can add ?w=1 to any diff URL to ignore whitespace, however. Not sure why Github hides this behind a [secret](h
@nk9
nk9 / largestFiles.py
Last active December 5, 2024 18:54
Python script to find the largest files in a git repository.
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Python script to find the largest files in a git repository.
# The general method is based on the script in this blog post:
# http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
#
# The above script worked for me, but was very slow on my 11GB repository. This version has a bunch
# of changes to speed things up to a more reasonable time. It takes less than a minute on repos with 250K objects.
#
#!/bin/sh
if [[ $# != 2 ]] ; then
echo "Usage: $0 <Size in GB> <Name>"
exit 1
fi
key=$(openssl rand -base64 100 | sed -e 'N;s/\n//')
echo SAVE THIS KEY: $key

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