Skip to content

Instantly share code, notes, and snippets.

View ManUtopiK's full-sized avatar
:octocat:
Ready to code.

Emmanuel Salomon ManUtopiK

:octocat:
Ready to code.
View GitHub Profile
@DavidWells
DavidWells / github-proxy-client.js
Last active March 3, 2025 17:47
Full Github REST api in 34 lines of code
/* Ultra lightweight Github REST Client */
// original inspiration via https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb
const token = 'github-token-here'
const githubClient = generateAPI('https://api.github.com', {
headers: {
'User-Agent': 'xyz',
'Authorization': `bearer ${token}`
}
})
@DavidWells
DavidWells / javascript-proxy-as-rest-client.js
Last active May 12, 2024 14:24
Using a javascript proxy as low code REST client
/* Using a JavaScript proxy for a super low code REST client */
// via https://dev.to/dipsaus9/javascript-lets-create-aproxy-19hg
// also see https://towardsdatascience.com/why-to-use-javascript-proxy-5cdc69d943e3
// also see https://github.com/fastify/manifetch
// also see https://github.com/flash-oss/allserver
// and https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb
const createApi = (url) => {
return new Proxy({}, {
get(target, key) {
@danielroe
danielroe / extensions.json
Last active June 2, 2025 10:10
VScode settings for a minimal UI
{
"recommendations": [
"aaron-bond.better-comments",
"adrieankhisbe.vscode-ndjson",
"johnsoncodehk.vscode-tsconfig-helper",
"rbuckton.deoptexplorer-vscode",
"helixquar.randomeverything",
"WallabyJs.quokka-vscode",
"bierner.comment-tagged-templates",
"alexcvzz.vscode-sqlite",
@exreplay
exreplay / .eslintrc.js
Last active November 17, 2021 16:07
nuxt3 generate eslint globals
// eslint-disable-next-line @typescript-eslint/no-var-requires
const globals = require('.nuxt/eslint-globals');
// @ts-check
/** @type {import('eslint').Linter.Config} */
module.exports = {
...globals,
//... other rules
};
@Eunovo
Eunovo / JobProcessor.ts
Last active January 9, 2022 10:13
Code describing a system to handle CPU-intensive jobs on NodeJS servers
class JobProcessor {
private assignedJobs = new Map<String, any>();
private queue = new Queue<any>();
private nWorkers = 5;
async loadOutstandingJobs() {
// load 'pending' or 'processing' jobs from DB
const jobs = await services.Job
.findMany({
$or: [
@brolnickij
brolnickij / VmGallery.vue
Last active October 12, 2021 11:40
vm-gallery
<template lang="pug">
.vm-gallery
div(
:style="{ transitionDuration: transitionDuration, transform: translate3DPosition }"
ref="galleryItems"
).vm-gallery-items
div(v-for="imageItem in imageNodes").vm-gallery-item
img(
:src="imageItem.src"
:key="imageItem.src"
@tgmarinho
tgmarinho / get_schema.md
Created October 3, 2021 20:10
Script to get schema.graphql from Hasura relay endpoint

Exporting the Hasura GraphQL schema

Install graphqurl

npm install -g graphqurl

If Hasura GraphQL engine is running with an admin secret

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Fastify Basic

Servicio rest con fastify cors, helmet, rate limit, autoload

import Fastify from 'fastify'
import { dirname, join } from 'path'
import { fileURLToPath } from 'url'
import AutoLoad from 'fastify-autoload'
@osdevisnot
osdevisnot / .gitignore
Created February 5, 2021 22:38
esbuild-fastify-starter
node_modules
dist
yarn.lock