-
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
| 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
| /* 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
| # 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
| package main | |
| import ( | |
| "database/sql" | |
| "gopkg.in/gorp.v1" | |
| "log" | |
| "strconv" | |
| "github.com/gin-gonic/gin" | |
| _ "github.com/go-sql-driver/mysql" |
Picking the right architecture = Picking the right battles + Managing trade-offs
- Clarify and agree on the scope of the system
- User cases (description of sequences of events that, taken together, lead to a system doing something useful)
- Who is going to use it?
- How are they going to use it?
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
| import java.util.LinkedList; | |
| import java.util.Queue; | |
| public class LevelOrderTraversal { | |
| public void levelOrderNaiveApproach(Node root){ | |
| int h = height(root); | |
| for(int i=1;i<=h;i++){ | |
| printLevels(root,i); | |
| System.out.println(""); |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
$ sudo npm install -g hexo-cli
$ hexo -v
hexo-cli: 0.1.9