Skip to content

Instantly share code, notes, and snippets.

Rafael Cavalcante rafaelcavalcante

Block or report user

Report or block rafaelcavalcante

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rafaelcavalcante
rafaelcavalcante / default-node-version-on-nvm.md
Created Nov 12, 2018
Setting the default node version on NVM
View default-node-version-on-nvm.md
$ nvm alias default VERSION
View helpers.js
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;
View parallax.js
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 / search.php
Last active May 2, 2017
Wordpress - Display the number of search results
View search.php
$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/
View penck-thumbnail.php
<?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 / Preferences.sublime-settings
Last active May 8, 2017
Sublime Text 3 - User Preferences
View Preferences.sublime-settings
{
// 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 / .gitconfig
Last active Aug 4, 2016
my .gitconfig aliases
View .gitconfig
[alias]
# simple commands
co = checkout
st = status
br = branch
cp = cherry-pick
ci = commit
cob = checkout -b
View .git_commit_msg.txt
# If this commit is applied, it will:
# Why was this change made?
# Any references to tickets, articles etc?
View mixin-multi_column_layout.sass
@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;
You can’t perform that action at this time.