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
| # Check if a program is installed on macOS (or any Unix-like system) | |
| # Run the function and pass the program/command you want to check as an argument | |
| # Example: checkInstall brew | |
| checkInstall() { | |
| program=$1 | |
| if [[ $(command -v ${program}) == "" ]]; then | |
| # program is not installed since the output is empty | |
| echo -e "${program} is not installed" |
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
| # Check if Homebrew is installed, install if we don't have it, update if we do | |
| homebrew() { | |
| # $() is for command substitution, commands don't _return_ values, they _capture_ them | |
| # more here: https://stackoverflow.com/a/12137501/890814 | |
| # [[ ]] is the newer _test command_ for evaluations, is more literal | |
| # more here: http://mywiki.wooledge.org/BashFAQ/031 | |
| # the double [[ ]], and $() is important | |
| # `command -v brew` will output nothing if Homebrew is not installed | |
| if [[ $(command -v brew) == "" ]]; then |
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
| # Copy Default Theme | |
| # run this script from inside `catalog/view/theme/` | |
| # (the themes directory for OpenCart, i.e. where your 'default' theme folder resides) | |
| # run: bash catalog/view/theme/copyTheme.sh foo | |
| # TODO | |
| # [ ] add status/progress messages | |
| # [ ] add error handling, if the folder already exists etc. |
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
| <form action="#" method="post" id="demoForm"> | |
| <h3>Form Elements and (most of the) Input Types</h3> | |
| <label for="progress-bar">Progress</label> | |
| <progress value="75" max="100" name="progress-bar"></progress> | |
| <fieldset> | |
| <legend>Account Info</legend> | |
| <label for="name">Name </label> | |
| <input type="name" id="name"> | |
| <label for="email">Email </label> |
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
| // MEDIA QUERIES | |
| // USE: @include media(desktop) { .. } | |
| // Breakpoints in ./_variables.scss | |
| // $S: 576px; // Small devices (landscape phones, 576px and up) | |
| // $M: 768px; // Medium devices (tablets, 768px and up) | |
| // $L: 992px; // Large devices (desktops, 992px and up) | |
| // $XL: 1200px; // Extra large devices (large desktops, 1200px and up) | |
| // If device size EXACTLY MATCHES |
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
| /* | |
| In Sublime Text, install the Color Highlighter plugin to get highlighted colors, | |
| immedidately know what color is the variable $body-bg pointing to | |
| Colors from: http://designmodo.github.io/Flat-UI/ | |
| */ | |
| $color-turquoise: #1ABC9C; // TURQUOISE | |
| $color-greenSea: #16A085; // GREEN SEA | |
| $color-emerald: #2ECC71; // EMERALD | |
| $color-nephritis: #27AE60; // NEPHRITIS |
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
| {% comment %} | |
| Loops though every collection you defined in _config.yml and grabs the pages they contain; outputting titles. | |
| {% endcomment %} | |
| {% for collection in site.collections %} | |
| {% assign name = collection.label %} | |
| <h1>{{ name }}</h1> |
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
| SET @DATABASE='database'; | |
| SET @USERNAME='username'; | |
| SET @PASSWORD='password'; | |
| SET @HOST='localhost'; | |
| CREATE DATABASE @DATABASE; | |
| CREATE USER '@USERNAME'@'@HOST' IDENTIFIED BY '@PASSWORD'; | |
| -- GRANT USAGE ON @DATABASE.* TO '@USERNAME'@'@HOST'; | |
| GRANT ALL PRIVILEGES ON @DATABASE.* TO '@USERNAME'@'@HOST'; | |
| FLUSH PRIVILEGES; |
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
| # Secure File Permissions | |
| # https://codex.wordpress.org/Changing_File_Permissions#.htaccess_permissions | |
| # 600 -rw------- /home/user/wp-config.php | |
| # 604 -rw----r-- /home/user/cgi-bin/.htaccess | |
| # 600 -rw------- /home/user/cgi-bin/php.ini | |
| # 711 -rwx--x--x /home/user/cgi-bin/php.cgi | |
| # 100 ---x------ /home/user/cgi-bin/php5.cgi | |
| # BEGIN Increases Max Upload Size | |
| php_value upload_max_filesize 64M |
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
| /* | |
| path: server.js | |
| */ | |
| // Require shit | |
| const express = require('express'); | |
| const bodyParser = require('body-parser'); | |
| const mongoose = require('mongoose'); | |
| // Let's import our Vehicle model |