Skip to content

Instantly share code, notes, and snippets.

@NickBranstein
NickBranstein / items.component.html
Created January 28, 2018 21:06
Reusable Card Component with NativeScript and Angular
<ng-template let-item="item">
<card [title]="item.name" [subtitle]="'This is a subtitle...'">
<Label [nsRouterLink]="['/item', item.id]" [text]="item.name"></Label>
<Label textWrap="true" text="Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi
ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit
in voluptate velit esse cillum dolore eu fugiat nulla pariatur.">
</Label>
</card>
@NickBranstein
NickBranstein / card.component.css
Created January 28, 2018 20:49
Reusable Card Component with NativeScript and Angular
.card {
background-color: #a2f7b8;
border-width: 5px;
border-color: black;
border-top-left-radius: 25px;
border-bottom-left-radius: 50px;
border-top-right-radius: 25px;
border-bottom-right-radius: 50px;
}
@NickBranstein
NickBranstein / card.component.html
Created January 28, 2018 20:43
Reusable Card Component with NativeScript and Angular
<StackLayout class="card m-5">
<Label class="text-center" [text]="title"></Label>
<Label class="font-italic" [text]="subtitle"></Label>
<StackLayout class="card-content">
<ng-content></ng-content>
</StackLayout>
</StackLayout>
@NickBranstein
NickBranstein / card.component.ts
Created January 28, 2018 20:36
Reusable Card Component with NativeScript and Angular
import { Component, Input } from "@angular/core";
@Component({
selector: "card",
moduleId: module.id,
templateUrl: "./card.component.html",
styleUrls: ["./card.component.css"]
})
export class CardComponent {
@Input() title: string;
@NickBranstein
NickBranstein / items.component.html
Last active January 28, 2018 20:34
Reusable Card Component with NativeScript and Angular
<ng-template let-item="item">
<Label [nsRouterLink]="['/item', item.id]" [text]="item.name"
class="list-group-item"></Label>
</ng-template>
@NickBranstein
NickBranstein / Bootstrap.cs
Last active December 3, 2015 04:07
NLog Slack Target
public static class Bootstrap
{
private static void BootstrapNLog()
{
var config = new LoggingConfiguration();
var slackTarget = new SlackTarget();
config.AddTarget("slack", slackTarget);
config.LoggingRules.Add(new LoggingRule("*", LogLevel.Warn, slackTarget));
@NickBranstein
NickBranstein / Supplies.cs
Last active August 29, 2015 14:09
NHibernate Map by Code Examples - Part 2
public abstract class BaseSupplyDiscriminated
{
public virtual Guid Id { get; set; }
public virtual string Name { get; set; }
public virtual bool Required { get; set; }
public virtual int Quantity { get; set; }
}
public abstract class BaseSupplyJoined
{
@NickBranstein
NickBranstein / config.xml
Last active April 7, 2017 10:41
log4net properties config
<log4net>
<appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender">
<bufferSize value="1" />
<connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<connectionStringName value="ConnectionName" />
<commandText value="INSERT INTO dbo.tbl_Log4Net_Log ([Date],[User],[Application],[Thread],[Ndc],[Level],[Logger],[Message],[Exception]) VALUES (@log_date, @user, @application, @thread, @ndc, @log_level, @logger, @message, @exception)" />
<parameter>
<parameterName value="@log_date" />
<dbType value="DateTime" />
<layout type="log4net.Layout.RawTimeStampLayout" />
@NickBranstein
NickBranstein / Student.cs
Last active August 29, 2015 14:06
Inverse Bag
public class Student
{
public virtual string FirstName { get; set; }
public virtual string LastName { get; set; }
public virtual IEnumerable<Classroom> Classrooms { get; set; }
public virtual Teacher Teacher { get; set; }
}
@NickBranstein
NickBranstein / Classroom.cs
Last active August 29, 2015 14:05
NHibernate Many To Many
public class Classroom
{
public virtual int RoomNumber { get; set; }
public virtual IEnumerable<Student> Students { get; set; }
}