Skip to content

Instantly share code, notes, and snippets.

Working from home

Alfonso alfonsodev

Working from home
View GitHub Profile
alfonsodev / Audience.dart
Created May 11, 2019
flutter broadcast
View Audience.dart
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:permission_handler/permission_handler.dart';
import 'package:agora_rtc_engine/agora_rtc_engine.dart';
class Audience extends StatefulWidget {
_AudienceState createState() => _AudienceState();
View package.json
"name": "xxxxx",
"version": "0.1.0",
"private": true,
"main": "public/electron.js",
"homepage": "./",
"dependencies": {
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.9.1",
"@testing-library/jest-dom": "^5.11.0",
View configureStore.ts
/* eslint-disable global-require */
/* eslint-disable no-undef */
import { compose } from "redux";
import persistState from "redux-localstorage";
import { StoreEnhancer } from "redux";
import { routerMiddleware } from "connected-react-router";
import { createBrowserHistory } from "history";
import { createEpicMiddleware } from "redux-observable";
import { createStore, applyMiddleware } from "redux";
import rootEpic from "./epics";
alfonsodev / submitSignUpFormEpic.test.ts
Last active Jun 19, 2020
Attempting to test redux-observable epics in typescript
View submitSignUpFormEpic.test.ts
import { submitSignUpFormEpic } from "../epics";
import { TestScheduler } from "rxjs/testing";
import { FirebaseUser } from "../logic/User";
import { submitSignUpForm } from "../actions/authActions";
import { of, from } from "rxjs";
import { ActionsObservable, StateObservable } from "redux-observable";
import { Observable } from "redux";
import { map } from "rxjs/operators";
import { push } from "connected-react-router";
var fs = require("fs");
View ContentView.swift
// ContentView.swift
import AVFoundation
import SwiftUI
struct Track: Identifiable {
var id = UUID()
var title: String
alfonsodev / ItemList.js
Last active Sep 28, 2019
React Native Item list
View ItemList.js
import React, { Component } from "react";
import {
} from "react-native";
View FormValues.tsx
import React from 'react';
import { withStyles, WithStyles, createStyles } from '@material-ui/core/styles';
import Typography from '@material-ui/core/Typography';
const styles = () =>
root: {
padding: 5,
marginTop: 20,
alfonsodev /
Created May 7, 2019 — forked from syafiqfaiz/
How to copy production database on AWS RDS(postgresql) to local development database.
  1. Change your database RDS instance security group to allow your machine to access it.
    • Add your ip to the security group to acces the instance via Postgres.
  2. Make a copy of the database using pg_dump
    • $ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
    • you will be asked for postgressql password.
    • a dump file(.sql) will be created
  3. Restore that dump file to your local database.
    • but you might need to drop the database and create it first
    • $ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
  • the database is restored
alfonsodev / WaitForCommand.php
Created Jan 14, 2019
Wait for is useful for docker images
View WaitForCommand.php
namespace App\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Output\OutputInterface;
use App\Service\CacheService;
class WaitForCommand extends ContainerAwareCommand
alfonsodev /
Created Nov 10, 2018
symfony 4 tutorial

Symfony 4 tutorial

Creating the project

Project has been created with symfony new project template

composer create-project symfony/website-skeleton demo

init repo and commit

cd demo