Skip to content

Instantly share code, notes, and snippets.

View samuelematias's full-sized avatar

samuca samuelematias

View GitHub Profile
@samuelematias
samuelematias / init.el
Created March 28, 2022 20:45 — forked from Lukewh/init.el
20210215 - Emacs config for typescript and CRA
(eval-and-compile
(customize-set-variable
'package-archives '(("org" . "https://orgmode.org/elpa/")
("melpa" . "https://melpa.org/packages/")
("gnu" . "https://elpa.gnu.org/packages/")))
(package-initialize)
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package)))
@samuelematias
samuelematias / react_native_start_bundle_and_android.json
Last active March 28, 2022 18:32
A way of execute the react native bundle and the android emulator on linux. if you have this problem https://github.com/facebook/react-native/issues/28807, try downgrade you node from 17 or higher to 14 and using this script/command.
{
....
"scripts": {
"run-android": "gnome-terminal -e \"react-native start\" && react-native run-android"
},
....
}
@samuelematias
samuelematias / material_outlined_card.dart
Created March 28, 2022 16:23 — forked from rodydavis/material_outlined_card.dart
Flutter Material Outlined Card
import 'package:flutter/material.dart';
class OutlinedCard extends StatefulWidget {
const OutlinedCard({
Key? key,
required this.child,
}) : super(key: key);
final Widget child;
@samuelematias
samuelematias / emacs_auto_startup_macos.bash
Last active March 21, 2022 20:21
The command to start your Emacs as service on macOS startup.
brew services start d12frosted/emacs-plus/emacs-plus@28
@samuelematias
samuelematias / .gitignore
Created January 3, 2022 14:30 — forked from dileepadev/.gitignore
.gitignore for Flutter projects
### ------------------------- Flutter.gitignore ------------------------ ###
# Miscellaneous
*.class
*.lock
*.log
*.pyc
*.swp
.DS_Store
.atom/
@samuelematias
samuelematias / url_state.dart
Last active March 10, 2021 15:20
Example of cubit state using const/factory in only one state.
part of 'url_cubit.dart';
enum ErrorType { defaultError, urlAlreadyExists, none }
class UrlState extends Equatable {
const UrlState({
this.isLoading,
this.url,
this.urlList,
this.hasError,
@samuelematias
samuelematias / doom.txt
Created February 11, 2021 22:12 — forked from hjertnes/doom.txt
Doom Emacs Cheatsheet
SPC
SPC: find file
, switch buffer
. browse files
: MX
; EX
< switch buffer
` eval
u universal arg
x pop up scratch
@samuelematias
samuelematias / modal_navigation_bar.dart
Last active November 16, 2023 05:47
If you need a modal (showModalBottomSheet) but you have a bottomnavigationbar and the modal needs to be on top of the bottomnavigationbar, use the userootnavigator = true property of showModalBottomSheet.
// This example on Dartpad:
// https://dartpad.dev/cbbfed060a664b6fdaf4229b02cd1add
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@samuelematias
samuelematias / settings.json
Created February 1, 2021 22:36
vsCode configs
{
"terminal.integrated.shell.osx": "/bin/zsh",
"workbench.colorTheme": "Dracula Pro",
"workbench.iconTheme": "vscode-icons",
"workbench.startupEditor": "newUntitledFile",
"terminal.integrated.rendererType": "dom",
"terminal.integrated.fontFamily": "Fira Code",
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"window.title": "${activeEditorLong}${separator}${rootName}",
@samuelematias
samuelematias / auth_interceptor.dart
Created January 29, 2021 10:37 — forked from douglasiacovelli/auth_interceptor.dart
This is a code for an auth interceptor for Dio, which uses a header to avoid retrying indefinitely to refresh the token.
/// This interceptor is simplified because is doesn't contemplate
/// a refresh token, which you should take care of.
/// I haven't tested this code, but I believe it should work.
/// If you have some feedback, please leave a comment and I'll review it :) Thanks.
class AuthInterceptor extends InterceptorsWrapper {
final Dio loggedDio;
final Dio tokenDio;