Skip to content

Instantly share code, notes, and snippets.

Avatar

Vượng Nguyễn nmvuong92

  • viet nam
View GitHub Profile
View Add_Existing_Project_To_Git.md

#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
nmvuong92 / index.php
Created Jan 17, 2019 — forked from ziadoz/index.php
Simple PHP / jQuery CSRF Protection
View index.php
<?php
// See: http://blog.ircmaxell.com/2013/02/preventing-csrf-attacks.html
// Start a session (which should use cookies over HTTP only).
session_start();
// Create a new CSRF token.
if (! isset($_SESSION['csrf_token'])) {
$_SESSION['csrf_token'] = base64_encode(openssl_random_pseudo_bytes(32));
}
You can’t perform that action at this time.