Skip to content

Instantly share code, notes, and snippets.

View mresti's full-sized avatar

Esteban Dorado Roldan mresti

  • GDG, BEEVA
  • Madrid, Spain
View GitHub Profile
@mresti
mresti / dashboard.html
Created January 3, 2017 18:08
Example of vertial bar chart using pfC3Chart angular directive using angular-patternfly
<body>
<div ng-controller="ChartCtrl" class="row" style="display:inline-block; width: 100%;">
<div class="col-md-12">
<div pf-c3-chart id="chartId" config="chartConfig" get-chart-callback="getChart"></div>
</div>
</div>
</body>
@mresti
mresti / dashboard.html
Created January 3, 2017 18:01
Idea of example of vertial bar chart using custom angular directive using angular-patternfly
<body>
<div ng-controller="ChartCtrl" class="row" style="display:inline-block; width: 100%;">
<div class="col-md-12">
<div pf-bar-chart config="config" chart-data="data" chart-category="category" chart-type="vertical"></div>
</div>
</div>
</body>
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
context "GET index" do
#context "POST create" do
#context "GET show" do
#context "PATCH update" do (or PUT update)
#context "DELETE destroy" do
#context "GET new" do
@mresti
mresti / friend.java
Created March 10, 2016 12:13
es tu amigo
Normalizer.normalize(text, Normalizer.Form.NFD) // es tu amigo
@mresti
mresti / vali.js
Created February 4, 2016 22:08
validation
function ValidateEmail(mail)
{
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.emailAddr.value))
{
return (true)
}
alert("You have entered an invalid email address!")
return (false)
}
@mresti
mresti / themes.txt
Created December 1, 2015 20:10
Android Logcat Theme (Darcula / Holo)
// Holo Theme
Assert: AA66CC
Debug: 33B5E5
Error: FF4444
Info: 99CC00
Verbose: FFFFFF
Warning: FFBB33
// Darcula Theme
@mresti
mresti / sample.scala
Created November 24, 2015 14:31
Get fields of a class in Scala using reflection
def getFields(t: Any): Map[String, Any] = {
val fieldsAsPairs = for (field <- t.getClass.getDeclaredFields) yield {
field.setAccessible(true)
(field.getName, field.get(t))
}
Map(fieldsAsPairs :_*)
}