Skip to content

Instantly share code, notes, and snippets.

View danywalls's full-sized avatar
🎯
Focusing

Dany Paredes danywalls

🎯
Focusing
View GitHub Profile
function isAnagram(word: string, secondword: string): boolean {
const reversedWord = [...word].reverse().toString().replaceAll(',',"")
return secondword === reversedWord;
}
isAnagram('amor', 'roma')
function generateNumbers(from: number, to: number)
{
for(let index = from; index <= to; index++) {
const message = getMessage(index)
console.log(message)
}
}
version: "3"
services:
db:
image: mysql
command: --default-authentication-plugin=mysql_native_password
restart: always
ports:
- "3306:3306"
environment:
@danywalls
danywalls / scaffold.sh
Created February 5, 2023 12:52
example of scaffolding with bash
#!/bin/bash
version="1.0"
#validate that the user passed the parameter
if [ -z "$1" ]
then
echo "Please add the parameter to script ex: ./scaffold.sh blog"
exit
fi
#get the project name parameter
projectName=$1
class Invoice {
public amount: number;
public description: string;
country: string;
}
class SalesInvoices extends Invoice {
products: Array<string> = [];
}
import { AppComponent } from './app.component';
import { Pipe, PipeTransform } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { TranslateService } from '@ngx-translate/core';
@Pipe({ name: 'translate' })
class MockPipe implements PipeTransform {
transform(value: string): string {
return '';
@danywalls
danywalls / adapter.ts
Last active April 29, 2022 16:19
adapter example
class Item {
key: string;
value: string;
}
interface IStorage {
getItem(key: string): Item;
setItem(item: Item): boolean;
remove(key: string): boolean;
}
// aqui uso el stragety
@danywalls
danywalls / vscode extensions
Last active April 9, 2020 09:52
My VSCode extensions
Tag AutoClose https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-close-tag
Tag highligth https://marketplace.visualstudio.com/items?itemName=vincaslt.highlight-matching-tag
Tag Rename https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag
Vetur https://marketplace.visualstudio.com/items?itemName=octref.vetur
ESLint https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint
GitLens https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens
Sass https://marketplace.visualstudio.com/items?itemName=Syler.sass-indented
Live Sass Compiler https://marketplace.visualstudio.com/items?itemName=ritwickdey.live-sass
Prettier https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode
VSCode icons https://marketplace.visualstudio.com/items?itemName=vscode-icons-team.vscode-icons
{"lastUpload":"2020-01-16T20:59:08.958Z","extensionVersion":"v3.4.3"}
@danywalls
danywalls / Players.js
Last active April 24, 2024 21:58
Set the default value in react-select component
import React, {Component} from 'react';
import Select from 'react-select';
class Players extends Component {
state = {
defaultSelected: 2,
playerOptions: [
{ value: 1, label: 'Lebron'},
{ value: 2, label: 'Davis'}
]