Skip to content

Instantly share code, notes, and snippets.

View leandrohsilveira's full-sized avatar

Leandro Hinckel Silveira leandrohsilveira

View GitHub Profile
@leandrohsilveira
leandrohsilveira / Counter.svelte
Last active January 18, 2023 03:33
Using RXJS Observables in Svelte with autosubscribe feature
<script lang="ts">
import { map } from 'rxjs';
import { count$, evenCount$, oddCount$ } from './counter';
import { toReadable, toWritable } from './util';
let count = toWritable(count$);
let lastEven = toReadable(evenCount$.pipe(map(String)), 'none')
let lastOdd = toReadable(oddCount$.pipe(map(String)), 'none')
</script>
@leandrohsilveira
leandrohsilveira / app.tag
Last active December 17, 2018 13:28
Make riot.js observables more friendly
import './trigger.tag';
import './message.tag';
<app>
<trigger />
<message />
</app>
@leandrohsilveira
leandrohsilveira / output.txt
Created September 15, 2018 20:46
Output of create-react-app
$ create-react-app testcra
Creating a new React app in C:\dev\testcra.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
yarn add v1.9.4
info No lockfile found.
[1/4] Resolving packages...
@leandrohsilveira
leandrohsilveira / faces-config.xml
Created February 26, 2016 15:32
FacesConfig para JavaServer Faces 2.2
<faces-config version="2.2"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd">
</faces-config>
@leandrohsilveira
leandrohsilveira / beans.xml
Created February 26, 2016 15:31
Arquivo Beans XML para CDI 1.0
<?xml version="1.0"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
</beans>
@leandrohsilveira
leandrohsilveira / pom.xml
Created February 26, 2016 15:26
Maven Compiler e WAR Plugin para Projeto Web
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<!-- http://maven.apache.org/plugins/maven-compiler-plugin/ -->
<source>1.7</source>
<target>1.7</target>
@leandrohsilveira
leandrohsilveira / pom.xml
Created February 26, 2016 15:23
Dependências para JEE 7 com WildFly
<dependencies>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<scope>provided</scope>
@leandrohsilveira
leandrohsilveira / pom.xml
Last active February 26, 2016 15:20
Gerência de dependências para JEE 7 Com Wildfly
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.wildfly.bom</groupId>
<artifactId>jboss-javaee-7.0-with-tools</artifactId>
<version>8.2.0.Final</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>