This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import kotlin.properties.ReadWriteProperty | |
import kotlin.reflect.KProperty | |
open class SmartDevice(val name: String, val category: String) { | |
var deviceStatus = "online" | |
protected set | |
open val deviceType = "unknown" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// source - https://stefma.medium.com/jetpack-compose-remember-mutablestateof-derivedstateof-and-remembersaveable-explained-270dbaa61b8 | |
@Composable | |
private fun CounterWithDerivedState() { | |
// salvar stado em caso a activity seja recaregada - rememberSaveable | |
val counterState = remember { mutableStateOf(0) } | |
val showHurrayState = remember { | |
derivedStateOf { counterState.value > 10 } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useState, useEffect } from 'react' | |
export const useFetch = (url) => { | |
const [data, setData] = useState([]) | |
useEffect(() => { | |
const fetchData = async () => { | |
try { | |
const response = await fetch(url) | |
const data = await response.json() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash | |
I had problem installing ruby +3 using rbenv from apt, I moreved rbenv and staling from source works like a charm | |
font: https://phoenixnap.com/kb/install-ruby-ubuntu |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/bin/python | |
# http://exploreflask.com/en/latest/views.html | |
# https://stackoverflow.com/questions/51691730/flask-middleware-for-specific-route | |
# https://dev.to/rhymes/logging-flask-requests-with-colors-and-structure--7g1 | |
import logging | |
from logging.handlers import RotatingFileHandler | |
from flask import Flask, request, jsonify | |
from time import strftime |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs') | |
function readFile (filename) { | |
if (fs.existsSync(filename)) { | |
return fs.readFileSync(filename, 'utf8') | |
} | |
throw new Error('Cannot find file ' + filename) | |
} | |
describe('mocking individual fs sync methods', () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://codingsans.com/blog/microservice-architecture-best-practices |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// promises https://developers.google.com/web/fundamentals/primers/promises | |
// source: http://2ality.com/2017/05/util-promisify.html | |
const {promisify} = require('util'); | |
const fs = require('fs'); | |
const readFileAsync = promisify(fs.readFile); | |
const filePath = process.argv[2]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://www.ibm.com/support/knowledgecenter/pt-br/SSMNED_5.0.0/com.ibm.apic.toolkit.doc/tutorial_apionprem_security_OAuth.html | |
https://www.digitalocean.com/community/tutorials/uma-introducao-ao-oauth-2-pt | |
https://alexbilbie.com/tag/oauth/ |