Skip to content

Instantly share code, notes, and snippets.

@jeffreysbrother
Last active November 8, 2016 19:38
Show Gist options
  • Save jeffreysbrother/e2cf080e66b99c61b87357b8c2fd2e78 to your computer and use it in GitHub Desktop.
Save jeffreysbrother/e2cf080e66b99c61b87357b8c2fd2e78 to your computer and use it in GitHub Desktop.
{
"always_show_minimap_viewport": true,
"color_scheme": "Packages/Colorsublime - Themes/Boron.tmTheme",
"font_face": "Fira Code",
"font_size": 11,
"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,
"word_wrap": "true"
}
{
"always_show_minimap_viewport": true,
"color_scheme": "Packages/Boxy Theme/schemes/Boxy Tomorrow.tmTheme",
"font_face": "Fira Code",
"font_size": 11,
"hot_exit": false,
"ignored_packages":
[
"Vintage"
],
"indent_guide_options":
[
"draw_normal",
"draw_active"
],
"line_padding_bottom": 3,
"line_padding_top": 3,
"material_theme_accent_scrollbars": true,
"material_theme_arrow_folders": true,
"material_theme_big_fileicons": true,
"material_theme_bright_scrollbars": true,
"material_theme_bullet_tree_indicator": true,
"material_theme_compact_sidebar": true,
"material_theme_contrast_mode": true,
"material_theme_disable_folder_animation": true,
"material_theme_panel_separator": true,
"material_theme_small_statusbar": true,
"material_theme_small_tab": true,
"material_theme_tabs_separator": true,
"overlay_scroll_bars": "enabled",
"remember_open_files": false,
"theme": "Boxy Tomorrow.sublime-theme",
"use_simple_full_screen": true,
"word_wrap": "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)
//when we are manually connecting to PDO, we want to wrap it in a try/catch block
try {
	$pdo = new PDO('mysql:host=127.0.0.1;dbname=<database-name>', '<username>', '<password>');
} catch (PDOException $e) {
	die('Could not connect.');
}

###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 colorscheme. So far I enjoy these themes the best: 1337, Acai, Facebook, Afterglow, and Boron. I have not tried every colorscheme.
  • 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
  • Install a blade syntax highlighter
  • Install GitGutter (not sure if I like this yet)

###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