Skip to content

Instantly share code, notes, and snippets.

@scy
scy / delete-from-repo.md
Created September 20, 2013 11:54
How to delete a file from a Git repository, but not other users' working copies

How to delete a file from a Git repository, but not other users' working copies

Suppose you have, by mistake, added your IDE's project folder (you know, these .idea folders with all kinds of local paths and configuration data and settings in it) to the Git repository of your project. (We're talking about a whole folder here, but the same rules apply to individual files as well.)

Of course, you only realize that two days after the fact and have already pushed it, and your colleagues have already pulled it. They use the same IDE as you do, so whenever they change a setting or fix paths, they can either

  • commit that, causing nasty merge conflicts for you and others or
  • ignore the changes and carry around a modified file until the end of time without ever committing it.

Why .gitignore won't help

@sck
sck / makeAnyPdfSearchable.rb
Created June 24, 2012 11:23
Use ScanSnap's 'Scan to Searchable PDF' even with PDFs not created by ScanSnap
#! /usr/bin/env ruby
require 'tmpdir'
def fixed?(fn) fn =~ /\.searchable\.pdf/; end
def searchable_fn(fn)
return fn if fixed?(fn)
"#{File.dirname(fn)}/#{File.basename(fn, File.extname(fn))}.searchable.pdf"
end
@rjbs
rjbs / clarify.pl
Created March 25, 2011 03:22
make it easy to see CRLF anomalies
use strict;
use Term::ANSIColor;
my $CR = "\x0d";
my $LF = "\x0a";
my %rep = (
$CR => color('bold magenta') . "␍",
$LF => color('bold yellow') . "␤",
'' => color('bold black'), # If you can't read bright black on your terminal,
2010 ENGLISH GEEKY ADVENT CALENDARS:
http://advent.rjbs.manxome.org/2010/
http://advent.perldancer.org/2010
http://www.catalystframework.org/calendar
http://perladvent.pm.org/2010/
http://sysadvent.blogspot.com/
http://perl-users.jp/articles/advent-calendar/2010/english/
http://perl6advent.wordpress.com/