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 profiler from './screeps-profiler'; | |
export function profile(target: Function): void; | |
export function profile(target: object, key: string | symbol, _descriptor: TypedPropertyDescriptor<Function>): void; | |
export default function profile(target: object | Function, key?: string | symbol, _descriptor?: TypedPropertyDescriptor<Function>): void { | |
if (typeof profiler === 'undefined') { | |
return; | |
} | |
if (key) { |
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
// ==UserScript== | |
// @name Zendesk Comment Permalinks | |
// @namespace GSoft | |
// @description Adds new navigation capabilities to Zendesk | |
// @version 2.0.0 | |
// @match https://*.zendesk.com/agent/* | |
// @grant none | |
// ==/UserScript== | |
/******/ (function(modules) { // webpackBootstrap |
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
// ==UserScript== | |
// @name Better Bitbucket Pull Requests | |
// @namespace GSoft | |
// @author Anthony Simmon | |
// @version 1.0.0 | |
// @match https://bitbucket.org/*/pull-requests/* | |
// @match https://bitbucket.org/*/branch/* | |
// ==/UserScript== | |
function BBPR_App () { |
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
public class FirstViewModel : PillarViewModelBase | |
{ | |
private readonly INavigator _navigator; | |
public FirstViewModel(INavigator navigator) | |
{ | |
_navigator = navigator; | |
// Go to the second view after 5 seconds | |
GoToSecondViewModel(); |
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
public class MyAppBootstrapper : PillarBootstrapper | |
{ | |
private readonly Application _app; | |
public MyAppBootstrapper(Application app) | |
{ | |
_app = app; | |
} | |
protected override void ConfigureContainer(ContainerBuilder builder) |
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
server { | |
# Port and domain | |
listen 80; | |
server_name aspnet.local; | |
# Path to the wwwroot folder | |
root /home/developer/projects/WebApplicationBasic/wwwroot; | |
# Static content | |
location ~ \.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf|html|htm|woff2|svg)$ { |
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
public class BindableBehavior<T> : Behavior<T> where T : BindableObject | |
{ | |
public T AssociatedObject { get; private set; } | |
protected override void OnAttachedTo(T visualElement) | |
{ | |
base.OnAttachedTo(visualElement); | |
AssociatedObject = visualElement; |
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
public class EventToCommandBehavior : BindableBehavior<View> | |
{ | |
public static readonly BindableProperty EventNameProperty = BindableProperty.Create<EventToCommandBehavior, string>(p => p.EventName, null); | |
public static readonly BindableProperty CommandProperty = BindableProperty.Create<EventToCommandBehavior, ICommand>(p => p.Command, null); | |
public static readonly BindableProperty CommandParameterProperty = BindableProperty.Create<EventToCommandBehavior, object>(p => p.CommandParameter, null); | |
public static readonly BindableProperty EventArgsConverterProperty = BindableProperty.Create<EventToCommandBehavior, IValueConverter>(p => p.EventArgsConverter, null); | |
public static readonly BindableProperty EventArgsConverterParameterProperty = BindableProperty.Create<EventToCommandBehavior, object>(p => p.EventArgsConverterParameter, null); | |
private Delegate _handler; | |
private EventInfo _eventInfo; |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:b="clr-namespace:HelloEventToCommand.Behaviors;assembly=HelloEventToCommand" xmlns:c="clr-namespace:HelloEventToCommand.Converters;assembly=HelloEventToCommand" x:Class="HelloEventToCommand.Views.HomeView"> | |
<ContentPage.Resources> | |
<ResourceDictionary> | |
<c:ItemTappedEventArgsConverter x:Key="ItemTappedConverter" /> | |
</ResourceDictionary> | |
</ContentPage.Resources> | |
<ListView ItemsSource="{Binding People}"> | |
<ListView.Behaviors> |
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
public class ItemTappedEventArgsConverter : IValueConverter | |
{ | |
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | |
{ | |
var eventArgs = value as ItemTappedEventArgs; | |
if (eventArgs == null) | |
throw new ArgumentException("Expected TappedEventArgs as value", "value"); | |
return eventArgs.Item; | |
} |