Skip to content

Instantly share code, notes, and snippets.

@seemly
seemly / my.cnf
Created May 24, 2021 08:32
Apple M1 - Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Setting up my new Apple M1 macbook pro I was having issues setting up [email protected] using homebrew, with the following message being thrown:
```
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
```
We need to modify the MySQL config file:
```
nano /usr/local/etc/my.cnf
@seemly
seemly / getTextNodes.txt
Last active February 7, 2018 16:58
jQuery - Find object containing direct textNode content
function getTextNodes(cssSelector, findString) {
var items = $(cssSelector)
.contents()
.filter(function() {
var isText = this.nodeType == Node.TEXT_NODE;
if (isText) {
var text = $.trim(this.textContent);
if (text.length && text.indexOf(findString) > -1) {