Skip to content

Instantly share code, notes, and snippets.

View dotsara's full-sized avatar

Sara dotsara

View GitHub Profile
@dotsara
dotsara / reminders.md
Last active April 12, 2018 15:50
Stuff that tends to be muscle memory while I'm at a job/on a project, but then I forget when contexts switch.

interrogating tests

Rails environment, using rspec: spit out objects and things to the console with puts

it 'checking a thing' do
puts activity # where activity is the name of an object
puts activity.class
# etc
@gvaughn
gvaughn / copr.md
Last active January 30, 2024 16:11
git copr alias

I'd like to share some git aliases that you might find useful if you handle pull requests from others.

Add these to your ~/.gitconfig in the [alias] section:

copr = "!f() { git fetch -fu origin refs/pull/$1/head:pr-$1; git checkout pr-$1; } ; f"
prunepr = "!git for-each-ref refs/heads/pr-* --format='%(refname:short)' | while read ref ; do git branch -D $ref ; done"

Now you can "git copr #{pr_number}" (check out pull request is the mnemonic) and it will pull down the PR in a local branch of pr-#{pr_number} and check it out for you. To do it right, you must pronounce it "Copper" with a James Cagney gangster accent.

@mandiwise
mandiwise / Count lines in Git repo
Last active June 6, 2024 06:11
A command to calculate lines of code in all tracked files in a Git repo
// Reference: http://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository
$ git ls-files | xargs wc -l
@glv
glv / trouble-free-bundler.md
Last active March 16, 2018 14:50
This is a thing I wrote over a year ago for the internal LivingSocial wiki. There's nothing LS-specific about it, and it seems generally useful, so …

Trouble-Free Bundler

Every couple of weeks, I hear someone complaining about some difficulties with Bundler. Yesterday, it happened twice. But somehow I just never have those difficulties. I'm not saying Bundler is perfect; certainly in its early days it wasn't even close. But for the past two years it's been incredibly solid and trouble-free for me, and I think a large part of the reason is the way I use it. Bundler arguably does too much, and just as with Git, a big part of it is knowing what not to do, and configuring things to avoid the trouble spots.

@quirkey
quirkey / Creeds.md
Created June 8, 2013 18:17
The current state of the Paperless Post Dev Teams Creeds http://dev.paperlesspost.com

The Paperless Post Developer Creeds

For as long as we've been a team, we've tried hard to work with a set of guiding principles. These are not hard and fast rules, but rather a set of informal maxims that help us to make decisions, prioritize our work, and generally ship a ton of quality code. We're here to work hard, have fun, and make our customers happy, and we feel that these principles can help us make that happen.

Fixing > Complaining

We work in an ever changing system. Yesterday's awesome work is today's legacy code. Complaining that a piece of code or system doesn't work or isn't correct will not fix it. We are all responsible for this "bad" code which means we're also responsible for making it better.

Helping > Winning

@cmod
cmod / minmal_twitter.css
Created September 13, 2012 18:45 — forked from maxfenton/gist:3670929
Twitter stylebot
/* -------------------------------------------------
MINIMAL TWITTER FOR FLUID / USERSTYLES
Special thanks to:
Max Fenton (@maxfenton) for kicking this off
------------------------------------------------- */
.trends, .bird-topbar-etched, .wtf-module, .site-footer, .topics {
@avdi
avdi / apology101.markdown
Created March 22, 2012 17:36
How to apologize

Chances are your head's spinning right now. That accusation of bias caught you off guard, you got kind of defensive, and now all hell has broken loose. You're feeling attacked on all sides. You're a good person at heart, and having all these people treat you like the antichrist is pretty upsetting.

You need to say something, but you're probably not in the best headspace to write copy right now. So to help you along, here's my 100% guaranteed-or-you-money-back scandal defusement apology template: