Skip to content

Instantly share code, notes, and snippets.

View Mr-Perfection's full-sized avatar
😎

Stephen S. Lee Mr-Perfection

😎
View GitHub Profile
'''
mine_sweeper
board: 2D array
cell
state: mine or not
revealed: revealed or not
value: number of mines in surrounding zone
reveal(x,y): reveal the cell
game_over(): exit the game
# 4 in a row game
# https://en.wikipedia.org/wiki/Connect_Four
'''
Game
board: a 2D array of cells
check_winner(): check who won the game every input from player1 or player2
game_over(): terminates a game
place_checker(x, y, player): takes an input and update a cell
print_board()
Verifying my Blockstack ID is secured with the address 1MDjAKK1ySkgQkSNULf467H5jdwqvpTinF https://explorer.blockstack.org/address/1MDjAKK1ySkgQkSNULf467H5jdwqvpTinF
1. Go to https://golang.org/dl/ and get download based on your OS.
2. Get VSCode
3. Get all the installs that VSCode recommends for Go.
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
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:
//
// Item.swift
// todosy
//
// Created by Stephen lee on 3/6/18.
// Copyright © 2018 Stephen Lee. All rights reserved.
//
import Foundation
class Item: Codable {
//
// OnboardingViewController.swift
// PWMe
//
// Created by Stephen lee on 8/22/19.
// Copyright © 2019 Stephen lee. All rights reserved.
//
import UIKit
@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 {
@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]