Skip to content

Instantly share code, notes, and snippets.

View scr2em's full-sized avatar

Mohamed Abdelgwad scr2em

  • Egypt
View GitHub Profile
@textbook
textbook / cypress-cra.md
Last active September 28, 2023 20:16
Adding Cypress to a Create React App app

Here is how to add Cypress E2E tests to a Create React App bootstrapped application. Assumes the *nix command line, you may need to adapt this for a Windows command line (or use WSL or Git Bash).

  1. Install Cypress and the Testing Library utilities for it (to match the helpers CRA installs):

    $ npm i {,@testing-library/}cypress

    i is short for install, and the braces {} are expanded by brace expansion to cypress @testing-library/cypress.

/* eslint-disable no-var,newline-before-return */
var removeDuplicates = true
/**
* This function should work for any instagram post.
* Use it by opening Chrome's javascript console and pasting all of this code. (see link below)
* https://developers.google.com/web/tools/chrome-devtools/console/
*
* All comments are not immediately visible. This will automatically click the "show more" button for you.
* It could take some time depending on how many comments there are.
@bradtraversy
bradtraversy / ssh.md
Last active October 22, 2024 15:35
SSH & DevOps Crash Course Snippets

SSH Cheat Sheet

This sheet goes along with this SSH YouTube tutorial

Login via SSH with password (LOCAL SERVER)

$ ssh [email protected]

Create folder, file, install Apache (Just messing around)

$ mkdir test

$ cd test

@byanofsky
byanofsky / chess-ai-minimax-with-alpha-beta.js
Created July 6, 2017 15:35
Minimax algorithm with alpha beta pruning
var calcBestMove = function(depth, game, playerColor,
alpha=Number.NEGATIVE_INFINITY,
beta=Number.POSITIVE_INFINITY,
isMaximizingPlayer=true) {
// Base case: evaluate board
if (depth === 0) {
value = evaluateBoard(game.board(), playerColor);
return [value, null]
}
@matijagrcic
matijagrcic / Batch-convert-webp-to-png.txt
Created November 18, 2016 18:28
Batch convert webp to png
#Download dwebp (WebP decoder tool) https://developers.google.com/speed/webp/download
#Run
for %f in (*.webp) do dwebp.exe "%f" -o "%~nf.png"