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
@eff-kay
eff-kay / API design
Created June 24, 2021 02:36
Joshua Bloch: Bumper-Sticker API Design
All programmers are API designers:
Good programs are modular, and intermodular boundaries define APIs. Good modules get reused.
APIs can be among your greatest assets or liabilities:
Good APIs create long-term customers; bad ones create long-term support nightmares.
Public APIs, like diamonds, are forever:
You have one chance to get it right so give it your best.
APIs should be easy to use and hard to misuse:

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])   ['▲','▲','●','●']

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@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