Skip to content

Instantly share code, notes, and snippets.

Brandon Sueur brandonsueur

Block or report user

Report or block brandonsueur

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:809ceb8b042816d764fe108ad95a1f77
const moment = require('moment')
const GRANULARITY_MONTH = 'month'
const GRANULARITY_QUARTER = 'quarter'
const GRANULARITY_YEAR = 'year'
/**
* getContractYearTabs
*
* @param contractStart moment
View uuid.js
const replacer = c => {
const r = Math.random() * 16|0
const v = c === 'x' ? r : (r&0x3|0x8)
return v.toString(16)
}
export default uuid = () => 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, replacer)
View .eslintrc
{
"extends": ["airbnb", "prettier", "plugin:flowtype/recommended"],
"rules": {
"no-underscore-dangle": "off",
"no-param-reassign": "off",
"class-methods-use-this": "warn",
"import/no-unresolved": "off",
"import/no-extraneous-dependencies": 0,
"import/prefer-default-export": 0,
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
View gist:54061978031d39bcda18ffe40462e538
import React from "react";
import { ApolloProvider } from "@apollo/react-hooks";
import ApolloClient from "apollo-boost";
import { InMemoryCache, NormalizedCacheObject } from "apollo-cache-inmemory";
import { CachePersistor } from "apollo-cache-persist";
import localforage from "localforage";
import { BrowserRouter, Switch, Route } from "react-router-dom";
import { PersistentStorage, PersistedData } from "apollo-cache-persist/types";
import {
CssBaseline,
View UsersController.php
r->email = $request->email;
if(Auth::user()->role === 'super-admin'){
$user->user_type = $request->user_type;
} elseif(Auth::user()->user_type === 'hospital'){
$user->user_type = 'hospital';
$user->service_id = $request->service ?? null;
} elseif(Auth::user()->user_type === 'carrier'){
$user->user_type = 'carrier';
} elseif(Auth::user()->user_type === 'gesnord') {
View keybase.md

Keybase proof

I hereby claim:

  • I am brandonsueur on github.
  • I am brandonsueur (https://keybase.io/brandonsueur) on keybase.
  • I have a public key ASAe02DV9hBFmtgH78QHF0V_gxKBuj4cmAJk3hz8M_Ozjwo

To claim this, I am signing this object:

@brandonsueur
brandonsueur / test.vue
Last active Sep 18, 2019
is-online.vue
View test.vue
<template>
<span v-if="users == this.$props.id" class="pulse-online"></span>
<span v-else class="pulse-disconnected"></span>
</template>
<style>
.pulse-online {
width: 10px;
height: 10px;
border-radius: 50%;
View controller.php
<?php
protected function create(array $data)
{
$user = User::create([
'first_name' => $data['first_name'],
'last_name' => $data['last_name'],
'username' => strtolower($data['first_name'] . $data['last_name']),
'phone' => $data['phone'],
'email' => $data['email'],
'verified' => false,
View UsersController.php
<?php
namespace App\Http\Controllers;
use App\User;
use Illuminate\Support\Facades\Auth;
use App\Http\Requests\UserAddRequest;
use App\LogActivity;
use Illuminate\Support\Facades\Hash;
View auth.js
import decode from 'jwt-decode';
export default class AuthService {
constructor(domain) {
this.domain = domain || 'http://localhost:8080'
this.fetch = this.fetch.bind(this)
this.login = this.login.bind(this)
this.getProfile = this.getProfile.bind(this)
}
You can’t perform that action at this time.