Skip to content

Instantly share code, notes, and snippets.

@alanmarcos
alanmarcos / gist:8abdeab0ace73b3e3f88
Last active August 29, 2015 14:14
make any element clickable
View gist:8abdeab0ace73b3e3f88
$('[data-clickable]').css('cursor', 'pointer').on('click', function(){
var $this = $(this),
elm = $this.data('clickable'),
url = elm.trim()? $this.find(elm).attr('href') : $this.find('a').attr('href');
window.location.href = url;
return false;
});
@alanmarcos
alanmarcos / gist:5e77f24f981517ed1bf3
Created February 19, 2015 18:58
"Open with Sublime Text 3" to files and folders
View gist:5e77f24f981517ed1bf3
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text]
"Icon"="C:\\Program Files\\Sublime Text 3\\sublime_text.exe"
[HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text\command]
@="C:\\Program Files\\Sublime Text 3\\sublime_text.exe \"%1\""
[HKEY_CLASSES_ROOT\Directory\Background\shell\Sublime Text]
@alanmarcos
alanmarcos / gist:511a1223b12e126a73bb
Last active August 29, 2015 14:15
jquery .exists(), to check if an element exists in the dom
View gist:511a1223b12e126a73bb
;(function ($) {
$.fn.exists = function () {
return this.length > 0? true : false
};
}(jQuery));
View gist:7a9e2d07d2c716fabe36
<div class="grid-stack-item" data-gs-x="0" data-gs-y="0" data-gs-width="6" data-gs-height="4"><div class="grid-stack-item-content">1</div></div>
<div class="grid-stack-item" data-gs-x="4" data-gs-y="4" data-gs-width="4" data-gs-height="4"><div class="grid-stack-item-content">2</div></div>
<div class="grid-stack-item" data-gs-x="8" data-gs-y="40" data-gs-width="2" data-gs-height="2" data-gs-min-width="2" data-gs-no-resize="yes"><div class="grid-stack-item-content"> <span class="fa fa-hand-o-up"></span> Drag me! <a href="#" class="close">Fechar</a></div></div>
<div class="grid-stack-item" data-gs-x="10" data-gs-y="4" data-gs-width="2" data-gs-height="2"><div class="grid-stack-item-content">4</div></div>
<div class="grid-stack-item" data-gs-x="0" data-gs-y="6" data-gs-width="2" data-gs-height="2"><div class="grid-stack-item-content">5</div></div>
View gist:86dd4d67a3059f27308e
replace: {
start: {
src: ['<%= path %>/header.php', '<%= path %>/footer.php'],
overwrite: true,
replacements: [
{
from: '<?php bloginfo(\'template_directory\'); ?>/',
to: ''
},
{
View Meus git aliases
git config --global alias.lg "log --pretty=oneline --abbrev-commit"