inspired by simple counter app implementations
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 { log } from "https://cdn.skypack.dev/fp-ts/Console"; | |
log("hello world!")(); | |
// deno run deno-fp-ts-log.ts | |
// evaluating tree shaking and maximum compability bundles | |
// see ts-doc for config options https://www.typescriptlang.org/tsconfig | |
// deno bundle --config tsconfig.json deno-fp-ts-log.ts log-bundle.js | |
// as of deno 1.9.1 the following options were ignored: module, target |
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
// It's more interesting if the numbers are -50 to +50. | |
const range = (x1,x2) => [...Array(x2-x1+1)].map( (_,i)=>x1+i ) | |
const maybeFizz = x => x%3==0 ? 'fizz' : undefined | |
const maybeBuzz = x => x%5==0 ? 'buzz' : undefined | |
const join = (s1,s2) => [s1,s2].join('') | |
const maybeText = x => join(maybeFizz(x),maybeBuzz(x)) |
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 r2 = require('r2') | |
// asynchronous arrow functions seem to need an explicit return to work properly | |
const loadUser = async id => { return await r2(`https://jsonplaceholder.typicode.com/users/${id}`).json } | |
(async function() { | |
console.log(await loadUser(2)) | |
})() |
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 config = { | |
// Required | |
username: 'personal-wikidata-username', | |
password: 'password', | |
// Optional | |
verbose: true // Default: false | |
} | |
const wdEdit = require('wikidata-edit')(config) |
The data is from the Finnish ministry of justice election results
curl -O http://tulospalvelu.vaalit.fi/K2012/data/k-2012_ehd_maa.csv.zip
unzip k-2012_ehd_maa.csv.zip
head -n 1 kv-2012_teat_maa.csv > scandinavian.csv
iconv -f ISO-8859-1 -t UTF-8 scandinavian.csv > scandinavian-utf.csv
$ file -I scandinavian.csv
scandinavian.csv: text/plain; charset=iso-8859-1
$ file -I scandinavian-utf.csv
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 React, { PropTypes } from 'react' | |
import ReactDOM from 'react-dom' | |
import { createStore, combineReducers, applyMiddleware } from 'redux' | |
import { Provider, connect } from 'react-redux' | |
import sagaMiddleware, { take, put, fork } from 'redux-saga' | |
// React component | |
export class Counter extends React.Component { | |
render(){ | |
const { value, clickPlus, clickMinus, clickSlow } = this.props |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<script src="https://npmcdn.com/[email protected]/dist/react.js" charset="utf-8"></script> | |
<script src="https://npmcdn.com/[email protected]/dist/react-dom.js" charset="utf-8"></script> | |
<script src="https://npmcdn.com/[email protected]/browser-polyfill.min.js" charset="utf-8"></script> | |
<script src="https://npmcdn.com/[email protected]/browser.min.js" charset="utf-8"></script> | |
</head> |
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 React from 'react' | |
import ReactDOM from 'react-dom' | |
import fetch from 'isomorphic-fetch' | |
const App = () => ( | |
<div> | |
<RepositoryList id="pe3"/> | |
</div> | |
) |
to run: webpack-dev-server
suit-loader is deprecated.
should probably use something like rework-webpack-loader but i dont understand webpack or rework well enough.
NewerOlder