Ramda | Sanctuary |
---|---|
add(a, b) |
add(b, a) |
addIndex(f) |
`` |
adjust(f, i, xs) |
`` |
all(f, xs) |
`` |
allPass(fs, x) |
allPass(fs, x) |
always(x) |
K(x) |
and(a, b) |
and(a, b) |
any(f, 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 immLens = key => lens((x) => x.get(key), (val, x) => x.set(key, val)) |
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
export const Validator = (value, props, ...customValidators) => (validators => validators.reduce((errors, validate) => [...errors, ...validate(value, props)], []))([ | |
// Here the list of validators | |
(value, props) => typeof value !== 'string' | |
|| props.type !== 'email' | |
|| /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(value.toLowerCase()) ? [] : [{error: Errors.EMAIL}], | |
(value, props) => typeof value !== 'string' | |
|| typeof props.maxLength === 'undefined' | |
|| parseInt(props.maxLength) >= value.length ? [] : [{error: Errors.MAXLENGTH, length: parseInt(props.maxLength)}], | |
/** | |
* Other validators here |
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
require("@babel/polyfill"); | |
const { | |
adt, | |
_, | |
fail, | |
Maybe, | |
Fn, | |
Arr, | |
implement, | |
Chain, |
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 fs = require('fs'); | |
const webpack = require('webpack'); | |
const { send } = require('micro'); | |
const config = require('./webpack.config'); | |
const webpackMiddleware = require('webpack-dev-middleware'); | |
const webpackHotMiddleware = require('webpack-hot-middleware'); | |
const compiler = webpack(config); | |
const middleware = (next) => { | |
const mw = webpackMiddleware(compiler, { |
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
tell application "Screen Sharing" | |
activate | |
tell application "Screen Sharing" | |
activate | |
tell application "System Events" | |
keystroke "osx-mini.local" -- "osx.mini.local" would need to be replaced by "YourComputerName or IP Address" | |
keystroke return | |
end tell | |
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
@mixin smart-underline($background: #fff, $text: #000, $selection: #ffc, $position: 86%){ | |
a { | |
color: inherit; | |
text-decoration: none; | |
background: -webkit-linear-gradient($background, $background), -webkit-linear-gradient($background, $background), -webkit-linear-gradient($text, $text); | |
background-size: .05em 1px, .05em 1px, 1px 1px; | |
background-repeat: no-repeat, no-repeat, repeat-x; | |
text-shadow: 0.03em 0 $background, -0.03em 0 $background, 0 0.03em $background, 0 -0.03em $background, 0.06em 0 $background, -0.06em 0 $background, 0.09em 0 $background, -0.09em 0 $background, 0.12em 0 $background, -0.12em 0 $background, 0.15em 0 $background, -0.15em 0 $background; | |
background-position-y: $position,$position, $position; | |
background-position-x: 0%, 100%, 0%; |
Write a function of type String -> Integer
. The input may or may not be a
valid JSON string. If it is valid, the resulting JavaScript value is expected
to be an object, but may not be. If it is an object, it is expected to have a
foo
property whose value is expected to be an object, but may not be. This
value is expected to have a bar
property which is expected to be an object
with a baz
property whose value is expected to be an array of strings.
Each of these strings is expected to be a hex representation of an integer
(e.g. 0xFF
). If every element of the array meets this expectation, the
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
<?php | |
// get all repos from yiiext | |
$response = file_get_contents("https://api.github.com/orgs/yiiext/repos"); | |
$repos = json_decode($response); | |
#var_dump($repos); | |
// get versions/tags | |
$satis = array(); | |
foreach($repos AS $num => $repo) { |
OlderNewer