This file contains 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
source ~/.profile | |
# --------------------------------------------------------------------------- | |
# | |
# Description: This file holds all my BASH configurations and aliases | |
# | |
# The inspiration for this file can be found: https://natelandau.com/my-mac-osx-bash_profile/ | |
# | |
# Sections: | |
# 1. Environment Configuration | |
# 2. Make Terminal Better (remapping defaults and adding functionality) |
This file contains 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="/controller.php" method="post" enctype="multipart/form-data"> | |
<input type="file" id="imgInput" name="file" /> | |
<img src="/assets/default_empty.png" id="upImage" src="#" alt="Upload Image" /> | |
</form> | |
<script type="text/javascript"> | |
function readURL(input) { | |
if (input.files && input.files[0]) { | |
var reader = new FileReader(); |
This file contains 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
function generatePassword() { | |
var numCaps = 1; | |
var numLower = 6; | |
var numChars = 1; | |
var stringLength = numCaps + numLower + numChars; | |
var randomString = ''; | |
var caps = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']; | |
var lower = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']; |
This file contains 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
RewriteEngine on | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule .* index.php/$0 [PT,L] |
This file contains 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
try { | |
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | |
// Add PDO query below here. | |
if($sth->execute()){ | |
$arr = $sth->errorInfo(); | |
print_r($arr); | |
} | |
} |
This file contains 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
# Your snippets | |
# | |
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to | |
# expand the prefix into a larger code block with templated values. | |
# | |
# You can create a new snippet in this file by typing "snip" and then hitting | |
# tab. | |
# | |
# An example CoffeeScript snippet to expand log to console.log: | |
# |
This file contains 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
//#1 - npm init -y | |
//#2 - npm install -save express | |
//#3 - npm install -save nodemon | |
var express = require('express') | |
var app = express() | |
var port = 3000; | |
app.get('/', function(req, res){ | |
res.sendFile(__dirname + 'index.html') |
This file contains 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
# 1) Replace 'http://localhost/site.loc' with 'http://site.com' | |
# 2) Check if wp_ prefix needs to changed. | |
# 3) Avoid trailing slashes in url. eg. http://site.com/ | |
UPDATE wp_options SET option_value = replace(option_value, | |
'//localhost/website', '//website.loc') WHERE | |
option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, | |
'//localhost/website','//website.loc'); |