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
/** | |
* Dereference object attributes from a string. | |
* | |
* Access nested object attributes using a string. | |
* | |
* @link https://gist.github.com/jmlon/e0fcfdd79233ac4ec3c041cc31370bd2 | |
* @author Jorge M. Londoño | |
* @since 1.0.0 | |
*/ | |
'use strict'; |
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
# pip install mysql-connector-python | |
import threading | |
import time | |
import mysql.connector | |
HOST = 'localhost' | |
USER = 'root' | |
PASSWORD = 'my-secret-pw' | |
SLEEP = 2 |
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 smtplib | |
import argparse | |
from email.mime.text import MIMEText | |
from email.mime.multipart import MIMEMultipart | |
# from email.header import Header | |
from configparser import ConfigParser | |
SERVER="email-smtp.us-east-1.amazonaws.com" |
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 { clusterApiUrl, Connection, PublicKey, RpcResponseAndContext, SignatureResult, SystemProgram, Transaction } from '@solana/web3.js'; | |
import { FC, useEffect, useRef, useState } from 'react'; | |
import { PhantomProvider } from './ConnectWallet'; | |
interface ITransferSolProps { | |
provider: PhantomProvider; | |
} | |
const network = "devnet"; |
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 { Connection, PublicKey, clusterApiUrl, RpcResponseAndContext, SignatureResult } from "@solana/web3.js"; | |
import { FC, useEffect, useRef, useState } from "react"; | |
interface AirdropProps { | |
pubkey: PublicKey; | |
} | |
const network = "devnet"; | |
const Airdrop: FC<AirdropProps> = ({pubkey}) => { |
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 { FC, useEffect, useState } from "react"; | |
import { Connection, PublicKey, clusterApiUrl } from "@solana/web3.js"; | |
type PhantomEvent = "disconnect" | "connect" | "accountChanged"; | |
interface ConnectOpts { | |
onlyIfTrusted: boolean; | |
} |
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 React from 'react'; | |
import './App.css'; | |
import Connect2Phantom from './components/Connect2Phantom'; | |
function App() { | |
return ( | |
<div className="App"> | |
<header className="App-header"> | |
<h1>Solana Examples</h1> | |
<hr className="fullWidth" /> |
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
package edu.upb.estalg.busqueda.movies; | |
import java.util.ArrayList; | |
import edu.princeton.cs.algs4.Bag; | |
import edu.princeton.cs.algs4.RedBlackBST; | |
import edu.princeton.cs.algs4.SeparateChainingHashST; | |
import edu.princeton.cs.algs4.StdOut; | |
public class GeneroPredominante { |
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
# Módulo para funciones matemáticas en los complejos | |
# https://docs.python.org/3/library/cmath.html | |
import cmath | |
# Ingresar complejos en la forma 1+2j | |
a = complex(input("Ingrese a: ")) | |
b = complex(input("Ingrese b: ")) | |
c = complex(input("Ingrese c: ")) | |
# En este caso no hay precondiciones con respecto a los valores a,b,c |
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
# Tipos de datos | |
# Definir algunas variables de varios tipos | |
a = 123 | |
b = 4.56 | |
c = 'Hola Mundo' | |
d = [ 1,2,3.33 ] | |
e = ( 1,2,3.33 ) | |
f = { 'a':1, 'b':2 } | |
g = True |
NewerOlder