Skip to content

Instantly share code, notes, and snippets.

View bayareawebpro's full-sized avatar
✔️
Available for Consulting

Dan Alvidrez bayareawebpro

✔️
Available for Consulting
View GitHub Profile
export default {
name: 'broadcasting',
data() {
return {
broadcasting: this.$broadcasting
}
},
computed: {
...mapState('auth', {
currentUser: (state) => state.currentUser,
Detect users Timezone from javascript
We have awesome library moment.js in JS world which can do all sorts of things with time, parse, validate, manipulate, and display dates and times in any formatting, it has also support to handle the timezone.
Pull the following in libraries:
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.20.1/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment-timezone/0.5.14/moment-timezone.min.js"></script>
Now if you check you chrome developer console you will have access to following methods provided by moment.
export default class ExceptionRenderer{
constructor(html) {
this.html = html
}
/**
* Render Exception
*/
render(){
if(this.html && !document.getElementById('exception')){
export default class Response {
constructor(response) {
this.data = response.data
this.headers = response.headers
this.status = response.status
}
/**
* Is response invalid?
export default class Validator{
constructor(){
this.message = null
this.exception = null
this.messageBag = {}
}
/**
* Make New Instance
* @param data
<?php
namespace App\Traits;
trait HasMemoization
{
protected static $memoized = [];
/**
* Memoize Operation Result
* @param $key
<?php namespace App;
use Illuminate\Support\Facades\Cache;
class GithubWiki
{
// GithubWiki::make('MyPage')
const CACHE = 60*60*24;
const ENDPOINT = 'https://raw.githubusercontent.com/wiki/username/repo/';
module.exports = {
prefix: '',
important: false,
separator: ':',
theme: {
screens: {
sm: '640px',
md: '768px',
lg: '1024px',
xl: '1280px',
<?php
public function upload()
{
$this->validate($this->request, [
'file' => 'required|image',
]);
$file = $this->request->file('file');
<script>
import { FormField, HandlesValidationErrors } from 'laravel-nova'
export default {
mixins: [FormField, HandlesValidationErrors],
props: ['resourceName', 'resourceId', 'field'],
data: () =>({
results: [
// { label: "British Virgin Islands, (VG)", value: 41198 },
// { label: "Zambia", value: 41203 },
],