Skip to content

Instantly share code, notes, and snippets.

View josephwoodward's full-sized avatar

Joseph Woodward josephwoodward

View GitHub Profile
internal class Program
{
private static void Main(string[] args)
{
var myClass = new ExpressionTest();
// Ambig.
myClass.TestMethod(myExpression1:x => x.ToString());
using System;
using System.Linq.Expressions;
namespace ExpressionDemo2
{
internal class Program
{
private static void Main(string[] args)
{
<tbody>
<tr>
<td rowspan="4">
<select>
skip, remap etc.
</select>
</td>
</tr>
<tr id=skip>
@josephwoodward
josephwoodward / WriteToSection.cs
Last active August 29, 2015 14:25
Write to section in ASP.NET MVC
public static IHtmlString PageHeading(this HtmlHelper html, Icon icon, string title, string subTitle)
{
WebViewPage page = html.ViewDataContainer as WebViewPage;
if (page != null)
{
page.DefineSection("Heading", () => {
page.Write(MvcHtmlString.Create("My Text"));
});
}
ActionsToBuildUp = () => true;
ActionsToBuildUp += () => false;
bool result = ActionsToBuildUp(); // returns false
// 1: Object Initializer //////////////////////////////////
public class User {
public bool IsActive { get; set; }
public string Name { get; set; }
}
var user = new User {
.class private auto ansi '<Module>'
{
} // end of class <Module>
.class public auto ansi beforefieldinit C
extends [mscorlib]System.Object
{
// Methods
.method public hidebysig
instance void M () cil managed
public static void ParseMyCode(string code)
{
var sourceLanguage = new CSharpLanguage();
SyntaxTree syntaxTree = sourceLanguage.ParseText(code, SourceCodeKind.Regular);
}
[HtmlTargetElement("div")]
public class VisibilityTagHelper : TagHelper
{
public bool IsVisible { get; set; } = true;
public override void Process(TagHelperContext context, TagHelperOutput output)
{
if (!IsVisible)
output.SuppressOutput();

Getting the following error when running promtrail:

./promtail_darwin_amd64 -config.file=promtail.yml

level=error ts=2019-10-09T20:07:54.577597Z caller=main.go:51 msg="error creating promtail" error="failed to make file target manager: invalid json stage config: JMES expression is required"

My log file:

{"@t":"2019-10-09T17:59:46.4148580Z","@mt":"Hello, world!","@l":"Debug"}