This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<button class="btn" :classList="classList"> | |
<template v-if="this.icons"> | |
<slot></slot> | |
</template> | |
{{ this.text }} | |
</button> | |
</template> | |
<script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Storage { | |
get(item) { | |
const request = new Promise((resolve, reject) => { | |
let data = localStorage.getItem(item); | |
console.log(`Start of promise`); | |
(data) ? resolve(data) : reject(); | |
}); | |
request.then((data) => { | |
console.log(`promise resolved`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let total = 0, amount, item; | |
for (item in localStorage) { | |
amount = ((localStorage[item].length + item.length) * 2); | |
total += amount; | |
} | |
console.log(`Total = ${(total / 1024).toFixed(2)}KB`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Event { | |
constructor() { | |
this.events = {}; | |
} | |
fire(event, data) { | |
const Event = this.events[event]; | |
if( Event ) { | |
Event.forEach(callback => { | |
callback.call(null, data); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use App\Identity; | |
use App\Http\Requests; | |
use App\Http\Controllers\Controller; | |
class AccountController extends Controller { |
NewerOlder