This file contains 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
var data = 'Just something great'; | |
var input = 'Jus'; | |
// this one | |
data.substring(0, input.length) === input; | |
// or this one | |
data.lastIndexOf(input, 0) === 0 | |
This file contains 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
ko.bindingHandlers.dump = { | |
init: function (element, valueAccessor, allBindingsAccessor, viewmodel, bindingContext) { | |
var context = valueAccessor(); | |
var allBindings = allBindingsAccessor(); | |
var pre = document.createElement('pre'); | |
element.appendChild(pre); | |
var dumpJSON = ko.computed({ | |
read: function () { |
This file contains 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
// css | |
.dialogWide > .modal-dialog { | |
width: 80% !important; | |
} | |
// script | |
bootbox.dialog({ | |
className: "dialogWide", | |
title: "Foo", | |
message: "what to say, go wide", | |
buttons: { |
This file contains 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
/// <summary> | |
/// Calculation based on https://da.wikipedia.org/wiki/P%C3%A5ske | |
/// </summary> | |
/// <param name="year"></param> | |
/// <returns></returns> | |
public DateTime GetEasterDateOfYear(int year) | |
{ | |
int a = year % 19; | |
int b = (int)Math.Floor(year / 100m);//Heltal (rundet) ned) af aar / 100 | |
int c = year % 100; |
This file contains 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
cropTextImage.SaveToPhotosAlbum((imageSave, error) => | |
{ | |
//you can retrieve the saved UI Image as well if needed using | |
if (error != null) | |
{ | |
Debug.WriteLine(error.ToString()); | |
} | |
}); |
This file contains 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 byte[] MakeGrayScale(byte[] imageAsBytes) | |
{ | |
UIImage image = ImageFromByteArray(imageAsBytes); | |
var height = image.Size.Height; | |
var width = image.Size.Width; | |
var imageRect = new CGRect(0, 0, width, height); | |
using (CGBitmapContext context = new CGBitmapContext(IntPtr.Zero, | |
(int)width, (int)height, 8, |
This file contains 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 override UIInterfaceOrientationMask GetSupportedInterfaceOrientations(UIApplication application, UIWindow forWindow) | |
{ | |
if (Xamarin.Forms.Application.Current == null || Xamarin.Forms.Application.Current.MainPage == null) | |
{ | |
return UIInterfaceOrientationMask.Portrait; | |
} | |
var navigationPage = Xamarin.Forms.Application.Current.MainPage as NavigationPage; | |
This file contains 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
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Collections.Specialized; | |
using Xamarin.Forms; | |
namespace Controls.Bypassion.dk | |
{ | |
public class WrapLayout : Layout<View> | |
{ |
This file contains 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
private $TYPE$ _$name$; | |
public $TYPE$ $NAME$ | |
{ | |
get { return _$name$; } | |
set { SetProperty(ref _$name$, value); } | |
} |
This file contains 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
$swaggerEndpoint = "http://localhost:9000/swagger/docs/v1" | |
$outputDirectory = "targetfolder" | |
$autoRestRelativePath = "..\..\packages\autorest.0.17.3\tools\AutoRest.exe" | |
& $autoRestRelativePath -Input $swaggerEndpoint -Namespace "com.myproject.Client.Proxies.targetfolder" -OutputDirectory $outputDirectory -CodeGenerator CSharp |
OlderNewer