Skip to content

Instantly share code, notes, and snippets.

View ryanpadilha's full-sized avatar
:octocat:

Ryan Padilha ryanpadilha

:octocat:
View GitHub Profile
When you think your git is messed up, you can use this command to do everything up-to-date.
git rm -r --cached .
git add .
git commit -am 'git cache cleared'
git push
Also to revert back last commit use this :
git reset HEAD^ --hard
def VERSION = "${env.BUILD_NUMBER}"
def DIST_ARCHIVE = "dist.${env.BUILD_NUMBER}"
def S3_BUCKET = 'angular-prod-deploy'
pipeline {
agent any
tools { nodejs "Angular Project" }
stages {
stage('NPM Install') {
@ryanpadilha
ryanpadilha / .gitignore
Created September 1, 2020 17:45 — forked from Avinashachu007/.gitignore
Gitignore for Java,maven,Eclipse,Spring
/target/
!.mvn/wrapper/maven-wrapper.jar
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
CREATE TEXT SEARCH CONFIGURATION fr ( COPY = french );
ALTER TEXT SEARCH CONFIGURATION fr ALTER MAPPING
FOR hword, hword_part, word WITH unaccent, french_stem;
CREATE TEXT SEARCH CONFIGURATION en ( COPY = english );
ALTER TEXT SEARCH CONFIGURATION en ALTER MAPPING
FOR hword, hword_part, word WITH unaccent, english_stem;
CREATE TEXT SEARCH CONFIGURATION de ( COPY = german );
ALTER TEXT SEARCH CONFIGURATION de ALTER MAPPING
@ryanpadilha
ryanpadilha / brdocs.cpfcnpjValidator.js
Created May 19, 2020 02:13 — forked from victor-rds/brdocs.cpfcnpjValidator.js
Extensão para JQuery Validation Plugin (jqueryvalidation.org) que valida o número de CPF ou CNPJ (inclusive os dois ao mesmo tempo num único campo), usa "namespace" brdocs para evitar conflitos, a função calculaDigito() pode ser usada sozinha caso você deseje mudar a lógica do validador ou criar seu método de validação em outro framework ou plugin.
brdocs = {
/**
* Enum com opções do validador
* @readonly
* @enum {number}
*/
cpfcnpj: { "CPF": 1, "CNPJ": 2, "AMBOS": 3 },
/**
* Função que valida CPF e CNPJ de uma só vez.
@ryanpadilha
ryanpadilha / postgres_manager.py
Created May 7, 2020 04:17 — forked from valferon/postgres_manager.py
Python script to take care of postgres backup and restore of data
#!/usr/bin/python3
import argparse
import logging
import subprocess
import os
import tempfile
from tempfile import mkstemp
import configparser
import gzip
@ryanpadilha
ryanpadilha / WebServiceCaller.java
Created March 10, 2020 16:50 — forked from jeffbicca/WebServiceCaller.java
Adding header elements into a SOAP envelope and setting timeout with JAX-WS.
import javax.xml.ws.Binding;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.WebServiceRef;
import javax.xml.ws.handler.Handler;
public class WebServiceCaller implements Serializable {
private static final int MINUTES = 60000;
@WebServiceRef(wsdlLocation = "http://localhost/WebService.wsdl")
@ryanpadilha
ryanpadilha / Validate_cpf_cnpj
Created December 11, 2019 02:14 — forked from fjcunha/Validate_cpf_cnpj
jQuery validator methods to validate cpf and cnpj
jQuery.validator.addMethod("cnpj", function (value, element) {
var numeros, digitos, soma, i, resultado, pos, tamanho, digitos_iguais;
if (value.length == 0) {
return false;
}
value = value.replace(/\D+/g, '');
digitos_iguais = 1;
@ryanpadilha
ryanpadilha / meta-tags.md
Created July 17, 2019 18:42 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@ryanpadilha
ryanpadilha / ga.py
Created June 5, 2019 17:15 — forked from canburak/ga.py
blog post: Push data to Google Analytics with Python: https://medium.com/p/pushing-data-to-google-analytics-with-python-80eb9691d61f
"""
Simple proof of concept code to push data to Google Analytics.
Related blog post:
* https://medium.com/python-programming-language/80eb9691d61f
"""
from random import randint
from urllib import urlencode
from urllib2 import urlopen
from urlparse import urlunparse