Skip to content

Instantly share code, notes, and snippets.

View joeljuca's full-sized avatar
👨‍💻
Working on smt new

Joel Jucá joeljuca

👨‍💻
Working on smt new
View GitHub Profile
@joeljuca
joeljuca / twitter_client.ex
Last active May 23, 2020 02:29 — forked from allefgomes/twitter_client.ex
Twitter Client in elixir
defmodule TwitterClient do
use Tesla
@token System.get_env("TWITTER_TOKEN")
plug(Tesla.Middleware.BaseUrl, "https://api.twitter.com")
plug(Tesla.Middleware.DecodeJson)
def get_tweets do
{:ok, response} = make_request()
person = :joel
given_person = :john
case given_person do
^person -> "Hi, Joel!"
person -> "Hi, #{person}!"
end
# => "Hi, john!"
type DocumentVersion = {
// CouchDB's own ID system
_id: string;
// Your document history ID - the same across all versions of a document
historyId: string;
// The _id of the ancestor document (undefined if first version)
parentId: string;
const Option = ({ option, onChange }) => {
return (
<label for="">
<option onChange={onChange} /> {option.title}
</label>
);
};
const Question = ({ question, onSubmit }) => {
return (
// IIFE - Immediately Invoked Function Expression
(function () {
"use strict"
console.log("I'm inside a private scope!")
})()
class DataFetcher extends React.Component {
componentWillMount() {
this.setState(this.props.initialState)
this.props.fetcher().then(newState => this.setState(newState))
}
render() {
<TablePage {...this.state} />
}
}
@joeljuca
joeljuca / app.js
Last active December 25, 2018 14:19 — forked from JohnnyHandy/app.js
PASSPORT & express-session config e models
const passport = require("passport");
const { LocalStrategy } = require("passport-local");
const User = require("./models/user");
const Employee = require("./models/employee");
const session = require('express-session');
passport.use(new LocalStrategy(username, password, done) => {
User.findOne({ username })
.then(user => done(null, user && User.isPasswordValid(user, password) ? user : false))
.then(err => done(err))
FROM elixir:1.7.4-alpine
LABEL maintainer="Joel Wallis Jucá <joelwallis@gmail.com>"
ENV MIX_ENV prod
WORKDIR /app
COPY . $WORKDIR
RUN mix local.hex --force

This is a discussion issue. Tasks will be defined after this discussion issue is closed.


Currently, our Entity library is pretty simple and primitive. It only supports a single database per program, and there's no distinction between a database and a row. Ideally, we would have a clear distinction between representations of a database, a row, and a collection of rows (eg.: a table), so we could use object-oriented programming to properly represent every single aspect of a database (for now, we'll be focused in databases, collections/tables, and rows/documents).

Below are examples of how I imagine it could be:

Different classes for different representations

Keybase proof

I hereby claim:

  • I am joelwallis on github.
  • I am joelwallis (https://keybase.io/joelwallis) on keybase.
  • I have a public key ASDEG3poIdSCikhq4hNqxFUAFI-iK30SPf5Dhy8g8BrVnwo

To claim this, I am signing this object: