Skip to content

Instantly share code, notes, and snippets.

View brifiction's full-sized avatar
👋
Hello there! Check out my Github profile!

Brian Ng brifiction

👋
Hello there! Check out my Github profile!
View GitHub Profile
@brifiction
brifiction / index.html
Last active January 12, 2025 16:08
Medium-like Highlighting Tools Component
<div id="app">
<highlightable
@share="onShare"
@highlight="onHighlight"
>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eveniet at debitis deserunt, optio rem eaque obcaecati non possimus nisi assumenda architecto exercitationem dolore quo praesentium, deleniti reiciendis sed ab nihil!
</p>
</highlightable>
<p>
@brifiction
brifiction / regex.md
Last active October 9, 2019 04:54
Regular Expression Recipes

Validate LinkedIn public profile url

^https?://((www|\w\w)\.)?linkedin.com/((in/[^/]+/?)|(pub/[^/]+/((\w|\d)+/?){3}))$

example:

http://uk.linkedin.com/pub/some-name/1/1b3/b45/
@brifiction
brifiction / README.md
Last active November 29, 2019 04:28
Exchange Online - Find Recipient via Unified Messaging (UM) (Extension Number)

Exchange Online - Find Recipient via Unified Messaging (UM) (Extension Number)

  1. Files cannot be loaded because running scripts is disabled on this system. Provide a valid certificate with which to sign the files. Simply run:
Set-ExecutionPolicy RemoteSigned

You need to configure this setting only once on your computer, not every time you connect.

  1. Define your Exchange Online authentication:
$UserCredential = Get-Credential
@brifiction
brifiction / README.md
Last active December 6, 2019 04:38
Generate Service Report (Powershell)

Service Report (Powershell Script)

Pre-requisites:

  1. Basic knowledge of using a CLI (Linux, Command Prompt, DOS etc).
  2. Basic knowledge of PowerShell (Documentation).
  3. Basic knowledge of fundamental programming practices.

How to use

Please note, registry keys checked for pending reboot:
W2K3 = "SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations"
@brifiction
brifiction / UserSeeder.php
Created February 3, 2020 01:55
Laravel Console - Progress Bar Example
<?php
use App\Account;
use App\User;
use Illuminate\Database\Seeder;
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Output\ConsoleOutput;
class LocalUserSeeder extends Seeder
{
@brifiction
brifiction / README.md
Created February 4, 2020 00:34
Laravel Relationship Conditions

Example of Laravel relationship where condition.

$users = User::with('account', 'role')->whereHas('role', function ($q) {
  $q->where('name', 'Administrator');
})->get();
@brifiction
brifiction / FormHelper.php
Created February 4, 2020 03:57
Boolean Associative Array Example
<?php
namespace App\Helpers;
use App\Account;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Validator;
class FormHelper
{
@brifiction
brifiction / main.js
Last active February 5, 2020 03:23
JQuery - File Upload Text (with Bootstrap)
/**
* The following block of code is to load all JQuery functions and methods
*
*
*
*/
$(document).ready(function () {
// load file upload display text function
fileUpload();
@brifiction
brifiction / DocumentController.php
Created February 7, 2020 04:48
Laravel - Simple Print Document Example
<?php
namespace App\Http\Controllers\External;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
class AwardsSubmissionController extends Controller
{
/**
@brifiction
brifiction / DocumentController.php
Last active February 7, 2020 06:55
Laravel - Simple Print Document Example
<?php
namespace App\Http\Controllers\External;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
class DocumentController extends Controller
{
/**