Skip to content

Instantly share code, notes, and snippets.

View dmartinlozano's full-sized avatar

David Martín Lozano dmartinlozano

View GitHub Profile
@dmartinlozano
dmartinlozano / my_file.dart
Created November 14, 2021 02:54
flutter ReorderableListView with Slidable
class MyFile{
int? index;
String name;
String path;
MyFile({required this.name, required this.path, this.index});
Map<String, dynamic> toJson() => {
'name': name,
'path': path
@dmartinlozano
dmartinlozano / README.txt
Created May 24, 2021 22:31
Ionic multi-app/multi-project with stenciljs
npm install -g @ionic/cli
ionic start app1 blank --capacitor --type angular
ionic start app2 blank --capacitor --type angular
npm init stencil (responses: component/shared-components)
cd shared-components
npm install
npm run build
cd ..
@dmartinlozano
dmartinlozano / app.module.ts
Created May 19, 2021 17:58
Angular interceptor with ionic-loading
import { LoadingInterceptorModule } from './loading-interceptor.module';
@NgModule({
imports: [
...
LoadingInterceptorModule
...
],
@dmartinlozano
dmartinlozano / launch.json
Created September 24, 2020 12:07
vscode debug mvn quarkus
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Debug",
"request": "attach",
"hostName": "localhost",
"port": 5005,
"preLaunchTask": "mvnDebug"
@dmartinlozano
dmartinlozano / launch.json
Last active June 8, 2020 15:52
vscode debug mvn spring-boot
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Debug",
"request": "attach",
"hostName": "localhost",
"port": 8000,
"preLaunchTask": "mvnDebug"
@dmartinlozano
dmartinlozano / github_release_asset_upload.sh
Created May 19, 2020 14:47
Shell script bash to upload an asset to a asset in github
#GITHUB_TOKEN must be a github access token or must be a variabled defined by github actions.
GITHUB_OWNER=
GITHUB_REPO=
FILE_NAME=name-version
FILE=name-version.tar.gz
echo "Check tag $FILE_NAME"
release_id=$(curl -s -X GET -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/$GITHUB_OWNER/$GITHUB_REPO/releases/tags/$FILE_NAME|jq -r '.id')
if [ "$release_id" == "null" ]
@dmartinlozano
dmartinlozano / cosumer.html
Created April 29, 2020 08:38
The objective of this angular component is to show all validation errors of a form field.
<!--View the errors of a field-->
<form-error [form]="formu" [field]="'email'" [i18n-field-page]="'consumerPage'" [view-errors]="viewErrorsOnInit"></form-error>
...
<!--View the errors of all fields-->
<div *ngIf="verErrores">
<div *ngFor="let field of formu.controls | keyvalue">
<form-error [form]="formu" [field]="field.key" [i18n-field-page]="'consumerPage'" [view-errors]="viewErrorsOnInit"></form-error>
</div>
@dmartinlozano
dmartinlozano / app.module.ts
Last active April 25, 2020 20:57
The objective of this angular component is to create several coach marks with ion-popovers. https://stackblitz.com/edit/coach-marks-with-popovers
import { PopoverModule } from './components/popover/popover.module';
@NgModule({
imports: [
...
PopoverModule
...
]
@dmartinlozano
dmartinlozano / custom-webdriver.js
Last active September 2, 2022 06:39
hooks and some functions (custom-webdriver.js) to skip shadowRoot with cucumber-js and selenium-webdriver in a Polymer development.
'use strict';
const platform = process.env.PLATFORM || "chrome";
const mainAppTag = "/html/body/main-app";
import {Promise} from 'bluebird';
import {until, WebElementCondition} from 'selenium-webdriver';
import fs from 'fs';
import path from 'path';
@dmartinlozano
dmartinlozano / app.component.html
Last active May 10, 2018 15:09
tapTarget of material design in angular6. angular2-mdl components is used. The component is used when the page is loaded. https://stackblitz.com/edit/tpqa-tap-target
<button mdl-button mdl-button-type="fab" mdl-colored="primary" mdl-ripple #myButton style="margin-top:-20px;margin-left:300px">
<mdl-icon>add</mdl-icon>
</button>
<tap-target
width="600"
title="Create a new test project"
content=""
titleMarginLeft="150px"
titleMarginTop="50px"