Skip to content

Instantly share code, notes, and snippets.

View Kunoacc's full-sized avatar
🎯
Focusing

Nelson Nelson-Atuonwu Kunoacc

🎯
Focusing
View GitHub Profile
function getCacheSize(data, queries) {
const n = data.length;
const q = queries.length;
const events = [];
// TODO: add validations against constraints for inputs
// Create events for data insertions and expirations
for (let i = 0; i < n; i++) {
const [startTime, ttl] = data[i];
@Kunoacc
Kunoacc / http.ts
Created February 26, 2024 15:33
This is a custom fetch/http implementation used in my projects. I prefer working with fetch vs Axios, so I build this to have a smoother experience with fetch. It's reusable, the base http function supports dependency injection, and the http verb methods all support callbacks. Written in Typescript
import { API_BASE_URL } from '@/constants'
export interface HttpResponse<T> extends Response {
parsedBody?: T
}
type PostPathGenerator = (basePath: string) => string
export type HttpClient = <T>(req: RequestInfo) => Promise<HttpResponse<T>>
### Keybase proof
I hereby claim:
* I am kunoacc on github.
* I am kunoacc (https://keybase.io/kunoacc) on keybase.
* I have a public key ASA8QM3uaE1-1sqBgEVGhs11D4GNw5LQcK97z9Ooc_fPewo
To claim this, I am signing this object:
@Kunoacc
Kunoacc / bs3-login-form.html
Created January 27, 2016 00:11 — forked from bMinaise/bs3-login-form.html
Bootstrap 3 - Login Form Example From: http://bootsnipp.com
<div class="container">
<div class="row">
<div class="col-sm-6 col-md-4 col-md-offset-4">
<h1 class="text-center login-title">Sign in to continue to Bootsnipp</h1>
<div class="account-wall">
<img class="profile-img" src="https://lh5.googleusercontent.com/-b0-k99FZlyE/AAAAAAAAAAI/AAAAAAAAAAA/eu7opA4byxI/photo.jpg?sz=120"
alt="">
<form class="form-signin">
<input type="text" class="form-control" placeholder="Email" required autofocus>
<input type="password" class="form-control" placeholder="Password" required>
@Kunoacc
Kunoacc / NavigationDrawer.qml
Created January 2, 2016 22:38 — forked from jbache/NavigationDrawer.qml
Qt Quick Navigation Drawer
/*
Copyright (c) 2014 Cutehacks A/S
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions: