Skip to content

Instantly share code, notes, and snippets.

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

Geo geovanisouza92

🏠
Working from home
View GitHub Profile
@geovanisouza92
geovanisouza92 / cleanjs.diff
Last active September 3, 2016 05:41
Shared state with reducers
diff --git a/src/shared-state.js b/src/shared-state-cleanjs.js
index f92cbda..92e4c29 100644
--- a/src/shared-state.js
+++ b/src/shared-state-cleanjs.js
@@ -92,6 +92,32 @@ const GuestClicker = sources => isolate(guestClicker)(sources)
const MAX_GUEST = 5
+const stateByFree = ({count}) => state =>
+ ({
@geovanisouza92
geovanisouza92 / client.js
Created August 20, 2016 00:18
"Remote" model for Cycle.js
import {run} from '@cycle/xstream-run'
import {makeDOMDriver, div, button} from '@cycle/dom'
import xs from 'xstream'
function main (sources) {
// Intent
const incAction$ = sources.DOM
.select('.inc').events('click')
.mapTo({type: 'INC'})
const decAction$ = sources.DOM
@geovanisouza92
geovanisouza92 / main.js
Last active May 6, 2024 05:13
Reactive expression evaluator
import {run} from '@cycle/xstream-run'
import {makeDOMDriver, div, input, button, label} from '@cycle/dom'
import {makeLocalStorageDriver} from 'cyclejs-storage'
import Collection from '@cycle/collection'
import xs from 'xstream'
import debounce from 'xstream/extra/debounce'
import dropRepeats from 'xstream/extra/dropRepeats'
import pairwise from 'xstream/extra/pairwise'
import delay from 'xstream/extra/delay'
import concat from 'xstream/extra/concat'
@geovanisouza92
geovanisouza92 / problems.md
Created July 10, 2016 16:37
Problems with "xexpr"
@geovanisouza92
geovanisouza92 / Dockerfile
Last active June 23, 2016 12:04
Proxy Reverso simplificado (os '_' nos nomes dos arquivos deveriam ser '/', mas o Gist não suporta subdiretórios :P )
FROM nginx
COPY lb.conf /etc/nginx/conf.d/
@geovanisouza92
geovanisouza92 / Dockerfile
Created June 22, 2016 15:26
Proxy Reverso simplificado
FROM nginx
COPY lb.conf /etc/nginx/conf.d/
@geovanisouza92
geovanisouza92 / cycle-jwt.coffee
Created March 26, 2016 15:16
Reproduzindo a interface do "debugger" em jwt.io usando Cycle.js
DEFAULT_HS_TOKEN = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ'
DEFAULT_RS_TOKEN = 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.EkN-DOsnsuRjRO6BxXemmJDm3HbxrbRzXglbN2S4sOkopdU4IsDxTI8jO19W_A4K8ZPJijNLis4EZsHeY559a4DFOd50_OqgHGuERTqYZyuhtF39yxJPAjUESwxk2J5k_4zM3O-vtd1Ghyo4IbqKKSy6J9mTniYJPenn5-HIirE'
DEFAULT_PUBLIC_RSA = ["-----BEGIN PUBLIC KEY-----\n"
"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDdlatRjRjogo3WojgGHFHYLugd"
"UWAY9iR3fy4arWNA1KoS8kVw33cJibXr8bvwUAUparCwlvdbH6dvEOfou0/gCFQs"
"HUfQrSDv+MuSUMAe8jzKE4qW+jK+xQU9a03GUnKHkkle+Q0pX/g6jXZ7r1/xAK5D"
"o2kQ+X5xK9cipRgEKwIDAQAB\n"
"-----END PUBLIC KEY-----"].join ''
DEFAULT_PRIVATE_RSA = ["-----BEGIN RSA PRIVATE KEY-----\n"
provider "docker" {
host = "unix:///var/run/docker.sock"
}
resource "docker_image" "mysql_outer" {
name = "mysql:5.7"
}
resource "docker_container" "mysql_outer" {
name = "mysql_outer"
@geovanisouza92
geovanisouza92 / HowToRemoveDictKeys.ipynb
Last active January 6, 2016 15:57
Comparativo entre formas de remover itens de um dicionário no Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@geovanisouza92
geovanisouza92 / README.md
Last active April 30, 2016 11:22
Script to convert TextExpander snippets to Texpand

Usage:

$ ./te2t.py <.textpander file> <.txt file>

Import the .txt file into Texpand app.