Skip to content

Instantly share code, notes, and snippets.

View diegodfsd's full-sized avatar
🎯
Focusing

Diego Dias diegodfsd

🎯
Focusing
View GitHub Profile
@diegodfsd
diegodfsd / google-places.json
Created December 1, 2020 18:30
Response to google places api
// response to this request: https://maps.googleapis.com/maps/api/place/autocomplete/json?input=itaim%20bibi&types[]=(cities)&types[]=establishment&types[]=geocode&language=br&key={key}
{
"predictions" : [
{
"description" : "Itaim Bibi, São Paulo - State of São Paulo, Brazil",
"matched_substrings" : [
{
"length" : 10,
"offset" : 0
}
public static class MimeMap
{
private const string Dot = ".";
private const string ApplicationOctetStream = "application/octet-stream";
private static readonly Lazy<IDictionary<string, string>> _map = new Lazy<IDictionary<string, string>>(BuildMappings);
public static string ContentTypeFromPath(string path)
{
return ContentTypeFromExtension(Path.GetExtension(path));
@diegodfsd
diegodfsd / 90036345.json
Created October 25, 2019 17:01
Get product detail
{
"data": {
"id": 90036345,
"lm": 90036345,
"marketplaceId": 1543642543,
"createdByExternalSources": false,
"longTitle": "Suporte com Rodas Madeira Retangular 9x30x35cm até 45kg",
"shortTitle": "Suporte com Rodas Madeira Retangular 9x30x35cm até 45kg",
"description": "Os Suporte com Rodas de Madeira com 9x30x35cm possui a capacidade de peso de até 45kg. Ele é ideal para facilitar a movimentação de objetos, vasos, caixas etc.",
"url": "https://www.leroymerlin.com.br/suporte-com-rodas-madeira-retangular-9x30x35cm-ate-45kg_90036345",
-- pedidos com ao menos um item sem onda.
select o.id, oi.*
from orders o
join orderitems oi
on o.id = oi.OrderId
where o.WaveId is not null
and oi.WaveItemId is null
order by o.id
// Com o uso de javascript você deve transformar os dados recebidos da api externa
// no modelo esperado no Nexp. Estão disponíveis construções do ES6.
// É obrigatório que a função principal seja atribuida para a variável 'transform'
// declarada com var.
// Utilize as variaveis disponiveis no contexto para informar sobre o sucesso ou falha
// do seu processo de transformação.
var transform = function(response) {
const data = JSON.parse(response);
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /app
# Copiar source e restaurar dependencias
COPY ./Nexp.sln ./
COPY ./NuGet.config ./
COPY ./server/core/Domain/Nexp.Core.Application/Nexp.Core.Application.csproj ./server/core/Domain/Nexp.Core.Application/
COPY ./server/core/Domain/Nexp.Core.CQRS/Nexp.Core.CQRS.csproj ./server/core/Domain/Nexp.Core.CQRS/
COPY ./server/core/Domain/Nexp.Core.Domain.Model/Nexp.Core.Domain.Model.csproj ./server/core/Domain/Nexp.Core.Domain.Model/
COPY ./server/core/Domain/Nexp.Core.Domain.Service/Nexp.Core.Domain.Service.csproj ./server/core/Domain/Nexp.Core.Domain.Service/
public sealed class DynamicResource : DynamicObject, IDictionary<string, object>
{
/// <summary>
/// String Dictionary that contains the extra dynamic values
/// stored on this object/instance
/// </summary>
/// <remarks>Using PropertyBag to support XML Serialization of the dictionary</remarks>
private IDictionary<string, object> _properties = new Dictionary<string, object>();
/// <summary>
@diegodfsd
diegodfsd / Gemfile
Last active February 18, 2019 22:58
source 'https://rubygems.org'
gem 'rake', '0.8.7'
gem 'rails', '3.2.12'
gem 'devise'
gem 'activeadmin', '0.5.1'
# gem 'activeadmin-axlsx', :git => "git@github.com:rafaeliga/activeadmin-axlsx.git"
gem 'activeadmin-axlsx', '2.0.1'
gem 'kaminari'
1. Instalar Docker
2. Acessar diretorio do projeto via terminal
3. Execute o commando `docker-compose build` e aguarde, esse processo deve demorar um pouco
4. Execute o commando `docker-compose up`
5. Acessar o MySQL usando:
host: localhost
database: opote_development
usuário: root
password: password
6. Acessar outra janela do terminal e executar `docker-compose run web rake db:create`
public class CreateTenantCommand : ICommand
{
public string Name { get; }
public string Description { get; }
public Status Status { get; }
public string Hostname { get; }
public CreateTenantCommand(string hostname, string name, string description, Status status)
{
Hostname = hostname;