Skip to content

Instantly share code, notes, and snippets.

@retendo
retendo / index.js
Created May 31, 2020 12:14
Supabase node.js proxy server
const { Socket } = require('@supabase/realtime-js');
const WebSocket = require('ws');
const wss = new WebSocket.Server({ port: 3000 });
wss.on('connection', function connection(ws) {
ws.send('Connection established.');
});
const socket = new Socket(process.env.REALTIME_URL || 'http://localhost:4000/socket')
@pmatv
pmatv / aws-auth-cm.sh
Last active August 28, 2022 03:28
Map IAM group to EKS ConfigMap
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
IAM_GROUP=${1:-admins}
EKS_ROLE_ARN=${2:-arn:aws:iam::111122223333:role/eks-node-role}
RBAC_GROUP=${3:-system:masters}
@azu
azu / README.md
Last active January 24, 2024 10:27
GitHub Package Registry and Npm Registry for same scoped does not work @ 2020-01-10

📝 I submit the same text to GitHub Support.


I want to use same scope for npm package and GitHub Package Registry.

For example, @org scope exist in npm and GitHub.

  • @org/foo-public package is public on npm registry
  • @org/bar-private package is private on GitHub Package Registry
@clarkdave
clarkdave / ecs-interactive-console.sh
Last active January 31, 2023 19:26
ecs-interactive-console
#!/bin/bash -e
##
# Use this annotated script a base for launching an interactive console task on Amazon ECS
#
# more info: https://engineering.loyaltylion.com/running-an-interactive-console-on-amazon-ecs-c692f321b14d
#
# Requirements:
# - `jq` must be installed on both the client and server
##

One of Newscorp's most heavily used data platforms, TCOG, is beginning a rebuild.

TCOG has 6 deployments taking high web traffic to deliver digital content for some of Australia's most downloaded sources of news and media.

The TCOG service loosely fits into a 'backend for the frontend' pattern that provides an API to front end clients to transform and render data from one or more upstream APIs by "smart URLs". See http://samnewman.io/patterns/architectural/bff/ for more information about the pattern.

Over time, the TCOG service has become monolithic. We have designed TCOG 1.5, which will consist of smaller services. We want you to help us build them! This project is a mixture of refactoring the existing and working on greenfield solutions to known problems. The new architectural direction is focussed on service patterns for caching, rendering and data transformation.

In addition, regular BAU work requires communication and support for the surrounding developers who build TCOG extensions to service the

@cmerrick
cmerrick / bkadb-data-gen.sh
Last active December 19, 2022 03:31
Better Know a Database - Redshift Load Data Formats
#!/bin/sh
# OS: Ubuntu 14.01
# Generate data - produces about 200GB on disk, takes a while
DATADIR=tpch-dbgen
SCALE=1000
git clone https://github.com/electrum/tpch-dbgen.git
cd $DATADIR && make && ./dbgen -f -v -C 16 -S 1 -s $SCALE && cd -
@paulirish
paulirish / how-to-view-source-of-chrome-extension.md
Last active April 25, 2024 04:16
How to view-source of a Chrome extension

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

@nf
nf / vm-setup.sh
Last active June 14, 2023 22:08
Script for setting up Debian Jessie VM with my development environment
#!/bin/bash -e
echo '
PATH=$HOME/go/bin:$PATH
export GOPATH=$HOME
export CDPATH=.:$HOME/src/golang.org/x:$HOME/go/src:$HOME/src/github.com:$HOME/src/github.com/nf:$HOME/src/github.com/adg
export EDITOR=vim
' >> ~/.profile
sudo apt-get update
@holman
holman / emoji_test.rb
Last active June 18, 2020 01:27
A snapshot of the tests we use internally at GitHub to help edit our blog posts before they go out to everybody. For more information, take a peek at http://zachholman.com/posts/how-github-writes-blog-posts
require_relative "test_helper"
require "open-uri"
require "net/http"
class EmojiTest < Blog::Test
def test_no_emoji
posts.each do |post|
content = File.read(post)
refute_match /:[a-zA-Z0-9_]+:/, content,
@holman
holman / example.png
Created November 5, 2014 05:35
A quick Hubot script to display Uber surge pricing from a particular point (LIKE AN OFFICE).
example.png