Skip to content

Instantly share code, notes, and snippets.

<snippet>
<content><![CDATA[
console.log(${1:this});
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>log</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>
<snippet>
<content><![CDATA[
console.log('${1:this} = ', ${1:snippet});
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>clog</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.js</scope>
</snippet>
@codexico
codexico / gist:8568280
Created January 22, 2014 22:02
char list to accept from user
function inputOnlyLetters () {
var re_letters= /^[ ABCÇDEFGHIJKLMNÑOPQRSTUVWXYZabcçdefghijklmnñopqrstuvwxyzàáãÃÀÁéèÈÉíìÍÌïÏóòõÕÓÒúùÚÙüÜ]+$/gi;
var re_not_letters= /[^ ABCÇDEFGHIJKLMNÑOPQRSTUVWXYZabcçdefghijklmnñopqrstuvwxyzàáãÃÀÁéèÈÉíìÍÌïÏóòõÕÓÒúùÚÙüÜ]/gi;
$('.not-number').on('keyup', function() {
var input = this;
// user needs some time to write chars that need two strokes, like ç => ' + c
window.setTimeout(function(){
@codexico
codexico / gist:8572143
Last active January 4, 2016 04:59
CSS pointer-events ============= CSS' pointer-events property effectively disable an element when the value is none but otherwise allow the element to function per usual when the value isn't none. Pointer-events even prevent JavaScript events from firing. Click on that element and any addEventListener callback you've placed on the element will n…
.disabled { pointer-events: none; }
@codexico
codexico / gist:10409140
Created April 10, 2014 18:23
show hidden files on finder
defaults write com.apple.Finder AppleShowAllFiles TRUE; killall Finder
@codexico
codexico / log_args
Created April 21, 2014 20:02
javascript log arguments
function log_args () {
console.log([].slice.call(arguments))
}
@codexico
codexico / social.js
Created April 23, 2014 13:30
share functions
function shareFacebook(title, summary, url, image) {
url = ['https://www.facebook.com/sharer/sharer.php?s=100&p[summary]=', encodeURI(summary), '&p[title]=', encodeURI(title), '&p[url]=', encodeURI(url), '&p[images][0]=', encodeURI(image)];
window.open(url.join(''), 'facebook', 'height=300,width=600');
}
function shareFacebookFBui(options, callbackShare) {
// http://developers.facebook.com/docs/reference/dialogs/feed/
var defaults = {
method: 'feed',
-webkit-transform: translate3d(0, 0, 0);
-webkit-filter: blur(30px);
-moz-filter: blur(30px);
-o-filter: blur(30px);
-ms-filter: blur(30px);
filter: progid:DXImageTransform.Microsoft.Blur(PixelRadius='60');
@codexico
codexico / .gitconfig
Last active November 23, 2022 10:17
git alias
# https://gist.github.com/codexico/2a34c0d599f3af93b46f
[color]
# Use colors in Git commands that are capable of colored output when
# outputting to the terminal. (This is the default setting in Git ≥ 1.8.4.)
ui = auto
[color "branch"]
@codexico
codexico / pre-push
Last active June 2, 2023 12:08
hook to force tests and prevent failing pushs to develop or master
#!/usr/bin/env bash
# .git/hooks/pre-push
# hook to force tests and prevent failing pushs to develop or master
#
# Refs:
# http://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
# http://blog.ittybittyapps.com/blog/2013/09/03/git-pre-push/
#
# Bypassing the pre-push hook: