Skip to content

Instantly share code, notes, and snippets.

View sebCarabali's full-sized avatar

Sebastian Carabali sebCarabali

View GitHub Profile
@Entity
public class Parent implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@OneToMany(mappedBy = "parent", cascade = CascadeType.ALL, orphanRemoval = true)
private Set<Child> children = new HashSet<>();
...
@sebCarabali
sebCarabali / git-log-pretty
Created February 22, 2022 05:25 — forked from miebach/git-log-pretty
pretty git log graph with coloured branches
# Visualizing branch topology in git on the commandline
git log --graph --oneline --full-history --all
git log --graph --full-history --all --pretty=format:"%h%x09%d%x20%s"
# With colors in Bash:
git log --graph --full-history --all --color --pretty=format:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s"
@sebCarabali
sebCarabali / react-native-authentication.md
Created January 5, 2021 14:58 — forked from silvioramalho/react-native-authentication.md
Creating React Native Authentication

Creating React Native Authentication

Creating a complete authentication flow using context-api. (Step-by-step)

This flow can be replicated to React-JS (Web)

Creating App

npx react-native init reactNativeAuth --template react-native-template-typescript

@sebCarabali
sebCarabali / promiseInSerie.js
Created June 3, 2020 03:01
Correr promesas en serie con reduce
sequence.reduce((previusPromise, nextVal) => {
return previusPromise.then(() => {
return this.functionThatReturnAPromise(nextVal);
});
}, Promise.resolve());
@sebCarabali
sebCarabali / install-docker.md
Created February 8, 2020 17:46 — forked from npearce/install-docker.md
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command
@sebCarabali
sebCarabali / perms.md
Created March 10, 2019 10:34 — forked from stefanbc/perms.md
Set proper permissions on /var/www/

HOWTO

To set up permissions on /var/www where your files are served from by default:

sudo addgroup webmasters
sudo adduser $USER webmasters
sudo chown -R root:webmasters /var/www
sudo find /var/www -type f -exec chmod 664 {} \;
sudo find /var/www -type d -exec chmod 775 {} \;
@sebCarabali
sebCarabali / pom.xml
Created December 12, 2017 18:05 — forked from xsalefter/pom.xml
pom.xml for maven + jpa 2 + ejb3.1 + cdi + jsf 2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.projectboard</groupId>
<artifactId>projectboard</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>Project Board</name>
<description>Project management dashboard.</description>
TARGET = main
SRC = src
INC = inc
BIN = bin
SOURCE = $(wildcard $(SRC)/*.c)
OBJECT = $(patsubst %, $(BIN)/%, $(notdir $(SOURCE:.c=.o)))
CC=gcc
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"
version="2.1">
<persistence-unit name="persistenceUnitName" transaction-type="RESOURCE_LOCAL">
<properties>
<property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver" /> <!-- DB Driver -->
@sebCarabali
sebCarabali / driver.sh
Created November 25, 2017 20:50 — forked from TFaga/driver.sh
Wildfly postgresql datasource configuration
./jboss-cli.sh
embed-server --std-out=echo --server-config=standalone.xml
module add --name=org.postgres --resources=/tmp/postgresql-42.1.1.jar --dependencies=javax.api,javax.transaction.api
exit