This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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.Linq.Expressions; | |
using System.Web.Mvc; | |
using System.Web.Mvc.Html; | |
public static class PartialForExtensions | |
{ | |
public static MvcHtmlString PartialFor<T>(this HtmlHelper<T> htmlHelper, Expression<Func<T, object>> expression, | |
string partialViewName, ViewDataDictionary viewData) | |
{ | |
var model = expression.Compile()(htmlHelper.ViewData.Model); |
This file contains hidden or 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
@functions | |
{ | |
public static HelperResult ValidatedElementFor<TModel, TProperty>(HtmlHelper<TModel> html, Expression<Func<TModel, TProperty>> expr, object editorHtmlAttributes = null) | |
{ | |
var defaultHtmlAttributes = new { @class = "form-control" }; | |
var combinedHtmlAttributes = html.MergeHtmlAttributes(defaultHtmlAttributes, editorHtmlAttributes); | |
return ValidatedElement(html.ValidationErrorFor(expr, " has-error", " has-success"), html.LabelFor(expr, htmlAttributes: new { @class = "control-label col-sm-3" }), html.EditorFor(expr, new { htmlAttributes= combinedHtmlAttributes}), html.ValidationMessageFor(expr, "", new { @class = "text-danger" })); | |
} | |
} | |
@helper ValidatedElement(MvcHtmlString error, MvcHtmlString label, MvcHtmlString editor, MvcHtmlString message) |
This file contains hidden or 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
import java.awt.Point; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.PrintStream; | |
import java.io.PrintWriter; | |
import java.io.StringReader; | |
import java.io.StringWriter; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Collections; |
This file contains hidden or 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
version: "3" | |
services: | |
app: | |
build: . | |
volumes: | |
- app_data:/data_import | |
depends_on: | |
- data | |
data: | |
build: ./data |
This file contains hidden or 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
static void Main(string[] args) | |
{ | |
Mapper.Initialize(cfg => | |
{ | |
cfg.AddProfiles(new Profile[] { new CaseProfile()}); | |
}); | |
var configuration = new MapperConfiguration(cfg => cfg.CreateMap<CaseView, Case>()); | |
var executionPlan = configuration.BuildExecutionPlan(typeof(CaseView), typeof(Case)); | |
// Compare execution plans |
This file contains hidden or 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
static void Main(string[] args) | |
{ | |
var caseView = new CaseView(){ | |
User = new UserView{ | |
UserID = 5 | |
}, | |
UserID = 5 | |
}; | |
Mapper.Initialize(cfg => |
This file contains hidden or 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
esphome: | |
name: ${name} | |
name_add_mac_suffix: false | |
wifi: | |
ssid: !secret wifi_ssid | |
password: !secret wifi_password | |
ota: | |
- platform: esphome | |
password: !secret ota_password |