Skip to content

Instantly share code, notes, and snippets.

View tawn33y's full-sized avatar

Tony tawn33y

  • New York, US
View GitHub Profile

A few recommended community guidelines on opening PRs for good code quality on the whatsapp-cloud-api repo:

  • Open a new branch from staging (not main) with the prefix feature/ISSUE-XX, where XX is the issue number, e.g. feature/ISSUE-10
  • Make your changes and add tests for them.
  • Run the linter, ensure all tests pass, and then create a build. See more under the Development docs.
  • Ensure the build size does not substantially grow the currently published size on the npmjs.com page. You can run npm pack to verify the new package size, then look at the Properties of the created tgz file.
  • Commit the changes with a well descriptive message with the format: feature/ISSUE-XX Some message here, e.g. feature/ISSUE-10 Add logging when starting an express server
  • Open a PR to the staging branch with the title format feature/ISSUE-XX Some message here, e.g. `feature/ISSUE-10 Add logg
@tawn33y
tawn33y / is-valid-sudoku.js
Last active December 14, 2021 21:14
Solved (JS): Determine if a 9x9 Sudoku board is valid
const isValidSudoku = (board) => {
const obj = {
rows: {}, // 9 rows, each containing 9 cells across
columns: {}, // 9 columns, each containing 9 cells down
blocks: {}, // 9 blocks, each containing 3x3 cells inside
};
let isValid = true;
loop1:
@tawn33y
tawn33y / palindrome.js
Last active September 2, 2022 15:27
Solved (JS): Determine whether an integer is a palindrome
const isPalindrome = (x) => {
if (x < 0 || (x % 10 === 0 && x !== 0)) {
return false;
}
return x === reverse(x);
};
const reverse = (num) => {
let rev = 0;
@tawn33y
tawn33y / magic-square.js
Last active February 25, 2023 11:13
3x3 Magic Square
// To run the code, uncomment the following:
// console.log(generateGrid());
// console.log(test(50));
// --------------------------------------------------------------------------------
// helper functions
// --------------------------------------------------------------------------------
export const sum = (...arr) => arr.reduce((acc, curr) => {
acc += curr;