Skip to content

Instantly share code, notes, and snippets.

View snowden-fu's full-sized avatar
🏠
Working from home

Snowden Fu snowden-fu

🏠
Working from home
View GitHub Profile
@snowden-fu
snowden-fu / config.md
Created September 7, 2023 00:03 — forked from eneajaho/config.md
Angular ESLint & Prettier Configuration

Install Angular ESLint

ng add @angular-eslint/schematics

Install Prettier and Prettier-ESLint dependencies

npm install prettier prettier-eslint eslint-config-prettier eslint-plugin-prettier --save-dev

ESLint configuration

Filename: .eslintrc.json

@snowden-fu
snowden-fu / contracts...Auction.sol
Last active April 3, 2023 07:32
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.18+commit.87f61d96.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
contract Auction {
address public owner;
// buyer list
address[] public buyerList;
// seller list
address[] public sellerList;
@snowden-fu
snowden-fu / bing_wallpaper.py
Last active July 15, 2022 11:18
download latest wallpaper from bing.cn
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
BING_WALLPAPER_API="https://cn.bing.com/HPImageArchive.aspx?format=js&idx=0&n=10&nc=1612409408851&pid=hp&FORM=BEHPTB&uhd=1&uhdwidth=3840&uhdheight=2160"
BING_URL = "https://cn.bing.com";
import sys
import requests
import json
import getpass
import os
@snowden-fu
snowden-fu / findAllIndexesOf.js
Last active May 10, 2022 00:05
Utilities function for JavaScript
/**
*
* @param {*} arr array to search
* @param {*} val single element to search in array
* @returns
*/
function findAllIndexesOf(arr, val) {
var indexes = [], i;
for(i = 0; i < arr.length; i++)
if (arr[i] === val)
@snowden-fu
snowden-fu / requirements.txt
Created September 14, 2021 14:05
dependencies for COMP9444 in CSE of UNSW
numpy==1.21.2
scikit-learn==0.20.2
scipy==1.7.1
torch==1.8.1
typing-extensions==3.10.0.2
@snowden-fu
snowden-fu / launch.json
Created August 10, 2020 13:41
cpp debug configurations
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "gcc - Build and debug active file",
"type": "cppdbg",