Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am psebborn on github.
* I am sebbornidentity (https://keybase.io/sebbornidentity) on keybase.
* I have a public key whose fingerprint is 7780 F00C 4E5C 726B A63C A13D 9A18 4FC4 A439 DB01
To claim this, I am signing this object:

#Merging with graphical diff tools

First things first

It's worth trying to just run git difftool or git mergetool as by default most Git installations will configure your OS's diff tool (Meld for Ubuntu, and FileMerge / Opendiff for OSX).

There are two ways of updating the merge tools that Git will use by default. The first is to copy the config straight into your .gitconfig file (usually in your home folder). If you're not happy doing that you can use git config, e.g.:

git config --global diff.tool diffmerge
git config --global diffmerge.cmd "diffmerge --merge --result=\"$MERGED\" \"$LOCAL\" \"$(if test -f \"$BASE\"; then echo \"$BASE\"; else echo \"$LOCAL\"; fi)\" \"$REMOTE\""
@psebborn
psebborn / sentence-case.sass
Last active June 8, 2021 15:29
Sentence case for CSS
// CSS doesn't have a text-transform: sentence case,
// so here's a little mixin to spoof it for you
@mixin sentence-case() {
text-transform: lowercase;
&:first-letter {
text-transform: uppercase;
}
}
@psebborn
psebborn / countCSSRules.js
Last active April 25, 2023 11:43
Count the number of rules and selectors for CSS files on the page. Flags up the >4096 threshold that confuses IE
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {