Skip to content

Instantly share code, notes, and snippets.

View devhammed's full-sized 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 / countries.json
Created October 17, 2020 05:21
Countries with Name, Dial Code, Emoji Flag and ISO Code
[
{
"name": "Afghanistan",
"flag": "🇦🇫",
"code": "AF",
"dial_code": "+93"
},
{
"name": "Åland Islands",
"flag": "🇦🇽",
@devhammed
devhammed / nigeria-state-and-lgas.json
Last active April 2, 2024 18:37
Nigeria States and LGAs in one JSON file
[
{
"state": "Adamawa",
"alias": "adamawa",
"lgas": [
"Demsa",
"Fufure",
"Ganye",
"Gayuk",
"Gombi",
@devhammed
devhammed / app.js
Last active February 22, 2024 22:51
120-lines implementation of a reactive system in JavaScript.
const { reactive, effect,computed, ref, watch} = require('./reactive');
const x = ref(0)
const y = ref(0)
const state = reactive({
showSword: false,
message: "Hey young padawan!",
});
@devhammed
devhammed / SpatieLaravelDataSynthesizer.php
Last active February 6, 2024 11:51
This is a Livewire 3 Synthesizer (https://livewire.laravel.com/docs/synthesizers) for classes using spatie/laravel-data package (https://spatie.be/docs/laravel-data/v3/introduction)!
<?php
namespace App\Support\Synthesizers;
use Spatie\LaravelData\Data;
use Livewire\Mechanisms\HandleComponents\Synthesizers\Synth;
class SpatieLaravelDataSynthesizer extends Synth
{
public static string $key = 'spld';
@devhammed
devhammed / .gitlab-ci.yml
Last active February 1, 2024 17:35
GitLab Deploys Pipeline for Laravel (with environments and rollback support)
stages:
- deploy
production-deploy:
stage: deploy
environment: production
only:
- /^v.*$/
script:
- which ssh-agent || (apt-get update -y && apt-get install openssh-client -y)
@devhammed
devhammed / Country.php
Last active December 10, 2023 17:23
World Countries as a Sushi model that can be used as a regular Laravel model (https://github.com/calebporzio/sushi) and I also provided a Laravel config file if you prefer the configuration method but it can also be adapted for other PHP projects!
<?php
namespace App\Models;
use Sushi\Sushi;
use Illuminate\Database\Eloquent\Model;
class Country extends Model
{
use Sushi;
@devhammed
devhammed / statelessful.dart
Created May 26, 2021 12:11
Flutter Statelessful widget (inline stateful widgets)
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;