Skip to content

Instantly share code, notes, and snippets.

View rolspace's full-sized avatar

Rolando Ramos rolspace

View GitHub Profile
@rolspace
rolspace / example.sh
Created February 20, 2021 20:19
Tag Cleanup
# delete remote tags containing the word "text"
git push --delete origin `git tag --list "*text*"`
# delete local tags containing the word "text"
git tag -d `git tag --list "core@v0*-test.*"`
@rolspace
rolspace / mysql-docker.sh
Created November 5, 2020 12:08 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@rolspace
rolspace / multiple_ssh_setting.md
Created September 24, 2020 20:08 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
import { useState } from "react";
export const useInput = initialValue => {
const [value, setValue] = useState(initialValue);
return {
value,
setValue,
reset: () => setValue(""),
bind: {
@rolspace
rolspace / jest-mock-instance.js
Last active November 22, 2018 22:02
Syntax to mock object instance properties when using Jest
//mock object method
Object.defineProperty(object, 'method', { value: jest.fn() });
//mock object property
Object.defineProperty(object, 'property', { get: () => jest.fn() });