Skip to content

Instantly share code, notes, and snippets.

@jeffreysbrother
Last active November 8, 2016 19:38
Show Gist options
  • Select an option

  • Save jeffreysbrother/e2cf080e66b99c61b87357b8c2fd2e78 to your computer and use it in GitHub Desktop.

Select an option

Save jeffreysbrother/e2cf080e66b99c61b87357b8c2fd2e78 to your computer and use it in GitHub Desktop.
{
"always_show_minimap_viewport": true,
// "bold_folder_labels": true,
"color_scheme": "Packages/Colorsublime - Themes/Boron.tmTheme",
"font_face": "Fira Code",
"font_size": 12,
"hot_exit": false,
"ignored_packages":
[
"Vintage"
],
"indent_guide_options":
[
"draw_normal",
"draw_active"
],
"line_padding_bottom": 3,
"line_padding_top": 3,
"overlay_scroll_bars": "enabled",
"remember_open_files": false,
"theme": "Material-Theme.sublime-theme",
"use_simple_full_screen": true
}

###MySQL Stuff

log in as root user: mysql -u root -p (this will then prompt you for a password)

note: if running a command in the mysql prompt produces a -> this probably means that we have failed to insert a semicolon at the end of the line.

show databases;

create database <database-name>;

use <database-name>;

show tables;

create table <table-name> (id integer PRIMARY KEY AUTO_INCREMENT, description text NOT NULL, completed boolean NOT NULL); (basic formatting here is column_name type modifiers, column_name type modifiers, etc)

describe <table-name>;

drop table <table-name>;

insert into <table-name> (<columnA>, <columnB>) values('Go to the store', false);

select * from <table-name>;

select * from <table-name> where id = 1;

all of these things can be done from a GUI program such as Sequel Pro

###PHP stuff that might be related to MySQL

  • we can start up a PHP server by typing php -S localhost:4000 (any port)
  • we can use an existing PHP class to fetch data from a MySQL database: PDO (PHP Data Objects) $pdo = new PDO('mysql:host=127.0.0.1;dbname=<database-name>', 'root', '<password-here>');

###Sublime Text 3 Upgrades

  • install package control (by running the code in Sublime Text's console). This functionality can be accessed by typing ctrl+shift+p ... and by typing in "install", we will see an option that says "Package Control: Install Package". Selecting this option will give us the ability to install packages.
  • install Material Theme using package control, then add the required and recommended JSON parameters to Sublime's user settings.
  • install ColorSublime package using package control. We can then use ColorSublime to install a theme, perhaps the Facebook theme by mbixby.
  • download Fira Code and update font_face in Sublime's user settings
  • Install PackageResourceViewer (with package control). I think this allows us to extract the source code of some installed package so that subsequent updates to the package will not override our customizations.
  • Install AdvancedNewFile using package control. Key bindings can be configured by going here: Preferences > Package Settings > AdvancedNewFile > Key Bindings -- User

###Sublime Text 3 Shortcuts

  • ctrl+shift+p ... open command palette
  • ctrl+p ... browse files
  • ctrl+r ... go to symbol (this allows us to jump to class and function definitions)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment