Skip to content

Instantly share code, notes, and snippets.

View SabrinaMarkon's full-sized avatar
🐦

Sabrina Markon SabrinaMarkon

🐦
  • VML
  • Calgary, Alberta
View GitHub Profile
@SabrinaMarkon
SabrinaMarkon / php_form_submit.md
Created January 11, 2021 00:45 — forked from jesperorb/php_form_submit.md
PHP form submitting with fetch + async/await

PHP Form submitting

If we have the following structure in our application:

  • 📁 application_folder_name
    • 📄 index.php
    • 📄 handle_form.php
    • 📄 main.js

And we fill our index.php with the following content just to get a basic website with a form working. You should be able to run this through a php-server of your choice.

@SabrinaMarkon
SabrinaMarkon / px-em-rem.html
Last active February 8, 2020 01:32 — forked from prof3ssorSt3v3/px-em-rem.html
Difference between px, em, and rem units example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>px vs em vs rem</title>
<style>
html {
@SabrinaMarkon
SabrinaMarkon / App.js
Created March 31, 2019 10:29 — forked from ryanjyost/App.js
Updated with localStorage methods
import React, { Component } from "react";
import logo from "./logo.svg";
import "./App.css";
class App extends Component {
constructor(props) {
super(props);
this.state = {
newItem: "",
list: []
@SabrinaMarkon
SabrinaMarkon / App.js
Created March 31, 2019 10:08 — forked from ryanjyost/App.js
App.js for localStorage tutorial - Initial Setup
import React, { Component } from "react";
import logo from "./logo.svg";
import "./App.css";
class App extends Component {
constructor(props) {
super(props);
this.state = {
newItem: "",
list: []
// A more functional memoizer
//We can beef up our module by adding functions later
var Memoizer = (function(){
//Private data
var cache = {};
//named functions are awesome!
function cacher(func){
return function(){
var key = JSON.stringify(arguments);
/*
Closures cannot access the arguments object of the parent,
but, because functions are first class objects, we can pass a function as a parameter.
The closure can now access the arguments object of the function that is passesd as a parameter.
So, there is no confusion as to which arguments object we want the closure to access.
We're basically taking advantage of its limitations
*/
function demoMemo(func){
//we must return a function in order to keep state
//this will be more apparant in a recursive example
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
@SabrinaMarkon
SabrinaMarkon / .htaccess
Created January 2, 2017 10:34 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/