Skip to content

Instantly share code, notes, and snippets.

View joshuaquek's full-sized avatar
🏠
Working from home

Joshua Ben-Tzion Quek ( יְהוֹשֻׁעַ בֶּן-צִיּוֹן ) joshuaquek

🏠
Working from home
View GitHub Profile
@random-robbie
random-robbie / install.sh
Last active February 4, 2023 07:22
Install helm for kubernetes on centos 7
#!/bin/bash
wget https://storage.googleapis.com/kubernetes-helm/helm-v2.12.2-linux-amd64.tar.gz
tar -zxvf helm-v2.12.2-linux-amd64.tar.gz
mv linux-amd64/helm /usr/local/bin/helm
kubectl -n kube-system create sa tiller
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account tiller
kubectl create namespace kubeapps
helm install --name kubeapps --namespace kubeapps bitnami/kubeapps
@koladilip
koladilip / aws-cognito-refresh-tokens-from-brower.js
Last active August 22, 2023 20:13
Code for refreshing AWS Cognito user pool tokens using refresh token from browser.
fetch("https://cognito-idp.<cognito-user-pool-region>.amazonaws.com/", {
headers: {
"X-Amz-Target": "AWSCognitoIdentityProviderService.InitiateAuth",
"Content-Type": "application/x-amz-json-1.1",
},
mode: 'cors',
cache: 'no-cache',
method: 'POST',
body: JSON.stringify({
ClientId: "<cognito-user-pool-client-id>",
@Rich-Harris
Rich-Harris / what-is-svelte.md
Last active October 13, 2024 17:18
The truth about Svelte

I've been deceiving you all. I had you believe that Svelte was a UI framework — unlike React and Vue etc, because it shifts work out of the client and into the compiler, but a framework nonetheless.

But that's not exactly accurate. In my defense, I didn't realise it myself until very recently. But with Svelte 3 around the corner, it's time to come clean about what Svelte really is.

Svelte is a language.

Specifically, Svelte is an attempt to answer a question that many people have asked, and a few have answered: what would it look like if we had a language for describing reactive user interfaces?

A few projects that have answered this question:

@ewpratten
ewpratten / hosts-yt-ads
Last active December 24, 2024 04:46
youtube ads hosts file
This project has been moved to a GitHub repository to allow Pull Requests.
See: https://github.com/Ewpratten/youtube_ad_blocklist
@trfiladelfo
trfiladelfo / index.txt
Created December 16, 2017 00:17
Mac OS X: create/extract split zip archives
I. Create split zip archive
To create a split zip archive (a series of files named zip, z01, z02...), run following command in Terminal:
zip -s 100m -x "*.DS_Store" -r split-foo.zip foo/
II. Extract split zip archive
To extract a split zip archive (a series of files named zip, z01, z01...), run following command in Terminal:
First, combine the split archive to a single archive:
zip -s 0 split-foo.zip --out unsplit-foo.zip
Extract the single archive using unzip:
unzip unsplit-foo.zip
@laurenfazah
laurenfazah / authentication_with_express_postgres.md
Last active July 13, 2024 16:51
Authentication with an Express API and Postgres

Authentication with an Express API and Postgres

Setting Up

Let's make sure our Express app has the required base modules:

# within root of API
npm install --save express pg knex bcrypt
npm install --save-dev nodemon
@praveenpuglia
praveenpuglia / shadow-dom.md
Last active December 17, 2024 15:14
Everything you need to know about Shadow DOM

I am moving this gist to a github repo so more people can contribute to it. Also, it makes it easier for me to version control.

Please go to - https://github.com/praveenpuglia/shadow-dom-in-depth for latest version of this document. Also, if you find the document useful, please shower your love, go ⭐️ it. :)

Shadow DOM

Heads Up! It's all about the V1 Spec.

In a nutshell, Shadow DOM enables local scoping for HTML & CSS.

@dcpesses
dcpesses / index.js
Created March 29, 2017 00:46
HTTPS Proxy Server in node.js
// via http://stackoverflow.com/questions/8165570/https-proxy-server-in-node-js
// Install npm dependencies first
// npm init
// npm install --save [email protected]
// npm install --save [email protected]
// node ./index.js
var httpProxy = require("http-proxy");
var http = require("http");
var url = require("url");
var net = require('net');
@nonlogos
nonlogos / API_SERVER_basic_authentication
Last active November 23, 2024 11:16
basic API Server with Node, Express and Passport Authentication
// mkdir server
// dependencies
// npm install --save express mongoose morgan body-parser nodemon bcrypt-nodejs jwt-simple passport passport-jwt cors
- express
- mongoose
- morgan
- body-parse
- nodemon
- bcrypt
- jwt-simple
@mikaelMortensenADI
mikaelMortensenADI / Install_VNC_AWS_Centos
Last active January 8, 2024 11:00
How to Install VNC on an Amazon EC2 Centos 7.2 AMI
How to Install VNC on an AWS EC2 Centos 7.2 AMI
Reference: http://devopscube.com/how-to-setup-gui-for-amazon-ec2-rhel-7-instance/
1. Update the server using the following command.
sudo yum -y update
2. Install the gnome GUI components using the following command.
sudo yum groupinstall -y "Server with GUI"