Skip to content

Instantly share code, notes, and snippets.

View javedbaloch4's full-sized avatar

Javed Ahmed (Baloch) javedbaloch4

  • Mixvoip
  • Luxembourg
View GitHub Profile
@javedbaloch4
javedbaloch4 / Tabs.html
Last active June 6, 2023 23:42
Switching tabs using AlpineJS & TailwindCSS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Home</title>
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.6.0/dist/alpine.min.js" defer></script>
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
<link rel="stylesheet" href="">
@javedbaloch4
javedbaloch4 / node_nginx_ssl.md
Created October 12, 2022 15:09 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@javedbaloch4
javedbaloch4 / airdrop.ts
Created May 27, 2022 13:18
TypeScript to generate Solana in Devnet
import { PublicKey, Connection, LAMPORTS_PER_SOL } from "@solana/web3.js";
export const airdrop = async (address: string, amount: number) => {
const publicKey = new PublicKey(address);
const conn = new Connection("https://api.devnet.solana.com", "confirmed");
const signature = await conn.requestAirdrop(
publicKey,
amount * LAMPORTS_PER_SOL
);
await conn.confirmTransaction(signature);
@javedbaloch4
javedbaloch4 / hashing.js
Created February 17, 2022 12:35
Hashing with Asynchronous programming
/* --------- app.js ----------*/
// Import block class
const BlockClass = require('./block')
// Create a block object
const block = new BlockClass.Block("Test Block")
// Generate the block hash
block.generateHash().then((result) => {
console.log(`Block Hash: ${result.hash}`)
@javedbaloch4
javedbaloch4 / hashing.js
Created February 17, 2022 12:16
Hashing SHA256 in JavaScript using crypto-js package.
const { SHA256 } = require('crypto-js')
const name = "Javed"
const transactionHistory = {
id: 223423424,
name: 'Javed-123',
amount: 24234234
}
const generateHash = (obj) => {
@javedbaloch4
javedbaloch4 / image-switcher.html
Last active August 30, 2021 04:18
TailwindCSS & AlpineJS Image switcher.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Home</title>
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.6.0/dist/alpine.min.js" defer></script>
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
<link rel="stylesheet" href="">
@javedbaloch4
javedbaloch4 / alpine-accordian-toggle.html
Created September 10, 2020 21:17
AlpineJS Loops Accordion & Toggle.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Home</title>
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.6.0/dist/alpine.min.js" defer></script>
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
<link rel="stylesheet" href="">
@javedbaloch4
javedbaloch4 / scroll-detector.html
Created September 10, 2020 20:29
AlpineJS scroll detector.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Home</title>
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.6.0/dist/alpine.min.js" defer></script>
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
<link rel="stylesheet" href="">
@javedbaloch4
javedbaloch4 / alpine-tailwind-selector.html
Created September 14, 2020 19:37
AlpineJS TailwindCSS selector.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Home</title>
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.6.0/dist/alpine.min.js" defer></script>
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
@javedbaloch4
javedbaloch4 / js_validation.html
Created March 25, 2021 09:10
Javascript fields validation example.
<html>
<head>
<title>Assignemnt</title>
<style>
.progress-bar {
border-radius: 5px;
padding: 5px;
color: #FFF;
}