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 validateParams = function (requestParams) { | |
return function (req, res, next) { | |
for (let param of requestParams) { | |
if (checkParamPresent(Object.keys(req.body), param)) { | |
let reqParam = req.body[param.param_key]; | |
if (!checkParamType(reqParam, param)) { | |
return res.send(400, { | |
status: 400, | |
result: `${param.param_key} is of type ` + | |
`${typeof reqParam} but should be ${param.type}` |
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
router.post('/abc', validateParams([ | |
{ | |
param_key: 'abc', | |
required: true, | |
type: 'string', | |
validator_functions: [(param) => {return param.length === 10}] | |
}]), routeFunction); | |
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
{% if include.image_src %} | |
<!-- If javascript is not on. --> | |
<noscript><img src="{{include.image_src}}" alt="{{include.image_alt}}" title="{{include.image_title}}" /></noscript> | |
<!-- If javascript is present. --> | |
<img data-src="{{include.image_src}}" alt="{{include.image_alt}}" title="{{include.image_title}}" class="blur-up lazyload" /> | |
{% endif %} |
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
{% include lazyload.html image_src="https://image.png" image_alt="Alt" image_title="Title" %} |
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
{% include toc.html content=page.content skip_toc=page.skip_toc%} | |
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
{% if include.skip_toc %} | |
{% assign content = include.content %} | |
{% assign h2_open_start = content | split: "<h2" %} | |
{% assign final_h2_texts = '' | split: '' %} | |
{% assign final_h2_ids = '' | split: '' %} | |
{% for h2_possible_open in h2_open_start %} | |
{% assign first_char = h2_possible_open | slice: 1,2 %} | |
{% if first_char == "id" %} | |
{% assign h2_text_start = h2_possible_open | split: ">" %} |
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
... | |
<section> | |
<h1>Reveal.js</h1> | |
<h3>The HTML Presentation Framework</h3> | |
<p> | |
<small>Created by <a href="http://hakim.se">Hakim El Hattab</a> and <a href="https://github.com/hakimel/reveal.js/graphs/contributors">contributors</a></small> | |
</p> | |
</section> | |
... |
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
{% include linked_post.html url="how-to-contribute-to-open-source-and-land-a-better-job" %} |
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
<div class="linked_post"> | |
{% for post in site.posts %} | |
{% assign post_url = post.url | replace: "/", "" %} | |
{% if post_url == include.url %} | |
<div class="linked_post_div"> | |
<article class="post"> | |
<h1><a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a></h1> | |
<p style="color: #969494; margin: 10px 0px; font-size: 18px;"> | |
{{ post.date | date: "%B %e, %Y" }} | |
</p> |
NewerOlder