Skip to content

Instantly share code, notes, and snippets.

View isaobushi's full-sized avatar
🎃

Andrea Mele isaobushi

🎃
View GitHub Profile
@isaobushi
isaobushi / customHooks.js
Created May 26, 2022 22:01
Custom hooks #hooks #toggle
import { useState } from "react"
export default function useToggle(defaultValue) {
const [value, setValue] = useState(defaultValue);
function toggleValue(value) {
setValue(currentValue =>
typeof value === "boolean" ? value : !currentValue
)
}
@isaobushi
isaobushi / scrpt.md
Created September 14, 2020 22:05
script to implement

1.Alfred launch script to toggle displays true tone

@isaobushi
isaobushi / .md
Created July 23, 2020 23:39
Aliases

Git aliases

alias ga="git add ." alias gc="git commit -a" alias gp="git push origin " alias gd="git diff" alias gs="git status"

General aliases

@isaobushi
isaobushi / mardown.md
Last active July 23, 2020 23:47
Markdown Cheat Sheet

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6
@isaobushi
isaobushi / installation.md
Last active February 9, 2024 09:46
Setting up a new machine

Installation

Here there are some scripts to install automatically all my applications and settings on a fresh OSX machine

  • Note 1: not all the applications have a cask install, therefore they must be installed automatically
  • Note 2: it's better to install Xcode first from the app store before running the bootstrap script. Otherwise, Homebrew can't access the Xcode libraries as the agreement hasn't been accepted yet.

@isaobushi
isaobushi / scripts
Created July 23, 2020 05:00
Personal managing scripts
enable disable wifi
networksetup -setairportpower en0 on (or off)
@isaobushi
isaobushi / docker
Created July 16, 2020 05:49
Docker
docker volume down -v ( address to just one volume )
@isaobushi
isaobushi / Delete node_modules from all the projects in a folder
Last active July 13, 2020 02:25
Check Memory of/and Clean node_modules
**Check how much memory
find . -name "node_modules" -type d -prune | xargs du -chs
- example output:
252M ./jotto-hooks/node_modules
410M ./tempBin/refugee-job-search-frontend-user/node_modules
415M ./Magic-League/node_modules
72M ./legal-block-backend/node_modules
@isaobushi
isaobushi / deployKuber.md
Created October 14, 2019 05:26
Deploy on Kubernetes

Build docker Image Push docker Image Create a deployment on kubectl kubectl create deployment <name_app> --image=<repo_name>: Expose service kubectl expose deployment/<name_app> --type=NodePort --port=NNNN --name=<name_app>-service --target-port=NNNN

@isaobushi
isaobushi / convert.js
Created August 12, 2019 23:27
convert string to date #js #method
const dateString = '20/12/2019'
const convertedDate = date.toISOString(dateString)