Skip to content

Instantly share code, notes, and snippets.

View nestorsgarzonc's full-sized avatar
👋

Nestor Sebastian Garzon Contreras nestorsgarzonc

👋
View GitHub Profile
@nestorsgarzonc
nestorsgarzonc / CI.yml
Last active October 22, 2024 00:34
CI.yml
name: Flutter CI
on:
push:
branches:
- "main"
pull_request:
branches:
# Your desired branches
- "main"
@nestorsgarzonc
nestorsgarzonc / android_deployment.yml
Last active October 22, 2024 00:51
Github action for android deployment using flutter
name: Flutter CD - Deployment Android
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
@nestorsgarzonc
nestorsgarzonc / example_provider.dart
Last active March 3, 2023 20:23
Useful on async operations like a request:
Future<void> getRestaurant() async {
state = state.copyWith(restaurant: StateAsync.loading());
final result = await restaurantRepository.getMenuByRestaurant();
result.fold(
(failure) => state = state.copyWith(restaurant: StateAsync.error(failure)),
(restaurant) => state = state.copyWith(restaurant: StateAsync.success(restaurant)
);
}
class ChatNotifier extends StateNotifier<ChatState> {
ChatNotifier() : super(const ChatState()) {
_initSocket();
_handleSocketListening();
}
final _messagesStream = StreamController<dynamic>();
final _usersStream = StreamController<dynamic>();
final scrollController = ScrollController();
late io.Socket socket;
void main() {
final participants=["SB", "SG", "JS", "SL"];
final features=[
"Activation",
"App",
"Auth",
"Bank",
"Commercial",
"Credit card",
"Error",
@nestorsgarzonc
nestorsgarzonc / main.dart
Created September 9, 2021 13:03
Flutter 2.5.0 scroll bug example
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
class Node:
def __init__(self, item, priority):
"""
Clase elemento en el cual se almacena la prioridad y el elemento
item: Dynamic
priority: Int
"""
self.item = item
self.priority = priority
@nestorsgarzonc
nestorsgarzonc / app.py
Created October 3, 2020 19:10
Visualice activations in convolutions
from keras.layers import Conv2D,Flatten
model = Sequential()
# Add a convolutional layer of 32 filters of size 3x3
model.add(Conv2D(32, kernel_size = 3, input_shape = (28, 28, 1), activation = 'relu'))
# Add a convolutional layer of 16 filters of size 3x3
model.add(Conv2D(16, kernel_size =3, activation = 'relu'))
# Flatten the previous layer output
-- *************************************************************
-- Versión para Microsoft SQL Server
-- *************************************************************
/* Crear una tabla que contenga las características presentadas en el
enunciado del problema e incluya las columnas digitador y fecha */
CREATE TABLE Empleado
(
identificacion BIGINT,
nombres VARCHAR(30),
apellidos VARCHAR(30),
#https://keras.io/api/preprocessing/image/
TRAINING_DIR = "/tmp/cats-v-dogs/training"
train_datagen = ImageDataGenerator(rescale=1.0/255.0)
# NOTE: YOU MUST USE A BATCH SIZE OF 10 (batch_size=10) FOR THE
train_generator = train_datagen.flow_from_directory(TRAINING_DIR,
batch_size=10,
class_mode="categorical",
color_mode: "grayscale",
target_size=(1020, 480)