Can I use "*" in application name. Something like:
{ rule = { name = "Appname*" },
The code uses Lua's string.match, so the patterns that are explained at http://lua-users.org/wiki/PatternsTutorial can be used. For your case that should be "Appname.*", if I'm reading this correctly.
Related
Referencing to Kestrel documentation is it possible to configure https using appsettings.json file:
"HttpsInlineCertStore": {
"Url": "https://+:5002",
"Certificate": {
"Subject": "<coma separated multi-line subject name>",
"Store": "Root",
"Location": "LocalMachine"
}
This certificate exist for sure and next code returns finds it:
using (var certStore = new X509Store(StoreName.Root, StoreLocation.LocalMachine))
{
certStore.Open(OpenFlags.ReadOnly);
var certificates = certStore.Certificates.Find(
X509FindType.FindBySubjectDistinguishedName, "<coma separated multi-line subject name>", true);
return certificates .Count > 0 ? certificates [0] : null;;
}
At the same time if to search certificate by X509FindType.FindBySubjectName it founds nothing and I believe this is the issue even though microsoft says that FindBySubjectDistinguishedName is more specific search.
Finally I was able to fix this issue:
is something like "CN=name, C=UK, ..." but if you want to FindBySubjectName you must remove "CN=" from search string and leave only the name so it is looks not like "CN=name" but like "name".
I am using the "selector-class-pattern" stylelint rule. The pattern I am using is to enforce the ECSS naming standard. The rule looks like this:
"selector-class-pattern": ["^[a-z]([a-z0-9]){1,3}-[A-Z][a-zA-Z0-9]+(_[A-Z][a-zA-Z0-9]+)?(-([a-z0-9-]+)?[a-z0-9])?$", { "resolveNestedSelectors": true }]
An ECSS class name uses 3 parts (module name, component name, element name) and looks something like .mod-Component_Element {} where mod is an abbreviation of the module name.
My SCSS files are kept in component folders, so the folder structure looks like the below, where app is the name of the module.
app
-- component-name
-- component-name.component.js
-- component-name.component.scss
I would like a stylelint rule to ensure that the module and the component part of class names match the folder they are in. So the class names kept in the example component-name.component.scss file would be restricted to .app-ComponentName_ElementName {} where ElementName is optional and can be anything.
I am using Gulp to run stylelint:
gulp.task('css', () => {
let processors = [
// add postcss processors here
];
return gulp.src([
path.join(gconfig.rootDir, 'vars.style.scss'),
path.join(gconfig.rootDir, 'style.scss'),
path.join(gconfig.rootDir, gconfig.rootModule, '**/*.scss'),
])
.pipe(stylelint({
failAfterError: false,
reporters: [ {formatter: 'string', console: true} ]
}))
.pipe(gif( debug, sourcemaps.init() ))
.pipe(cssimport())
.pipe(concat(`${gconfig.projectName}.style.css`))
.pipe(scss().on('error', scss.logError))
.pipe(postcss(processors))
.pipe(gif( debug, sourcemaps.write() ))
.pipe(gulp.dest(path.join(gconfig.outDir, 'css')))
});
I understand I will probably need to write a plugin for this, but wondered if there is already a plugin for something like this out there, or if there are any ways to do it maybe by passing the file name/folder to stylelint from Gulp?
I've not seen anything that does what you're asking out of the box
The closest similar plugins I've seen would be the BEM plugins:
https://github.com/postcss/postcss-bem-linter
https://github.com/davidtheclark/stylelint-selector-bem-pattern
These might work as a base guide on writing some plugins for your ECSS use case
I have used the following code to set my reset email subject:
Accounts.emailTemplates.resetPassword.subject = function(user, url) {
var ul = Meteor.absoluteUrl();
var myArray = ul.split("//");
var array = myArray[1].split('/');
return "How to reset your password on "+array[0];
};
I want it to contain the current browser's url, but it's not happening.
This is what the subject looks like
How to reset your password on 139.59.9.214
but the desired outcome is:
How to reset your password on someName.com
where someName.com is my URL.
I would recommend handling this a bit differently. Your host name is tied to your environment, and depending on what your production environment looks like, deriving your hostname from the server might not always be the easiest thing to do (especially if you're behind proxies, load balancers, etc.). You could instead look into leveraging Meteor's Meteor.settings functionality, and create a settings file for each environment with a matching hostname setting. For example:
1) Create a settings_local.json file with the following contents:
{
"private": {
"hostname": "localhost:3000"
}
}
2) Create a settings.json file with the following contents:
{
"private": {
"hostname": "somename.com"
}
}
3) Adjust your code to look like:
Accounts.emailTemplates.resetPassword.subject = function (user, url) {
const hostname = Meteor.settings.private.hostname;
return `How to reset your password on ${hostname}`;
};
4) When working locally, start meteor like:
meteor --settings=settings_local.json
5) When deploying to production, make sure the contents or your settings.json file are taken into consideration. How you do this depends on how you're deploying to your prod environment. If using mup for example, it will automatically look for a settings.json to use in production. MDG's Galaxy will do the same.
I've got a main premake4.lua script:
solution "MySolution"
language "c++"
newoption = {
trigger = "my-option",
description = "This is an option"
}
include "../my_library"
I would like to pivot logic in the included script ( ../my_library/premake4.lua ) based on the contents of _OPTIONS:
if _OPTIONS["my-option"] then
project "myStaticLibrary"
kind "StaticLib"
else
project "mySharedLibrary"
kind "SharedLib"
end
files "foo.cpp"
How to get _OPTIONS in the scope of the included premake4 script?
You don't need to do anything. _OPTIONS is a global variable and will be accessible to all of your scripts automatically. Are you seeing otherwise?
I'm answering my own question just in case anyone else is tempted to solve things in the same way. I was Doing It Wrong. After struggling with it my final solution defined multiple configurations:
-- the main script
solution "MySolution"
language "c++"
configurations { "Release", "Debug", "ReleaseDLL", "DebugDLL" }
configuration { "Release", "ReleaseDLL" }
flags { "Optimize" }
configuration { "Debug", "DebugDLL" }
flags { }
defines {"_DEBUG=1"}
configuration {}
include "../my_library"
The included script specified the kind according to configuration:
-- the included script
project "myStaticLibrary"
configuration { "*" }
kind "StaticLib"
configuration { "*DLL" }
kind "SharedLib"
configuration {}
files "foo.cpp"
And to to build the right targets the config is specified at the make:
premake4 gmake
cd gmake
make config=release
make config=debug
make config=releasedll
make config=debugdll
I have a settingKey that I have defined in project/build.scala
val databasePropertiesFile = settingKey[File]("The file we use to grab the database login configuration.")
And I want to assign it a default value based on the sourceDirctory, something like this, but it doesn't compile:
databasePropertiesFile := {
sourceDirectory / "db/devel.properties"
}
What is the magic I must perform to set a default File?
The magic is ".value":
databasePropertiesFile := {
sourceDirectory.value / "db" / "devel.properties"
}