Skip to content

Instantly share code, notes, and snippets.

View haku-d's full-sized avatar
🏠
Work from home

Thanh Dang haku-d

🏠
Work from home
View GitHub Profile

Preact, Without Build Tools

This is a demonstration of using Preact without any build tooling. The library is linked from the esm.sh CDN, however a standalone JS file exporting HTM + Preact + Hooks can also be downloaded here.

@haku-d
haku-d / index.md
Created March 28, 2024 19:46
Pooled Download - Parallel Asynchronous Programming

Pooled Download: Parallel Asynchronous Programming

Objective

Your goal is to write an asynchronous function pooledDownload. This function needs to be able to parallelly download and save files from a given array of URLs, using a connection pool of a given size.


Dependencies

This function has two dependencies:

  • a connect function that opens a connection the server
@haku-d
haku-d / policy.json
Last active March 7, 2024 16:58
AWS policy statement grants sufficient permissions to AWS SAM CLI
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "CloudFormationTemplate",
"Effect": "Allow",
"Action": [
"cloudformation:CreateChangeSet"
],
"Resource": [
@haku-d
haku-d / nginx_reverse_proxy.md
Created September 8, 2023 16:35
Nginx Reverse Proxy

1. Install nginx

2. Update nginx configuration

server {
      listen       80;
      listen       [::]:80;
      server_name  _;
      location / {
      	  proxy_pass http://your-server.com;
 proxy_set_header Host $http_host;
@haku-d
haku-d / google_login.ts
Created February 27, 2023 20:54 — forked from Brandawg93/google_login.ts
Login to Google Account via Puppeteer
import puppeteer from 'puppeteer-extra';
import pluginStealth from 'puppeteer-extra-plugin-stealth'; // Use v2.4.5 instead of latest
import * as readline from 'readline';
puppeteer.use(pluginStealth());
// Use '-h' arg for headful login.
const headless = !process.argv.includes('-h');
// Prompt user for email and password.
@haku-d
haku-d / NETWILA.md
Created August 8, 2020 03:46
Netwila Coding Challenge - FullStack Developer

Netwila Coding Challenge - FullStack Developer

Challenge

We’re going to build a very simple authentication function which most applications have.

Requirements

  • Use node.js to build an authentication API with JWT and another API which requires authentication token to access. Feel free to choose any framework in your favorites.
  • Using React.js to create simple login form with email & password.
@haku-d
haku-d / README.md
Created January 20, 2020 05:28 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@haku-d
haku-d / interview-questions.md
Created January 2, 2020 03:48 — forked from jvns/interview-questions.md
A list of questions you could ask while interviewing

A lot of these are outright stolen from Edward O'Campo-Gooding's list of questions. I really like his list.

I'm having some trouble paring this down to a manageable list of questions -- I realistically want to know all of these things before starting to work at a company, but it's a lot to ask all at once. My current game plan is to pick 6 before an interview and ask those.

I'd love comments and suggestions about any of these.

I've found questions like "do you have smart people? Can I learn a lot at your company?" to be basically totally useless -- everybody will say "yeah, definitely!" and it's hard to learn anything from them. So I'm trying to make all of these questions pretty concrete -- if a team doesn't have an issue tracker, they don't have an issue tracker.

I'm also mostly not asking about principles, but the way things are -- not "do you think code review is important?", but "Does all code get reviewed?".

Source: https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md

Install npm packages globally without sudo on macOS and Linux

npm installs packages locally within your projects by default. You can also install packages globally (e.g. npm install -g <package>) (useful for command-line apps). However the downside of this is that you need to be root (or use sudo) to be able to install globally.

Here is a way to install packages globally for a given user.

1. Create a directory for global packages
@haku-d
haku-d / README.md
Created October 26, 2019 12:33 — forked from greyscaled/README.md
Sequelize + Express + Migrations + Seed Starter