Skip to content

Instantly share code, notes, and snippets.

View rafaelcavalcante's full-sized avatar
🏠
(I wish i was) Working from home

Rafael Cavalcante rafaelcavalcante

🏠
(I wish i was) Working from home
View GitHub Profile
@rafaelcavalcante
rafaelcavalcante / mixin-multi_column_layout.sass
Created September 28, 2015 19:01
Multi Column Sass Mixin
@mixin split($columns, $gap) {
// Number of columns
-webkit-column-count: $columns;
-moz-column-count: $columns;
-o-column-count: $columns;
-o-column-count: $columns;
// Gap size
-webkit-column-gap: $gap;
-moz-column-gap: $gap;
-o-column-gap: $gap;
@rafaelcavalcante
rafaelcavalcante / .git_commit_msg.txt
Created May 5, 2016 20:26 — forked from danielfilho/.git_commit_msg.txt
Template for commit messages.
# If this commit is applied, it will:
# Why was this change made?
# Any references to tickets, articles etc?
@rafaelcavalcante
rafaelcavalcante / .gitconfig
Last active August 4, 2016 00:10
my .gitconfig aliases
[alias]
# simple commands
co = checkout
st = status
br = branch
cp = cherry-pick
ci = commit
cob = checkout -b
@rafaelcavalcante
rafaelcavalcante / Preferences.sublime-settings
Last active May 8, 2017 03:41
Sublime Text 3 - User Preferences
{
// editor behavior
"ensure_newline_at_eof_on_save": true,
// you-will-never-browse-this-while-coding-etc stuff
"folder_exclude_patterns":
[
".svn",
".git",
"node_modules"
@rafaelcavalcante
rafaelcavalcante / penck-thumbnail.php
Created March 8, 2017 15:44
the_penck_thumbnail()
<?php
/*
PT: O snippet "penck thumbnail" foi feito para exibir
o caminho da imagem de acordo com o objeto de imagem retornado do
plugin Advanced Custom Fields
EN: The penck thumbnail snipper were made to output the
image path according to the image object returned by the
Advanced Custom Fields plugin
@rafaelcavalcante
rafaelcavalcante / search.php
Last active May 2, 2017 16:56
Wordpress - Display the number of search results
$allsearch = &new WP_Query("s=$s&showposts=-1");
$count = $allsearch->post_count;
echo $count; // print results quantity
wp_reset_query();
// Source: http://www.problogdesign.com/wordpress/3-codes-for-a-far-better-wordpress-search-page/
jQuery(document).ready(function(){
jQuery(window).on('scroll', function(){
var scrollTop = jQuery(window).scrollTop();
var windowHeight = jQuery(window).height();
var windowAxis = scrollTop + (windowHeight / 2);
jQuery('[data-bubble]').each(function(){
var height = jQuery(this).height();
var top = jQuery(this).offset().top;
@rafaelcavalcante
rafaelcavalcante / helpers.js
Created September 13, 2018 17:50
elocc/helpers
const helpers = {
toCurrency: (value) => value.toLocaleString('pt-BR', { style: 'currency', currency: 'BRL' }),
parseIsoDate: (value) => Date.parse(value).toLocaleDateString('pt-BR', { day: 'numeric', month: 'long', year: 'numeric' })
};
export default helpers;
@rafaelcavalcante
rafaelcavalcante / default-node-version-on-nvm.md
Created November 12, 2018 15:54
Setting the default node version on NVM
$ nvm alias default VERSION
jest.mock('react-native-gesture-handler')
const contacts = [
{
displayName: 'Abel Tesfaye',
cellphone: '11971033230'
},
{
givenName: 'Chancelor ',
familyName: 'Bennett',