Skip to content

Instantly share code, notes, and snippets.

@PatrickSunico
PatrickSunico / fetchpost.swift
Created July 12, 2017 20:27
Fetch and Post Requests Swift
@IBAction func getPressed(_ sender: Any) {
// GET REQUEST
// guard checks if the data from the url exists, i.e early return
guard let url = URL(string: "https://jsonplaceholder.typicode.com/users") else {
return
}
let session = URLSession.shared
// completion handler
session.dataTask(with: url) { (data, response, error) in
@PatrickSunico
PatrickSunico / rm_mysql.md
Created August 5, 2016 11:07 — forked from vitorbritto/rm_mysql.md
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

brew remove mysql

@PatrickSunico
PatrickSunico / MySQL.md
Created August 5, 2016 06:41 — forked from nrollr/MySQL.md
Install MySQL on El Capitan using Homebrew

Install MySQL on OS X El Capitan

Normally the installation of MySQL can be achieved with a single command, which executes a script provided by MacMiniVault : bash <(curl -Ls http://git.io/eUx7rg)

However, at the time of writing the script is not compatible with OS X El Capitan (10.11)

Install MySQL using Homebrew

An alternative to the aforementioned installation script is installing MySQL using Homebrew. This gist assumes you already have Homebrew installed, if not first read the article "Homebrew and El Capitan"

Make sure Homebrew has the latest formulae, so run brew update first

@PatrickSunico
PatrickSunico / 0_reuse_code.js
Created February 14, 2016 11:03
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console