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
// browser part | |
const codeVerifier = crypto.getRandomValues(new Uint8Array(128)); | |
function toBase64(buffer: Uint8Array): string { | |
return btoa(String.fromCharCode(...buffer)) | |
.replace(/=/g, '') | |
.replace(/\+/g, '-') | |
.replace(/\//g, '_') | |
} |
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 { FormControl, SyncValidator } from "universal-reactive-forms"; | |
import { ErrorKeys } from "@/components/ErrorKeys"; | |
/** | |
* Returns valid when the value is not null|undefined|empty string or when array is not empty | |
* @param value | |
* @constructor | |
*/ | |
export const Required: SyncValidator = (value) => { | |
if (value instanceof Array) { |
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 { ajax, AjaxConfig, AjaxResponse } from 'rxjs/ajax'; | |
import { from, Observable, of, OperatorFunction, switchMap } from 'rxjs'; | |
export type BeforeInterceptors = (config: AjaxConfig) => Promise<AjaxConfig> | AjaxConfig | Observable<AjaxConfig>; | |
export type AfterInterceptors<T extends any = any> = (response: AjaxResponse<T>) => Observable<AjaxResponse<T>> | AjaxResponse<T> | Promise<AjaxResponse<T>>; | |
const BEFORE_INTERCEPTORS: BeforeInterceptors[] = []; | |
const AFTER_INTERCEPTORS: AfterInterceptors[] = []; | |
interface ConfigInterceptor { |
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
<html> | |
<head> | |
<title>Title</title> | |
<style> | |
body { | |
margin: 0; | |
} | |
canvas { | |
width: 100%; |
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
class ABC { | |
protected function test() | |
{ | |
echo "Will not echo from an instance for protected"; | |
} | |
private function otherTest($content) | |
{ | |
echo "WIll not echo from an instance for private and content is $content"; | |
} |
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 sets the flash message with type | |
* @param string $message [contains message to be displayed] | |
* @param string $type [contains type of message] | |
*/ | |
public static function setFlashMessage ($message, $type = 'success'){ | |
if(session()->has('flashMessages')){ | |
$data = session('flashMessages'); | |
}else{ | |
$data = [ |
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
#This scripts installs and setups the eviornment for laravel with database and seeding | |
# We support all major PHP versions. Please see our docs for a full list | |
# https://codeship.com/documentation/languages/php/ | |
#setting the phpenv | |
phpenv local 5.6 | |
# Install dependencies through Composer | |
rm -f /home/rof/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini | |
#setting the composer cache directory | |
COMPOSER_HOME=${HOME}/cache/composer |
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 | |
namespace App\Exceptions; | |
use Exception; | |
use Illuminate\Validation\ValidationException; | |
use Illuminate\Auth\Access\AuthorizationException; | |
use Illuminate\Database\Eloquent\ModelNotFoundException; | |
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; | |
use Symfony\Component\HttpKernel\Exception\HttpException; |