-
Open the Terminal
-
Use
mysqldump
to backup your databases -
Check for MySQL processes with:
ps -ax | grep mysql
-
Stop and kill any MySQL processes
-
Analyze MySQL on HomeBrew:
brew remove mysql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func uniqueNonEmptyElementsOf(s []string) []string { | |
unique := make(map[string]bool, len(s)) | |
us := make([]string, len(unique)) | |
for _, elem := range s { | |
if len(elem) != 0 { | |
if !unique[elem] { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#add 'node_modules' to .gitignore file | |
git rm -r --cached node_modules | |
git commit -m 'Remove the now ignored directory node_modules' | |
git push origin <branch-name> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
/* | |
Return all permutations of a string | |
Example, | |
Find all perm of abc: |
###Sketch trial non stop
Open hosts files:
$ open /private/etc/hosts
Edit the file adding:
127.0.0.1 backend.bohemiancoding.com
127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This gist is for my YouTube video which I tried to explain Window Sliding Technique. | |
// You can watch it from here: https://youtu.be/guDU5HnLqAs | |
// Given a sorted array A (sorted in ascending order), having N integers, | |
// find if there exists any pair of elements (A[i], A[j]) such that | |
// their sum is equal to X. | |
// | |
// Input: A = [2,3,4,5,6,7,8,9], k= 10 | |
// Output: true | |
// NOTE: We slightly changed the question and the output in the video. We're returning pair indexes as an array. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const app = express(); | |
// Application | |
app.get('/', function(req, res) { | |
if (process.env.NODE_ENV === 'development') { | |
for (var key in require.cache) { | |
delete require.cache[key]; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package cache | |
import ( | |
"sync" | |
"time" | |
) | |
// Cache is a basic in-memory key-value cache implementation. | |
type Cache[K comparable, V any] struct { | |
items map[K]V // The map storing key-value pairs. |