Skip to content

Instantly share code, notes, and snippets.

View timbergus's full-sized avatar

Gustavo Muñoz timbergus

View GitHub Profile
@timbergus
timbergus / makefile
Last active October 5, 2021 16:55
C++ Projects' Makefile for Windows and Mac.
# Clang as the compiler.
CXX=clang++
# The project name as the target.
TARGET=my_cool_project
# Paths to app and include directories from the root path.
# The folder structure is as follows.
// This is the variable that stores the image URL.
String imageUrl = '';
// This is the variable that stores the image extension.
String ext = '';
// This is the function to fetch the image from the storage.
// Here we get an instance to Firebase Storage.
FirebaseStorage _storage = FirebaseStorage.instance;
// This async function gets the image from the gallery
// and upload it to Firebase Storage.
Future uploadImage() async {
var image = await ImagePicker.pickImage(
source: ImageSource.gallery,
// Logged status.
bool isLogged = false;
// Firebase authentication instance.
FirebaseAuth _auth = FirebaseAuth.instance;
// The init state will check the logged status of the user.
body: StreamBuilder(
stream: Firestore.instance
.collection('feed')
.where('email', isEqualTo: 'user@fakemailaddress.com')
.snapshots(),
builder: (context, snapshot) {
if (!snapshot.hasData) {
return Text('Loading...');
}
return ListView.builder(
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Web 101</title>
<link rel="stylesheet" href="style.css">
<script src="index.js" defer></script>
</head>
function handleClick() {
// 1. Selecciona el botón.
const button = document.querySelector('input[type=button]');
// 2. Cambia el color de verde a rojo.
button.style.backgroundColor = 'red';
// 3. Cambia el texto de "Click Me!" a "See You!".
button.value = 'See You!';
input[type=button] {
background-color: green;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
font-size: 16px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Web 101</title>
</head>
<body>
import 'package:flutter/material.dart';
import 'package:firebase_auth/firebase_auth.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',