Skip to content

Instantly share code, notes, and snippets.

View anggxyz's full-sized avatar
🙇‍♀️
probably thinking something irrelevant

Angela anggxyz

🙇‍♀️
probably thinking something irrelevant
View GitHub Profile
@anggxyz
anggxyz / filegenerator.sh
Created September 4, 2018 12:27
bash script to generate a pdf from .cpp (or any other language) files (concatenating their output with each source file) https://github.com/angelagilhotra/file-generator
#!/bin/bash
target='/home/angg/code/mca209lab'
cd $target
find . -maxdepth 1 -type f -name '*.cpp' | while read CPPFILE
do
TITLE=$(basename $CPPFILE .cpp)
g++ $TITLE.cpp
/* Read input from STDIN. Print your output to STDOUT*/
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
#include <iostream>
#include <string>
@anggxyz
anggxyz / task.html
Created October 9, 2018 17:09
Task
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<body>
<div class="container" style=padding:5em;>
<div class="progress">
<div class="progress-bar" style="width: 50%;">
@anggxyz
anggxyz / shift_cipher.cpp
Created January 27, 2019 17:42
input : text (cipher/plain), key; output : (cipher/plain) text [plaintext: lowercase, ciphertext: UPPERCASE]
#include <iostream>
#include <vector>
using namespace std;
string shift_cipher_encrypt (string plaintext, int shift) {
string ciphertext;
for (int i = 0; i < plaintext.size(); i ++) {
//lower case letters
if (plaintext[i] >= 97 && plaintext[i] <= 122) {
@anggxyz
anggxyz / ChildToken.sol
Last active November 23, 2019 18:12
The three contracts used to enable PoS enabled asset deposit and withdraw from Matic chain. Manager contract emits events `deposit` and `withdraw`, the bridge listens to these events and invokes relevant functions on RootToken and ChildToken, depending upon the request. Both Deposits and Transfers start from `Manager` contract. There will be a s…
pragma solidity ^0.5.11;
import "github.com/OpenZeppelin/openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol";
import "github.com/OpenZeppelin/openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";
contract ChildToken is ERC20, ERC20Detailed {
constructor (
string memory _name,
string memory _symbol,

Keybase proof

I hereby claim:

@anggxyz
anggxyz / config.json
Created February 3, 2020 10:46
maticjs 2.0.0 deposit sample code
{
"network":"testnet",
"version": "v3",
"privateKey": "0x..", // prepend with '0x'
"from": "0x..", // address corresponding to the private key
"RootTokenAddress": "...",
"ChildTokenAddress": "...",
}
@anggxyz
anggxyz / config.json
Last active February 4, 2020 04:47
maticjs 2.0.0 deposit sample code
{
"network":"testnet",
"version": "v3",
"privateKey": "0x..", // prepend with '0x'
"from": "0x..", // address corresponding to the private key
"RootTokenAddress": "...",
"ChildTokenAddress": "...",
}
import { ChildERC20 } from './ChildERC20'
// other ERC20 contract imports ...
contract ERC20Meta is ERC20 {
mapping (address => uint256) public replayNonce;
ChildERC20 childErc20;
constructor (address _childErc20) {
@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 {