Skip to content

Instantly share code, notes, and snippets.

@lyahdav
lyahdav / phabricator-diff-lines-modified.js
Last active January 27, 2021 20:34
Tampermonkey script to Show Total Number of Lines Modified in Phabricator Diff
// ==UserScript==
// @name Show Total Number of Lines Modified in Diff
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Show total number of lines modified in diff at bottom of table of contents
// @author lyahdav
// @match UPDATE HERE e.g. https://phab.example.com/D*
// @grant none
// ==/UserScript==
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.System;
using Windows.UI.Core;
using Windows.UI.Xaml;
// (c) Facebook, Inc. and its affiliates. Confidential and proprietary.
#import "FocusZoneViewManager-macOS.h"
#import <React/RCTView.h>
@interface FocusZoneView : RCTView
@end
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "pch.h"
#include <Views/ShadowNodeBase.h>
#include "FlyoutViewManager.h"
#include "TouchEventHandler.h"
#include "ViewPanel.h"
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "pch.h"
#include "FocusZoneViewManager.h"
#include "ViewControl.h"
#include "DynamicAutomationProperties.h"
// (c) Facebook, Inc. and its affiliates. Confidential and proprietary.
#include "ContextMenuModule.h"
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.UI.Core.h>
#include <winrt/Windows.UI.Xaml.Controls.Primitives.h>
#include <winrt/Windows.UI.Xaml.Controls.h>
using namespace Microsoft::ReactNative;
import {
Image,
View,
NativeModules,
findNodeHandle,
ImageSourcePropType,
} from 'react-native';
export type MenuPlacement =
| 'top-left'
#include "ContextMenuNativeModule-win.h"
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.UI.Core.h>
#include <winrt/Windows.UI.Xaml.Controls.Primitives.h>
#include <winrt/Windows.UI.Xaml.Controls.h>
namespace winrt {
using namespace winrt::Windows::UI::Core;
#pragma once
#include <NativeModules.h>
#include <mutex>
#include <winrt/Windows.UI.Core.h>
#include <winrt/Windows.UI.Xaml.Controls.Primitives.h>
#include <winrt/Windows.UI.Xaml.Controls.h>
#import "ContextMenuNativeModule-macOS.h"
#import <React/RCTImageLoaderWithAttributionProtocol.h>
#import <React/RCTImageSource.h>
#import <React/RCTUIManager.h>
typedef NS_ENUM(NSInteger, MenuPlacement) {
MenuPlacementTopLeft,
MenuPlacementTopRight,
MenuPlacementBottomLeft,