Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View micromaomao's full-sized avatar
👋

maowtm micromaomao

👋
View GitHub Profile
FROM rust
WORKDIR /usr/src/fakesas
COPY . .
RUN cargo build --release
CMD ["./target/release/fakesas"]
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev ERC-721 non-fungible token standard.
* See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md.
*/
interface ERC721
{
### A Pluto.jl notebook ###
# v0.12.16
using Markdown
using InteractiveUtils
# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
macro bind(def, element)
quote
local el = $(esc(element))
#include <string>
#include <algorithm>
#include <optional>
#include <vector>
#include <cassert>
using namespace std;
optional<string_view> solve(string_view chars, size_t assume_len) {
if (assume_len >= chars.size()) {
@micromaomao
micromaomao / CMakeLists.txt
Created January 28, 2020 23:26
simple asm template
cmake_minimum_required(VERSION 3.16)
project(main NONE)
add_custom_command(
OUTPUT main.o
DEPENDS main.asm
COMMAND nasm -f elf64 main.asm -o main.o
)
add_custom_command(
OUTPUT main
@micromaomao
micromaomao / data.yml
Last active June 20, 2019 14:24
zPermission bootstrap
players: []
groups:
- name: players
permissions:
bukkit.command.help: true
bukkit.command.tps: true
coreprotect.help: true
coreprotect.inspect: true
coreprotect.lookup: true
essentials.afk: true
#!/usr/bin/python
import sys
sys.path.insert(0, '../setval')
import setval as v
for x in range(32, 126):
xt = v.genpt(v.tryns(x))
print "(" + chr(x) + xt + ")"
@micromaomao
micromaomao / aabb.hs
Created June 2, 2019 03:05
My Haskell "Hello World" Practice.
import Data.List
toListNums :: Int -> [Int]
chrToInt :: Char -> Int
chrToInt chr = read ([chr])
toListNums num = if length rs == 4 then rs else 0:rs where rs = map chrToInt (show num)
ifDistinct :: (Eq a) => [a] -> Bool
ifDistinct [] = True
ifDistinct (x:px) = x `notElem` px && ifDistinct px
/*
* Problem 1
*
* Write three functions that compute the sum of the numbers in a given list using a for-loop, a while-loop, and recursion.
*/
/**
* Sum a integer list using `for`.
* @param list array list to sum
* @return the sum.
@micromaomao
micromaomao / run_in_console.js
Created June 1, 2019 13:25
Mass delete stuff from repl.it
setInterval(() => {try {let ele=Array.prototype.slice.call(document.querySelectorAll('.jsx-2732537345.options-image-wrapper'),-1)[0];ele.click();ele.remove();document.querySelector('.contextMenu-menuItem-delete').dispatchEvent(new MouseEvent('mousedown', {bubbles: true}));
document.querySelector('.button-base-kind-danger').click()} catch (e) {}}, 200)