Skip to content

Instantly share code, notes, and snippets.

View woss's full-sized avatar
🛸

Daniel Maricic woss

🛸
View GitHub Profile
@javier
javier / Exif-questdb-schema.sql
Created January 10, 2024 11:05
Exif-questdb-schema
CREATE TABLE CameraDetails (
Manufacturer SYMBOL,
Model SYMBOL,
Orientation SYMBOL,
Software STRING,
DateAndTime timestamp,
YCbCrPositioning SYMBOL,
Compression SYMBOL,
XResolution LONG,
YResolution LONG,
@silassare
silassare / fix-esm-import-paths.js
Created July 21, 2022 09:58
Browse a folder and try to change all esm import `from`, by auto prefixing `.js` or `/index.js` only if this file exists.
import * as fs from 'fs';
import * as path from 'path';
// https://gist.github.com/lovasoa/8691344
async function* walk(dir) {
for await (const d of await fs.promises.opendir(dir)) {
const entry = path.join(dir, d.name);
if (d.isDirectory()) {
yield* walk(entry);
} else if (d.isFile()) {
@xvaara
xvaara / postgraphiql.ts
Last active October 28, 2021 06:06
Dark mode for PostgraphiQL
const graphiqlBrandingTweak = {
["postgraphile:graphiql:html"](html: string) {
console.log("Applying GraphiQL Branding Tweak...");
return html.replace(
"</head>",
`<style type="text/css">
@media (prefers-color-scheme: dark) {
html {
filter: invert(1) hue-rotate(180deg);
}
@58bits
58bits / multipart.js
Created August 15, 2020 02:02
MultiPart Handler
'use strict'
const config = require('../../config')
const { MultipartError } = require('./errors')
const fs = require('fs')
const path = require('path')
const nanoid = require('nanoid')
const Multipart = (request, response, done) => {
// Note: onFile and addToBody cannot be handled on a per reuqest basis at the moment
@frankdugan3
frankdugan3 / audit-graphql-schema.js
Last active April 9, 2019 09:03
Script to audit a GraphQL schema against previous commit.
/*
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
module.exports = function PgUpsertPlugin(
builder,
{ pgDisableDefaultMutations }
) {
if (pgDisableDefaultMutations) {
return;
}
builder.hook("inflection", (inflection, build) =>
build.extend(inflection, {
@aqwert
aqwert / ReadMe.md
Last active November 9, 2019 18:22
GraphQL Schema stiching

NOTE:

Although this is a gist with accompanied files, I will at some stage make a proper project with working parts.

Getting Started with a Graphql Microservice

This is an opinionated view of how to use Prisma Graphql backend in a microservice way. The idea is that each Graphql Micorservice has both a App GraphQL service (the one that creates a public API) and a Prisma GraphQL service (The one that is a ORM to a DB expiosing GraphQL CRUD, filtering and ordering operations). Each of these microservices are then "stitched" together to form a single GraphQL App Service (Like a Backend For Frontend service BFF) that the client consumes.

Creating a GraphQL Microservice

@BoGnY
BoGnY / README.md
Last active July 11, 2024 14:14
[WINDOWS] How to enable auto-signing Git commits with GnuPG for programs that don't support it natively

[WINDOWS] How to enable auto-signing Git commits with GnuPG for programs that don't support it natively

This is a step-by-step guide on how to enable auto-signing Git commits with GPG for every applications that don't support it natively (eg. GitHub Desktop, Eclipse, Git Tower, ...)

Requirements

  • Install GPG4Win: this software is a bundle with latest version of GnuPG v2, Kleopatra v3 certificate manager, GNU Privacy Assistant (GPA) v0.9 which is a GUI that uses GTK+, GpgOL and GpgEX that are respectively an extension for MS Outlook and an extension for Windows Explorer shell
  • Install Git for Windows: so you can have a *nix based shell, this software is a bundle with latest version of Git which use MINGW environment, a Git bash shell, a Git GUI and an extension for Windows Explorer shell (Make sure your local version of Git is at least 2.0, otherwise Git don't have support for automatically sign your commits)
  • Verify
@cezarneaga
cezarneaga / filterArraysRamda.md
Last active April 26, 2023 07:52
Filter array of objects by nested values using ramda: Sometimes you dont have access to backend and you want to filter the response from an endpoint based on certain criteria. While trivial on flat arrays, this gets a bit tricky if the property you want to query is deeply nested. This is where Ramda shines.

Say we have a prop.users of the shape:

const users = [
    {username: 'bob', age: 30, tags: [{name: 'work', id: 1}, {name: 'boring', id: 2}]},
    {username: 'jim', age: 25, tags: [{name: 'home', id: 3}, {name: 'fun', id: 4}]},
    {username: 'jane', age: 30, tags: [{name: 'vacation', id: 5}, {name: 'fun', id: 4}]}
];
@stubailo
stubailo / apollo-fetch.js
Last active December 1, 2018 15:54
Call a GraphQL API with apollo-fetch
const { createApolloFetch } = require('apollo-fetch');
const fetch = createApolloFetch({
uri: 'https://1jzxrj179.lp.gql.zone/graphql',
});
fetch({
query: '{ posts { title }}',
}).then(res => {
console.log(res.data);