Skip to content

Instantly share code, notes, and snippets.

Vikram Saraph vsaraph

Block or report user

Report or block vsaraph

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@vsaraph
vsaraph / get_bearer_token.py
Created Jun 30, 2019
Generate new Twitter OAuth bearer token and use the token to fetch latest tweet from a given account
View get_bearer_token.py
import requests
import base64
# encode consumer API key and secret key
key = input("key: ")
secret = input("secret: ")
encoded = base64.b64encode((key + ":" + secret).encode()).decode()
# construct payload
endpoint = "https://api.twitter.com/oauth2/token"
@vsaraph
vsaraph / stack.sol
Created Feb 28, 2019
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.5.1+commit.c8a2cb62.js&optimize=false&gist=
View stack.sol
pragma solidity ^0.5.1;
contract Stack {
int256[] stack;
function push(int256 data) public {
stack.push(data);
}
function pop() public returns (int256 data) {
You can’t perform that action at this time.