Skip to content

Instantly share code, notes, and snippets.

View chombazm's full-sized avatar
🇿🇲
Focusing

Chomba chombazm

🇿🇲
Focusing
View GitHub Profile
@chombazm
chombazm / gist:daeb45efbd28bb67d53d4e257daad32f
Created January 16, 2024 10:24
Local-Push-Notifications-App.tsx
import { StatusBar } from "expo-status-bar";
import { Button, Platform, StyleSheet, Text, View } from "react-native";
// notifications imports
import * as Device from "expo-device";
import * as Notifications from "expo-notifications";
import Constants from "expo-constants"; // Optional
// Initialize the notification service
Notifications.setNotificationHandler({
@chombazm
chombazm / microcosm-onix-bisac-codes.csv
Created March 2, 2022 13:44 — forked from natebeaty/microcosm-onix-bisac-codes.csv
ONIX BISAC codes from microcosm publishing database, with some manually entered codes — use at your own risk!
ANT000000 Antiques & Collectibles / General
ANT001000 Antiques & Collectibles / Americana
ANT002000 Antiques & Collectibles / Art
ANT003000 Antiques & Collectibles / Autographs
ANT005000 Antiques & Collectibles / Books
ANT006000 Antiques & Collectibles / Bottles
ANT007000 Antiques & Collectibles / Buttons & Pins
ANT008000 Antiques & Collectibles / Care & Restoration
ANT009000 Antiques & Collectibles / Transportation
ANT010000 Antiques & Collectibles / Clocks & Watches
@chombazm
chombazm / closures.js
Last active January 10, 2022 16:53
Learning closures with experiments. Javascript the hard partsyes the Hapas
console.log("thenxtlvls 🚀 ", 2022);
// using clousures create a function that tracks how many times it's been called
// and exit when limit is reached. Reset the counter back to zero.
function functionCreatorWithLimit(limit) {
let counter = 0;
function functionToBeCalledWithDefinedLimit () {
if (counter >= limit ) {
console.log(`Limit of (${counter}) calls is reached, the counter has rested back to zero and you can run again`)
counter = 0;
@chombazm
chombazm / script.js
Created January 8, 2022 17:53
copy text to clipboard
// console.log("thenxtlvls", 2022);
function copyContentToClipboard (content) {
console.log(content, "to be copied")
navigator.clipboard.writeText(content).then(function() {
alert("text copied to clipboard")
}, function() {
alert("Oops! Couldnt copy text to clipboard")
})
}
// Paste in your browser console
const kamba = vokamba => {
const sp = new SpeechSynthesisUtterance(vokamba);
[sp.voice] = speechSynthesis.getVoices();
speechSynthesis.speak(sp);
};
kamba('My name is chomba chanda, an intern at bongohive');
@chombazm
chombazm / .ts
Created May 27, 2021 04:40
Learning-typescript-types
let myStr: string;
let myNumber: number;
let myBool: boolean;
let myVar: any;
let strNumTuple: [string, number];
//voidi
let myVoid: void = undefined;
@chombazm
chombazm / index.html
Created April 12, 2021 10:51
Survey Form
<main id="main-container">
<header id="header-section">
<h1 id="title">
School to Newsletter survey
</h1>
<p id="descripltioln">
Lastly, we’ll drag and drop a button and edit the text to “Add to cart” and link it up to a fresh new screen.
</p>
</header>
@chombazm
chombazm / index.html
Created April 12, 2021 08:17
Tribute Page
<main id="main">
<header>
<h1 id="title">Nelson Mandela</h1>
<h3>A man guided with hope, not fear.</h3>
</header>
<div id="img-div">
<img src="https://miro.medium.com/max/990/1*4q3MqQCFB_gy_ckqz6gomQ.jpeg" alt="nelson mandela" id="image">
<span id="img-caption">
Photo Credit: Boston Big Picture
</span>