Exclude one .html file from codelyzer linting - tslint

While working on ngx-bootstrap, I have extracted part of datepicker logic
to separate class, and not codelyzer shows a lot of issues like:
The property "viewMode" that you're trying to access does not exist in the class declaration.
Such exclude of file doesn't work:
```
tslint \"src/**/*.ts\" -c tslint.json --type-check -p src/tsconfig.spec.json -e \"**/bs-datepicker-view.html\"
```
Thanks in advance

Related

knit Rmarkdown moderncv to pdf using makefile with sty file in subdirectory

I am using the moderncv class to create a CV in Rmarkdown. In order to make the cv reproducible out of the box I have included the .cls and .sty files in the root directory. However, in an effort to keep the root directory uncluttered I would prefer to keep all the moderncv related files in a subdirectory (assets/tex/). I am able to access the .cls file using a relative path in the yaml front matter, but I am not able to access the .sty files unless they are in the root directory.
Searching previous questions on stackoverflow I learned the following: (1) keeping .cls and .sty files in nested directories is not recommended. I understand this and would like to do it anyway so that other people can fork my project and be able to knit the cv without having to deal with finding their texmk folder. (2) the solution to my problem seems to involve setting the TEXINPUTS using a Makefile (see this thread and another thread)
I am not very good with Makefiles, but I have managed to get one working that will knit my .Rmd file to pdf without problems, so long as the .sty files are still in root. This is what it looks like currently:
PDF_FILE=my_cv.pdf
all : $(PDF_FILE)
echo All files are now up to date
clean :
rm -f $(PDF_FILE)
%.pdf : %.Rmd
Rscript -e 'rmarkdown::render("$<")'
My understanding is that I can set the TEXINPUTS using:
export TEXINPUTS=".:./assets/tex:"
Where "assets/tex" represents the subdirectory where the .sty files are located. I do not know how to incorporate the above code into my makefile so that the .sty files are recognized in the subdirectories and my .Rmd is knit to PDF. In its current state, I get the following error if I remove the .sty files from root and put then in the aforementioned subdirectory:
! LaTeX Error: Command \fax already defined.
Or name \end... illegal, see p.192 of the manual.
which I assume is occurring because the moderncv class needs---and cannot locate---the relevant .sty files.
You could try to define the environment variable in the make rule:
%.pdf : %.Rmd
export TEXINPUTS=".:./assets/tex:"
Rscript -e 'rmarkdown::render("$<")'
Or you could set the environment variable in a set-up chunk in your Rmd file:
```{r setup, include = FALSE}
Sys.setenv(TEXINPUTS=".:./assets/tex:")
```
Note: Not tested due to lack of minimal example.

How to rewrite file to file using bash?

I create builds using AppCenter.ms. But My project has many CustomAndroidManifest.xml files. It places on UserApp/UserApp.Android/Properties/
AppCenter automatically increments version code. But AppCenter changes it in AndroidManifest.xml.
Task: I need to rewrite CustomAndroidManifest.xml to AndroidManifest.xml before AppCenter will change build number.
Why I have many CustomAndroidManifests... because My App has many Configurations.
I've created appcenter-post-clone.sh file and put it in Droid folder. Please look at the my script:
#!/usr/bin/env bash
if [ "$APPCENTER_XAMARIN_CONFIGURATION" == "Conf1" ];
then
cp -R $APPCENTER_SOURCE_DIRECTORY/UserApp/UserApp.Android/Properties/Conf1AndroidManifest.xml/. $APPCENTER_SOURCE_DIRECTORY/UserApp/UserApp.Android/Properties/AndroidManifest.xml/
if [ "$APPCENTER_XAMARIN_CONFIGURATION" == "Conf2" ];
then
cp -R $APPCENTER_SOURCE_DIRECTORY/UserApp/UserApp.Android/Properties/Conf2AndroidManifest.xml/. $APPCENTER_SOURCE_DIRECTORY/UserApp/UserApp.Android/Properties/AndroidManifest.xml/
fi
Main Idea is change first file to second. Thank you.
EDIT! Problem is that CustomAndroidManifest.xml dos not rewrite to AndroidManifest.xml.
Question: How can I rewrite one file to second using bash?

Use multiple env files

I'm wondering if there's a way in Laravel to specify a set of env files to load. My exact problem is I want to add something like a suffix to all my .js and .css resources. Ideally I'd have a suffix like the release date because it would be ok for these files to be cached within the same release but I would like the caches to be invalidated on the next release. However I want to avoid reading, modifying and saving the .env file if possible and would instead prefer to create a new file e.g. .env.rdate which would be generated via a script, e.g.
echo APP_RELEASE_DATE=`date +%s` > env.rdate
or something like this. Is this at all possible or do I have to read/update/write the .env file instead?
Create your .env.rdate file next to .env file.
Put this to your AppServiceProvider boot method:
$dotenv = new \Dotenv\Dotenv(base_path(),'.env.rdate');
$dotenv->overload();
After you can use in your project:
ENV('APP_RELEASE_DATE')

How to input a parameter in a custom target with cmake

I have a custom target:
add_custom_target(
create-po
COMMAND ${MSGINIT} --no-translator -i "${PROJECT_SOURCE_DIR}/data/${PACKAGE}.pot" - "${PROJECT_SOURCE_DIR}/po/es.po" -l es_MX.utf8
)
so, is invoked like this:
# make create-po
my idea is to change it to something like this:
# make create-po "es"
so, any user can create a custom localed po file. I don't know the word exactly for this, but I'd like to add a parameter in the target name..is it posible with cmake? Thanks
After so long time I found this question for the same reason: Can I use CMake to initialize a .po file if I want to add a new translation? I expect to use it only once in a while for my project, so make the build system do it seems more comfortable to me than find out all the required options and paths every time.
I ended up with the following CMake snippet:
set(INIT_LANG CACHE STRING "give a locale here to create a target which initializes a related .po file")
IF(INIT_LANG)
add_custom_target(
create-po-${INIT_LANG}
... # integrate INIT_LANG in your command
)
ENDIF(INIT_LANG)
Then, if you want to initialize a new translation file, call (assuming your build dir in under the project root):
# cmake -DINIT_LANG=es_MX.utf8 ..
... and you should get a corresponding make target:
# make create-po-es_MX.utf8
Yes, it's not as straight-forward as the OP's idea/expectation (and mine as well), but users can create new .po files by themselves (of course, this will be documented properly for them in the project ;) ).

Auto-compile Jade in Webstorm on Windows

I recently discovered Jade and want to give it a try for a new static website. I like the terse syntax and the templating capabilities, so much better than raw HTML. I'm editing in Webstorm 6, which has support for file watchers, and can run e.g. Sass out of the box. I've been able to run Jade via the command line to watch my Jade files:
jade --watch --out public jade
I'm now trying to configure my project in Webstorm to handle this automatically, and I'm running into problems.
To keep the source files separate from the generated ones, I'm aiming for a layout like this:
root
jade
index.jade
subdir
subdir.jade
public
index.html
subdir
subdir.html
With the Arguments field set as:
--out $ProjectFileDir$\public\$FileNameWithoutExtension$.html $FileDir$\$FileName$
To start with, I have the following within my jade folder:
index.jade
subdir
index.jade
The result in my public folder is:
index.html (folder)
index.html (file)
subdir.html (folder)
subdir.html (file)
This is the first time I've tried to use the file watcher feature, and the available macros are confusing me. Has anyone with experience in a similar situation any suggestions?
jade --out option specifies the directory, not the file:
-O, --out <dir> output the compiled html to <dir>
To retain the directories structure you will have to use $FileDirPathFromParent$ macro that takes a parameter.
For example, for the C:\project\public\jade\subdir\subdir.jade file we need it to return the path right to the jade directory, that would be the parameter for the macro: $FileDirPathFromParent(jade)$, and the result would be subdir.
Now if you set the Working directory to $FileDir$, the Arguments would be:
$FileName$ --out $ProjectFileDir$\public\$FileDirPathFromParent(jade)$
And the complete Jade File Watcher for this specific project layout would look like this:

Resources