Skip to content

Instantly share code, notes, and snippets.

View 0ex-d's full-sized avatar
💭
Engr. management

Precious 0ex-d

💭
Engr. management
  • Irgendwo, Irgendwohin (100% remote)
View GitHub Profile
@0ex-d
0ex-d / override_button.jsx
Last active March 4, 2020 08:44
Overriding components in React and Vanilla JavaScript
import React, { Component } from 'react';
import FakeButton from 'react-fake-button'; // from npm public repo
/* In this example, we would be preppending
* a button to a component
* Learn to overrride components we can't control
*/
class AppComponent extends Component {
constructor() {}
@0ex-d
0ex-d / Base64.js
Created May 9, 2020 14:28
Hard-coded support for Base64 in NodeJs
// @flow
// Inspired by: https://github.com/davidchambers/Base64.js/blob/master/base64.js
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
const Base64 = {
btoa: (input:string = '') => {
let str = input;
let output = '';
for (let block = 0, charCode, i = 0, map = chars;
@0ex-d
0ex-d / my_pagination_component.jsx
Created August 1, 2020 18:32
Pagination component using ReactJs for your bulky data pages or dashboard.
// Handling pagination with React hooks
// React
// By Precious Akin
import React, {
useEffect, useState
} from 'react';
const Page = () => {
const [page, setPage] = useState(1); // first page
const [totalPages, setTotalPages] = useState(0);
@0ex-d
0ex-d / pushnotif_service.py
Last active August 1, 2020 19:32
Serverside push notifications done using Firebase SDK in Python
"""
A server-side implementation module for push notifications
utilizing firebase SDK
Reference https://firebase.google.com/docs/reference/admin/python/
By Precious Akin"""
from app import app
@0ex-d
0ex-d / override_button_hook.jsx
Created August 1, 2020 19:43
Overriding numb components in React and Vanilla JavaScript (Using hooks)
/* In this example, we would be preppending
* a button to a component
* Learn to overrride components we can't control
* By Precious Akin
*/
import React, { useState, useEffect } from 'react';
import FakeButton from 'react-fake-button';
export default ()=>{
@0ex-d
0ex-d / react_env_selector.js
Created August 4, 2020 23:32
React Javascript environment config for various URL rules. Used in my React Native project.
/*
* Configure various url rules per environment
* Use `envSelector` and createSelector hooks to load env.json file
* By Precious Akin
*/
import { createSelector } from 'reselect';
import ENV_FILE from '../../env.json';
const envSelector = () => ENV_FILE;
@0ex-d
0ex-d / interests-and-tools.txt
Last active November 25, 2020 22:18
Languages I code in and tools I use for full-stack development across products.
ReactJS ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░
Python ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░
HTML/CSS ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░
MongoDB ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░
NodeJs ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░
GraphQL ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░
.sh ▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░
PostgreSQL ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░
C/Rust ▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░
VueJS ▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░
@0ex-d
0ex-d / duoligot.py
Created August 12, 2020 22:06
Duoligot is a NLP class that uses various language processing toolset to convert your spoken words to text. Can be used in audio transcription, voice commands e.t.c
__doc__ = """
NLP module to convert speech-to-text, can be used
for extracting audio files, voice commands.
requires speech_recognition toolset for NLP.
Only works with English Language
By Precious Akin
"""
import speech_recognition as recognize
class Duoligot:
'''
Use 'passlib' for password encryption and make the perfect round algo. ;)
Required: pip install passlib
'''
from passlib.context import CryptContext
pwd_context = CryptContext(
schemes=["pbkdf2_sha256"],
default="pbkdf2_sha256",
pbkdf2_sha256__default_rounds=30000
)
@0ex-d
0ex-d / TimeDogg.py
Last active August 24, 2020 06:40
Event and Date manager used by @classboard for reminding folks to attend online classes ;(
__doc__ = '''
~TimeDogg~
Used by @Classboard for reminding folks to attend online classes ;(
- Use of `private` modifiers to prevent aliens from invading
- typechecking following Python 3.x standards
- This is not @facts or @uberfacts...
don't ever ever try to call private class members from the outside world
or I would .ssh ya!
Author: Precious Akin