Skip to content

Instantly share code, notes, and snippets.

@abergs
abergs / MyModel.ts
Created February 24, 2014 21:13
Typescript AMD example
class MyModel {
public ID: number;
public Value: string;
}
export = MyModel;
@abergs
abergs / v0 API proposal
Last active August 29, 2015 14:05
TableViewComponent
// version 0.0.1 of TableViewcomponent API
<TableView>
<Columns>
<Column format="%s kg" />
<Column format="%s" />
</Columns>
<Rows>
{Items}
</Rows
</TableView
var SomeView = React.createClass({
render: function () {
return (
<ColumnLayout expanded={true} somethingElse={this.state.stuff}>
<Column text={this.state.text} onClick={this.props.onClick} focus={this.state.isFocus} />
....
</ColumnLayout>
);
using AppFunc = System.Func<System.Collections.Generic.IDictionary<string, object>, System.Threading.Tasks.Task>;
public class NewRelicIgnoreTransactionOwinModule
{
private AppFunc _nextAppFunc;
public NewRelicIgnoreTransactionOwinModule(AppFunc nextAppFunc)
{
_nextAppFunc = nextAppFunc;
}
Public Function createBtn(ByVal Handler As EventHandler, Optional ByVal text As String = "Ändra", Optional ByVal link As String = "main.aspx")
Dim editbtn As New LinkButton
editbtn.Attributes.Add("rel", link)
editbtn.Attributes.Add("class", "Btn")
editbtn.Attributes.CssStyle.Add("margin-left", "10px")
editbtn.ID = "editBtn"
Dim icon As New Image
icon.ImageUrl = "Images/edit.png"
icon.CssClass = "icon"
editbtn.Controls.Add(icon)
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Text
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
<DefaultProperty("Text"), ToolboxData("<{0}:myBtn runat=server></{0}:myBtn>")> _
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Text
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
<DefaultProperty("Text"), ToolboxData("<{0}:myBtn runat=server></{0}:myBtn>")> _
'Anders Åberg
'LinkButton med ikon & text
'Används:
'<cc1:myBtn ID="addTask" runat="server" Text="Lägg till uppgift" ImageUrl="Images/add.png" ></cc1:myBtn>
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Text
Imports System.Web
Imports System
Imports System.Web
Imports System.Web.Mvc
Imports System.IO
Imports System.Xml
Imports System.Text
Imports System.Collections.Generic
Imports System.Web.Script.Serialization
Imports System.Runtime.Serialization
Imports System.Reflection
Imports System
Imports System.Web
Imports System.Web.Mvc
Imports System.IO
Imports System.Xml
Imports System.Text
Imports System.Collections.Generic
Imports System.Web.Script.Serialization
Imports System.Runtime.Serialization
Imports System.Reflection