Skip to content

Instantly share code, notes, and snippets.

View oirodolfo's full-sized avatar
🏳️‍🌈

Rod Kisten (Costa) oirodolfo

🏳️‍🌈
View GitHub Profile
@oirodolfo
oirodolfo / apolloServer2019.ts
Created November 16, 2020 17:42 — forked from nodkz/apolloServer2019.ts
GraphQL error tracking with sentry.io (ApolloServer 2019)
import express from 'express';
import { ApolloServer } from 'apollo-server-express';
import { ApolloServerPlugin } from 'apollo-server-plugin-base';
import * as Sentry from '@sentry/node';
Sentry.init({
environment: process.env.APP_ENV,
// see why we use APP_NAME here: https://github.com/getsentry/sentry-cli/issues/482
release: `${process.env.APP_NAME}-${process.env.APP_REVISION}` || '0.0.1',
dsn: process.env.SENTRY_DSN,
@oirodolfo
oirodolfo / Bohemian.Rhapsody.js
Created November 19, 2020 20:48 — forked from designbyadrian/Bohemian.Rhapsody.js
The well known tune transcribed into JavaScript, based on an image I found on the Internet. Please link me the source and author if you have it.
/**
* @author Freddie Mercury
* @copyright Sony/ATV Music Publishing LLC
*/
let BohemianRhapsody = function(){
// Is this the real life?
// Is this just fantasy?
try {
#!/bin/bash
# if we are testing a PR, merge it with the latest master branch before testing
# this ensures that all tests pass with the latest changes in master.
set -eu -o pipefail
PR_NUMBER=${CI_PULL_REQUEST//*pull\//}
err=0
if [ -z "$PR_NUMBER" ]; then
@oirodolfo
oirodolfo / service-worker.js
Created April 1, 2021 15:29 — forked from jeffposnick/service-worker.js
Example of InjectManifest in Workbox v5
// Add any other logic here as needed.
import { CacheableResponsePlugin } from 'workbox-cacheable-response/CacheableResponsePlugin';
import { CacheFirst } from 'workbox-strategies/CacheFirst';
import { createHandlerForURL } from 'workbox-precaching/createHandlerForURL';
import { ExpirationPlugin } from 'workbox-expiration/ExpirationPlugin';
import { NavigationRoute } from 'workbox-routing/NavigationRoute';
import { precacheAndRoute } from 'workbox-precaching/precacheAndRoute';
import { registerRoute } from 'workbox-routing/registerRoute';
import { ApolloClient, QueryOptions, MutationOptions } from 'apollo-client';
import { DocumentNode } from 'graphql';
import { getSdk, Requester } from '.generated/schema-typedefs';
import { ApolloRequestError } from './ApolloRequestError';
export type ApolloRequesterOptions<V, R> =
| Omit<QueryOptions<V>, 'variables' | 'query'>
| Omit<MutationOptions<R, V>, 'variables' | 'mutation'>;
@oirodolfo
oirodolfo / createCrudHooks.js
Created May 17, 2021 19:31 — forked from tannerlinsley/createCrudHooks.js
A naive, but efficient starter to generate crud hooks for React Query
export default function createCrudHooks({
baseKey,
indexFn,
singleFn,
createFn,
updateFn,
deleteFn,
}) {
const useIndex = (config) => useQuery([baseKey], indexFn, config)
const useSingle = (id, config) =>
@oirodolfo
oirodolfo / useGlobalMemo.js
Created May 17, 2021 19:32 — forked from tannerlinsley/useGlobalMemo.js
useGlobalMemo is a React hook that lets you share memoizations across an entire app using a unique key.
const cache = {}
export default function useGlobalMemo (key, fn, deps) {
if (!cache[key]) {
cache[key] = {
subs: 0,
deps,
value: fn(),
}
@oirodolfo
oirodolfo / react-app-s3-sync.sh
Created June 15, 2021 18:06 — forked from kevindice/react-app-s3-sync.sh
A shell script for uploading a React app build to S3 + CloudFront for deployment
#!/bin/bash
S3_BUCKET_NAME=$1
CF_ID=$2
# Sync all files except for service-worker and index
echo "Uploading files to $S3_BUCKET_NAME..."
aws s3 sync build s3://$S3_BUCKET_NAME/ \
--acl public-read \
--exclude service-worker.js \
@oirodolfo
oirodolfo / ig-denoiser.user.js
Created June 18, 2021 20:25 — forked from noromanba/ig-denoiser.user.js
hidden user comments on instagram.com for UserScript
// ==UserScript==
// @name IG denoiser
// @namespace https://noromanba.github.com
// @description hidden user comments on instagram.com for UserScript
// @include https://www.instagram.com/*
// @grant none
// @noframes
// @run-at document-start
// @version 2019.5.28.1
// @homepage https://gist.github.com/noromanba/1f369b316c1b43bdf0e337c6c5af1c80
@oirodolfo
oirodolfo / instagram.js
Created June 18, 2021 20:26 — forked from muminy/instagram.js
Violentmonkey instagram addition
// ==UserScript==
// @name İnstagram ext
// @namespace Violentmonkey Scripts
// @match https://www.instagram.com/*
// @grant none
// @version 1.2
// @grant GM_addStyle
// @author @mmnyldrm
// @description İnstagram yardımcı eklenti
// ==/UserScript==