Skip to content

Instantly share code, notes, and snippets.

@cazala
cazala / emojis.js
Last active December 19, 2023 16:43
Generate emoji hash from input text
async function emojis(input, amount = 4) {
const list = [
"🔥",
"✨",
"🌟",
"💫",
"💥",
"💢",
"💦",
"💧",
@cazala
cazala / work-with-multiple-github-accounts.md
Created August 9, 2023 21:22 — forked from rahularity/work-with-multiple-github-accounts.md
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@cazala
cazala / space_colonization.pde
Created December 18, 2020 17:51 — forked from shiffman/space_colonization.pde
Space Colonization Attempt
Tree tree;
float min_dist = 5;
float max_dist = 250;
void setup() {
size(180, 300);
tree = new Tree();
}
@cazala
cazala / 3box
Created October 19, 2020 21:00
This post links my 3Box profile to my Github account! Web3 social profiles by 3Box.
✅ did:3:bafyreih4vta56c7pcnhogpv2t36qlzq4xz473u5hhc5cb3ty7xomw6lch4 ✅
Create your profile today to start building social connection and trust online at https://3Box.io/
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGNiYAAAAAkAAxkR2eQAAAAASUVORK5CYII=
@cazala
cazala / remove_desktop.sh
Created July 2, 2019 16:54
Remove destktop
defaults write com.apple.finder CreateDesktop -bool false
killall Finder
renderMessage() {
const state = store.getState()
const { whiteTurn } = state.game
const { playerWhite, playerBlack, status } = state.match
const yourTurn =
(whiteTurn && playerWhite === this.id) ||
(!whiteTurn && playerBlack === this.id)
const theirTurn =
(whiteTurn && playerBlack === this.id) ||
(!whiteTurn && playerWhite === this.id
  renderBoard() {
     return (
       <entity
         position={{
           x: 1.5,
           y: 0,
           z: 1.5
         }}
 &gt;
} else if (elementId != null) {
// players can click squares only on their turn
if (whiteTurn && this.id !== playerWhite) return
if (!whiteTurn && this.id !== playerBlack) return
// click on square
const squareId = getSquareId(elementId)
const square = state.squares.find(
(square: any) => square.id === squareId
)
if (elementId === 'register-white') {
if (!playerBlack) {
store.dispatch(initSquares()) // let the first player who registers init the board
}
store.dispatch(registerPlayer(this.id, true))
} else if (elementId === 'register-black') {
if (!playerWhite) {
store.dispatch(initSquares()) // let the first player who registers init the board
}
store.dispatch(registerPlayer(this.id, false))