I thought that it would be nice to share this not only because it would save others a lot of time figuring out this mess. So if you find something that could be improved or is just wrong, I will happily update this post.
| // Original script: https://gist.github.com/leodevbro/2987e8874a18b2086ea6cc1aa3c494e8 | |
| // v2.5 | |
| // Google Apps Script is a coding language based on JavaScript. | |
| // This Apps Script code helps us to sort addresses by most threads. | |
| // A thread is a group of messages, as a conversation. | |
| const modes = { | |
| inbox: "inbox", // to analyze threads in the "Inbox" folder | |
| outbox: "outbox", // to analyze threads in the "Sent" folder |
| {% if certificate and certificate_id > 0 -%} | |
| {% if ssl_forced == 1 or ssl_forced == true %} | |
| {% if hsts_enabled == 1 or hsts_enabled == true %} | |
| # HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years) | |
| add_header Strict-Transport-Security "max-age=63072000;{% if hsts_subdomains == 1 or hsts_subdomains == true -%} includeSubDomains;{% endif %} preload" always; | |
| add_header Referrer-Policy strict-origin-when-cross-origin; | |
| add_header X-Content-Type-Options nosniff; | |
| add_header X-XSS-Protection "1; mode=block"; | |
| add_header X-Frame-Options SAMEORIGIN; | |
| add_header Content-Security-Policy upgrade-insecure-requests; |
| --New child with start with the current 'aid' and 'audio-device' of the parent | |
| -- non-Windows environments require the use of the 'socat' package | |
| local platform_is_windows = (package.config:sub(1, 1) == "\\") | |
| local options = require 'mp.options' | |
| local o = { | |
| pipe_template = platform_is_windows and "\\\\.\\pipe\\mpvDupedAudio" or "~/mpvDupedAudio", --windows format | |
| new_child_key = 'Ctrl+A', --Start a new child: 'Ctrl+Shift+a' | |
| cycle_child_control_key = 'Ctrl+Alt+A', --Cycle child control: 'Ctrl+Shift+Alt+a' | |
| cycle_child_aid_key = 'Ctrl+Alt+a', --Cycle 'aid' of child: 'Ctrl+Alt+a' | |
| child_increase_volume_key = 'Ctrl+Alt+WHEEL_UP', --Change volume of child: 'Ctrl+Alt+wheel' |
Option<T> |
non-Option (T | undefined) |
|
|---|---|---|
| accessing property | userOption.map(user => user.age) |
userNullish?.age |
| calling a method | userOption.map(user => user.fn()) |
userNullish?.fn() |
| providing fallback | ageOption.getOrElse(0) |
ageNullish ?? 0 |
| filter | ageOption.filter(checkIsOddNumber) |
`ageNull |
| #!/bin/sh | |
| FLUTTER_BRANCH=`grep channel: .metadata | sed 's/ channel: //g'` | |
| FLUTTER_REVISION=`grep revision: .metadata | sed 's/ revision: //g'` | |
| git clone https://github.com/flutter/flutter.git | |
| cd flutter | |
| git checkout $FLUTTER_BRANCH | |
| git pull origin $FLUTTER_BRANCH | |
| git checkout $FLUTTER_REVISION | |
| cd .. |
Testing Jenkins flows on your local machine, or running Jenkins in production in a docker container can be a little tricky with a docker-in-docker scenario. You could install Jenkins to avoid any docker-in-docker issues, but then you have Jenkins on your machine, and the local environment is likely going to be a fairly different from the actual production build servers, which can lead to annoying and time-consuming issues to debug.
Build environment differences are precisely why there is a strong argument to be made to run build processes strictly in docker containers. If we follow the philosophy that every build step or action should run in a docker container, even the Jenkins server itself, then we get massive benefits from things like, total control over the build environment, easily modify the build environment without the possibility of adversely effecting other jobs, explicit and strongly controlled tool versions,
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "os" | |
| ) | |
| // Adapter wraps an http.Handler with additional |
| { | |
| "presets": ["es2015"], | |
| "plugins": ["transform-runtime"] | |
| } |