Skip to content

Instantly share code, notes, and snippets.

View agoldis's full-sized avatar
🎯
Focused

Andrew Goldis agoldis

🎯
Focused
View GitHub Profile
@bodokaiser
bodokaiser / context.ts
Last active August 10, 2023 01:00
React Hook integration for AWS Amplify Auth
import React from "react"
import { CognitoUser } from "@aws-amplify/auth"
import { useAuth } from "./hooks"
import { SignInInput } from "./types"
interface AuthState {
user: CognitoUser | null
signIn(input : SignInInput): Promise<void>
signOut(): Promise<void>
@regevbr
regevbr / proxy-chain.js
Last active January 17, 2023 01:59
node-http-proxy proxy chain with connect method implemented (+ bonus auth handling)
"use strict";
const http = require('http');
const request = http.request;
const net = require('net');
const httpProxy = require('http-proxy');
let auth = "secret-string";
auth = new Buffer(auth).toString('base64');
auth = "Basic " + auth;
@digitalkaoz
digitalkaoz / index.js
Created December 20, 2017 21:32
gatsby in aws lambda
const AWS = require("aws-sdk");
const {link} = require("linkfs");
const mock = require('mock-require');
const fs = require('fs');
const tmpDir = require('os').tmpdir();
exports.handler = (event, context) => {
rewriteFs();
invokeGatsby(context);
}
@ethicka
ethicka / localhost-ssl-certificate.md
Last active June 11, 2024 10:06
Localhost SSL Certificate on Mac OS

🚨 2020 Update: I recommend using mkcert to generate local certificates. You can do everything below by just running the commands brew install mkcert and mkcert -install. Keep it simple!


This gives you that beautiful green lock in Chrome. I'm assuming you're putting your SSL documents in /etc/ssl, but you can put them anywhere and replace the references in the following commands. Tested successfully on Mac OS Sierra and High Sierra.

Set up localhost.conf

sudo nano /etc/ssl/localhost/localhost.conf

@orbitbot
orbitbot / index.html
Created October 23, 2014 21:43
Ace editor with http-link highlighting and click action, from http://jsbin.com/jehopaja/30/edit?html,output
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<script src="http://ajaxorg.github.io/ace-builds/src/ace.js"></script>
<style>
#editor { position: absolute; top: 0; left: 0; right: 0; bottom: 0;}
.ace_link_marker {
position: absolute;
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active June 12, 2024 03:08
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@gdamjan
gdamjan / README.md
Last active June 3, 2024 06:48
Setup for an easy to use, simple reverse http tunnels with nginx and ssh. It's that simple there's no authentication at all. The end result, a single ssh command invocation gives you a public url for your web app hosted on your laptop.

What

A lot of times you are developing a web application on your own laptop or home computer and would like to demo it to the public. Most of those times you are behind a router/firewall and you don't have a public IP address. Instead of configuring routers (often not possible), this solution gives you a public URL that's reverse tunnelled via ssh to your laptop.

Because of the relaxation of the sshd setup, it's best used on a dedicated virtual machine just for this (an Amazon micro instance for example).

Requirements

@domenic
domenic / promises.md
Last active March 31, 2024 14:07
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.