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
package spacelift | |
sample := true | |
module_version := version { | |
version := trim_prefix(input.push.tag, "v") | |
not propose | |
} | |
propose { |
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
name: Deploy | |
permissions: | |
id-token: write | |
contents: read | |
on: | |
workflow_dispatch: | |
env: |
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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: nginx | |
spec: | |
selector: | |
matchLabels: | |
app: nginx | |
template: | |
metadata: |
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 Common; | |
using CountryPull; | |
using Dapr.Client; | |
using Microsoft.EntityFrameworkCore; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Hosting; | |
await Host.CreateDefaultBuilder(args).ConfigureServices((context, services) => | |
{ |
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.Generic; | |
using System.Linq; | |
using Microsoft.Exchange.WebServices.Data; | |
using static Microsoft.Exchange.WebServices.Data.SearchFilter; | |
namespace Inboxer | |
{ | |
class MainClass | |
{ |
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
if let library = try? ITLibrary(apiVersion: "1") { | |
print(library.applicationVersion) | |
for artist in library.allMediaItems | |
.filter({ $0.mediaKind == ITLibMediaItemMediaKind.kindSong }) | |
.group(by: { $0.artist?.name }){ | |
print(artist.key) | |
for album in artist.value.group(by: { $0.album.title }) { | |
print(" \(album.key) (\(album.value.first!.year))") | |
} | |
} |
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 extension Sequence { | |
func group<U: Hashable>(by key: (Iterator.Element) -> U?) -> [U:[Iterator.Element]] { | |
var categories: [U: [Iterator.Element]] = [:] | |
for element in self { | |
let key = key(element) | |
if case nil = categories[key!]?.append(element) { | |
categories[key!] = [element] | |
} | |
} | |
return categories |
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
curl -s http://nginx.org/keys/nginx_signing.key > /tmp/nginx.key | |
sudo apt-key add /tmp/nginx.key | |
rm /tmp/nginx.key | |
sudo apt-add-repository "deb http://nginx.org/packages/mainline/ubuntu/ xenial nginx" | |
sudo apt-add-repository "deb-src http://nginx.org/packages/mainline/ubuntu/ xenial nginx" | |
sudo apt-get update | |
sudo apt-get install nginx letsencrypt -y | |
sudo letsencrypt certonly --standalone -d "$DOMAIN" --email "$EMAIL" --agree-tos |
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
## | |
# You should look at the following URL's in order to grasp a solid understanding | |
# of Nginx configuration files in order to fully unleash the power of Nginx. | |
# http://wiki.nginx.org/Pitfalls | |
# http://wiki.nginx.org/QuickStart | |
# http://wiki.nginx.org/Configuration | |
# | |
# Generally, you will want to move this file somewhere, and start with a clean | |
# file but keep this around for reference. Or just disable in sites-enabled. | |
# |
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
user www-data; | |
worker_processes auto; | |
pid /run/nginx.pid; | |
events { | |
worker_connections 768; | |
# multi_accept on; | |
} | |
http { |
NewerOlder