Skip to content

Instantly share code, notes, and snippets.

View alphaolomi's full-sized avatar
🎯
Focusing

Alpha alphaolomi

🎯
Focusing
View GitHub Profile
@alphaolomi
alphaolomi / Number Assignments in TZ.md
Created July 15, 2021 09:05
Number Assignments in TZ

Number Assignments

S/N OPERATOR 7-digit Assignments STATUS
1. MIC Tanzania PLC 071 + Y XXXXXX
065 + Y XXXXXX
067 + Y XXXXXX
Operational
2. Tanzania Telecommunications Corporation 073 + Y XXXXXX Operational
3. Vodacom Tanzania PLC 074 + Y XXXXXX
075 + Y XXXXXX
076 + Y XXXXXX
Operational
4. Zanzibar Telecom PLC 077 + Y XXXXXX Operational
5. Airtel Tanzania PLC 078 + Y XXXXXX
068 + Y XXXXXX
069 + Y XXXXXX
Operational
6. Smile Communications Tanzania Limited 066 + Y XXXXXX
@alphaolomi
alphaolomi / torrent_trackers.txt
Created July 29, 2021 19:59
July29_2021_torrent_tacker
http://tracker2.wasabii.com.tw:6969/announce
http://www.wareztorrent.com:80/announce
udp://bt.xxx-tracker.com:2710/announce
udp://tracker.eddie4.nl:6969/announce
udp://tracker.grepler.com:6969/announce
udp://tracker.mg64.net:2710/announce
udp://wambo.club:1337/announce
udp://tracker.dutchtracking.com:6969/announce
udp://tc.animereactor.ru:8082/announce
udp://tracker.justseed.it:1337/announce
@alphaolomi
alphaolomi / toc.md
Created September 17, 2021 04:55
LARAVEL TESTING like a Champ

TABLE OF CONTENTS

Getting started

  • Intro
  • Our first HTTP test
  • Using a database
  • Using factories
  • Factory relations
<!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.0">
<title>Document</title>
</head>
@alphaolomi
alphaolomi / form.tsx
Last active March 19, 2022 14:12
RHF Smart Form
import React from "react";
import { useForm, UseFormReturn, SubmitHandler } from "react-hook-form";
type InputProps = React.DetailedHTMLProps<
React.InputHTMLAttributes<HTMLInputElement>,
HTMLInputElement
>;
const Input = React.forwardRef<HTMLInputElement, InputProps>((props, ref) => (
<label htmlFor={props.name}>
@alphaolomi
alphaolomi / numberWithCommas.ts
Created March 19, 2022 14:10
Number with commas (JS/TS)
// Number with commas
function numberWithCommas(x: number): string {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function toLocaleStringSupportsLocales(number: number | string) {
if (typeof number === "string") {
return parseFloat(number).toLocaleString();
}
return number.toLocaleString();
@alphaolomi
alphaolomi / email_validation.ts
Last active March 27, 2022 20:42
Node.js Email Validation
const validateEmail = (email: string) => {
const re =
/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(String(email).toLowerCase());
};
const ifElse = (condition: boolean, ifTrue: any, ifFalse: any) => {
return condition ? ifTrue : ifFalse;
};
@alphaolomi
alphaolomi / HTML_Form_Validation.md
Created March 29, 2022 22:20
Warning: HTML form validation

HTML form validation

Warning: HTML form validation is not a substitute for server-side scripts that ensure the entered data is in the proper format before it is allowed into the database. It's far too easy for someone to make adjustments to the HTML that allow them to bypass the validation, or to remove it entirely. It's also possible for someone to bypass your HTML entirely and submit the data directly to your server. If your server-side code fails to validate the data it receives, disaster could strike when improperly-formatted data (or data which is too large, is of the wrong type, and so forth) is entered into your database.

@alphaolomi
alphaolomi / node_mailer.mjs
Created April 29, 2022 13:50
Test Node mailer smtp transaport
import { createTransport } from "nodemailer";
const smtpConnection = createTransport({
host: "smtp-relay.sendinblue.com",
port: 587,
auth: {
user: process.env.SMTP_USER || "",
pass: process.env.SMTP_PASSWORD || "",
},
});
@alphaolomi
alphaolomi / fresh.md
Created May 25, 2022 19:18
Fresh Parrot Linux

fresh linux

sudo apt update
sudo apt full-upgrade

ToC

  1. php
  2. node