-
Open the Terminal
-
Use
mysqldumpto 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 hidden or 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 ( | |
| "database/sql" | |
| "gopkg.in/gorp.v1" | |
| "log" | |
| "strconv" | |
| "github.com/gin-gonic/gin" | |
| _ "github.com/go-sql-driver/mysql" |
This file contains hidden or 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
| # The following script will deploy a Laravel 5 applicaion on AWS Elastic Beanstalk. | |
| # Add to .ebextensions at the root of your application and name your commands file (e.g., commands.config) | |
| # -------------------------------- Commands ------------------------------------ | |
| # Use "commands" key to execute commands on the EC2 instance. The commands are | |
| # processed in alphabetical order by name, and they run before the application | |
| # and web server are set up and the application version file is extracted. | |
| # ------------------------------------------------------------------------------ | |
| commands: | |
| 01updateComposer: |
This file contains hidden or 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
| /* Marvel Heroes and Villains | |
| Based on the website http://marvel.wikia.com/Main_Page | |
| with popularity data from http://observationdeck.io9.com/something-i-found-marvel-character-popularity-poll-cb-1568108064 | |
| and power grid data from http://marvel.wikia.com/Power_Grid#Power | |
| Collected by: https://www.khanacademy.org/profile/Mentrasto/ | |
| */ | |
| CREATE TABLE marvels (ID INTEGER PRIMARY KEY, | |
| name TEXT, | |
| popularity INTEGER, |
This file contains hidden or 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
| var _ = require('lodash'), | |
| fs = require('fs'), | |
| path = require('path'), | |
| csv = require('csv'), | |
| Sequelize = require('sequelize'); | |
| function addUser(db, filename, rolesByName, addresses) { | |
| var parser = csv.parse({}, function (err, data) { | |
| db.models.User.bulkCreate( | |
| _.map(data, function (record, index) { |
This file contains hidden or 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
| <?php | |
| /** | |
| * Query builder scope to list neighboring locations | |
| * within a given distance from a given location | |
| * | |
| * @param Illuminate\Database\Query\Builder $query Query builder instance | |
| * @param mixed $lat Lattitude of given location | |
| * @param mixed $lng Longitude of given location | |
| * @param integer $radius Optional distance |
This file contains hidden or 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
| <?php | |
| require __DIR__ . '/vendor/autoload.php'; | |
| $s3 = Aws\S3\S3Client::factory($config); | |
| $s3->registerStreamWrapper(); | |
| $url = 's3://{$bucket}/{$key}'; | |
| // Read CSV with fopen |
This file contains hidden or 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
| # The next line updates PATH for the Google Cloud SDK. | |
| source /Users/dwchiang/google-cloud-sdk/path.zsh.inc | |
| # The next line enables zsh completion for gcloud. | |
| source /Users/dwchiang/google-cloud-sdk/completion.zsh.inc |