Skip to content

Instantly share code, notes, and snippets.

View vijayakumar-psg587's full-sized avatar

Vijayakumar vijayakumar-psg587

View GitHub Profile

How we incorporate next and cloudfront (2018-04-21)

Feel free to contact me at [email protected] or tweet at me @statisticsftw

This is a rough outline of how we utilize next.js and S3/Cloudfront. Hope it helps!

It assumes some knowledge of AWS.

Goals

@joepie91
joepie91 / es-modules-are-terrible-actually.md
Last active November 18, 2024 07:25
ES Modules are terrible, actually

ES Modules are terrible, actually

This post was adapted from an earlier Twitter thread.

It's incredible how many collective developer hours have been wasted on pushing through the turd that is ES Modules (often mistakenly called "ES6 Modules"). Causing a big ecosystem divide and massive tooling support issues, for... well, no reason, really. There are no actual advantages to it. At all.

It looks shiny and new and some libraries use it in their documentation without any explanation, so people assume that it's the new thing that must be used. And then I end up having to explain to them why, unlike CommonJS, it doesn't actually work everywhere yet, and may never do so. For example, you can't import ESM modules from a CommonJS file! (Update: I've released a module that works around this issue.)

And then there's Rollup, which apparently requires ESM to be u

Iterables, AsyncIterables, Observables, Oh My!

I know there is a lot of confusion around Observables, Iterables, AsyncIterables and AsyncObservables. Let's try to break this down and the reasons for each.

Pull versus Push Collections

When it comes to collections, you have two ways of thinking about collections, push versus pull. With pull, the consumer is in control of when you get the items, but with push, you get the values when the producer is ready.

Pull Based Collections

@tonkla
tonkla / upload.js
Last active August 28, 2023 12:35
Parsing 'multipart/form-data' Excel (.xlsx) with Busboy on AWS Lambda (Node.js)
'use strict'
const Busboy = require('busboy')
const XLSX = require('xlsx')
function parseMultipartFormData(input, contentType) {
return new Promise((resolve, reject) => {
const buffers = []
const busboy = new Busboy({
headers: { 'content-type': contentType },
pm.sendRequest({
url: '{{your url}}',
method: 'POST',
header: {
'Content-Type': 'multipart/form-data',
},
body: {
mode: 'formdata',
formdata: [

How we incorporate next and cloudfront (2018-04-21)

Feel free to contact me at [email protected] or tweet at me @statisticsftw

This is a rough outline of how we utilize next.js and S3/Cloudfront. Hope it helps!

It assumes some knowledge of AWS.

Goals

@ivan-pinatti
ivan-pinatti / jenkins-set-bitbucket-oauth-plugin.groovy
Last active January 18, 2019 22:28
Jenkins - Set Bitbucket Oauth plugin parameters via groovy script - #jenkins #groovy #bitbucket #oauth
#!groovy
// imports
import hudson.security.AuthorizationStrategy
import hudson.security.SecurityRealm
import jenkins.model.Jenkins
import org.jenkinsci.plugins.BitbucketSecurityRealm
// parameters
def bitbucketSecurityRealmParameters = [
@JekaMas
JekaMas / main.go
Created August 31, 2017 16:10
Golang slice flatten
package main
import (
"errors"
"fmt"
)
func Flatten(arr interface{}) ([]int, error) {
return doFlatten([]int{}, arr)
}
@nikhita
nikhita / update-golang.md
Last active November 15, 2024 08:50
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by: