Skip to content

Instantly share code, notes, and snippets.

View LuisDeHaro's full-sized avatar
🏠
Working from home

Luis de Haro LuisDeHaro

🏠
Working from home
  • Monterrey, México
View GitHub Profile
@LuisDeHaro
LuisDeHaro / commands.sh
Created July 20, 2022 01:21
Let's build a project with Kafka
## SSH INTO A KAFKA BOX (Console commands)
docker ps
docker exec -it 07019df81d7f /bin/bash
BROKERS=kafka-1:29092,kafka-2:29093,kafka-3:29094
## CREATE A TOPIC
import { Controller } from 'stimulus'
import StimulusReflex from 'stimulus_reflex'
export default class extends Controller {
connect () {
StimulusReflex.register(this)
}
beforeReflex (element, reflex) {
document.body.classList.add('wait')
@LuisDeHaro
LuisDeHaro / discount_schedule_serializer.rb
Last active August 15, 2018 23:24
ActiveModel::Serializers
class Api::V1::DiscountScheduleSerializer < ActiveModel::Serializer
attributes :id, ... ,:created_at, :updated_at, :number_of_reservations
def created_at
object.created_at.in_time_zone.iso8601 if object.created_at
end
def updated_at
object.updated_at.in_time_zone.iso8601 if object.updated_at
end
@LuisDeHaro
LuisDeHaro / ProductItemTemplate.xaml
Last active July 5, 2018 15:54
Xamarin.Forms - ListView with SearchBar freezes UI
<?xml version="1.0" encoding="UTF-8"?>
<ContentView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Project.ProductItemTemplate"
xmlns:i8ln="clr-namespace:Project;assembly=Project"
xmlns:ValueConverters="clr-namespace:Project;assembly=Project"
xmlns:artina="clr-namespace:UXDivers.Artina.Shared;assembly=UXDivers.Artina.Shared"
xmlns:ffimageloading="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
Azure Storage (BLOB):
{
"event": [
{
"name": "MainBusinesses",
"count": 1
}
],
"internal": {
@LuisDeHaro
LuisDeHaro / ImagesPopUp.xaml
Created November 26, 2017 16:25
CarouselView
<?xml version="1.0" encoding="UTF-8"?>
<pages:PopupPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:pages="clr-namespace:Rg.Plugins.Popup.Pages;assembly=Rg.Plugins.Popup"
BackgroundColor="Black"
xmlns:i8ln="clr-namespace:MaverickMobileOnline;assembly=MaverickMobileOnline"
x:Name="ImagesPopUp"
xmlns:artina="clr-namespace:UXDivers.Artina.Shared;assembly=UXDivers.Artina.Shared"
xmlns:templates="clr-namespace:MaverickMobileOnline;assembly=MaverickMobileOnline"