Skip to content

Instantly share code, notes, and snippets.

View amazingandyyy's full-sized avatar
🦄

Andy Chen amazingandyyy

🦄
View GitHub Profile
import random
count = 0
number = random.randint(1, 100)
while count < 11:
print('Take a guess from 1 ~ 100')
guess = input()
guess = int(guess)
@amazingandyyy
amazingandyyy / truffle.js
Created November 19, 2017 21:31
For truffle 3
module.exports = {
networks: {
development: {
host: "localhost",
port: 8545,
network_id: "*", // Match any network id
gas: 4700000
}
}
};
const call = async (index) => {
setTimeout(()=>{
console.log(index)
},5000)
}
for (var i=0;i<5;i++) {
await call(i);
}
0xD9dDC0A50F94d38514e02c70bcF00835B3Ba3F71

Here is the prompt

Below is the coding challenge. You have 2 hours to complete the challenge. If you need more time to finish, please send us what you have at the 2 hour mark and then send over your final solution once you have completed it (within 24 hours). We will assess you on both versions.

You can use any programming language you are comfortable with. When ready, please email your code as an attachment (please do not put the solution on GitHub or any other public repository).

Thank you!


Your task is to write an implementation of the game Connect-4 (http://en.wikipedia.org/wiki/Connect_Four).

@amazingandyyy
amazingandyyy / golang-deploy-to-aws-ec2.md
Last active February 22, 2023 04:30
Some useful commmands you will need to build your goloang binary and deploy to aws-ec2

Some useful commmands you will need to build your goloang binary and deploy to aws-ec2

build golang

$ GOOS=linux GOARCH=amd64 go build -o [binary-name]
  • type go env to check your environment variables
  • GOOS stands for Go OS, depends on what ec2 machine you rent, you might have different os setting
  • GOARCH stands for Go Archetecture
  • -o only allowed when compiling a single package, define the name of output file

Inspiration

What it does

How we built it

We build 2 web scraper to get character list from Walking dead show and FRIENDS show We build a RESTful API with IBM Loopback and connect to our character list storaged on a MySQL database We build web interface for user to input their preference of every character of a show

@amazingandyyy
amazingandyyy / deploy-to-target-branch.sh
Created September 10, 2017 02:31 — forked from IvanWei/deploy-to-target-branch.sh
Deploy to target branch (e.g. gh-pages)
#!/bin/bash
set -e # stop on error
echo get last commit
git pull
echo add dist folder
git add -f dist
echo commit changes
git commit -m "deploy to gh-pages"
echo push to remote target branch (gh-pages is target branch)
0x247B201d48765910a77AFbc7D3629c9f0cDF8a93
var HelloEthSalon = artifacts.require("./HelloEthSalon.sol");
contract("HelloEthSalon:GetMessage", function (accounts) {
it("should return a correct string", async function () {
const contract = await HelloEthSalon.deployed();
const result = await contract.GetMessage.call();
assert.isTrue(result === "I know smart contract testing!!");
});
});