Skip to content

Instantly share code, notes, and snippets.

View anthonyalvarez's full-sized avatar
🏠
Working from home as a remote web coder

Anthony E. Alvarez anthonyalvarez

🏠
Working from home as a remote web coder
View GitHub Profile
@anthonyalvarez
anthonyalvarez / docker_wordpress.md
Created October 6, 2023 19:32 — forked from bradtraversy/docker_wordpress.md
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Anthony Alvarez",
"label": "Mobile Web Specialist (MWS), Progressive Web App (PWA)",
"image": "http://anthonyalvarez.us/wp-content/uploads/2018/07/Anthony-Alvarez-Avatar-Square-200px.jpg",
"email": "[email protected]",
"phone": "(973) 400-9409",
"url": "http://anthonyalvarez.us/",
"summary": "A software engineer with three years experience in Tokyo Japan. Also worked one year in China and Hong Kong. Services include: Local Docker based Ecommerce website Development, JavaScript programming and testing Web Hosting and DevOps with Git, Github Actions and continutous delivery/integration (CD/CI) and Web performance audting.",
{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
#Import-Module PSColors
#Import-Module posh-git
Import-Module -Name Terminal-Icons
@anthonyalvarez
anthonyalvarez / .gitmessage.txt
Created June 10, 2019 20:01
Sample Git Commit Message Template
type: subject
body
footer
# ========= INSTRUCTIONS FOR USE ============4950
#
# The Type
# The type is contained within the title
@anthonyalvarez
anthonyalvarez / Arrow-Functions.md
Created November 15, 2018 17:49
Arrow Functions

Arrow Functions

Functions are one of the primary data structures in JavaScript; they've been around forever. ES6 introduces a new kind of function called the arrow function. Arrow functions are very similar to regular functions in behavior, but are quite different syntactically. The following code takes a list of names and converts each one to uppercase using a regular function:

const upperizedNames = ['Farrin', 'Kagure', 'Asser'].map(function(name) { 
@anthonyalvarez
anthonyalvarez / callback.md
Created November 12, 2018 16:44
Callbacks

Callbacks

A function parameter passed to a function. Upon the recieving function's process completion, the parameter function is run.

JavaScript is single threaded, meaning that two bits of script cannot run at the same time; they have to run one after another. In browsers, JavaScript shares a thread with a load of other stuff that differs from browser to browser. But typically JavaScript is in the same queue as painting, updating styles, and handling user actions (such as highlighting text and interacting with form controls). Activity in one of these things delays the others.

As a human being, you're multithreaded. You can type with multiple fingers, you can drive and hold a conversation at the same time. The only blocking function we have to deal with is sneezing, where all current activity must be suspended for the duration of the sneeze. That's pretty annoying, especially when you're driving and trying to hold a conversation. You don't want to write code that's sneezy.

You've probably used events an

@anthonyalvarez
anthonyalvarez / HTML-JavaScript-Snippet-Pattern.md
Last active November 4, 2018 17:52
HTML / JavaScript Snippet Pattern

HTML / JavaScript Snippet Pattern

Useful for Progressive Web Apps (PWA) using App-shell architecture. Where each section and/or div in HTML is a template generated by a JavaScript function. The actual HTML web page contains very little HTML markup, styles informaiton or data.

Web pages only contains data listed below.

  • HTML5 landmark tags
  • section
@anthonyalvarez
anthonyalvarez / Web-Workers-Introduction.md
Last active November 2, 2018 19:39
Web Workers Introduction

Web Workers Introduction

Web Workers are a way that JavaScript has to start running tasks on a new thread. This helps to offload some heavy processing for your web pages.

There are really only two things you need for web workers.

  worker.postMessage( data ) 
  worker.addEventListener('message', func) 
@anthonyalvarez
anthonyalvarez / JavaScript-URLSearchParams-Constructing-Query-Strings.md
Created October 30, 2018 17:05
JavaScript URLSearchParams, Constructing Query Strings

JavaScript URLSearchParams, Constructing Query Strings

The very convenient URLSearchParams object within JavaScript lets you easily work with query strings - it provides methods to add, remove and retrieve key value pairs and most importantly, extract an encoded query string for further use. This object is a relief for traditional JavaScript developers who know the pain of using regular expressions to extract query string data or manual string construction to create a query string. URLSearchParams does all this for you through its very helpful methods.

<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8" />