Skip to content

Instantly share code, notes, and snippets.

View davivc's full-sized avatar

Davi Candido davivc

View GitHub Profile
@davivc
davivc / show_my_branch.sh
Last active May 6, 2024 18:49
Show git's branch name coloured on the terminal. Include it at the end of `~/.bashrc` file
# Git
# Show git branch name
force_color_prompt=yes
color_prompt=yes
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\] $(parse_git_branch)\[\033[00m\]\$ '
else
@davivc
davivc / ceris.script.js
Created December 7, 2020 18:21
Ceris Theme dataLayer on Reactions script
var reactionName = '';
if($(this).find('.atbs-reaction-name')){
reactionName = $(this).find('.atbs-reaction-name').text();
}
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'event': 'reaction',
'dtL.reaction': {
'type': reactionType,
{"data": [{"type": "scatter", "fill": "tozerox", "mode": "none", "x": ["2019-04-03", "2019-04-04", "2019-04-05", "2019-04-06", "2019-04-07", "2019-04-08", "2019-04-09", "2019-04-10", "2019-04-11", "2019-04-12", "2019-04-13", "2019-04-14", "2019-04-15", "2019-04-16", "2019-04-16", "2019-04-15", "2019-04-14", "2019-04-13", "2019-04-12", "2019-04-11", "2019-04-10", "2019-04-09", "2019-04-08", "2019-04-07", "2019-04-06", "2019-04-05", "2019-04-04", "2019-04-03"], "y": [2786.65, 2696.32, 2478.9, 2251.22, 2296.93, 2614.07, 2795.14, 2788.0, 2692.65, 2473.97, 2247.07, 2288.48, 2605.75, 2790.22, 6.36, -178.11, -495.38, -536.79, -309.89, -91.21, 4.14, 11.28, -169.79, -486.93, -532.64, -304.96, -87.54, 2.79], "fillcolor": "rgba(52, 1, 108,0.1)"}, {"x": ["2019-04-03", "2019-04-04", "2019-04-05", "2019-04-06", "2019-04-07", "2019-04-08", "2019-04-09", "2019-04-10", "2019-04-11", "2019-04-12", "2019-04-13", "2019-04-14", "2019-04-15", "2019-04-16"], "y": [2778.0, 1759.0, 1503.0, 945.0, 1023.0, 1797.0, 3081.0, 2788.0, 1762.
@davivc
davivc / app.R
Last active August 29, 2015 14:13
library("shiny")
# Global variables can go here
n <- 200
# Define the UI
ui <- bootstrapPage(
numericInput('n', 'Number of obs', n),
plotOutput('plot')
)