更新: | 2024-05-21 |
---|---|
作者: | @voluntas |
バージョン: | 2024.1 |
URL: | https://voluntas.github.io/ |
概要
import { map, filter, partial, partialRight, curry, __, pipe } from "ramda" | |
const publishedInYear = curry((year, book) => book.year === year) | |
const titlesForYear = curry((year, books) => | |
pipe( | |
filter(publishedInYear(year)), | |
map(book => book.title), | |
)(books), | |
) |
import { compose, both, either, gte, prop, equals, __ } from "ramda" | |
const OUR_COUNTRY = "France" | |
const wasBornInCountry = compose( | |
equals(OUR_COUNTRY), | |
prop("birthCountry"), | |
) | |
const wasNaturalized = compose( | |
Boolean, |
<div id=root /> | |
<script type=module> | |
import React from 'https://dev.jspm.io/react@16' | |
import ReactDOM from 'https://dev.jspm.io/react-dom@16' | |
ReactDOM.render( | |
React.createElement('h1', null, 'hello'), | |
document.querySelector('#root') | |
) | |
</script> |
// include ramda library | |
var users = [ | |
{id:1, name: 'papas', is_published:true}, | |
{id:2, name: 'nick', is_published:false}, | |
{id:3, name: 'Jopahn', is_published:true} | |
]; | |
更新: | 2024-05-21 |
---|---|
作者: | @voluntas |
バージョン: | 2024.1 |
URL: | https://voluntas.github.io/ |
概要
import R from 'ramda'; | |
const items = [ | |
{id: 1, name: 'Al', country: 'AA'}, | |
{id: 2, name: 'Connie', country: 'BB'}, | |
{id: 3, name: 'Doug', country: 'CC'}, | |
{id: 4, name: 'Zen', country: 'BB'}, | |
{id: 5, name: 'DatGGboi', country: 'AA'}, | |
{id: 6, name: 'Connie', country: 'AA'}, | |
]; |
DaBi (short for Data Binding) is a dead simple yet complete and self-contained DOM-to-JS and JS-to-DOM data binding library in just 25 lines of pure ES5 and 454 bytes when minified.
Download it right here or include it into your HTML:
const R = require('ramda'); | |
const permutations = (tokens, subperms = [[]]) => | |
R.isEmpty(tokens) ? | |
subperms : | |
R.addIndex(R.chain)((token, idx) => permutations( | |
R.remove(idx, 1, tokens), | |
R.map(R.append(token), subperms) | |
), tokens); |
This is a collection of the most common commands I run while administering Postgres databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Postgres has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.
http://www.postgresql.org/download/linux/ubuntu/ https://help.ubuntu.com/community/PostgreSQL