Skip to content

Instantly share code, notes, and snippets.

@julesx
julesx / AuthorizeService.js
Last active November 24, 2022 16:50
ASP.Net Core with React API Authorization
import { UserManager, WebStorageStateStore } from 'oidc-client';
import { ApplicationPaths, ApplicationName } from './ApiAuthorizationConstants';
export class AuthorizeService {
_callbacks = [];
_nextSubscriptionId = 0;
_user = null;
_isAuthenticated = false;
// By default pop ups are disabled because they don't work properly on Edge.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
public class CrazyTag : ICrazyTag
{
protected readonly List<Subscription> observables = new List<Subscription>();
protected readonly List<IObserver<ICrazyTag>> observers = new List<IObserver<ICrazyTag>>();
bool disposedValue = false;
protected CrazyTag() { }
IDisposable IObservable<ICrazyTag>.Subscribe(IObserver<ICrazyTag> observer)
{
<ListBox x:Class="PG.UserControls.ListBoxPgItems"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:classes="clr-namespace:WPF.Core.Classes;assembly=WPF.Core"
mc:Ignorable="d"
SelectionMode="Extended"
Style="{StaticResource MaterialDesignListBox}"
xmlns:controls="clr-namespace:WpfToolkit.Controls;assembly=VirtualizingWrapPanel"
<autocompletetextbox:AutoCompleteTextBox
DisplayMember="Name"
SelectedItem="{Binding SelectedTag, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
MaxPopupHeight="300" x:Name="AddTagAutoComplete"
Text="{Binding AutoCompleteText, Mode=OneWayToSource}"
Provider="{Binding SuggestionProvider, RelativeSource={RelativeSource AncestorType=UserControl}}"
Grid.Column="0"
Height="28"
Width="150"
Watermark="Add tag">
(function ($) {
// register namespace
$.extend(true, window, {
"Slick": {
"GroupedCheckboxSelectColumn": GroupedCheckboxSelectColumn
}
});
function GroupedCheckboxSelectColumn(options) {
@julesx
julesx / slick.checkboxselectionmodel.js
Created February 4, 2020 15:48
slickgrid custom plugins
(function ($) {
// register namespace
$.extend(true, window, {
"Slick": {
"CheckboxSelectionModel": CheckboxSelectionModel
}
});
function CheckboxSelectionModel(options) {
var _ranges = [];
public static void ExecuteCommand(String checkOutFile)
{
int ExitCode;
ProcessStartInfo ProcessInfo;
Process process;
ProcessInfo = new ProcessStartInfo(checkOutFile);
ProcessInfo.CreateNoWindow = true;
ProcessInfo.UseShellExecute = false;
ProcessInfo.WorkingDirectory = System.IO.Path.GetDirectoryName(checkOutFile);
@julesx
julesx / program.cs
Created June 21, 2018 15:11
command line work
private static void RunSelectedTests(List<String> apexClasses)
{
using (var cmdProcess = InitCmdProcess())
{
using (StreamWriter cmdProcessWriter = cmdProcess.StandardInput)
{
var selectedTests = string.Join(",", apexClasses);
cmdProcessWriter.WriteLine("sfdx force:apex:test:run -n " + selectedTests);// + " -d \"c:\\my stuff\\logs\"");
}
@julesx
julesx / program.cs
Created June 21, 2018 15:11
command line work
private static void RunSelectedTests(List<String> apexClasses)
{
using (var cmdProcess = InitCmdProcess())
{
using (StreamWriter cmdProcessWriter = cmdProcess.StandardInput)
{
var selectedTests = string.Join(",", apexClasses);
cmdProcessWriter.WriteLine("sfdx force:apex:test:run -n " + selectedTests);// + " -d \"c:\\my stuff\\logs\"");
}