Unable to auto-format *.rb in setting.json below in VScode - ruby-on-rails

I want to auto-format all html, css, sass, rb, and html.erb,js files with setting.json_Vs-code. But the next file after setting.json can only be the above *.rb file.
Please advise.
"workbench.colorTheme": "Dracula Soft",
"python.defaultInterpreterPath": "/opt/anaconda3/bin/python",
"editor.tabSize": 2,
"editor.fontSize": 16,
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.minimap.enabled": false,
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"window.zoomLevel": 1,
"emmet.includeLanguages": {
"erb": "html"
},
"[python]": {
"editor.tabSize": 4
},
"terminal.integrated.fontSize": 14,
"beautify.language": {
"html": [
"erb"
]
},
"[scss]": {
"editor.defaultFormatter": "HookyQR.beautify"
},
"[css]": {
"editor.defaultFormatter": "HookyQR.beautify"
},
"[javascript]": {
"editor.defaultFormatter": "HookyQR.beautify"
}

Related

NSwag generate single client class

When using NSwagStudio for generating C# client code (not in file) it generates the way that only one client class and corresponding interface is getting generated with all controllers methods in them.
However when trying to do the same thing with NSwag.MSBuild it generates separate partial classes/interfaces for each controller.
Here is the nswag.json:
{
"openApiToCSharpClient": {
"clientBaseClass": "BillingBaseClient",
"configurationClass": "ConnectionOptions",
"generateClientClasses": true,
"generateClientInterfaces": true,
"clientBaseInterface": null,
"injectHttpClient": true,
"disposeHttpClient": true,
"protectedMethods": [
],
"generateExceptionClasses": true,
"exceptionClass": "ApiException",
"wrapDtoExceptions": true,
"useHttpClientCreationMethod": false,
"httpClientType": "System.Net.Http.HttpClient",
"useHttpRequestMessageCreationMethod": true,
"useBaseUrl": true,
"generateBaseUrlProperty": false,
"generateSyncMethods": false,
"exposeJsonSerializerSettings": false,
"clientClassAccessModifier": "public",
"typeAccessModifier": "public",
"generateContractsOutput": false,
"contractsNamespace": null,
"contractsOutputFilePath": null,
"parameterDateTimeFormat": "s",
"parameterDateFormat": "yyyy-MM-dd",
"generateUpdateJsonSerializerSettingsMethod": true,
"useRequestAndResponseSerializationSettings": false,
"serializeTypeInformation": false,
"queryNullValue": "",
"className": "BillingClient",
"operationGenerationMode": "MultipleClientsFromOperationId",
"additionalNamespaceUsages": [
],
"additionalContractNamespaceUsages": [
],
"generateOptionalParameters": true,
"generateJsonMethods": true,
"enforceFlagEnums": false,
"parameterArrayType": "System.Collections.Generic.IEnumerable",
"parameterDictionaryType": "System.Collections.Generic.IDictionary",
"responseArrayType": "System.Collections.Generic.ICollection",
"responseDictionaryType": "System.Collections.Generic.IDictionary",
"wrapResponses": false,
"wrapResponseMethods": [
],
"generateResponseClasses": true,
"responseClass": "SwaggerResponse",
"namespace": "ServiceTitan.Billing.Api.Client",
"requiredPropertiesMustBeDefined": true,
"dateType": "System.DateTimeOffset",
"jsonConverters": null,
"anyType": "object",
"dateTimeType": "System.DateTimeOffset",
"timeType": "System.TimeSpan",
"timeSpanType": "System.TimeSpan",
"arrayType": "System.Collections.Generic.ICollection",
"arrayInstanceType": "System.Collections.ObjectModel.Collection",
"dictionaryType": "System.Collections.Generic.IDictionary",
"dictionaryInstanceType": "System.Collections.Generic.Dictionary",
"arrayBaseType": "System.Collections.ObjectModel.Collection",
"dictionaryBaseType": "System.Collections.Generic.Dictionary",
"classStyle": "Poco",
"generateDefaultValues": true,
"generateDataAnnotations": true,
"excludedTypeNames": [
],
"excludedParameterNames": [
],
"handleReferences": false,
"generateImmutableArrayProperties": false,
"generateImmutableDictionaryProperties": false,
"jsonSerializerSettingsTransformationMethod": null,
"inlineNamedArrays": false,
"inlineNamedDictionaries": false,
"inlineNamedTuples": true,
"inlineNamedAny": false,
"generateDtoTypes": true,
"generateOptionalPropertiesAsNullable": false,
"templateDirectory": null,
"typeNameGeneratorType": null,
"propertyNameGeneratorType": null,
"enumNameGeneratorType": null,
"serviceHost": null,
"serviceSchemes": null,
"output": "BillingClient.g.cs"
}
}
So which option am I missing for telling NSwag to generate single class/interface?
The option you need to change is operationGenerationMode which you have already in your nswag.json file, but you need to change its value to SingleClientFromOperationId if you want to have one interface for multiple controllers. MultipleClientsFromOperationId which is what you currently have set, will generate a class per controller.

Get css files when compiling using #nrwl/web:package

I need to get css files for the build version of a library using #nrwl/web:package, the library that I'm creating doesn't have an index.html, it's just plain TS, but when I try to compile using web:package, CSS files are not shown, in the build for this library I have:
{
"build": {
"builder": "#nrwl/web:package",
"options": {
"outputPath": "libs/data-table/dist",
"tsConfig": "libs/data-table/tsconfig.lib.json",
"project": "libs/data-table/package.json",
"entryFile": "libs/data-table/src/index.tsx",
"external": [ "react", "react-dom" ],
"styles": [ "libs/data-table/src/lib/index.css", "libs/data-table/src/lib/responsive.scss" ],
"webpackConfig": "libs/data-table/webpack.config.js",
"assets": [
{
"glob": "README.md",
"input": ".",
"output": "."
}
]
},
"configurations": {
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
}
]
}
}
}
}
And in webpack.config.js I have:
const getConfig = require('#nrwl/react/plugins/babel');
const cssModuleRegex = /\.module\.css$/;
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = (config) => {
config = getConfig(config);
config.module.rules.forEach((rule, idx) => {
// Find rule tests for CSS.
// Then make sure it excludes .module.css files.
if (rule.test.test('foo.css')) {
rule.exclude = rule.exclude
? Array.isArray(rule.exclude)
? [...rule.exclude, cssModuleRegex]
: [rule.exclude, cssModuleRegex]
: cssModuleRegex
}
});
// Add new rule to handle .module.css files by using css-loader
// with modules on.
config.module.rules.push({
test: /\.module\.css$/,
use: [
{ loader: 'style-loader' },
{ loader: 'css-modules-typescript-loader' },
{
loader: 'css-loader',
options: {
modules: true,
importLoaders: 1
}
}
]
});
config.module.rules.push({
test: /\.module\.(scss|sass)$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
},
{
loader: 'css-loader',
options: {
modules: true,
importLoaders: 1
}
}
]
});
return config;
}
But for some reason it seems that is not read.

vs code 1.47.1 automatically reformatting dart code files

Unfortunately I replied yes
to a vs code prompt for a settings change and now,
when I edit a .dart file, it is automatically reformatted.
In some cases git shows the entire file has been modified.
In some places 2 spaces are replaced with 4 spaces.
In another place code was added.
The time stamp on the settings.json file is today (July 14, 2020) at 11:20AM PST.
Is there a way to find out the latest changes to the settings.json file?
before:
icon: FaIcon(FontAwesomeIcons.solidBuilding), /*Icon(Icons.format_list_bulleted ),*/
after:
icon: FaIcon(FontAwesomeIcons.solidBuilding),
/*Icon(Icons.format_list_bulleted ),*/
before:
MyClass({
this.field1,
this.field2,
this.field3
});
after:
MyClass({this.field1,this.field2,this.field3});
before:
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
AvatarUpload(
after:
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
AvatarUpload(
AvatarUpload(
AvatarUpload(
What is the setting that I need to revert?
settings.json
{
"editor.tabSize": 2,
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/*.js": { "when": "$(basename).ts"}
},
"files.autoSave": "afterDelay",
"workbench.iconTheme": "vscode-simpler-icons",
"editor.insertSpaces": true,
"editor.detectIndentation": false,
"solidity.linter": "solhint",
"solidity.solhintRules": {
"avoid-sha3": "warn"
},
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"java.configuration.checkProjectSettingsExclusions": false,
"peacock.favoriteColors": [
{
"name": "Angular Red",
"value": "#b52e31"
},
{
"name": "Auth0 Orange",
"value": "#eb5424"
},
{
"name": "Azure Blue",
"value": "#007fff"
},
{
"name": "C# Purple",
"value": "#68217A"
},
{
"name": "Gatsby Purple",
"value": "#639"
},
{
"name": "Go Cyan",
"value": "#5dc9e2"
},
{
"name": "Java Blue-Gray",
"value": "#557c9b"
},
{
"name": "JavaScript Yellow",
"value": "#f9e64f"
},
{
"name": "Mandalorian Blue",
"value": "#1857a4"
},
{
"name": "Node Green",
"value": "#215732"
},
{
"name": "React Blue",
"value": "#00b3e6"
},
{
"name": "Something Different",
"value": "#832561"
},
{
"name": "Vue Green",
"value": "#42b883"
}
],
"dart.debugExternalLibraries": true,
"dart.debugSdkLibraries": false,
"[yaml]": {
"editor.defaultFormatter": "redhat.vscode-yaml"
},
"dart.openDevTools": "flutter",
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"diffEditor.ignoreTrimWhitespace": false,
"terminal.integrated.fontSize": 10,
"[dart]": {
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.rulers": [
80
],
"editor.selectionHighlight": false,
"editor.suggest.snippetsPreventQuickSuggestions": false,
"editor.suggestSelection": "first",
"editor.tabCompletion": "onlySnippets",
"editor.wordBasedSuggestions": false
}
}
This one:
"[dart]": {
"editor.formatOnSave": true,
"editor.formatOnType": true,
...
}
Change it to "editor.formatOnSave": false, and "editor.formatOnType": false, depends on your taste.

Highcharts xAxis has extra gap when multiple yAxis

We have a chart that plots multiple series at once.
There are the main y-series (line type) that will have the main data readings.
There is the option to set two different 'levels' (line types) on the y-axis as well.
There are also options to have multiple additional y-axis bars (bar types).
With the x-axis being the datetime
Here is what a typical example of a chart looks like with valid date for the given range
This is working as expected.
We have the main y-series as the average air temp (left y-axis)
Then we have two bars, one for rainfall and one for irrigation (right y-axis)
And then the two 'levels', one red and one blue.
This is all great.
However, when we go to a date range in the future, where there is no air temp data, we get the following
Note that the start date is 2 days before the date range, and the end date looks equal distance from the end of the 'levels'
Interestingly if we remove the bars we get the following
This now shows the 'levels' to span the full width of the chart
If we remove the lines and just have the bars then we get the following (which is how it should look, but with the 'levels')
There seems to be something in here that is causing the conflict when there are multiple y-series without the main y-series.
I am setting the xAxis.setExtremes to the start and end dates of the date range we are looking at, but that seems to be doing nothing.
Here is the config;
{
"chart": {
"type":"line",
"animation": {
"duration":150
},
"events":{}
},
"credits":{
"enabled":false
},
"title":{
"text":""
},
"subtitle":{
"text":""
},
"tooltip":{
"shared":true,
"crosshairs":true,
"borderWidth":0,
"followPointer":true,
"useHTML":true,
"headerFormat":"<span style=\"font-size: 10px;\">{point.key}</span><br><br>"
},
"xAxis":[
{
"id":"x-axis",
"type":"datetime",
"crosshair":{
"snap":false
},
"title":{
"text":"25th Sep 2019 - 1st Oct 2019",
"margin":15
}
}
],
"yAxis":[
{
"id":"y-axis-sensors",
"title":{
"text":"ºC"
},
"reversed":false,
"visible":true,
"endOnTick":false,
"startOnTick":false,
"alignTicks":false
},
{
"id":"y-axis-moisture",
"title":{
"text":"mm"
},
"opposite":true,
"min":0,
"endOnTick":false,
"startOnTick":false,
"alignTicks":false,
"tickWidth":0,
"gridLineWidth":0
}
],
"series":[
{
"type":"line",
"yAxis":"y-axis-sensors",
"marker":{
"enabled":false
},
"lineWidth":1,
"animation":false,
"name":"Full",
"seriesGroup":"levelSeries",
"id":"series-level-range-full",
"color":"#31B5E0",
"showInLegend":false,
"states":{
"hover":{
"enabled":false
}
},
"enableMouseTracking":false,
"zIndex":5,
"step":true,
"data":[
[1569369600000,5],
[1569974400000,5]
]
},
{
"type":"line",
"yAxis":"y-axis-sensors",
"marker":{
"enabled":false
},
"lineWidth":1,
"animation":false,
"name":"Refill",
"seriesGroup":"levelSeries",
"id":"series-level-range-refill",
"color":"#D23333",
"showInLegend":false,
"states":{
"hover":{
"enabled":false
}
},
"enableMouseTracking":false,
"zIndex":5,
"step":true,
"data":[
[1569369600000,17],
[1569974400000,17]
]
},
{
"type":"column",
"yAxis":"y-axis-moisture",
"marker":{
"enabled":false
},
"name":"Rainfall",
"seriesGroup":"rainfallSeries",
"states":{
"hover":{
"enabled":false
}
},
"id":"series-rainfall",
"pointWidth":6,
"borderWidth":0,
"color":"rgba(41, 182, 246, 0.3)",
"data":[
[1569488400000,5]
],
"zIndex":10,
"stacking":"normal",
"stack":"moisture"
},
{
"type":"column",
"yAxis":"y-axis-moisture",
"marker":{
"enabled":false
},
"states":{
"hover":{
"enabled":false
}
},
"name":"Irrigation",
"seriesGroup":"irrigationSeries",
"id":"series-irrigation",
"pointWidth":6,
"borderWidth":0,
"color":"rgba(205,220,57, 0.3)",
"data":[[1569574800000,3]],
"zIndex":10,
"stacking":"normal",
"stack":"moisture"
}
]
}
I am at a bit of a loss here as to why this is happening.
Can anyone shed some light on this?
One of the solutions can be to add additional x-axis and bind line series to it. Then it looks like your expected result. Check demo and code posted below.
Code:
Highcharts.chart('container', {
"chart": {
"type": "line",
"animation": {
"duration": 150
},
"events": {}
},
"credits": {
"enabled": false
},
"title": {
"text": ""
},
"subtitle": {
"text": ""
},
"tooltip": {
"shared": true,
"crosshairs": true,
"borderWidth": 0,
"followPointer": true,
"useHTML": true,
"headerFormat": "<span style=\"font-size: 10px;\">{point.key}</span><br><br>"
},
"xAxis": [{
"id": "x-axis1",
"type": "datetime",
"crosshair": {
"snap": false
},
"title": {
"text": "25th Sep 2019 - 1st Oct 2019",
"margin": 15
}
}, {
"id": "x-axis2",
visible: false,
"type": "datetime"
}],
"yAxis": [{
"id": "y-axis-sensors",
"title": {
"text": "ºC"
},
"reversed": false,
"visible": true,
"endOnTick": false,
"startOnTick": false,
"alignTicks": false
},
{
"id": "y-axis-moisture",
"title": {
"text": "mm"
},
"opposite": true,
"min": 0,
"endOnTick": false,
"startOnTick": false,
"alignTicks": false,
"tickWidth": 0,
"gridLineWidth": 0
}
],
"series": [
{
"type": "line",
xAxis: 'x-axis2',
"yAxis": "y-axis-sensors",
"marker": {
"enabled": false
},
"lineWidth": 1,
"animation": false,
"name": "Full",
"seriesGroup": "levelSeries",
"id": "series-level-range-full",
"color": "#31B5E0",
"showInLegend": false,
"states": {
"hover": {
"enabled": false
}
},
"enableMouseTracking": false,
"zIndex": 5,
"step": true,
"data": [
[1569369600000, 5],
[1569974400000, 5]
]
},
{
"type": "line",
xAxis: 'x-axis2',
"yAxis": "y-axis-sensors",
"marker": {
"enabled": false
},
"lineWidth": 1,
"animation": false,
"name": "Refill",
"seriesGroup": "levelSeries",
"id": "series-level-range-refill",
"color": "#D23333",
"showInLegend": false,
"states": {
"hover": {
"enabled": false
}
},
"enableMouseTracking": false,
"zIndex": 5,
"step": true,
"data": [
[1569369600000, 17],
[1569974400000, 17]
]
},
{
"type": "column",
xAxis: 'x-axis1',
"yAxis": "y-axis-moisture",
"marker": {
"enabled": false
},
"name": "Rainfall",
"seriesGroup": "rainfallSeries",
"states": {
"hover": {
"enabled": false
}
},
"id": "series-rainfall",
"pointWidth": 6,
"borderWidth": 0,
"color": "rgba(41, 182, 246, 0.3)",
"data": [
[1569488400000, 5]
],
"zIndex": 10,
"stacking": "normal",
"stack": "moisture"
},
{
"type": "column",
xAxis: 'x-axis1',
"yAxis": "y-axis-moisture",
"marker": {
"enabled": false
},
"states": {
"hover": {
"enabled": false
}
},
"name": "Irrigation",
"seriesGroup": "irrigationSeries",
"id": "series-irrigation",
"pointWidth": 6,
"borderWidth": 0,
"color": "rgba(205,220,57, 0.3)",
"data": [
[1569574800000, 3]
],
"zIndex": 10,
"stacking": "normal",
"stack": "moisture"
}
]
});
<script src="https://code.highcharts.com/highcharts.js"></script>
<div id="container"></div>
Demo:
https://jsfiddle.net/BlackLabel/juwc8f37/

DataTables has not rendering image

i'm trying show image in datatable, but i have a troubles with rendering image, how i may fixed it?
i'm using Django
$(document).ready(function() {
var datatable = $("#asins_list").DataTable({
"bServerSide": true,
"sAjaxSource": links.ajax_get_asins_list,
"bProcessing": true,
"bLengthChange": true,
"bFilter": false,
'sDom': 'Bfrtip',
"bSortable": false,
"bSearch": false,
"autoWidth": true,
"ordering": false,
"bInfo": false,
"lengthMenu": [[10, 25, 50, 100], [10, 25, 50, 100]],
"iDisplayLength": 10,
responsive: true,
"aoColumnDefs": [{
"targets": 0,
"data": "remark",
"render": function ( data, type, row, meta ) {
// return 'Download';
return '<a href="test.png"><img src="test.png" ' +
'><b>Competed</b></a>';
}
}],
});
You did not indicate which version you are using, so I assume its the latest (1.10.18).
In that case please note that aoColumnDefs no longer exists, it is now just ColumnDefs.

Resources