Skip to content

Instantly share code, notes, and snippets.

View jayeshcp's full-sized avatar

Jayesh Chandrapal jayeshcp

View GitHub Profile
@jayeshcp
jayeshcp / Phaser 4 Crash Course.md
Last active September 23, 2026 17:33
Phaser 4 Crash Course

Phaser 4 Crash Course — Code Reference

Phaser 4 ("Caladan", released April 2026) keeps the same public API you know from Phaser 3 for standard game objects — sprites, text, physics, input, tilemaps, etc. The big changes are under the hood (a full WebGL render-node rewrite) plus a few new/renamed systems: unified Filters (replacing FX + Masks), a simplified Lighting API, an overhauled Tint system, and rounded-corner rectangles. Those are called out inline below.

<!-- CDN (un-minified / minified) -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/4.1.0/phaser.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/4.1.0/phaser.min.js"></script>
@jayeshcp
jayeshcp / Jest Cheatsheet.md
Created July 27, 2022 00:35
Jest Cheatsheet
import React, { useState, useEffect } from 'react';
/* Custom hook */
function useAPIFetch(apiURL) {
const [loading, setLoading] = useState(true);
const [data, setData] = useState(null);
function fetchData() {
setLoading(true);
fetch(apiURL)
@jayeshcp
jayeshcp / README.md
Last active June 20, 2021 00:41
Kafka - Docker Compose

Kafka - Docker Compose

Run docker container in shell

docker exec -it <container id> /bin/sh

Kafka Home

@jayeshcp
jayeshcp / soduku.js
Created October 23, 2020 15:29
Soduku checker
// In this implementation it is assumed that grid is always 9x9
function sudoku2(grid) {
// check rows
for(let row = 0; row < grid.length; row++) {
const numbersMap = new Set();
for(let column = 0; column < grid[row].length; column++) {
if(grid[row][column] === ".") continue;
if (numbersMap.has(grid[row][column])) {
return false;
} else {
@jayeshcp
jayeshcp / k-means-clustering.py
Created October 17, 2020 13:52
K Means Clustering in Python
from numpy import unique
from numpy import where
from matplotlib import pyplot
from sklearn.datasets import make_classification
from sklearn.cluster import KMeans
if __name__ == '__main__':
# initialize the data set we'll work with
training_data, _ = make_classification(
n_samples=2000,
@jayeshcp
jayeshcp / javascript_questions_with_answers.md
Created June 15, 2020 13:50
Javascript Questions with Answers

JavaScript Questions

1. What's the output?
function sayHi() {
 console.log(name);
@jayeshcp
jayeshcp / .gitconfig
Created November 9, 2016 14:07
Using WinMerge as Git Diff/Merge tool
[mergetool]
prompt = false
keepBackup = false
keepTemporaries = false
[merge]
tool = winmerge
[mergetool "winmerge"]
name = WinMerge
@jayeshcp
jayeshcp / curl.md
Created August 25, 2016 00:06
Notes

REST Requests using curl

GET:

curl 
  -X "GET" 
  http://localhost:3000/api

To discard changes in working directory:

git checkout -- < file >

To unstage file:

> git reset HEAD < file >