Skip to content

Instantly share code, notes, and snippets.

View jdnichollsc's full-sized avatar
🏠
Working from home

J.D Nicholls jdnichollsc

🏠
Working from home
View GitHub Profile
@jdnichollsc
jdnichollsc / Codes
Last active June 22, 2023 19:04
Ionic Framework Links
- Ejemplo de Gulp con Ionic => https://gist.github.com/jdnichollsc/e3a323223fcb7822dbba
- SQLite con ngCordova usando patrón de servicio y promesas => https://gist.github.com/jdnichollsc/9ac79aaa3407e92677ba
- Permitir dinamicamente arrastrar elementos de una Lista => https://gist.github.com/mhartington/c5107ccd9204b755442b
- Obtener datos consumiendo un servicio REST o desde el LocalStorage => https://gist.github.com/jdnichollsc/7367fe5b17369e856157
- Cambiar el tamaño de un Modal => https://gist.github.com/jdnichollsc/1b0112dfdca4b7f06fbe
- OAuth Authentication, Firebase 3 and ngCordovaOauth => https://gist.github.com/jdnichollsc/17bae6581d405321937fe433410172c9
- Firebase Upload Files => https://gist.github.com/jdnichollsc/5ddc40c1c482e6209a8f4d634fd11d1e
- Download and Open Files => https://gist.github.com/jdnichollsc/1e
@jdnichollsc
jdnichollsc / index.js
Created February 23, 2019 05:43
Get areas of shapes - Hackerrank
const getArea = (shape, values) => {
let area = -1
switch(shape) {
case "square":
area = Math.pow(values[0], 2);
break;
case "rectangle":
area = values[0] * values[1];
break;
case "circle":
@jdnichollsc
jdnichollsc / NEAR.md
Last active November 28, 2022 22:26
NEAR Developer Bootcamp

NEAR enruta la transacción para que vaya al Shard correspondiente.

dApp en NEAR

Máquina virtual de NEAR:

Su máquina virtual no es exclusiva a su red

Blockchain Environment

@jdnichollsc
jdnichollsc / Bitcoin.md
Last active November 9, 2022 18:36
🇨🇴 Criptomonedas & BlockChain 🇪🇸

Bitcoin

Es la primera criptomoneda o activo financiero digital descentralizado de la historia que permite realizar transacciones de forma segura, privada y sin intermediarios alrededor del mundo. Satoshi Nakamoto es el pseudónimo que fue utilizado por la persona o el grupo de personas que diseñaron y crearon el ecosistema Bitcoin.

La motivación de Satoshi Nakamoto para concebir Bitcoin fue crear un nuevo sistema de dinero electrónico que utilice por completo una red de pares que no necesite un tercero de confianza (intermediario financiero) para realizar las transacciones y cuya oferta no pueda ser alterada por ninguna otra parte. En otras palabras Bitcoin trasladaría las características deseables del dinero físico (falta de intermediarios, irrevocabilidad de las transacciones) al mundo digital y las combinaría con una política monetaria rigurosa que no se pueda manipular para producir inflación inesperada en beneficio de terceros, acosta de los tenedores de dicha moneda. Nakamoto lo logro utilizando te

@jdnichollsc
jdnichollsc / user-signature.dto.ts
Created August 29, 2022 21:29
Verify that a request is signed by the owner of the public key (NestJS, ExpressJS and Solana)
import { ApiProperty } from '@nestjs/swagger';
export class UserSignatureDto {
@ApiProperty({ description: 'Wallet base58-encoded public key' })
walletPK: string;
@ApiProperty({ description: 'base58-encoded signature of a unique message' })
signature: string;
}
@jdnichollsc
jdnichollsc / animatable-component.html
Last active February 16, 2022 09:10
Animatable Components using Higher Order Component (HOC) with StencilJS 🙌 - https://proyecto26.github.io/animatable-component
<animatable-component
autoplay
easing="ease-in-out"
duration="800"
delay="300"
animation="zoomIn"
iterations="Infinity"
direction="alternate"
>
<h1>Hello World</h1>
@jdnichollsc
jdnichollsc / pdf.js
Created January 17, 2016 20:41
Generate PDF in base64 with jsPDF
services.factory('PDF', ['$q', function ($q) {
var createSubtopic = function (doc, subtopic, top, pageWidth) {
doc.autoTable([
{ title: "Title", dataKey: "title" },
{ title: "Value", dataKey: "value" }
], [
{ title: "Estándar", value: subtopic.standard },
{ title: "Tema", value: subtopic.topic },
sudo su
//Check Firewall
ufw status
ufw allow 8080
ufw reload
//Execute node app.js
pm2 start app.js --name "MyNodeApp" -i 0
//Execute npm start
@jdnichollsc
jdnichollsc / examples.md
Last active November 2, 2021 16:13
Git commands

Revertir un commit

  • git revert -m 1

Devolverse a un commit anterior (peligro, va a remover cambios locales)

  • git reset --hard HEAD~1

Subir los cambios a la fuerza

  • git push -f

Cambiar la rama actual

@jdnichollsc
jdnichollsc / Repository.cs
Last active August 18, 2021 21:32
Entity Framework - Generic Repository
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Linq.Expressions;
namespace Models.Repositories
{
public class Repository<T> where T : class
{