This file contains hidden or 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
| function round(value, precision) { | |
| var multiplier = Math.pow(10, precision || 0); | |
| var num = (Math.round(value * multiplier) / multiplier).toString(); | |
| return num.indexOf('.') ? num : num + '.0'; | |
| } | |
| function shortNumberFormatter(number) { | |
| if (number < 900) { | |
| return number; | |
| } |
This file contains hidden or 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
| function remove-merged-branches () { | |
| currentBranch=$(git rev-parse --abbrev-ref HEAD) | |
| read -p "Delete branches merges into $currentBranch y/N? " -n 1 -r | |
| echo | |
| if [[ $REPLY =~ ^[Yy]$ ]] | |
| then | |
| git branch --merged | grep -v $currentBranch | while read i; do git branch -d $i; done; | |
| echo "Branches removed successfully" | |
| else |
This file contains hidden or 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
| import 'dart:async'; | |
| import 'package:flutter/foundation.dart'; | |
| import 'package:sentry/sentry.dart'; | |
| class ErrorHandler { | |
| static ErrorHandler _instance; | |
| SentryClient _sentry; | |
| final bool isInDebugMode; |
This file contains hidden or 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
| export const isSameURL = (a, b) => a.split('?')[0] === b.split('?')[0] | |
| export const isRelativeURL = u => | |
| u && u.length && /^\/[a-zA-Z0-9@\-%_~][/a-zA-Z0-9@\-%_~]*[?]?([^#]*)#?([^#]*)$/.test(u) | |
| export default function ({ app }) { | |
| const redirect = function (name, noRouter = false) { | |
| if (!this.options.redirect) { | |
| return | |
| } |
This file contains hidden or 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
| export default async function ({ store, route, redirect }) { | |
| store.dispatch('auth/loadToken') | |
| const hasToken = Boolean(store.state.auth.token) | |
| const isLoggedIn = store.state.auth.loggedIn | |
| // if have a token | |
| if (hasToken) { | |
| if (route.path === '/login') { | |
| redirect('/') | |
| return |
This file contains hidden or 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 | |
| use Symfony\Component\Process\Process; | |
| use Symfony\Component\Process\Exception\ProcessFailedException; | |
| trait ArtisanCommandTrait{ | |
| public function executeArtisanCommand($command, $options){ | |
| $stmt = 'php artisan '. $command . ' ' . $this->prepareOptions($options); | |
| $process = new Process($stmt); |