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
var filteredAndMapped : IEnumerable = toEnumerable([1, 2, 3, 4, 5, 6, 7, 8, 9]) | |
.filter(function(i:int):Boolean { return (i % 2) == 0); }) | |
.map(function(i:int):String { return "It's value " + i; }); | |
for each(var value : String in filteredAndMapped) | |
{ | |
trace(value); | |
} | |
// Output: |
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
var doubleClicks : IObservable = Observable.fromEvent(stage, MouseEvent.CLICK) | |
.timeInterval() | |
.filter(function(ti:TimeInterval):Boolean { return ti.interval < 300; }) | |
.removeTimeInterval(); | |
var subscription : ICancelable = doubleClicks.subscribe(function(me:MouseEvent):void | |
{ | |
trace("Double click"); | |
}); |
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
using Sitecore.Mvc.Helpers; | |
using Sitecore.Web.UI.WebControls; | |
using System; | |
using System.IO; | |
using System.Web.UI; | |
public static class SitecoreHelperExtensions | |
{ | |
/// <summary> | |
/// Creates a scoped EditFrame |
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 AudioPlayer | |
{ | |
// Note "static" ! | |
static readonly PlatformBluetoothIssueWorkaround bluetoothIssueWorkaround = new PlatformBluetoothIssueWorkaround(); | |
protected override void OnPlayStateChanged(BackgroundAudioPlayer player, AudioTrack track, PlayState playState) | |
{ | |
if (bluetoothIssueWorkaround.HandlePlayStateChanged(player, playState)) | |
{ | |
NotifyComplete(); | |
return; |
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
/* | |
Copyright (C) 2013 Richard Szalay | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation | |
files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, | |
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the | |
Software is furnished to do so. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE | |
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
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
/* | |
Copyright (C) 2013 Richard Szalay | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation | |
files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, | |
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the | |
Software is furnished to do so. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE | |
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
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
/* | |
@licstart The following is the entire license notice for the | |
ActionScript code in this gist. | |
Copyright (C) 2009 Richard Szalay | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at |
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
#requires -Version 2.0 | |
#region Exported Cmdlets | |
<# | |
.SYNOPSIS | |
Creates a self-signed certificate and copies it into the trusted store. | |
.DESCRIPTION | |
Creates a self-signed certificate and copies it into the trusted store. |
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
/* | |
Usage: "1,2,c,4".Split(',').WhereParsed<int>(int.TryParse) | |
*/ | |
public delegate bool TryConversion<TIn, TOut>(TIn input, out TOut output); | |
public static class WhereConvertedExtensions | |
{ | |
/// <summary> | |
/// Filters an enumerable to elements that succeeded in conversion via a "Try*" pattern implementation |
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
# https://github.com/fastlane/fastlane/issues/488 | |
export LANG=en_US.UTF-8 | |
export LANGUAGE=en_US.UTF-8 | |
export LC_ALL=en_US.UTF-8 | |
# If not using rvm (which will set this for you) | |
export GEM_HOME=~/.gems | |
export PATH=$PATH:~/.gems/bin |
OlderNewer