Skip to content

Instantly share code, notes, and snippets.

View xianminx's full-sized avatar
🏠
Working from home

Lucas xianminx

🏠
Working from home
  • 09:43 (UTC +08:00)
View GitHub Profile
@xianminx
xianminx / Ballot.sol
Created May 24, 2018 06:33
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.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.20;
/// @title Voting with delegation.
contract Ballot {
// This declares a new complex type which will
// be used for variables later.
// It will represent a single voter.
struct Voter {
uint weight; // weight is accumulated by delegation
bool voted; // if true, that person already voted
function hello_axios() {
const axios = require('axios');
axios.get('https://cityapi.opentown.cn/events/5b3a2aed66db7502c0a2760x').then(function (response) {
console.log(response);
}).catch(function (error) {
console.log(error);
}).then(function () {
console.log('always executed')
@xianminx
xianminx / custom_event.js
Created August 21, 2018 03:27
Javascript custom event
var event = new Event('custom_event')
var elem = document.getElementById('custom-event-elem')
function handler(){
console.log('custom event triggered!')
}
elem.addEventListener('custom_event', handler, false)
elem.dispatchEvent(event)
@startuml component
actor client
node app
database db
db -> app
app -> client
@enduml
@xianminx
xianminx / README.md
Created August 8, 2019 16:03 — forked from atenni/README.md
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]

@xianminx
xianminx / products.ts
Created August 25, 2023 04:45
solid-createResource
const fetchProducts = async () => {
const res = await fetch('https://fakestoreapi.com/products');
const data = await res.json();
return data;
}
export default function ProductList() {
const [products] = createResource(() =>
fetchProducts()
);
@xianminx
xianminx / "The Myth of Sisyphus" by Albert Camus.md
Created July 17, 2024 14:53
"The Myth of Sisyphus" by Albert Camus

"The Myth of Sisyphus" by Albert Camus

Introduction

  1. Opening Statement

    • Camus begins with a bold statement about the significance of the question of suicide, suggesting it is the most important philosophical question because it deals with the meaning of life.
  2. The Absurd

    • He introduces the concept of the absurd, which arises from the conflict between the human desire for meaning and the silent, indifferent universe.

Part 1: An Absurd Reasoning

@xianminx
xianminx / Schema Theory in Reading.md
Last active August 3, 2024 09:18
Schema Theory In Reading Preview at hhttps://m3-swart.vercel.app/mind/interactive?gist=https%3A%2F%2Fgist.githubusercontent.com%2Fxianminx%2F4f3f3b8e9433aa5191682025caf7a51b%2Fraw%2FSchema%2520Theory%2520in%2520Reading.md&tab=mindmap
title Schema Theory in Reading
markmap
colorFreezeLevel initialExpandLevel
2
3

Schema Theory in Reading

Definition of Schema

@xianminx
xianminx / Organization_Principle.md
Last active August 2, 2024 08:55
组织原则 (Organization Principle)
title 组织原则
markmap
colorFreezeLevel
2

组织原则 Organization Principle

1. 层级原则(Hierarchy Principle)

@xianminx
xianminx / The Art of Close Reading_1.md
Created August 4, 2024 07:20
# The Art of Close Reading (Part One)

The Art of Close Reading (Part One)

Introduction

  • Developing one's thinking about reading is essential to engaging in close reading.
  • Students must learn to determine the worth of a text and take ownership of its important ideas.
  • Close reading involves the active use of intellectual skills and guided practice based on theory.

Reading for a Purpose

  • Skilled readers read with a purpose, which varies based on the situation and text.
  • Reading aims to understand what the author conveys on a subject.