Skip to content

Instantly share code, notes, and snippets.

View andrerpena's full-sized avatar

André Pena andrerpena

  • London, UK
View GitHub Profile
@andrerpena
andrerpena / gist:11224476
Created April 23, 2014 17:11
How to create a CardView
public void CreateCardView {
return new CardView();
}
@andrerpena
andrerpena / AccessControlExample
Created April 23, 2014 17:25
Example of checking static access control
// checking permission...
if (AccessControl.HasPermission(ac => ac.Matters.Participants.Add))
{
// the current user or group has access to the specificed action or field
}
@andrerpena
andrerpena / ChangeTrackingExample
Created April 23, 2014 17:28
Example of a change tracking setup
public static void SetupChangeTracking()
{
// disables tracking for matter code
SetupProperty(matter => matter.Code, show: false);
// makes the matter issue date to be tracked as a "short date string"
SetupProperty(matter => matter.IssueDate, display: a => a.IssueDate.ToShortDateString());
}
@andrerpena
andrerpena / FluentMetadataProviderExample
Last active August 29, 2015 14:17
FluentMetadataProvider example
public class MyMetadataProvider : FluentMetadataProvider
{
public void SetupMetadata(MetadataContext ctx)
{
var view = ctx.CreateView<Contact>();
view.CreateGroup()
.AddProperty(m => m.Name).HasMaxLength(30).IsRequired()
.AddProperty(m => m.DateOfBirth)
.AddProperty(m => m.InvitationNumber).DisabledWhen(m => !m.EnableInvitation)
}
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
@andrerpena
andrerpena / css
Created March 7, 2016 00:34
Superação
.wp-search-form {
clear: both;
padding: 20px;
background-color: #EAEAEA;
overflow: hidden;
}
.text-wrapper {
display: inline-block;
var currentValue;
/**
* Observes changes in the Redux store and calls onChange when the state changes
* @param store The Redux store
* @param selector A function that should return what you are observing. Example: (state) => state.routing.locationBeforeTransitions;
* @param onChange A function called when the observable state changed. Params are store, previousValue and currentValue
*/
export default function observe(store, selector, onChange) {
if (!store) throw Error('\'store\' should be truthy');
if (!selector) throw Error('\'selector\' should be truthy');
export horseman from ''node-horseman' // no ES2015
// é equivalente a
module.exports = { horseman: require('node-horseman'); };
// que é equivalente a
module.exports.horseman = require('node-horseman');

Product name

Matterspace

aaaa

Appointment or task

{  
	"StartDate":"2016-12-15T19:00:00-02:00",
	"EndDate":"2016-12-15T19:30:00-02:00",
	"Description":"Ir no médico",
	"Status":"Pendente",
	"Location":null,

"Private":false,