Skip to content

Instantly share code, notes, and snippets.

View callezenwaka's full-sized avatar

Callis callezenwaka

View GitHub Profile
@callezenwaka
callezenwaka / pyenv.md
Created August 29, 2024 10:12
Steps to Use `pyenv` to Create and Activate a Virtual Environment.

Summary of Commands

By following these steps, you can manage multiple Python versions and virtual environments efficiently using pyenv.

Install Python Version:

pyenv install <version>
@callezenwaka
callezenwaka / theme.html
Created August 29, 2024 09:44
This is theme selection html boilerplate.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>HTML 5 Boilerplate</title>
<link rel="stylesheet" href="style.css">
<style>
:root {
@callezenwaka
callezenwaka / check.py
Last active November 9, 2022 07:52
How To Check If Python Is 32 Or 64-bit
# First import struct module.
import struct
# Return 64 means 64-bit version, return 32 means 32-bit version.
version = struct.calcsize("P") * 8
print(version)
@callezenwaka
callezenwaka / index.js
Created September 7, 2022 16:20
React two-way data binding
import logo from "./logo.svg";
import "./App.css";
import { useState } from "react";
function App() {
const [food, setFood] = useState("dumpling");
return (
<div className="App">
<input
@callezenwaka
callezenwaka / Array.sol
Last active February 19, 2022 00:45
Handle array in javascript
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title Storage
* @dev Store & retrieve value in a variable
*/
contract Array {
@callezenwaka
callezenwaka / index.html
Created January 19, 2022 09:05
Add space in html file
<!DOCTYPE html>
<html>
<head>
<title>
How to insert spaces/tabs in text using HTML/CSS?
</title>
</head>
<body>
<h1 style="color: green">GeeksforGeeks</h1>
<b>How to insert spaces/tabs in text using HTML/CSS?</b>
@callezenwaka
callezenwaka / Event.vue
Created January 19, 2022 07:24
Handle events in Vue 3 with Typescript
<template>
<div class="body--wrapper" :class="{ active: !slide && !width }">
<Header"></Header>
<div class="container">
<router-view :key="$route.path"/>
</div>
</div>
</template>
<script lang="ts">
Setup a POST => request;
Replace firebase api key in the url => "https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key={FIREBASE_API_KEY}"
Pass the following params in the body of the request
{
"email": "<email>",
"password": "<password>",
"returnSecureToken": true
}
'use strict';
// Import packages
import admin from 'firebase-admin';
const FieldValue = admin.firestore.FieldValue;
// Add credential service account details
import serviceAccount from ".path-to-file.json";
// Initialize firebase admin sdk config
@callezenwaka
callezenwaka / Padding numbers in JavaScript
Last active July 9, 2021 05:09
Number Padding In JavaScript
// Define new date, result
let d = new Date(), result;
// Set new date
d.setDate(d.getDate() + 20);
// Return result
result = ('0' + d.getDate()).slice(-2) + '/' + ('0' + (d.getMonth()+1)).slice(-2) + '/' + d.getFullYear();
Explanation:
.slice(-2) returns the last 2 characters of the string.