Skip to content

Instantly share code, notes, and snippets.

View ZenulAbidin's full-sized avatar
🎯
Focusing...

Ali Sherief ZenulAbidin

🎯
Focusing...
View GitHub Profile
@ZenulAbidin
ZenulAbidin / mcc.js
Created October 28, 2024 08:27
MCC codes in JSON. Categorized by section.
const mccData = [
{
category: "Contracted Services",
mccs: [
{ code: "0742", title: "Veterinary Services", icon: "bi-heart-pulse" },
{ code: "0763", title: "Agricultural Cooperatives", icon: "bi-plant" },
{ code: "0780", title: "Horticultural and Landscaping Services", icon: "bi-tree" },
{ code: "1520", title: "General Contractors – Residential and Commercial", icon: "bi-hammer" },
{ code: "1711", title: "Heating, Plumbing, and Air Conditioning Contractors", icon: "bi-thermometer-half" },
{ code: "1731", title: "Electrical Contractors", icon: "bi-lightning" },
@ZenulAbidin
ZenulAbidin / ev-guessing.py
Created September 6, 2024 08:35
Number of guesses for various binary search strategies (random targets)
import matplotlib.pyplot as plt
import numpy as np
import random
from math import log2
# Define the binary search strategies
def choose_straight_middle_left(left_incl, right_incl):
return (left_incl + right_incl) // 2
def choose_straight_middle_right(left_incl, right_incl):
import { Component, OnInit } from '@angular/core';
import { isValidPhoneNumber, parsePhoneNumber} from 'libphonenumber-js';
import { phoneNumbers } from './phone-numbers';
export interface Profile {
firstName?: string;
lastName?: string;
org?: string;
orgTitle?: string;
.profile-info {
ion-label {
margin-right: 1em;
min-width: 7em;
line-height: 45px;
}
ion-input, ion-select {
min-height: 45px;
max-width: 50%;
<div class="profile-info">
<ion-row>
<ion-label>First Name:</ion-label>
<ion-input [(ngModel)]="profile.firstName"></ion-input>
</ion-row>
<ion-row>
<ion-label>Last Name:</ion-label>
<ion-input [(ngModel)]="profile.lastName"></ion-input>
</ion-row>
<ion-row>
export const phoneNumbers = [
{ text: '🇺🇸 +1 United States', code: '+1', country: 'US' },
{ text: '🇨🇦 +1 Canada', code: '+1', country: 'CA' },
{ text: '🇷🇺 +7 Russia', code: '+7', country: 'RU' },
{ text: '🇪🇬 +20 Egypt', code: '+20', country: 'EG' },
{ text: '🇿🇦 +27 South Africa', code: '+27', country: 'ZA' },
{ text: '🇬🇷 +30 Greece', code: '+30', country: 'GR' },
{ text: '🇳🇱 +31 Netherlands', code: '+31', country: 'NL' },
{ text: '🇧🇪 +32 Belgium', code: '+32', country: 'BE' },
{ text: '🇫🇷 +33 France', code: '+33', country: 'FR' },
@ZenulAbidin
ZenulAbidin / example.module.ts
Last active November 29, 2023 08:33
Angular module for phone number component
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms'
import { IonicModule } from '@ionic/angular';
import { PhoneNumberComponent } from './phone-number.component';
@NgModule({
imports: [
CommonModule,
FormsModule,
@ZenulAbidin
ZenulAbidin / asciikeyboard.html
Created October 29, 2023 11:22
ASCII keyboard with hex codes
<html><head>
<style>
.kb {
display: grid;
grid-template-columns: repeat(13, 1fr);
grid-gap: 5px;
margin: 20px;
}
.k {
@ZenulAbidin
ZenulAbidin / cldr-locale-helper.sh
Last active April 27, 2023 11:05
Basic shell script to drive cldr-gen-locale-data.py
# Copyright 2023 Ali Sherief
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@ZenulAbidin
ZenulAbidin / cldr-gen-locale-data.py
Last active April 27, 2023 11:05
Parses i18n data form CLDR metadata and the local distribution /usr/share/i18n/locales folder.
# Copyright 2023 Ali Sherief
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,