Skip to content

Instantly share code, notes, and snippets.

View gardin1992's full-sized avatar

João Antonio Gardin Vieira gardin1992

View GitHub Profile
@gardin1992
gardin1992 / gist:3ccdf637b287d30c20399805a48262c5
Created March 30, 2023 20:50 — forked from sbarski/gist:5a9e94632ff68e5dbd58
Schema for ASP.NET Identity Model 2.0
CREATE TABLE [dbo].[AspNetUsers](
[Id] [nvarchar](128) NOT NULL,
[Email] [nvarchar](256) NULL,
[EmailConfirmed] [bit] NOT NULL,
[PasswordHash] [nvarchar](max) NULL,
[SecurityStamp] [nvarchar](max) NULL,
[PhoneNumber] [nvarchar](max) NULL,
[PhoneNumberConfirmed] [bit] NOT NULL,
[TwoFactorEnabled] [bit] NOT NULL,
[LockoutEndDateUtc] [datetime] NULL,
@gardin1992
gardin1992 / 1674561272677.json
Last active February 6, 2023 16:12
crawler dados
[{"id":1,"label":"AUDI","value":"br:br_pt:audi"},{"id":2,"label":"BMW","value":"br:br_pt:bmw"},{"id":3,"label":"LAND ROVER","value":"br:br_pt:landrover"},{"id":4,"label":"MERCEDES","value":"br:br_pt:mercedes"},{"id":5,"label":"PORSCHE","value":"br:br_pt:porsche"},{"id":6,"label":"AGRALE","value":"br:br_pt:agrale"},{"id":7,"label":"ALFA ROMEO","value":"br:br_pt:alfaromeo"},{"id":8,"label":"ASIA","value":"br:br_pt:asia"},{"id":9,"label":"ASTON MARTIN","value":"br:br_pt:astonmartin"},{"id":10,"label":"BENTLEY","value":"br:br_pt:bentley"},{"id":11,"label":"CAOA CHERY","value":"br:br_pt:caoachery"},{"id":12,"label":"CHERY","value":"br:br_pt:chery"},{"id":13,"label":"CHEVROLET","value":"br:br_pt:chevrolet"},{"id":14,"label":"CHRYSLER","value":"br:br_pt:chrysler"},{"id":15,"label":"CITROEN","value":"br:br_pt:citroen"},{"id":16,"label":"DAEWOO","value":"br:br_pt:daewoo"},{"id":17,"label":"DAIHATSU","value":"br:br_pt:daihatsu"},{"id":18,"label":"DODGE","value":"br:br_pt:dodge"},{"id":19,"label":"DS","value":"br:br_pt:
@gardin1992
gardin1992 / download-file.js
Created September 16, 2021 11:00
Blob base64 download
function blobToBase64(blob, callback) {
var reader = new FileReader();
reader.onload = function () {
var dataUrl = reader.result;
var base64 = dataUrl.split(",")[1];
callback(base64);
};
reader.readAsDataURL(blob);
}
@gardin1992
gardin1992 / index.js
Created November 18, 2020 11:07
Meu Cdn
const process = require('./process.js')
function Main() {
console.log('executa processos')
runProcess()
}
Main()
FROM php:7.4-fpm
# Arguments defined in docker-compose.yml
ARG user
ARG uid
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
@gardin1992
gardin1992 / UploadImage.cs
Last active November 12, 2019 02:50
Links upload image asp net 2.0
namespace Teste {
class SendFile {
[HttpPost]
public ActionResult Edit(Produto produto, HttpPostedFileBase logotipo = null, string chkRemoverImagem = null)
{
return GravarProduto(produto, logotipo, chkRemoverImagem);
}
private byte[] SetLogotipo(HttpPostedFileBase logotipo)
{
@gardin1992
gardin1992 / async-foreach.js
Created April 24, 2019 12:53 — forked from atinux/async-foreach.js
JavaScript: async/await with forEach()
const waitFor = (ms) => new Promise(r => setTimeout(r, ms))
const asyncForEach = (array, callback) => {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array)
}
}
const start = async () => {
await asyncForEach([1, 2, 3], async (num) => {
await waitFor(50)
@gardin1992
gardin1992 / HasDivisor.js
Last active April 1, 2021 16:42
Verificar se o numero é primo
const HasDivisor = (function () {
const remaindEqualsZero = (x, y) => x % y == 0;
const squareIsInteger = n => Number.isInteger(Math.sqrt(n));
const numberIterations = n => parseInt(n / 2);
const hasDivisor = (x, y) => {
@gardin1992
gardin1992 / client.js
Last active December 8, 2017 23:14
JavaScprit Herença por Object.call
// mesma classe com herença de call
// assim eh possivel atribuider valores privados
//
//
function ClientePeople(name, value, payment, payday) {
People.call(this, name, value);
var _payment = payment,
_payday = payday;
@gardin1992
gardin1992 / BootState.js
Last active December 8, 2017 22:52
Phaser Game base init
var States = States || {};
States.BootState = function() {
// atribundo ao PROTOTYPE da função as propiedados do State
// isso eh um tipo de herença
Phase.State.call(this);
preload() {
this.load.image('preloadBar', 'assets/loader.png');
}