Skip to content

Instantly share code, notes, and snippets.

View AbraaoAlves's full-sized avatar
☀️
stay positive

AbraaoAlves AbraaoAlves

☀️
stay positive
View GitHub Profile
@AbraaoAlves
AbraaoAlves / app.html
Created March 14, 2018 01:53
Dialog stuff
<template>
<h1>Dialog Repro</h1>
<button click.delegate="dt.openDialogA()">Open Dialog</button>
</template>
@AbraaoAlves
AbraaoAlves / app.html
Last active March 25, 2017 23:17 — forked from AshleyGrant/app.html
Aurelia tamplate map
<template>
<require from="./grid.html"></require>
<grid
data.bind="list"
config.bind="config"
>
</grid>
</template>
@AbraaoAlves
AbraaoAlves / colordiff.js
Last active December 17, 2015 20:09 — forked from alcidesqueiroz/colordiff
Percent Diff between two colors for RGB.
String.prototype.format = String.prototype.format || function(){
var format = this;
for (var i = 0; i < arguments.length; i++) {
var arg = arguments[i];
if (arg === null || arg === undefined) arg = "";
var regex = new RegExp("\\{" + i + "\\}", "g");
format = format.replace(regex, arg);
}
return format;
};
@AbraaoAlves
AbraaoAlves / gist:3297963
Created August 8, 2012 19:37 — forked from AlbertoMonteiro/gist:3297419
Get expression equal from string
Func<T, bool> GetExpressionOfEquals<T>(string propertyName, string equalsTo)
{
var parameter = Expression.Parameter(typeof(T));
var property = Expression.Property(parameter, propertyName);
var binaryExpression = Expression.Equal(property, Expression.Constant(equalsTo));
var lambda = Expression.Lambda<Func<T, bool>>(binaryExpression, "Teste", new[] { parameter });
var expression = lambda.Compile();
return expression;
@AbraaoAlves
AbraaoAlves / jqueryplugin
Created October 18, 2011 13:36 — forked from hvitorino/jqueryplugin
jquery plugin carregaSelects
(function ($) {
$.fn.carregaOptions = function(configs) {
var defaults = {
options : [],
template: function(val) {
return '<option value="{0}">{1}</option>'.format(val[0], val[1]);
}
};
return this.each(function(val) {