Skip to content

Instantly share code, notes, and snippets.

📚
Learning

Mao Wtm micromaomao

📚
Learning
Block or report user

Report or block micromaomao

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@micromaomao
micromaomao / data.yml
Last active Jun 20, 2019
zPermission bootstrap
View data.yml
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
View gencode-ASCII-functions.py
#!/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 Jun 2, 2019
My Haskell "Hello World" Practice.
View aabb.hs
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
View 1.js
/*
* 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 Jun 1, 2019
Mass delete stuff from repl.it
View run_in_console.js
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)
View lockholder.rs
use std::{io, mem};
use std::io::Write;
struct LockHolder {
stdout_ptr: *mut io::Stdout,
lock_ptr: *mut io::StdoutLock<'static>,
}
impl LockHolder {
fn new() -> Self {
@micromaomao
micromaomao / checkEr.js
Last active Jan 6, 2018
Check paper completeness for SchSrch
View checkEr.js
fetch('/subjects/?as=json').then(res => res.json()).then(subjs => {
function doSubject(i) {
if (i >= subjs.length) return void console.log('# Done!')
let subj = subjs[i]
console.log('# Doing ' + subj._id + '...')
checkSubject(subj).then(() => { doSubject(i + 1) })
}
function checkSubject (subj) {
return Promise.all(subj.times
.map(time => checkEr(subj._id, time).then(b => Promise.resolve([time, b]))))
View keybase.md

Keybase proof

I hereby claim:

  • I am micromaomao on github.
  • I am maowtm (https://keybase.io/maowtm) on keybase.
  • I have a public key ASBWYlQ8_f1DPRN9slDQM7YssGskMcQkqn5VDEWly5RNGQo

To claim this, I am signing this object:

View .vimrc
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
View sumall.sql
SELECT * FROM (
SELECT
destinationAccount AS account,
round(
IFNULL((SELECT sum(credit) FROM transactions WHERE destinationAccount=tx.destinationAccount), 0)
- IFNULL((SELECT sum(credit) FROM transactions WHERE sourceAccount=tx.destinationAccount), 0)
, 9)
AS balance
FROM transactions tx
GROUP BY destinationAccount
You can’t perform that action at this time.