Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
All roses are not flower, where did you put Royce?

Hammed Oyedele devhammed

💭
All roses are not flower, where did you put Royce?
View GitHub Profile
@devhammed
devhammed / statelessful.dart
Created May 26, 2021
Flutter Statelessful widget (inline stateful widgets)
View statelessful.dart
import 'package:flutter/material.dart';
class Statelessful<T> extends StatefulWidget {
final T Function() initialState;
final Widget Function(
BuildContext context,
T state,
void Function(T state) setState,
) builder;
@devhammed
devhammed / brainfuck.go
Last active Jan 18, 2021
Brainfuck Interpreter in 98 lines of Go!
View brainfuck.go
package main
import (
"fmt"
"io/ioutil"
"os"
)
func usage() {
fmt.Printf("BrainFuck Usage: %s script.bf\r\n", os.Args[0])
@devhammed
devhammed / countries.json
Created Oct 17, 2020
Countries with Name, Dial Code, Emoji Flag and ISO Code
View countries.json
[
{
"name": "Afghanistan",
"flag": "🇦🇫",
"code": "AF",
"dial_code": "+93"
},
{
"name": "Åland Islands",
"flag": "🇦🇽",
@devhammed
devhammed / 00-app-Exceptions-Handler.php
Last active Aug 12, 2020
Laravel API Essentials...this is the base configuration I use for Laravel API and React frontend.
View 00-app-Exceptions-Handler.php
<?php
namespace App\Exceptions;
use Throwable;
use Illuminate\Support\Arr;
use Illuminate\Http\JsonResponse;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Validation\ValidationException;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
View deb-packaging-guide.md

Creating deb packages to deploy applications in Debian or Ubuntu is a fairly simple process. However, I have found that the majority of existing documentation for doing so is overly verbose or more complex than needed. This writeup aims to summaries the process of creating deb packages in just a few simple steps.

Here is a short summary of what this writeup covers:

  • How to create a bare bones deb package
  • How to optionally add package configuration files
  • How to optionally add package dependancies
  • How to optionally add package scripts that run before or after installation

Create a Build Directory

View openpgp.md
@devhammed
devhammed / fetch-macos.py
Created Jul 7, 2020
MacOS DMG Installers Downloader
View fetch-macos.py
#!/usr/bin/env python
# encoding: utf-8
#
# https://github.com/munki/macadmin-scripts/blob/master/installinstallmacos.py
#
# Copyright 2017 Greg Neagle.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@devhammed
devhammed / build-and-release.yml
Last active Jan 6, 2022
GitHub Actions workflow to build Flutter app and create Release, put this file under `.github/workflows` folder.
View build-and-release.yml
on:
push:
branches:
- master
name: Build and Release Apps
jobs:
build:
name: Build Apps
runs-on: macos-latest
@devhammed
devhammed / countries-iso.json
Last active Jan 29, 2020
ISO code of Countries in the world, I also attached a simple JavaScript function that is able to convert the code to the country's flag emoji 🔥🔥🔥
View countries-iso.json
[
{
"code": "AD",
"label": "Andorra"
},
{
"code": "AE",
"label": "United Arab Emirates"
},
{
@devhammed
devhammed / update-fork
Last active Jan 15, 2020
Update forked Repositories, works for any Git repository e.g GitHub, GitLab, BitBucket etc.
View update-fork
#!/usr/bin/env bash
# The branch (defaults to master) to update,
# can be the first parameter if there is upstream remote already
branch="${1:-master}"
# Check if there is no existing 'upstream' remote repo
if [[ ! "$(git remote)" =~ "upstream" ]]; then
# Add upstream remote repo
git remote add upstream "$1"