Skip to content

Instantly share code, notes, and snippets.

View sixtusagbo's full-sized avatar

Sixtus Miracle Agbo sixtusagbo

View GitHub Profile
@sixtusagbo
sixtusagbo / copy_file.sh
Created April 8, 2025 04:33
Bash script for file transfer via SFTP
#!/bin/bash
# Copyright © Sixtus Agbo
# Bash script for file transfer via SFTP
# Usage: ./copy_file.sh <local_file_path> [remote_filename]
# Default values
REMOTE_USER="foo_remote_user"
REMOTE_HOST="foo.server"
REMOTE_PATH="/home/foo/bar"
@sixtusagbo
sixtusagbo / 419.blade.php
Created October 13, 2024 10:05
Simple laravel Page Expired
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Page Expired</title>
@sixtusagbo
sixtusagbo / gist:1f6742d8a149373d55c891a53d028b83
Created October 13, 2024 10:05
Simple laravel 419 Page Expired
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Page Expired</title>
# SETUP #
DOMAIN=example.com
PROJECT_REPO="[email protected]:example.com/app.git"
AMOUNT_KEEP_RELEASES=5
RELEASE_NAME=$(date +%s--%Y_%m_%d--%H_%M_%S)
RELEASES_DIRECTORY=~/$DOMAIN/releases
DEPLOYMENT_DIRECTORY=$RELEASES_DIRECTORY/$RELEASE_NAME
# stop script on error signal (-e) and undefined variables (-u)
@sixtusagbo
sixtusagbo / four_point_design_system.dart
Created August 3, 2024 07:09
Using extension types to implement 4-point grid system in flutter
// This code was borrowed from here: https://x.com/mkobuolys/status/1819377685639950585
const _multiplier = 4.0;
extension type DesignSystemSpace._(double spacing) implements double {
DesignSystemSpace(double token) : spacing = token * _multiplier;
}
final space = DesignSystemSpace(4); // 16
final padding = EdgeInsets.all(DesignSystemSpace(4)); // EdgeInsets.all(16.0)
@sixtusagbo
sixtusagbo / helpers.dart
Created July 26, 2024 15:06
Add a widget between each pair of widgets in a list of widgets.
/// Extension on Iterable<Widget> to add a specified widget between each pair of widgets.
extension WidgetIterableExtension on Iterable<Widget> {
List<Widget> addBetween(Widget child) {
final iterator = this.iterator;
final result = <Widget>[];
if (iterator.moveNext()) result.add(iterator.current);
while (iterator.moveNext()) {
result
@sixtusagbo
sixtusagbo / main.dart
Last active July 16, 2024 15:29
Text slide animation in Flutter (No external package)
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text('Text Slide Animation')),
@sixtusagbo
sixtusagbo / main.dart
Last active March 20, 2024 03:19
Rajvis Infinite size issue
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
@sixtusagbo
sixtusagbo / git_commited_but_unpushed.md
Last active March 19, 2024 06:51
How to get a list of all the files that have been commited but not yet pushed
You can use the following Git command in your terminal to see a list of all files that have been committed but not yet pushed:
git diff --name-only origin/main

This command compares your local repository (including committed changes) with the main branch on the origin remote repository.

To view more statistics on it:
git diff --stat origin/main
@sixtusagbo
sixtusagbo / translators.html
Created March 18, 2024 01:22
i18n for web w/ translators
<!-- Google Translate -->
<div id="google_translate_element"></div>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en',
layout: google.translate.TranslateElement.InlineLayout.SIMPLE
}, 'google_translate_element');
}
</script>