Skip to content

Instantly share code, notes, and snippets.

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

felipe bastos felipebastosweb

🏠
Working from home
View GitHub Profile
@viniciusfbb
viniciusfbb / Example.pas
Last active November 1, 2023 12:57
Google Geocoding API for Delphi - AddressToGeolocation and GeolocationToAddress
unit Example;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs;
type
TForm1 = class(TForm)
@eduardoflorence
eduardoflorence / main.dart
Created March 3, 2021 01:36
GetX - Sample Translation with GetStorage, GetxService, DropDownButton and PopMenuButton
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await initialConfig();
final storage = Get.find<StorageService>();
@eduardoflorence
eduardoflorence / main.dart
Last active February 18, 2025 17:55
Getx - Sample Form
import 'package:flutter/material.dart';
import 'package:get/get.dart';
void main() {
runApp(GetMaterialApp(
initialRoute: '/login',
getPages: [
GetPage(
name: '/login',
page: () => LoginPage(),
@eduardoflorence
eduardoflorence / main.dart
Created December 28, 2020 20:53
Dart - List with submodel
Future main() async {
Map<String, dynamic> res = {
"content": [
{
"from_info": {
"address": {
"address_string": "Av. Paulista, 302 - Bela Vista, São Paulo - SP, 01310-000, Brazil",
"latitude": "-23.5688619",
"longitude": "-46.6464484"
@aipi
aipi / tabela_fipe.py
Last active April 24, 2022 02:43
Consultar Tabela FIPE com Python
import requests
r = requests.post(
'http://veiculos.fipe.org.br/api/veiculos/ConsultarMarcas',
json=payload,
headers={
'Host': 'veiculos.fipe.org.br',
'Referer': 'http://veiculos.fipe.org.br/'
}
)
@monkut
monkut / Ubuntu1604py36Dockerfile
Last active June 14, 2023 20:31
Base Docker image for ubuntu-16.04 & Python3.6
# docker build -t ubuntu1604py36
FROM ubuntu:16.04
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:jonathonf/python-3.6
RUN apt-get update
RUN apt-get install -y build-essential python3.6 python3.6-dev python3-pip python3.6-venv
RUN apt-get install -y git
@marcoscastro
marcoscastro / btc_usd.py
Created February 15, 2017 09:53
Python - Monitoramento do preço do bitcoin em dólares
'''
Get Bitcoin Value
http://api.coindesk.com/v1/bpi/currentprice.json
'''
import urllib.request, json, time
def obter_valor():
try:
url = "http://api.coindesk.com/v1/bpi/currentprice.json"
"""
Análise inicial da autonomia do combustível (gasolina) de um veículo para uma viagem, ajudando a prever a probabilidade de faltar gasolina.
Cálculo incompleto, use por sua conta e risco.
Precisa de refatoração.
"""
class Fabricante(object):
nome = ''
def __init__(self, nome):
@neunhoef
neunhoef / docker-compose.yml
Created December 7, 2016 11:08
Docker compose file to start a local arangodb cluster
version: '2'
services:
agency:
image: arangodb/arangodb
environment:
- ARANGO_NO_AUTH=1
command: arangod --server.endpoint tcp://0.0.0.0:5001 --server.authentication false --agency.activate true --agency.size 1 --agency.supervision true --database.directory /var/lib/arangodb3/agency1
coordinator:
image: arangodb/arangodb
@jn0
jn0 / rtsp-rtp-sample.py
Created December 2, 2016 08:43
Sample Python script to employ RTSP/RTP to play a stream from an IP-cam (from stackoverflow)
"""
http://stackoverflow.com/questions/28022432/receiving-rtp-packets-after-rtsp-setup
A demo python code that ..
1) Connects to an IP cam with RTSP
2) Draws RTP/NAL/H264 packets from the camera
3) Writes them to a file that can be read with any stock video player (say, mplayer, vlc & other ffmpeg based video-players)
Done for educative/demonstrative purposes, not for efficiency..!