Skip to content

Instantly share code, notes, and snippets.

View ppuczka's full-sized avatar

Przemek Puczka ppuczka

  • Bielsko - Biala, Poland
View GitHub Profile
@ppuczka
ppuczka / emailcli.py
Created February 19, 2020 21:20 — forked from CITGuru/emailcli.py
EmailCLI - A Python Command Line App for sending mails using SendGrid
import os
import re
import click
import sendgrid
import six
from pyconfigstore import ConfigStore
from PyInquirer import (Token, ValidationError, Validator, print_json, prompt,
style_from_dict)
from sendgrid.helpers.mail import *
@ppuczka
ppuczka / Jenkinsfile
Created January 29, 2020 10:49 — forked from merikan/Jenkinsfile
Some Jenkinsfile examples
Some Jenkinsfile examples
@ppuczka
ppuczka / introrx.md
Created November 14, 2019 13:35 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@ppuczka
ppuczka / jenkinsfile-commons.groovy
Created October 9, 2019 20:45 — forked from aliok/jenkinsfile-commons.groovy
Sample advanced Jenkins pipeline
/**
* This file provides common stuff to be used in the pipelines.
* It is important to load it after repo checkout is done: see https://github.com/jenkinsci/pipeline-plugin/blob/master/TUTORIAL.md#triggering-manual-loading
*
*/
/**
* Dumps some info about the environment.
* @return
*/
@ppuczka
ppuczka / git.md
Created December 21, 2018 18:18
git

…or create a new repository on the command line

echo "# java8excercise" >> README.md git init git add README.md git commit -m "first commit" git remote add origin https://github.com/ppuczka/java8excercise.git git push -u origin master

…or push an existing repository from the command line

@ppuczka
ppuczka / settings.json
Created November 9, 2018 22:05
[Settings.json] Watch sass config
{
"liveSassCompile.settings.formats":[
{
"format": "expanded",
"extensionName": ".css",
"savePath": "/css"
},
{
"extensionName": ".min.css",
"format": "compressed",
@ppuczka
ppuczka / table.html
Created October 25, 2018 16:48
HTML Table c:forEeach #HTML #jstl #el
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Cities</title>
</head>
<body>
<h2>Cities</h2>
@ppuczka
ppuczka / forms.jsp
Created October 24, 2018 16:46
Tag Lib #Spring #Hibernate #forms
<%@ taglib prefix="form"
uri="http://www.springframework.org/tags/form" %>
@ppuczka
ppuczka / interfaceValidation.java
Last active October 21, 2018 11:59
Own Validator @interface #Spring #Hibernate #validation
package pl.coderslab.hibernate.validator;
import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Constraint(validatedBy = IsAdultValidator.class)
@ppuczka
ppuczka / apiValidation.java
Created October 21, 2018 10:28
Api Validation #Spring #Hibernate #validation
@Autowired
Validator validator;
@RequestMapping("/validate")
@ResponseBody
public String validateTest() {
Person p2 = new Person();
Set<ConstraintViolation<Person>> violations = validator.validate(p2);
if (!violations.isEmpty()) {
for (ConstraintViolation<Person> constraintViolation : violations) {
System.out.println(constraintViolation.getPropertyPath() + " "