Skip to content

Instantly share code, notes, and snippets.

View kostasx's full-sized avatar
💭
Uncaught ReferenceError

Kostas Minaidis kostasx

💭
Uncaught ReferenceError
View GitHub Profile

Cheat sheet: JavaScript Array methods

Deriving a new Array from an existing Array:

['■','●','▲'].slice(1, 3)           ['●','▲']
['■','●','■'].filter(x => x==='■')  ['■','■']
    ['▲','●'].map(x => x+x)         ['▲▲','●●']
    ['▲','●'].flatMap(x => [x,x])   ['▲','▲','●','●']
@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.

@weibeld
weibeld / 01-hello-world.yml
Last active June 27, 2025 06:09
GitHub Actions example workflow 1 — Hello World!
name: hello-world
on: push
jobs:
my-job:
runs-on: ubuntu-latest
steps:
- name: my-step
run: echo "Hello World!"
rom tensorflow.keras.preprocessing.sequence import pad_sequences
sentences = ['I love my dog',
'I love my cat',
'you love my dog!',
'Do you think my dog is amazing?',
]
tokenizer = Tokenizer(num_words = 100,oov_token="<OOV>")
tokenizer.fit_on_texts(sentences)
  • repo -> repository

  • clone -> bring a repo down from the internet (remote repository like Github) to your local machine

  • add -> track your files and changes with Git

  • commit -> save your changes into Git

  • push -> push your changes to your remote repo on Github (or another website)

  • pull -> pull changes down from the remote repo to your local machine

  • status -> check to see which files are being tracked or need to be commited

  • init -> use this command inside of your project to turn it into a Git repository and start using Git with that codebase

Name Latitude Longitude Cluster Day
Athens International Airport 37.9356467 23.9484156 2 1
Acropolis of Athens 37.9715323 23.7257492 2 1
Pl. Agias Irinis 2 37.977418 23.7280221 2 1
Diporto - Secret underground restaurant 37.9806622 23.7257688 2 1
Temple of Zeus 37.9692838 23.7331012 2 1
Plaka 37.9725529 23.7303363999999 2 1
Temple of Olympian Zeus 37.9693 23.7331 2 1
Lake Vouliagmeni 37.8078002 23.7855018 2 1
@tomhicks
tomhicks / plink-plonk.js
Last active May 15, 2025 13:25
Listen to your web pages
@willmendesneto
willmendesneto / a11y-dev-mode.css
Last active July 2, 2024 06:44
Using CSS for highlight errors in HTML - A11Y Linting HTML with CSS
/* Highliting accessibility errors in HTML */
/* highlight HTML element with invalid value for lang attribute */
html:not([lang]),
html[lang=""] {
border: 2px dotted red !important;
}
/* highlight images missing alt text */
img:not([alt]) {
@RecessPlayWorks
RecessPlayWorks / gist:792b632848de7f058ade52612d08b24e
Created December 12, 2019 00:05
SOLVED: "This repository moved..." warning in CLI
https://stackoverflow.com/questions/30443333/error-with-renamed-repo-in-github-remote-this-repository-moved-please-use-th
"
git remote set-url origin [updated link url https://........git]
"
const Web3 = require('web3');
class TransactionChecker {
web3;
web3ws;
account;
subscription;
constructor(projectId, account) {
this.web3ws = new Web3(new Web3.providers.WebsocketProvider('wss://rinkeby.infura.io/ws/v3/' + projectId));