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
| name: Deploy to GitHub Pages | |
| on: workflow_dispatch | |
| jobs: | |
| deploy-to-github-pages: | |
| # use ubuntu-latest image to run steps on | |
| runs-on: ubuntu-latest | |
| steps: | |
| # uses GitHub's checkout action to checkout code form the master branch |
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
| for i in *.avi; do ffmpeg -hwaccel cuda -i "$i" "${i%.*}.mp4"; done |
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 abstract class CrontabService : BackgroundService | |
| { | |
| private DateTime nextRun; | |
| private readonly CrontabSchedule _schedule; | |
| private readonly ILogger _logger; | |
| public CrontabService(CrontabSchedule schedule, ILogger logger) | |
| { | |
| _schedule = schedule; |
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 Ref<T> | |
| { | |
| public Ref() { } | |
| public Ref(T value) { Value = value; } | |
| public T Value { get; set; } | |
| public override string ToString() | |
| { | |
| T value = Value; | |
| return value == null ? "" : value.ToString(); | |
| } |
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 static class MongoDbExtensions | |
| { | |
| public static IMongoQueryable<TDestination> ProjectTo<TSource, TDestination>(this IQueryable<TSource> query, AutoMapper.IMapper autoMapper) => | |
| query.ProjectTo<BookListDTO>(autoMapper.ConfigurationProvider) as IMongoQueryable<TDestination>; | |
| } | |
| // usage ... | |
| private readonly IMongoCollection<Book> _books; | |
| private readonly IMapper _mapper; | |
| // ... |
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 Microsoft.Azure.Cosmos.Table; | |
| using System.Collections.Generic; | |
| using System.Runtime.CompilerServices; | |
| using System.Threading; | |
| public static class TableQueryExtensions | |
| { | |
| public static async IAsyncEnumerable<T> ExecuteAsync<T>(this TableQuery<T> query, [EnumeratorCancellation] CancellationToken ct = default) | |
| { |
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 AzureTableStorageCache : IDistributedCache | |
| { | |
| private readonly AzureTableStorageCacheOptions _options; | |
| private readonly CloudTable _table; | |
| public AzureTableStorageCache(IOptions<AzureTableStorageCacheOptions> options) | |
| { | |
| _options = options.Value; | |
| var tableClient = CloudStorageAccount.Parse(_options.ConnectionString).CreateCloudTableClient(); |
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
| #!/bin/bash | |
| while read line | |
| do | |
| echo "$line" | |
| done < "${1:-/dev/stdin}" |
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
| #!/bin/bash | |
| recurse () | |
| ( | |
| recurse2 () | |
| { | |
| [ $_recurse_stop -eq 1 ] && return | |
| cd "$1" || return | |
| pwd ## do whatever you want in the pwd | |
| for entry in $(ls); |
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 Microsoft.Extensions.Logging; | |
| using System; | |
| using System.Linq; | |
| public static class LoggingExtensions | |
| { | |
| public static IDisposable BeginPropertyScope(this ILogger logger, params (string key, object value)[] properties) => | |
| logger.BeginScope(properties.ToDictionary(p => p.key, p => p.value)); | |
| } |