Skip to content

Instantly share code, notes, and snippets.

View Hujjat's full-sized avatar
🎯
Focusing

Hujjat Nazari Hujjat

🎯
Focusing
View GitHub Profile
@Hujjat
Hujjat / ID.js
Created January 14, 2019 13:56
ID - a unique ID/name generator for JavaScript
// Generate unique IDs for use as pseudo-private/protected names.
// Similar in concept to
// <http://wiki.ecmascript.org/doku.php?id=strawman:names>.
//
// The goals of this function are twofold:
//
// * Provide a way to generate a string guaranteed to be unique when compared
// to other strings generated by this function.
// * Make the string complex enough that it is highly unlikely to be
// accidentally duplicated by hand (this is key if you're using `ID`
// Database Structure
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->nullable();
$table->string('password', 60)->nullable();
$table->string('provider');