- git rebase -i HEAD~X - this allows you to merge interactively several commits
- then fixup OR pick OR reword AND push --force
- git reset --hard HEAD~X - this rollbacks the index back to X commits (check git status before doing this. Commit first)
- commit again using just one commit
- git reset --hard COMMIT_ID - this rollbacks the index back to the commit_id
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
w3 = web3.Web3(HTTPProvider("PUT HERE YOUR PROVIDER")) | |
UNISWAP_V3_POSITIONS_NFT = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88" | |
# example of Ethereum transaction calling multicall on Uniswap v3 (Etherscan) | |
tx = w3.eth.get_transaction(HexBytes("0xb835f4ab29be621eca1b2520a1e85d06b2e4fc03b84772e3fe05c220509e88b7")) | |
abi = await get_abi(Chain.ETHEREUM, UNISWAP_V3_POSITIONS_NFT) | |
contract = w3.eth.contract(HexBytes(UNISWAP_V3_POSITIONS_NFT), abi=abi) | |
fn, params = contract.decode_function_input(tx.input) | |
fn_and_params: dict[str, list[dict[str, str]]] = {} | |
for key, value in params.items(): | |
for v in value: |
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
# in order to download release artifacts from github, you have to first retreive the | |
# list of asset URLs using the github repo REST API. Use the asset URL to download | |
# the artifact as a octet-stream data stream. You will need to get an access token | |
# from "settings -> developer settings -> personal access tokens" on the github UI | |
#!/bin/bash -e | |
owner="MY_ORG_NAME" | |
repo="MY_REPO_NAME" | |
tag="ARTIFACT_TAG" | |
artifact="ARTIFACT_NAME" |
Thanks everyone for commenting/contributing! I made this in college for a class and I no longer really use the technology. I encourage you all to help each other, but I probably won't be answering questions anymore.
This article is also on my blog: https://emilykauffman.com/blog/install-anaconda-on-wsl
Note: $
denotes the start of a command. Don't actually type this.
- Install WSL (Ubuntu for Windows - can be found in Windows Store). I recommend the latest version (I'm using 18.04) because there are some bugs they worked out during 14/16 (microsoft/WSL#785)
- Go to https://repo.continuum.io/archive to find the list of Anaconda releases
- Select the release you want. I have a 64-bit computer, so I chose the latest release ending in
x86_64.sh
. If I had a 32-bit computer, I'd select thex86.sh
version. If you accidentally try to install the wrong one, you'll get a warning in the terminal. I chose `Anaconda3-5.2.0-Li
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
// To force print in console | |
sp_std::if_std! { | |
// This code is only being compiled and executed when the `std` feature is enabled. | |
println!("Hello native world"); | |
} | |
// Run this command to see it in console during tests: cargo test -- --nocapture |
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
use std::str; | |
fn main() { | |
// -- FROM: vec of chars -- | |
let src1: Vec<char> = vec!['j','{','"','i','m','m','y','"','}']; | |
// to String | |
let string1: String = src1.iter().collect::<String>(); | |
// to str | |
let str1: &str = &src1.iter().collect::<String>(); | |
// to vec of byte |
- Install Docker Compose:
sudo apt install -y docker-compose
(Make sure that the docker-compose version is 1.14.0) - Install Golang version >= 1.15.x
- Install build essential
sudo apt install -y build-essential
mkdir -p $HOME/go/src/github.com/hyperledger
cd $HOME/go/src/github.com/hyperledger
curl -sSL http://bit.ly/2ysbOFE | bash -s -- 2.2.2 1.4.9
(do not change these versions)
brew install docker kubectl helm
You can do this with docker for mac by enabling kubernetes
Make sure to set docker for mac's resources for this demo. Ideally 8GB CPU, and 12GB of Memory.
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
class TextAnalyzer | |
def initialize | |
@file = File.open("song.mp3") | |
end | |
def has_tag? | |
@file.seek(-128, IO::SEEK_END) | |
@file.read(3) == 'TAG' | |
end |
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
// 1. Use the PersistentState custom schema to filter by custom attribute | |
val customFilter = builder { | |
StateSchemaV1.PersistentState::productId.equal(productId) | |
} | |
// 2. Create a CustomQueryCriteria using the above filter | |
val customCriteria = QueryCriteria.VaultCustomQueryCriteria(customFilter) | |
// 3. Easy and quick filter. This returns a list | |
val state = serviceHub.vaultService.queryBy<YourState>().states.filter { |
NewerOlder