Skip to content

Instantly share code, notes, and snippets.

View Mr-Perfection's full-sized avatar
😎

Stephen S. Lee Mr-Perfection

😎
View GitHub Profile

Command shortcuts

alias soltv="solana-test-validator"
alias solcs="solana config set --url"
alias solcg="solana config get"
alias solb="solana balance"
alias sola="solana address"
alias solair="solana airdrop"
@Mr-Perfection
Mr-Perfection / README_TEMPLATE.md
Created December 18, 2022 17:02
My README template

APP_NAME

Demo

Requirements

@Mr-Perfection
Mr-Perfection / README.txt
Created May 12, 2021 04:59
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.4+commit.c7e474f2.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
@Mr-Perfection
Mr-Perfection / README.txt
Created May 7, 2021 23:47
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.17+commit.d19bba13.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
@Mr-Perfection
Mr-Perfection / json_to_csv.py
Created January 4, 2021 08:26
Convert .JSON file to .csv file
import json
import csv
import sys
def process():
arguments = sys.argv
if len(arguments) != 2:
print('please pass your json file as argument i.e. python json_to_csv.py [FILENAME].json')
return
json_file = arguments[1]
@Mr-Perfection
Mr-Perfection / Test.swift
Created July 17, 2020 02:20
ScrollViewProxy didn't work when i use fetched data with observed object
// Repository
class BasePublicChatRepository {
@Published var publicChats = [PublicChat]()
}
// In repository, I load data from firebase. Like,
self.db.collection(self.publicChatsPath)
.whereField(...)
.getDocuments(completion: { (querySnapshot, error) in
if let querySnapshot = querySnapshot {
//
// OnboardingViewController.swift
// PWMe
//
// Created by Stephen lee on 8/22/19.
// Copyright © 2019 Stephen lee. All rights reserved.
//
import UIKit
//
// Item.swift
// todosy
//
// Created by Stephen lee on 3/6/18.
// Copyright © 2018 Stephen Lee. All rights reserved.
//
import Foundation
class Item: Codable {
version: 2
jobs:
build:
working_directory: ~/firebase-functions-hello-world
docker:
# specify the version you desire here
- image: circleci/node:7.10
steps:
- checkout
- restore_cache:
go run - compiles and excutes one or two files
go build - compiles a bunch of go source code files
go fmt - formats all the code in each file in the current directory
go install - compiles and installs a package
go get - downloads the raw source code of someone else's package
go test - runs any tests associated with the current project