Skip to content

Instantly share code, notes, and snippets.

@vitorhsb
vitorhsb / diffmerge-linux.txt
Created January 11, 2018 00:23
Set DiffMerge as Git merge and diff tool (Linux)
git config --global merge.tool diffmerge
git config --global mergetool.diffmerge.cmd "/usr/bin/diffmerge --merge --result=\"\$MERGED\" \"\$LOCAL\" \"\$BASE\" \"\$REMOTE\""
git config --global mergetool.diffmerge.trustExitCode true
git config --global mergetool.keepBackup false
git config --global diff.tool diffmerge
git config --global difftool.diffmerge.cmd "/usr/bin/diffmerge --nosplash \"\$LOCAL\" \"\$REMOTE\""
@vitorhsb
vitorhsb / diffmerge-macos-result.txt
Last active January 11, 2018 00:07
Setup DiffMerge as Git merge and diff tool (Mac OS) - Resulting config
[diff]
tool = diffmerge
[merge]
tool = diffmerge
...
[mergetool "diffmerge"]
cmd = /usr/local/bin/diffmerge --merge --result=\"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\"
@vitorhsb
vitorhsb / diffmerge-macos.txt
Last active November 2, 2021 15:12
Setup DiffMerge as Git merge and diff tool (Mac OS)
git config --global merge.tool diffmerge
git config --global mergetool.diffmerge.cmd "/usr/local/bin/diffmerge --merge --result=\"\$MERGED\" \"\$LOCAL\" \"\$BASE\" \"\$REMOTE\""
git config --global mergetool.diffmerge.trustExitCode true
git config --global mergetool.keepBackup false
git config --global diff.tool diffmerge
git config --global difftool.diffmerge.cmd "/usr/local/bin/diffmerge --nosplash \"\$LOCAL\" \"\$REMOTE\""
@vitorhsb
vitorhsb / ErrorHandler.php
Created May 18, 2016 18:23 — forked from bastman/ErrorHandler.php
PHP ErrorHandler Example: Extended Symfony2 AND Custom Errors
<?php
/**
* Created by JetBrains PhpStorm.
* User: seb
* Date: 11/20/12
* Time: 4:05 PM
* To change this template use File | Settings | File Templates.
*/
namespace Symfony\Component\HttpKernel\Debug;
class ErrorHandler
@vitorhsb
vitorhsb / tab.bash
Last active August 29, 2015 14:16 — forked from bobthecow/tab.bash
#!/bin/bash
#
# Open new Terminal tabs from the command line
#
# Author: Justin Hileman (http://justinhileman.com)
#
# Installation:
# Add the following function to your `.bashrc` or `.bash_profile`,
# or save it somewhere (e.g. `~/.tab.bash`) and source it in `.bashrc`
#
/* The basic CSS shortcuts stuff you should know */
w100
/* width: 100px; */
h25.5p
/* height: 25.5%; */
m55p
/* margin: 55%; */
@vitorhsb
vitorhsb / command.js
Last active August 29, 2015 13:56
Backtick - Add to Kippt it command
(function(){
var w=window.open('https://kippt.com/extensions/new/?url='+encodeURIComponent(document.location.href)+'&title='+encodeURIComponent(document.title)+'&source=bp1&notes='+encodeURIComponent(''+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text)),'kippt','width=400,height=245,location=0,links=0,scrollbars=0,toolbar=0');
if(w) {
setTimeout(function() {w.focus()}, 100);
} else {
alert('It seems that you have a popup blocker. Please, hold the CTRL-key and try again.')
}
})();
@vitorhsb
vitorhsb / ios_zoom_viewport.html
Created May 10, 2013 13:33
iOS viewport meta to remove automatic zoom when keyboard is shown.
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
@vitorhsb
vitorhsb / gist:3157616
Created July 21, 2012 23:56
Image replacement (logo image, text hidden)
.hide-text {
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}
@vitorhsb
vitorhsb / jquery.ba-tinypubsub.js
Created June 20, 2012 10:56 — forked from cowboy/HEY-YOU.md
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);