Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

Dyaa dyaa

I may be slow to respond.
View GitHub Profile
dyaa / route.go
Last active Apr 3, 2020
Golang - Proxy route to another backend
View route.go
// Original post:
router.POST("/api/v1/endpoint1", ReverseProxy())
func ReverseProxy() gin.HandlerFunc {
target := "localhost:3000"
return func(c *gin.Context) {
director := func(req *http.Request) {
r := c.Request
dyaa / README.txt
Last active May 1, 2020 — forked from ncw/README.txt
Client side certificates with go
View README.txt
This demonstrates how to make client side certificates with go
First generate the certificates with
Run the server in one terminal
go run server.go
dyaa / collectCoverageFiles.ts
Last active Feb 5, 2020
Jest coverage collection from multi-project and merging them into single coverage .lcov file
View collectCoverageFiles.ts
import fs from 'fs-extra';
import glob from 'glob';
import { exec } from 'child_process';
const coverageOutputDir = '.nyc_output';
glob('**/coverage-final.json', (err, coverageFiles) => {
if (err) {
dyaa / index.js
Created Oct 14, 2019 — forked from zackshapiro/index.js
Parse Separate Live Query Server Setup
View index.js
// This is the index.js file for my Parse Live Query Server, running on a separate EC2 instance
var express = require('express');
var cors = require('cors')
var ParseServer = require('parse-server').ParseServer;
var app = express();
// We include the lines below so that we can hit `/` and it passes the Elastic Beanstalk Health Check
dyaa / offline-analytics.js
Created Apr 25, 2019 — forked from jeffposnick/offline-analytics.js
Standalone offline analytics code
View offline-analytics.js
Copyright 2016 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
dyaa / firebase.js
Last active Apr 7, 2022
Lazy Load Import Firebase (dynamic import)
View firebase.js
.then(x => x[0].default)
.then(firebase => {
const config = {
apiKey: '',
authDomain: '',
dyaa / react-router-queyry-utils.js
Created Jun 18, 2018 — forked from DimitryDushkin/react-router-queyry-utils.js
React router utility functions to add and remove queries
View react-router-queyry-utils.js
import { browserHistory } from 'react-router';
* @param {Object} query
export const addQuery = (query) => {
const location = Object.assign({}, browserHistory.getCurrentLocation());
Object.assign(location.query, query);
dyaa / FirebaseToFirestore.js
Last active May 3, 2018 — forked from JoeRoddy/FirebaseToFirestore.js
Convert Firebase Database JSON to Firestore Collections
View FirebaseToFirestore.js
var db = firebase.firestore();
var content = require("./sourceData.json");
content &&
Object.keys(content).forEach(contentKey => {
const nestedContent = content[contentKey];
if (typeof nestedContent === "object") {
Object.keys(nestedContent).forEach(docTitle => {
dyaa / index.html
Last active Apr 18, 2018
Auto Search from the Chrome's Address Bar. - Example from
View index.html
<link rel="search" href="/opensearch.xml" type="application/opensearchdescription+xml" title="Can I use"/>
dyaa / compose.js
Created Apr 17, 2018 — forked from WaldoJeffers/compose.js
JavaScript one-line compose (ES6)
View compose.js
const compose = (...fns) => fns.reduce((f, g) => (...args) => f(g(...args)))
// Usage : compose functions right to left
// compose(minus8, add10, multiply10)(4) === 42
// The resulting function can accept as many arguments as the first function does
// compose(add2, multiply)(4, 10) === 42