Skip to content

Instantly share code, notes, and snippets.

<?php
function parseTOC($items) {
if (count($items) == 0) return [];
reset($items);
$stack = array();
$ret = array();
$stack[] = &$ret;
#ifndef _FY_STL_VECTOR
#define _FY_STL_VECTOR
#include <iostream>
#include <cstddef>
namespace fateyan {
template <typename T>
class Vector {
public:
-- This exercise covers the first 6 chapters of "Learn You a Haskell for Great Good!"
-- Chapter 1 - http://learnyouahaskell.com/introduction
-- Chapter 2 - http://learnyouahaskell.com/starting-out
-- Chapter 3 - http://learnyouahaskell.com/types-and-typeclasses
-- Chapter 4 - http://learnyouahaskell.com/syntax-in-functions
-- Chapter 5 - http://learnyouahaskell.com/recursion
-- Chapter 6 - http://learnyouahaskell.com/higher-order-functions
-- Download this file and then type ":l Chapter-1-6.hs" in GHCi to load this exercise
@fateyan
fateyan / DuYueKan.js
Created November 25, 2018 11:43
從 Readmoo 爬犢月刊全刊下來
// https://new-read.readmoo.com/mags/7
// 犢月刊
var els = document.querySelectorAll('[data-readmoo-id]');
var ans = [];
for(var i = 0; i < els.length; ++i) {
ans.push(`https://readmoo.com/epub/${els[i].attributes['data-readmoo-id'].value}/eb\n`);
}