Skip to content

Instantly share code, notes, and snippets.

@r3vit
r3vit / safari_historydb_instructions
Last active September 9, 2021 15:59
Easy clean Safari History.db
# Steps:
# 1. Close Safari.
# 2. Open the Safari History.db with sqlite3.
cd cd ~/Library/Safari
sqlite3 History.db
# 2. Remove the url that I have visited less than 5 times (there is no timestamp, so I cannot delete the "older than")
# My goal is to remove the ones that I usually don't use and are freezing/lagging Safari.

Keybase proof

I hereby claim:

  • I am r3vit on github.
  • I am r3vit (https://keybase.io/r3vit) on keybase.
  • I have a public key ASBts_haCUWQFEl5jrEg8ZuLTMw-gCO1SuCspFrBT2G3Lgo

To claim this, I am signing this object:

@r3vit
r3vit / generateRandomInt.go
Created May 24, 2018 13:59
Generate simple random int using crypto/rand.
package main
import (
"crypto/rand"
"fmt"
"math/big"
)
func main() {
@r3vit
r3vit / start_mysql_dump.sh
Last active June 10, 2017 10:20
Start a mysql docker container and restore your dump.sql
#!/bin/sh
#clear
docker stop CONTAINER
docker rm CONTAINER
#start new mysql service at port :3306 with password:root
docker run --name CONTAINER -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root -d mysql
#start mysql service
docker exec CONTAINER service mysql start
@r3vit
r3vit / exec.go
Created September 8, 2016 12:13
Exec command line commands in go
package main
import (
"fmt"
"log"
"os/exec"
"strings"
)
func main() {
@r3vit
r3vit / randomNumber.go
Created September 8, 2016 12:07
Simple random number generator Go
package main
import (
"fmt"
"math/rand"
"time"
)
//RandomNumber generate a random number from [min] to [max]
func RandomNumber(min, max int) int {