Skip to content

Instantly share code, notes, and snippets.

View koechkevin's full-sized avatar
💭

KEVIN KOECH koechkevin

💭
View GitHub Profile
@koechkevin
koechkevin / spreadsheet.js
Created May 2, 2023 09:25
Spreadsheet utils
import fetchJson from "@/charterafrica/utils/fetchJson";
export async function fetchSpreadsheet(path, options) {
const params = {
...options,
key: process.env.GOOGLE_API_KEY,
};
const res = await fetchJson.get(
`https://sheets.googleapis.com/v4/spreadsheets${path}`,
{ params }
@koechkevin
koechkevin / playListItems.json
Created March 10, 2023 12:49
Playlist Items
{
"kind": "youtube#playlistItemListResponse",
"etag": "iOyRQaMhPoX-PFhTnLaJBFV3r7Y",
"items": [
{
"kind": "youtube#playlistItem",
"etag": "RYpX0ENBvMxA01NpTLpqVvSC6Ys",
"id": "UEx2dXdiWVRrVXpIZk5ZWWlMV3NlUHZzS3h5dVY5ektqYy41NkI0NEY2RDEwNTU3Q0M2",
"snippet": {
"publishedAt": "2023-02-16T14:10:20Z",
@koechkevin
koechkevin / channelPlaylists.json
Created March 10, 2023 12:41
Playlists in a channel
{
"kind": "youtube#playlistListResponse",
"etag": "gQ8fwXjx5ZDpu6T5qUt-No8SRkg",
"nextPageToken": "CDIQAA",
"pageInfo": {
"totalResults": 151,
"resultsPerPage": 50
},
"items": [
{
@koechkevin
koechkevin / youtubeThreads.json
Created March 10, 2023 11:49
Youtube comments threads
{
"kind": "youtube#commentThreadListResponse",
"etag": "M6pYMLfwJF4E5-1j75TD0uMUzoE",
"nextPageToken": "Z2V0X3JhbmtlZF9zdHJlYW1zLS1Db0lFQ0lBRUZSZTMwVGdhOXdNSzhnTUkyRjhRZ0FRWUJ5TG5Bd3RFNG9udHF5NU44UmtyelowV1RDSnJsUFRJRXE0aGtreEphRVZBQXVza3JuZUZxYTJnZEtvbW9tSEVIVTFlSU90UXp4eVhLQWw5NGFkMVRubWN2MC1zd0FLUzZmaTFLQkI2blJKbEhUUG8tcmtPbE1JSVRaTnlxM1ZOSmVRbzdpaWhEQzh1dUJ1bXdrd0pTdm1veW9aVFBpVk9sUVRQcUF5UVRtcG91dUpNTnRkRGhSUzFWQWxPTGM0eWFGbTJxa3g2Y1VfdnR3c041YXFzUk9kSDJrbVNHa2N2dFpuUTdQcTlzVndQdjFSNEl6cEJkT052VkJzR0tPZXVNb25rVG1TZmlKbWxWUGhBaEVVMFVWakNqd29Ua0hraWFlOUVWN1pTeEFVbE5mVWFiYW5uVzlvc3NKRWJvamo5aEdSTUdJZnNWN0lwR0pJdUdxVEJpMFhBREVjQ1BpV0NyQkNScWVqazBsQXQtQ0lRSndzbkk2ZmdocVlNbWVIcnJXdDZCbk1VMmNJU2dkSVJFUUZISnExT1ZMY1JDaGtjaXRjSHBoWFdEN3dRWE54MXhDZFNiSmpOamFNdVpaTFdfQ1dWSTdXRnZhT3hsb1JjRUVXYzJBWHlWWlYzQ0JHR3pGZVp5cEtTMlN1VVNDaXBOUVpSb1l0TVJrSkozY1lrdFpxWW9ZSVROVEE2MzVabGs1R0tSSEtyU2tvS0tNcjZENDdNYW1vTkpzYXFLMmhNWkwweE8ydFNOMUtQbmJqa3ZrbE1UMXE3YVVMSE1xWjVmaDQwRUY0MURXeUlHTnJTd0plTmk3Q2F6cE5SMkRfLURrRVVr
const output = {
full_name: "EticaAI/ais-ethics-cplp", // Tool Name
html_url: "https://github.com/EticaAI/ais-ethics-cplp", // Tool Link
description:
"Contexto tecnológico para fomento de Ética na Inteligência Artificial na Comunidade dos Países de Língua Portuguesa (CPLP): Angola, Brasil, Cabo Verde, Guiné Equatorial, Guiné-Bissau, Macau, Moçambique, Portugal, São Tomé e Príncipe e Timor-Leste", // Tool Description
url: "https://api.github.com/repos/EticaAI/ais-ethics-cplp", // Tool Github
languages_url:
"https://api.github.com/repos/EticaAI/ais-ethics-cplp/languages", // fetch this url for tool languages
languages: {
Ruby: 6802,
@koechkevin
koechkevin / drug_availability.py
Created April 18, 2021 16:42
Drug Material Request
import frappe
from datetime import date, datetime, timedelta
import json
from erpnext.healthcare.doctype.patient_encounter.patient_encounter import get_prescription_dates
from erpnext.accounts.doctype.pos_invoice.pos_invoice import get_stock_availability
from clinical.api.prescription.stock import make_material_request
from frappe import _
@frappe.whitelist()
def get_doctor_medication_orders(patient, patient_encounter_status='', patient_encounter=''):
@koechkevin
koechkevin / Search.ts
Created February 10, 2021 17:05
Sample Component
import React, { FC, useState } from 'react';
import { Button, Select, Typography } from 'antd';
import { PlusCircleFilled, SearchOutlined } from '@ant-design/icons/lib';
import { useSelector } from 'react-redux';
import { useHistory } from 'react-router';
import styles from './Search.module.scss';
import { getBorrowerNames } from '../../utils/helper';
import routes from '../../constants/routes';
@koechkevin
koechkevin / tree.ts
Created October 21, 2020 09:08
Tree implementation Typescript
interface NodeInterface {
value: any;
children: NodeInterface[];
key: string;
parent?: NodeInterface;
depth?: number;
}
interface TreeInterface {
readonly root: NodeInterface | null;
@koechkevin
koechkevin / Dockerfile
Last active August 14, 2020 11:43
nginx proxy config
FROM nginx:1.13.7-alpine
RUN mkdir -p /app
WORKDIR /app
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
df -h
vgdisplay
*Extend LVM *
lvextend -l +{Free PE / Size} /dev/mapper/ubuntu--vg-ubuntu--lv
*Resize the file-system
resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv