Skip to content

Instantly share code, notes, and snippets.

View rg3915's full-sized avatar
🏠
Working from home

Regis Santos rg3915

🏠
Working from home
View GitHub Profile
@rg3915
rg3915 / templatetags.md
Created April 25, 2018 19:38
Custom TemplateTags
@rg3915
rg3915 / filter_jquery_element.js
Last active January 31, 2019 10:09 — forked from olivx/filter_jquery_element.js
Filter elements with jQuery - Search (dataTable)
function filter(element, selector) {
var value = $(element).val().toUpperCase();
$(selector +" li").each(function () {
if ($(this).text().toUpperCase().indexOf(value)> -1) {
$(this).show();
} else {
$(this).hide();
}
});
}
@rg3915
rg3915 / validation.html
Last active April 27, 2018 19:11
email validation with pattern
<input id="email" name="email" type="email" class="form-control" pattern="\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}" title="Formato de e-mail inválido. Ex: [email protected]" placeholder="ex: [email protected]">
and link
<!-- https://stackoverflow.com/a/46181 -->
@rg3915
rg3915 / count_cite_words.py
Last active April 28, 2018 16:52
Le os arquivos .tex numa pasta pages/. E conta a quantidade de ocorrências da palavra \\cite{foo} ou \\citeonline{bar}, agrupando por foo ou bar.
'''
Le os arquivos .tex numa pasta projeto/document/pages/.
E conta a quantidade de ocorrências da palavra \\cite{foo} ou \\citeonline{bar},
agrupando por foo ou bar.
'''
import csv
import os
import re
from collections import Counter
@rg3915
rg3915 / FromDict.ipynb
Last active December 15, 2021 18:51
Annotations of Pandas DataFrame
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rg3915
rg3915 / Dockerfile
Last active July 25, 2020 09:12 — forked from olivx/docker_basic.md
Guia definitivo de Docker
ARG PYTHON_VERSION='3.8'
# set base image (host OS)
FROM python:3.8
ENV PYTHONUNBUFFERED 1
# set the working directory in the container
WORKDIR /code
@rg3915
rg3915 / vuejs_annotation.md
Last active May 3, 2018 23:14
VueJS annotations

VueJS Annotations

v-model

v-on eventos

v-on:click="onbotao()"
@click
@change
@rg3915
rg3915 / vim_shortcuts.md
Last active May 28, 2020 20:07
Vim commands shortcuts

Vim

Modo de inserção

  • I - insere no começo da linha.
  • A - insere no final da linha.
  • o - abre um nova linha abaixo.
  • O - abre um nova linha acima.

Navegação

@rg3915
rg3915 / main.js
Created May 8, 2018 20:48
Annotate, JSON parse and ChartJS
// https://gomakethings.com/decoding-html-entities-with-vanilla-javascript/
var decodeHTML = function(html) {
var txt = document.createElement('textarea')
txt.innerHTML = html
return txt.value
}
var string = "{{ job_per_recruter }}"
var array = JSON.parse(decodeHTML(string))
console.log(array);
@rg3915
rg3915 / mypersonality_test36.py
Created May 12, 2018 00:10
Test personality with 36 questions
#!/usr/bin/python
# William Thing
# March 29, 2015
# Personality Test
#
# The Keirsey test measures four independent dimensions of personality:
# Extrovert versus Introvert (E vs I): what energizes you
# Sensation versus iNtuition (S vs N): what you focus on
# Thinking versus Feeling (T vs F): how you interpret what you focus on
# Judging versus Perceiving (J vs P): how you approach life