Skip to content

Instantly share code, notes, and snippets.

View IgnacioCastro0713's full-sized avatar
:octocat:
Developer

José Ignacio Menchaca Castro IgnacioCastro0713

:octocat:
Developer
View GitHub Profile
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Linq;
namespace Extensions
{
public static class DataReaderExtension
{
using System.Collections.Generic;
using System.Data;
using System.Threading.Tasks;
using Microsoft.Data.SqlClient;
using PLXS.EmailInvoice.Database.DbContext;
namespace Extensions
{
public static class ApplicationContextExtension
{
var serials = new[]
{
"00001", "00002", "00003", "00004", "00005",
"00006", "00007", "00008", "00009", "00010",
"00011", "00012", "00013", "00014", "00015",
};
const int rows = 5;
var columns = (int)Math.Ceiling((double)serials.Length / rows);
var result = string.Empty;
###
POST http://localhost:8080/login/register
Content-Type: application/json
{
"username":"ignacio",
"password":"hola"
}
###
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
@IgnacioCastro0713
IgnacioCastro0713 / useFetch.js
Created June 17, 2020 03:26
hook http fetch
import { useState, useEffect } from 'react';
export default function useFetch(url, options) {
const [loading, setLoading] = useState(true);
const [result, setResult] = useState(null);
const [error, setError] = useState(null);
useEffect(() => {
(async () => {
try {
@IgnacioCastro0713
IgnacioCastro0713 / toArray.js
Last active June 17, 2020 03:29
convert object to array
function* toArray(obj) {
for (let prop of Object.keys(obj))
yield obj[prop];
}