- Slim muito mais consistente.
- Slim pode ser wrapper da aplicação inteira, como a Startup no ASP.NET C#.
- Tanto o routing quanto IoC é decoupled no Slim 4, da pra integrar como quiser, no more gambi.
- Usar o composer.json na raíz como um arquivo .sln e criar um composer.json dentro de cada camada como se fosse um .csproj para isolar escopos de projeto. Usar então o composer-merge-plugin para fazer .sln agregar os .csproj e interpreta-los no install e update.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect, useRef } from 'react'; | |
const defaultInterval = 30e3; | |
export function usePolling(callback: () => Promise<void>, dependencies: any[] = [], interval: number = defaultInterval) { | |
const savedCallback = useRef<() => Promise<void>>(); | |
const intervalId = useRef<NodeJS.Timeout | null>(null); | |
// Store the latest callback in a ref to avoid recreating the effect on every render | |
useEffect(() => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"main": "./cjs/index.js", | |
"module": "./esm/index.js", | |
"typings": "./esm/index.d.ts", | |
"esnext": "./esm/index.js", | |
"scripts": { | |
"clean": "yarn shx rm -rf dist output", | |
"test": "yarn test:build && yarn test:run", | |
"test:build": "tsc --build tsconfig.test.json", | |
"test:run": "mocha -r tsconfig-paths/register --timeout 200000 output/tests/**/*.spec.js", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"scripts": { | |
"build": "npm run build:es2015 && npm run build:esm && npm run build:cjs && npm run build:umd && npm run build:umd:min", | |
"build:es2015": "tsc --module es2015 --target es2015 --outDir dist/es2015", | |
"build:esm": "tsc --module es2015 --target es5 --outDir dist/esm", | |
"build:cjs": "tsc --module commonjs --target es5 --outDir dist/cjs", | |
"build:umd": "rollup dist/esm/index.js --format umd --name YourLibrary --sourceMap --output dist/umd/yourlibrary.js", | |
"build:umd:min": "cd dist/umd && uglifyjs --compress --mangle --source-map --screw-ie8 --comments -o yourlibrary.min.js -- yourlibrary.js && gzip yourlibrary.min.js -c > yourlibrary.min.js.gz", | |
} | |
} |
Livro on-line, ou documentação, da Microsoft sobre o desenvolvimento de micro-serviços com AspNetCore para Containers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
string ObfuscarEmail(string input) | |
{ | |
int arroba = 0; | |
int firstDot = 0; | |
int secondDot = 0; | |
string firstPart = ""; | |
string secondPart = ""; | |
string thirdPart = ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
^!Left::Send {Media_Prev} | |
^!F12::Send {Media_Play_Pause} | |
^!Right::Send {Media_Next} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Text; | |
namespace MyNamespace | |
{ | |
public class MyClass | |
{ | |
/// <summary> | |
/// Creates an Authentication Token for "Basic Auth" HTTP Authorization. | |
/// </summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Pipe, PipeTransform } from '@angular/core'; | |
@Pipe({ | |
name: 'firstWord' | |
}) | |
export class FirstWordPipe implements PipeTransform { | |
transform(value: string): string { | |
if (!value) { return ''; } | |
return value.split(' ')[0]; |
NewerOlder