Skip to content

Instantly share code, notes, and snippets.


Vượng Nguyễn nmvuong92

View GitHub Profile

#Adding an existing project to GitHub using the command line

Simple steps to add existing project to Github.

1. Create a new repository on GitHub.

In Terminal, change the current working directory to your local project.

##2. Initialize the local directory as a Git repository.

git init
nmvuong92 / index.php
Created Jan 17, 2019 — forked from ziadoz/index.php
Simple PHP / jQuery CSRF Protection
View index.php
// See:
// Start a session (which should use cookies over HTTP only).
// Create a new CSRF token.
if (! isset($_SESSION['csrf_token'])) {
$_SESSION['csrf_token'] = base64_encode(openssl_random_pseudo_bytes(32));