// src/useWasm.js
export const useWasm = (fileName, imports) => {
const [state, setState] = useState({
loaded: false,
instance: null,
error: null,
});
useEffect(() => {
+ const abortController = new AbortController();
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
class Markov(object): | |
def __init__(self, open_file, chain_size=3): | |
self.chain_size = chain_size | |
self.cache = {} | |
self.open_file = open_file | |
self.words = self.file_to_words() | |
self.word_size = len(self.words) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# this will download a csv format calendar file with TV info and | |
# filter only channels I want. The output can be imported into google calendar etc | |
# this url is for the cubs, but you could modify url parameters if you want | |
csvurl="http://mlb.mlb.com/ticketing-client/csv/EventTicketPromotionPrice.tiksrv?team_id=112&display_in=singlegame&ticket_category=Tickets&site_section=Default&sub_category=Default&leave_empty_games=true&event_type=T" | |
tmpfullfile="tmpfullfile.csv" | |
outputfile="cubs-onair-schedule.csv" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const request = require('request'); | |
const app = express(); | |
app.use((req, res, next) => { | |
res.header('Access-Control-Allow-Origin', '*'); | |
next(); | |
}); |