This file contains hidden or 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 tax = R.curry((tax, price) => { | |
if (!_.isNumber(price)) return Left(new Error("Price must be numeric")); | |
return Right(price + (tax * price)); | |
}); | |
const discount = R.curry((dis, price) => { | |
if (!_.isNumber(price)) return Left(new Error("Price must be numeric")); |
This file contains hidden or 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 Validation = require('data.validation') //from folktalejs | |
const Success = Validation.Success | |
const Failure = Validation.Failure | |
const R = require('ramda'); | |
function isUsernameValid(a) { | |
return /^(0|[1-9][0-9]*)$/.test(a) ? Failure(["Username can't be a number"]) : Success(a) | |
} | |
function isPwdLengthCorrect(a) { |
This file contains hidden or 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
//https://github.com/rajaraodv/react-redux-blog/blob/master/app.js#L41-L63 | |
//middleware that checks if JWT token exists and verifies it if it does exist. | |
//In all the future routes, this helps to know if the request is authenticated or not. | |
app.use(function(req, res, next) { | |
// check header or url parameters or post parameters for token | |
var token = req.headers['authorization']; | |
if (!token) return next(); //if no token, continue | |
token = token.replace('Bearer ', ''); |
This file contains hidden or 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 { h, app } = hyperapp; | |
/** @jsx h */ | |
function Square(props) { | |
return ( | |
<button class="square" onclick={props.onClick}> | |
{props.value} | |
</button> | |
); | |
} |
This file contains hidden or 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
function Square(props) { | |
return ( | |
<button className="square" onClick={props.onClick}> | |
{props.value} | |
</button> | |
); | |
} | |
class Board extends React.Component { | |
renderSquare(i) { |
This file contains hidden or 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
{ | |
"name": "Default color scheme for shell prompts", | |
"groups": { | |
"hostname": { "fg": "brightyellow", "bg": "mediumorange", "attrs": [] }, | |
"environment": { "fg": "white", "bg": "darkestgreen", "attrs": [] }, | |
"mode": { "fg": "darkestgreen", "bg": "brightgreen", "attrs": ["bold"] }, | |
"attached_clients": { "fg": "white", "bg": "darkestgreen", "attrs": [] }, | |
"gitstatus": { "fg": "gray8", "bg": "gray2", "attrs": [] }, | |
"gitstatus_branch": { "fg": "gray8", "bg": "gray2", "attrs": [] }, |
This file contains hidden or 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
{ | |
"segments": { | |
"left": [ | |
{ | |
"function": "powerline.segments.shell.mode" | |
}, | |
{ | |
"function": "powerline.segments.common.net.hostname", | |
"priority": 10 | |
}, |
This file contains hidden or 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
arning Resolution field "[email protected]" is incompatible with requested version "react@^15.6.2" | |
warning Resolution field "[email protected]" is incompatible with requested version "react-dom@^15.6.2" | |
warning Resolution field "[email protected]" is incompatible with requested version "react@^15.4.1" | |
warning Resolution field "[email protected]" is incompatible with requested version "react@^15.0.2" | |
warning Resolution field "[email protected]" is incompatible with requested version "react-dom@^15.0.2" | |
[2/4] 🚚 Fetching packages... | |
[3/4] 🔗 Linking dependencies... | |
warning "firebase > @firebase/[email protected]" has unmet peer dependency "@firebase/app-types@^0.1.0". | |
warning "firebase > @firebase/[email protected]" has unmet peer dependency "@firebase/app-types@^0.1.0". | |
warning "firebase > @firebase/[email protected]" has unmet peer dependency "@firebase/app-types@^0.1.0". |
This file contains hidden or 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
//Note: This is just an example in Java. This shows how to print and also how to call that method. | |
//Feel free to change it to your language and framework needs | |
// Get the browser, viewport and device info from a variable like below or from a file or environment variable. | |
public static String browser = "Firefox"; | |
public static String viewport = "1200X700"; | |
public static String device = "Laptop"; | |
/** |
This file contains hidden or 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
//Note: This is just an example in JavaScript. This shows how to print and also how to call that method. | |
//Feel free to change it to your language and framework needs | |
const fs = require('fs'); | |
// Get the browser, viewport and device info from a variable like below or from a file or environment variable. | |
const browser = "Firefox"; | |
const viewport = "1200x700"; | |
const device = "Laptop"; |