Skip to content

Instantly share code, notes, and snippets.

View Ian-FR's full-sized avatar
:octocat:

Ian Rocha Ian-FR

:octocat:
View GitHub Profile
@Ian-FR
Ian-FR / generate-ios.sh
Created January 9, 2023 19:24 — forked from monmonja/generate-ios.sh
generate ios from command line
# download this file to your project folder and excute
# chmod +x generate-ios.sh
# then run using
# ./generate-ios.sh
# flutter build defaults to --release
flutter build ios
# make folder, add .app then zip it and rename it to .ipa
mkdir -p Payload
@Ian-FR
Ian-FR / result.dart
Created June 7, 2022 11:39
Either functional approach
import 'package:flutter_test/flutter_test.dart';
import 'package:oakberry_superapp/app/error/failures.dart';
abstract class Result<L, R> {
static Result<L, R> failure<L, R>(L error) => _Left(error);
static Result<L, R> success<L, R>(R data) => _Right(data);
bool get isFailure => this is _Left<L, R>;
bool get isSuccess => this is _Right<L, R>;
@Ian-FR
Ian-FR / private-build-plans.toml
Created September 20, 2021 12:37
Iosevka custom
[buildPlans.iosevka-ian-custom]
family = "Iosevka Ian Custom"
spacing = "normal"
serifs = "sans"
no-cv-ss = false
[buildPlans.iosevka-ian-custom.variants]
inherits = "ss14"
[buildPlans.iosevka-ian-custom.weights.thin]
@Ian-FR
Ian-FR / Util commands
Last active February 25, 2022 12:53
util commands
# Running android from terminal
/home/ian/Android/Sdk/emulator/emulator @Pixel_4_API_30 -dns-server 8.8.8.8
# Flutter coverage (needs the lcov installed
flutter test --coverage test/src/something/**test.dart && genhtml -o coverage coverage/lcov.info
@Ian-FR
Ian-FR / keychron.service
Last active December 5, 2022 23:26
keychron K2 V2 linux
[Unit]
Description=The command to make the Keychron K2 work
[Service]
Type=oneshot
ExecStart=/bin/bash -c "echo 0 > /sys/module/hid_apple/parameters/fnmode"
[Install]
WantedBy=multi-user.target
@Ian-FR
Ian-FR / start-web-server.sh
Created October 5, 2020 01:53
script to start web server quickly
sudo service php7.4-fpm start
status=$1
cols=$(($COLUMNS - 29))
red=$(tput setaf 1)
normal=$(tput sgr0)
if [[ $status -eq 0 ]]; then
printf " * Starting php7.4-fpm\033[%dC[ OK ]\n" $(($cols))
else
printf " * Starting php7.4-fpm\033[%dC[${red}fail${normal}]\n" $(($cols))
fi
@Ian-FR
Ian-FR / Fix WSL DNS
Last active July 21, 2024 00:11
WSL as Web Server
# /etc/wsl.conf
[network]
generateResolvConf = false
# /etc/resolv.conf
nameserver 8.8.8.8
nameserver 1.1.1.1