A Pen by David Sekula on CodePen.
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
--[[ | |
Youtube Playlist Importer for VLC | |
--]] | |
-- Helper function to get a parameter's value in a URL | |
function get_url_param( url, name ) | |
local _, _, res = string.find( url, "[&?]"..name.."=([^&]*)" ) | |
return res | |
end | |
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 Microsoft.Win32; | |
using System; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Get45or451FromRegistry(); |
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
//XAML | |
<Window x:Class="App.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:tools="clr-namespace:App.Tools" | |
Height="{Binding Source={x:Static SystemParameters.PrimaryScreenHeight}, Converter={tools:RatioConverter}, ConverterParameter='0.9' }" | |
Width="{Binding Source={x:Static SystemParameters.PrimaryScreenWidth}, Converter={tools:RatioConverter}, ConverterParameter='0.9' }" | |
Title="{Binding Path=DisplayName}" | |
WindowStartupLocation="CenterScreen" | |
> |
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
class Telepen: GenratorCommon, IBarcodeConstants | |
{ | |
private static Hashtable Telepen_Code = new Hashtable(); | |
private enum StartStopCode : int { START1, STOP1, START2, STOP2, START3, STOP3 }; | |
private StartStopCode StartCode = StartStopCode.START1; | |
private StartStopCode StopCode = StartStopCode.STOP1; | |
private int SwitchModeIndex = 0; | |
private int iCheckSum = 0; | |
/// <summary> |
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 class WidgetsGoogleAnalyticsController : BasePluginController | |
{ | |
private readonly IWorkContext _workContext; | |
private readonly IStoreContext _storeContext; | |
private readonly IStoreService _storeService; | |
private readonly ISettingService _settingService; | |
private readonly IOrderService _orderService; | |
private readonly ILogger _logger; | |
private readonly ICategoryService _categoryService; | |
private readonly IProductAttributeParser _productAttributeParser; |
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
{ | |
"version": "0.0.1", | |
"discord": { | |
"clientId": "568451050181492736", | |
"smallImageText": "Score", | |
"smallImageKey": "seal-circle" | |
}, | |
"java": { | |
"oracle": "http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html" | |
}, |
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> | |
/// Creates a Polly-based resiliency strategy that helps deal with transient faults when communicating | |
/// with the external (downstream) Computer Vision API service. | |
/// </summary> | |
/// <returns></returns> | |
private PolicyWrap<HttpResponseMessage> DefineAndRetrieveResiliencyStrategy() | |
{ | |
// Retry when these status codes are encountered. | |
HttpStatusCode[] httpStatusCodesWorthRetrying = { | |
HttpStatusCode.InternalServerError, // 500 |
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 authorisationEnsuringPolicy = Policy | |
.HandleResult<HttpResponseMessage>(r => r.StatusCode == HttpStatusCode.Unauthorized) | |
.RetryAsync( | |
retryCount: 1, // Consider how many retries. If auth lapses and you have valid credentials, one should be enough; too many tries can cause some auth systems to blacklist. | |
onRetryAsync: async (outcome, retryNumber, context) => FooRefreshAuthorizationAsync(context), | |
/* more configuration */); | |
var response = authorisationEnsuringPolicy.ExecuteAsync(context => DoSomethingThatRequiresAuthorization(context), cancellationToken); |
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 TimeSpan getServerWaitDuration(DelegateResult<HttpResponseMessage> response) | |
{ | |
var retryAfter = response?.Result?.Headers?.RetryAfter; | |
if (retryAfter == null) | |
return TimeSpan.Zero; | |
return retryAfter.Date.HasValue | |
? retryAfter.Date.Value - DateTime.UtcNow | |
: retryAfter.Delta.GetValueOrDefault(TimeSpan.Zero); | |
} |
OlderNewer