Skip to content

Instantly share code, notes, and snippets.

View callezenwaka's full-sized avatar

Callis callezenwaka

View GitHub Profile
@duanescarlett
duanescarlett / index.js
Last active April 10, 2022 00:37
Send Ether to another wallet
ethers = require('ethers')
require('dotenv').config()
async function main () {
// Connect to an EVM network
const provider = new ethers.providers.JsonRpcProvider(`https://polygon-mainnet.g.alchemy.com/v2/${process.env.RPC_KEY}`)
// Get the gas price
const gasPrice = provider.getGasPrice()
// Create a wallet object from private key
const wallet = new ethers.Wallet(`${process.env.PRIVATE_KEY}`)
@finxter
finxter / structArray2.sol
Created December 28, 2021 08:28 — forked from yassesh/structArray2.sol
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
pragma solidity ^0.8.0;
pragma experimental ABIEncoderV2;
contract SavingsAccount {
struct Member{
uint id;
string name;
uint balance;
}
mapping (uint => Member) public members;
event savingsEvent(uint indexed _memberId);
@thpham
thpham / leadership_principles_questions.md
Created October 12, 2021 18:04
Interview questions

Are Right, A Lot

  1. Tell me about a decision for which data and analysis weren’t sufficient to provide the right course and you had to rely on your judgment and instincts. Give me two to three examples. They don’t have to be big strategic decisions – could be big or small.
  2. Tell me about a time you made a difficult decision and how you knew it was the right solution (probe on how they evaluated the options, if they received input, what data they reviewed, etc.)
  3. Give me an example of when you have to make an important decision in the absence of good data because there just wasn’t any. What was the situation and how did you arrive at your decision? Did the decision turn out to be the correct one? Why or why not?
  4. Tell me about a time when you made a bad decision and the learning from the experience enabled you to make a good decision later. What did you learn that you were able to apply?
  5. Tell me about a time when you have been faced with a challenge where the best way forward or strategy
worker_processes 1;
events {
worker_connections 1024;
}
http {
server {
listen 80;
server_name localhost;
const Web3 = require('web3');
class TransactionChecker {
web3;
web3ws;
account;
subscription;
constructor(projectId, account) {
this.web3ws = new Web3(new Web3.providers.WebsocketProvider('wss://rinkeby.infura.io/ws/v3/' + projectId));
'use strict';
const {Storage} = require('@google-cloud/storage');
const storage = new Storage();
storage
.getBuckets()
.then((results) => {
const buckets = results[0];
@Pelirrojo
Pelirrojo / README.md
Created October 16, 2018 10:44
NodeJS Local example with DynamoDB/Docker

NodeJS Local Examples with DynamoDB/Docker

Some samples to test DynamoDB locally through Docker

  # Download & Run LocalStack
  $ docker pull localstack/localstack:latest
 $ docker run -it -p 4567-4578:4567-4578 -p 8080:8080 localstack/localstack
@huogerac
huogerac / HomeView.vue
Created June 7, 2018 03:34
Push Notifications
<template>
<div>
<!-- componente que encapsula o PUSH NOTIFICATION -->
<push-notification
ref="pushNotification"
:currentToken="userToken"
@update-token="onUpdateToken"
@new-message="onNewMessage" />
@adriennetacke
adriennetacke / countdown.js
Last active September 1, 2022 04:18
Countdown timer in pure JavaScript
function countdown(endDate) {
let days, hours, minutes, seconds;
endDate = new Date(endDate).getTime();
if (isNaN(endDate)) {
return;
}
setInterval(calculate, 1000);
@inecmc
inecmc / vue-history-prerender-nginx.md
Created March 2, 2018 06:54
Nginx config for Vue.js history mode + Prerender.io
# Force to use https
server {
    listen 80;
    listen [::]:80;
    server_name example.com;
    return 301 https://$server_name$request_uri;
}

# Default server configuration