Skip to content

Instantly share code, notes, and snippets.

View anggxyz's full-sized avatar
🚶‍♀️
meandering

Angela anggxyz

🚶‍♀️
meandering
View GitHub Profile
@anggxyz
anggxyz / send.py
Last active December 2, 2020 12:15
Send email (jinja2 + python3)
from smtplib import SMTP
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from jinja2 import Environment, FileSystemLoader
import os
env = Environment(
loader=FileSystemLoader('templates'))
@anggxyz
anggxyz / README.md
Last active September 27, 2020 18:17
April 8, 2020. Matic MasterClass: Building a Full Stack dApp from Scratch [Helper Doc]

Matic MasterClass: Building a Full Stack dApp

Helper Doc

The session won't be focussed on coding, but on the concepts that are involved in building a decentralised application. It is aimed towards an introduction to the programmable capabilities of Ethereum blockchain and the tools that will help you in your journey of becoming an Ethereum developer.

Prerequisites

There are a few prerequisites however if you'd like to follow along the session. You should be familiar with Javascript, Node and HTML. And some familiarity with console will help.

@anggxyz
anggxyz / README.md
Last active September 27, 2020 18:28
Resources for 🛠 Build on Matic: ETHOnline Workshop, 2020.
@anggxyz
anggxyz / README.md
Created September 11, 2020 17:18
Mint and deposit PoS dummy erc721 to Matic Network [networks: goerli, mumbai]

Usage

Save all three files in a directory and install dependencies:

$ npm init -y
$ npm i -s @maticnetwork/maticjs @truffle/hdwallet-provider web3
@anggxyz
anggxyz / fetch.js
Last active September 5, 2020 20:09
fetch messages from a slack org (admin access req.)
/**
* fetches all message history from all the channels the bot is added in
* make sure to export SLACK_TOKEN in the environment before running the script - this is the bot token
*/
const { WebClient } = require('@slack/web-api')
const fs = require('fs')
const token = process.env.SLACK_TOKEN
const web = new WebClient(token)
const csvWriter = require('csv-write-stream')
const path = require('path')
@anggxyz
anggxyz / readme.md
Last active August 3, 2020 16:18
TypeError: 'NoneType' object is not callable | part of dev-notes: https://gist.github.com/nglglhtr/561e987c1168c868e484f35f76f4c0fd
  • Error TypeError: 'NoneType' object is not callable in google colab while fitting a tensorflow model.
  • Resolved by restarting the session and re-running all cells
  • Not sure what causes this.
@anggxyz
anggxyz / nginx.conf
Last active November 17, 2021 11:27
nginx config for deploying streamlit apps from custom url + reverse proxy for port | part of dev-notes: https://gist.github.com/nglglhtr/561e987c1168c868e484f35f76f4c0fd
location /:CUSTOM-PATH/ {
proxy_pass http://127.0.0.1:<PORT>/:CUSTOM-PATH/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
proxy_http_version 1.1;
# Also requires websocket:
proxy_set_header Upgrade $http_upgrade;
@anggxyz
anggxyz / map-plasma.js
Last active July 29, 2020 16:11
mapping erc20/721 tokens via PoS/Plasma - deploys new token on child, updates mapping on root and child chain
const Web3 = require('web3')
const rootRPC = ''
const childRPC = ''
const web3 = new Web3 ()
// add pvt for owner account
const pvtKey = ''
// registry contract
@anggxyz
anggxyz / Receiver.sol
Created May 20, 2020 09:57
Files for Walkthrough of Transferring data to Matic chain (https://docs.matic.network/docs/develop/advanced/transfer-data)
// receiver.sol
pragma solidity ^0.5.11;
// IStateReceiver represents interface to receive state
interface IStateReceiver {
function onStateReceive(uint256 stateId, bytes calldata data) external;
}
contract receiver {