text
stringlengths 7
3.69M
|
|---|
import posed from 'react-pose';
export default {
Container: posed.ol({
active: {
beforeChildren: false,
delayChildren: 200,
staggerChildren: 50,
opacity: 1,
},
inactive: {
beforeChildren: false,
delayChildren: 200,
staggerChildren: 50,
delay: 180,
opacity: 0,
},
}),
Column: posed.li({
active: {
y: 0,
beforeChildren: true,
delayChildren: 200,
staggerChildren: 50,
opacity: 1,
},
inactive: {
y: 20,
delayChildren: 200,
staggerChildren: 50,
opacity: 0,
},
}),
Row: posed.div({
active: { y: 0, opacity: 1 },
inactive: { y: 10, opacity: 0 },
}),
};
|
//var main_series_object = {
// // color: color or number
// // data: data,
// color: 3,
// label: "responding",
// // lines: specific lines options
// // bars: specific bars options
// // points: specific points options
// // xaxis: number
// // yaxis: number
// // clickable: true,
// // hoverable: true,
//};
var responding_serie_object = {
label: "responding at all",
}
var responding_on_time_serie_object = {
label: "responding on time",
}
var responding_ok_serie_object = {
label: "answering OK",
}
var counters_main_chart_options = {
xaxis: {
mode: "time",
minTickSize: [1, "minute"],
// tickColor: 1,
// ticks: [5, "minute"],
// tickSize: 1,
},
yaxis: {
min: 0,
max: 300,
},
// yaxis: { tickFormatter: function(v) { return v + " s"; }, },
series: {
lines: {
show: true,
fill: true,
steps: true,
},
// points: { show: true },
// threshold: { below: 0.1, color: "rgb(200, 20, 30)" },
points: {
radius: 2,
// show: true,
},
bars: {
// show: true,
},
stack: true,
},
// lines: { show: true, fill: true, fillColor: "rgba(255, 255, 255, 0.8)" },
// points: { show: true, fill: false },
selection: {
mode: "x"
},
grid: {
// aboveData: true,
// color: 1,
// labelMargin: 50,
// borderWidth: 0,
hoverable: true,
// clickable: true,
},
};
counters_overview_chart_options = {
series: {
lines: { show: true, lineWidth: 1, fill: true, steps: true },
stack: true,
},
xaxis: { mode: "time", },
yaxis: { ticks: 4, min: 0, max: 300, }, // a little hack :-) I can't force it to use 2 ticks (it does not strictly follow this contstrain, but apparently tries not to be too far away from it
selection: { mode: "x" },
};
function create_main_counters_chart(data) {
var series = data['duration_serie']; // TODO: rename
var d1 = [];
var d2 = [];
var d3 = [];
for (var i = 0; i < series.length; i += 1) {
d1.push([ series[i][0], series[i][1] ]);
d2.push([ series[i][0], series[i][2] ]);
d3.push([ series[i][0], series[i][3] ]);
// d3.push([series[i][0], parseInt(Math.random() * 30)]);
}
// serie = $.extend(main_series_object, {data: data['duration_serie']}); // wrap data (simple list of points) into object with settings (defined above)
// main_counters_chart = $.plot($("#counters_main_chart_div"), [serie], counters_main_chart_options);
/*
var d1 = [];
for (var i = 0; i <= 10; i += 1)
d1.push([i, parseInt(Math.random() * 30)]);
var d2 = [];
for (var i = 0; i <= 10; i += 1)
d2.push([i, parseInt(Math.random() * 30)]);
var d3 = [];
for (var i = 0; i <= 10; i += 1)
d3.push([i, parseInt(Math.random() * 30)]);
*/
s1 = $.extend(responding_serie_object, {data: d1});
s2 = $.extend(responding_on_time_serie_object, {data: d2});
s3 = $.extend(responding_ok_serie_object, {data: d3});
main_counters_chart = $.plot($("#counters_main_chart_div"), [s1, s2, s3], counters_main_chart_options);
$("#counters_aggregation_info").html(data['aggregation'] ? "Data series aggregated by Min on every<b> " + data['aggregation'] + "</b>" : ""); // set info text about aggregation period used
};
function reload_main_counters_chart(url) {
$.ajax({
url: url,
method: 'GET',
dataType: 'json',
success: create_main_counters_chart
});
};
function reload_overview_counters_chart() {
$.ajax({
url: COUNTERS_CHARTS_DATA_FETCH_URL_BASE,
method: 'GET',
dataType: 'json',
success: function(data) {
var series = data['duration_serie']; // TODO: rename
var d1 = [];
var d2 = [];
var d3 = [];
for (var i = 0; i < series.length; i += 1) {
d1.push([ series[i][0], series[i][1] ]);
d2.push([ series[i][0], series[i][2] ]);
d3.push([ series[i][0], series[i][3] ]);
// d3.push([series[i][0], parseInt(Math.random() * 30)]);
}
//counters_overview_chart = $.plot($("#counters_overview_chart_div"), [data['duration_serie']], counters_overview_chart_options);
counters_overview_chart = $.plot($("#counters_overview_chart_div"), [d1, d2, d3], counters_overview_chart_options);
create_main_counters_chart(data); // optimalization: for single request on page load to be sufficient
}
});
};
function init_counters_charts() {
$("#counters_main_chart_div").unbind();
$("#counters_overview_chart_div").unbind();
reload_overview_counters_chart();
// bind handler for main chart
$("#counters_main_chart_div").bind("plotselected", function(event, ranges) {
// recreate main chart with data from selected interval
reload_main_counters_chart(COUNTERS_CHARTS_DATA_FETCH_URL_BASE + Math.round(ranges.xaxis.from) + "-" + Math.round(ranges.xaxis.to));
// don't fire event on the overview to prevent eternal loop
counters_overview_chart.setSelection(ranges, true); // counters_overview_chart is global variable
});
// bind handler for overview chart
$("#counters_overview_chart_div").bind("plotselected", function(event, ranges) {
main_counters_chart.setSelection(ranges); // main_counters_chart is global variable
});
};
function insert_counters_charts(DOM_element_selector, data_fetch_url_base) { // Public function for inserting counters chart(s) in the document
$(DOM_element_selector).html('');
$(DOM_element_selector).append('<div id="counters_main_chart_div" class="main_chart_div"></div>');
$(DOM_element_selector).append('<div id="counters_overview_chart_div" class="overview_chart_div"></div>');
$(DOM_element_selector).append('<div id="counters_aggregation_info" class="chart_aggregation_info">Used aggregation:</div>');
$(DOM_element_selector).append('<div class="chart_button_reset"><button id="counters_button_reset">Reset</button></div>');
//<div class="chart_button_reset"><button id="duration_button_reset">Reset</button></div>'
COUNTERS_CHARTS_DATA_FETCH_URL_BASE = data_fetch_url_base;
init_counters_charts();
$("#counters_button_reset").click(function(event) {
init_counters_charts()
});
}
|
var
http = require("http"),
moduleStatic = require("node-static"),
file = new moduleStatic.Server("."),
LISTEN_PORT = 8081;
//<!--<script src="bower_components/requirejs/require.js" data-main="/app/main"></script>-->
// http.createServer(function(req, res) {
// if (req.url == "/") {
// file.serve(req, res);
// } else {
// setTimeout(function() {
// file.serve(req, res);
// }, 4000);
// }
// }).listen(LISTEN_PORT);
http.createServer(function(req, res) {
file.serve(req, res);
}).listen(LISTEN_PORT);
console.log("Server running on port " + LISTEN_PORT);
|
import { useEffect, useState } from 'react'
import Head from 'next/head'
// import Image from 'next/image'
import { Container, Row, Col, ButtonGroup, Button, Image, Form, Alert, Modal } from 'react-bootstrap';
import { PersonPlusFill, Award, UpcScan } from 'react-bootstrap-icons';
import Reward from './reward'
import History from './history'
// import liff from '@line/liff'
export default function Register(props) {
const [show, setShow] = useState(false);
const [info, setInfo] = useState('');
const [code, setCode] = useState()
const [friendFlag, setFriendFlag] = useState()
const [os, setOs] = useState('ios')
const [page, setPage] = useState('reward')
const handleClose = () => setShow(false);
const handleShow = () => setShow(true);
useEffect(async () => {
// const liff = (await import('@line/liff')).default
await liff.ready
const checkOs = liff.getOS()
setOs(checkOs)
console.log(checkOs)
liff.getFriendship().then(data => {
console.log('friendFlag: ', data)
if (data.friendFlag) {
setFriendFlag(data.friendFlag)
}
});
}, [])
const scanCode = async () => {
// await liff.ready
const liff = (await import('@line/liff')).default
// await liff.ready
if (liff.isInClient() && liff.getOS() === "android") {
const result = await liff.scanCode()
// alert(JSON.stringify(result))
setCode(result.value)
} else {
alert('Not support')
}
}
const changePage = (page) => {
setPage(page)
console.log('page', page)
}
const collect = async () => {
// setInfo(code)
setInfo('loading...')
handleShow()
// console.log(props.users.users_id)
// handleShow()
// alert(point)
const res = await fetch('/api/reward/collect_point/'+props.users.users_id+'/5/'+code, {
headers: {
'Content-Type': 'application/json'
},
method: 'GET'
})
const result = await res.json()
setInfo(result.message)
}
return (
<section>
<Head>
<title>My Profile</title>
</Head>
<Container fluid="md" className="m-2 p-2">
<Row className="justify-content-md-center mb-2">
<Col className="text-center">
<h4>My Profile</h4>
</Col>
</Row>
<div className="profile-box">
<Row className="justify-content-md-center mb-2">
<Col xs={4} className="text-center">
{props.profile.pictureUrl && <Image
src={props.profile.pictureUrl}
alt={props.profile.displayName}
width={96}
height={96}
roundedCircle
/>}
<div className="mt-1 mb-1">
<h5><Award size={24} />{' '} 5,000</h5>
</div>
{/* <div>{props.profile.displayName}</div>
<div>{props.profile.userId}</div> */}
</Col>
<Col xs={8} className="text-left">
<h5>{props.users.fullname}</h5>
<div>{props.users.email}</div>
<div>{props.users.mobile}</div>
<div className="mt-1">
{!friendFlag && <Button variant="success" size="sm">
<PersonPlusFill size={18} />{' '}Add Friend
</Button>}
</div>
</Col>
</Row>
</div>
<Row className="justify-content-md-center mt-2">
<Col className="text-center">
<ButtonGroup className="d-flex" aria-label="First group">
<Button variant="info" className="w-100" onClick={() => changePage('reward')}>Reward</Button>
<Button variant="info" className="w-100" onClick={() => changePage('collect')}>Collect Point</Button>
<Button variant="info" className="w-100" onClick={() => changePage('history')}>History</Button>
</ButtonGroup>
</Col>
</Row>
{page === 'reward' && <Row className="justify-content-md-center mt-2">
<Col xs={12} className="text-center">
<Reward users={props.users} />
</Col>
</Row>}
{page === 'collect' && <Row className="justify-content-md-center mt-2">
<Col xs={12} className="text-center">
<h5>Collect Point</h5>
</Col>
<Col xs={os === "ios" ? 12 : 8} className="text-center">
<Form.Group>
<Form.Control id="code" name="code" defaultValue={code} type="text" placeholder="Code" className="w-100" onChange={e => { setCode(e.currentTarget.value); }} required />
</Form.Group>
</Col>
{os === "android" && <Col xs={4} className="text-center">
<Button variant="primary" className="w-100" onClick={scanCode}>
<UpcScan />{' '}Scan
</Button>
</Col>}
<Col xs={12} className="text-center">
<Button variant="primary" onClick={() => collect()} className="w-100">
Save
</Button>
</Col>
</Row>}
{page === 'history' && <Row className="justify-content-md-center mt-2">
<Col xs={12} className="text-center">
<History users={props.users} />
</Col>
</Row>}
</Container>
<style jsx>{`
.profile-box {
border: 1px solid #ccc;
border-radius: 10px;
padding: 15px;
}
`}</style>
<Modal
show={show}
onHide={handleClose}
size="md"
aria-labelledby="contained-modal-title-vcenter"
centered
>
<Modal.Header closeButton>
<Modal.Title>Information</Modal.Title>
</Modal.Header>
<Modal.Body>{info}</Modal.Body>
<Modal.Footer>
<Button variant="secondary" onClick={handleClose}>
Close
</Button>
</Modal.Footer>
</Modal>
</section>
)
}
|
import React from "react";
import { FiExternalLink } from "react-icons/fi";
import img3 from "../../images/conig.png";
const Conig = () => {
return (
<div className="modal">
<div className="modal-image-container">
<img src={img3} alt="img1" className="modal-img" />
</div>
<div className="modal-info">
<div className="modal-title">CONIG</div>
<div className="modal-tag">Process Solution</div>
<div className="modal-description">
{" "}
CONIG® (Converged Information Governance) is a governance framework
developed by TAC A.S. addressing information and related technologies.
Its main focus is INFORMATION. CONIG® is based on models that are
widely used for Information Technologies, Corporate Governance as well
as Business Governance.
</div>
<div className="modal-button">
<FiExternalLink className="linkicon" />
<a
className="modal-link"
target="_blank"
rel="noopener noreferrer"
href="http://www.conig.org/"
>
LEARN MORE
</a>
</div>
</div>
</div>
);
};
export default Conig;
|
/*
* @lc app=leetcode.cn id=448 lang=javascript
*
* [448] 找到所有数组中消失的数字
*/
// @lc code=start
/**
* @param {number[]} nums
* @return {number[]}
*/
var findDisappearedNumbers = function(nums) {
var res = [];
var n = nums.length
for (const num of nums) {
var x = (num - 1) % n;
nums[x] += n
}
for (const [index, num] of nums.entries()) {
if (num <= n) {
res.push(index + 1)
}
}
return res;
};
// @lc code=end
|
import __initBottom from '../__init/bottom'
import '../../js/load-background-img'
import makeClassGetter from '../__mcg'
const renameMaps = { }
__initBottom()
import { Component, render, h } from '@externs/preact'
import { makeIo, init, start } from '../__competent-lib'
import Comments from '../../../articles/components/comments.jsx'
import Parallax from 'splendid/build/components/parallax'
const __components = {
'comments': Comments,
'parallax': Parallax,
}
const io = makeIo()
/** @type {!Array<!preact.PreactProps>} */
const meta = [{
key: 'comments',
id: 'preact-div',
},
{
key: 'parallax',
id: 'c8757',
props: {
'background-image': '../articles/img/tile.jpg',
},
}]
meta.forEach(({ key, id, props = {}, children = [] }) => {
const Comp = __components[key]
const plain = Comp.plain || (/^\s*class\s+/.test(Comp.toString()) && !Component.isPrototypeOf(Comp))
props.splendid = { mount: '/', addCSS(stylesheet) {
return makeClassGetter(renameMaps[stylesheet])
} }
const ids = id.split(',')
ids.forEach((Id) => {
const { parent, el } = init(Id, key)
if (!el) return
const renderMeta = /** @type {_competent.RenderMeta} */ ({ key, id: Id, plain })
let comp
el.render = () => {
comp = start(renderMeta, Comp, comp, el, parent, props, children, { render, Component, h })
return comp
}
el.render.meta = renderMeta
io.observe(el)
})
})
|
phantom.injectJs('chance.min.js');
var casper = require('casper').create();
casper.start("http://google.com/", function() {
this.echo('random: ' + chance.phone());
});
casper.run();
|
const path = require("path");
const express = require("express");
const helmet = require('helmet');
const mongoose = require("mongoose");
const compression = require('compression');
const app = express();
const routes = require("./routes");
// refactored to use helmet set security-related HTTP response headers
app.use(helmet())
// support parsing of application/json type post data and limit payload
app.use(express.json({ limit: '300kb' }));
//support parsing of application/x-www-form-urlencoded post data
app.use(express.urlencoded({ extended: true }));
// set up static folder
app.use(express.static(path.join(__dirname, './client/build')))
// compress response to improve performance when displaying to clients
app.use(compression());
// use our crud routes
app.use(routes);
module.exports = app;
|
console.log("hello world :o");
var info;
$.getJSON('/info/', function(body) {
//console.log(body);
info = body;
}).fail(function( jqxhr, textStatus, error ) {
var err = textStatus + ", " + error;
//console.log("Text: " + jqxhr.responseText);
console.log( "Request Failed: " + err );
});
let answers = {};
let clicked;
$("body").on("click", (e) => {
clicked = $(e.target);
console.log(clicked);
});
$("button#start").on("click", (e) => {
answers.id = $("input#idnumber").val();
$("div#container").css("display", "block");
console.log(answers);
});
$("rect.text").on("click", (e) => {
clicked = $(e.target);
$("body").off("keypress");
//console.log($(e.target).attr("x"));
$("rect.text").attr("style", "stroke:black;stroke-width:1");
$(e.target).attr("style", "stroke:blue;stroke-width:2");
let text = $(e.target).next().text();
if (clicked.is("rect.text")) {
console.log(clicked);
$("body").on("keypress", (ee) => {
console.log(ee.which);
if (text.length > 0 && ee.which === 8) {
text = text.slice(0, -1);
} else if (ee.which > 64 && ee.which < 123 && ![91,92,93,94,95,96].includes(ee.which)) {
text += String.fromCharCode(ee.which);
}
$(e.target).next().text(text);
answers[e.target.id] = text;
console.log(answers);
});
} else {
$(this).off("keypress");
}
});
$("input").on("click", (e) => {
$("body").off("keypress");
//$(e.target).off("keypress");
// $("rect.text").attr("style", "stroke:black;stroke-width:1");
});
$("input").on("change", (e) => {
console.log(e.target);
answers[e.target.id] = $(e.target).val();
console.log(answers);
});
var label;
var svg = document.getElementById("svg-q2");
let notestems = [];
$("#buttons button").on("click", (e) => {
label = e.target.id;
if (["note2","note3", "barline"].includes(label)) {
$("path").off("mouseenter mouseleave");
$("path").attr("style", "");
$("#notes").attr("style", "stroke: black; stroke-width: 1px; fill: black; fill-rule: evenodd;");
$(svg).hover(function() {
let url = "url(https://cdn.glitch.com/ba66e22e-49d8-46fa-abb2-cdd3790b12e6%2F"+label+".png"+(info[label] ? `?${info[label].urlend}${info[label].coord}` : ")");
$(this).css("cursor", url + ", crosshair");
});
} else {
$("path").attr("style", "");
$("#notes").attr("style", "stroke: black; stroke-width: 1px; fill: black; fill-rule: evenodd;");
$(svg).hover(function() {
$(svg).css("cursor", "auto");
});
}
if (label === "eraser") {
$("#notes").hover(function() {
$(this).css("cursor", "no-drop");
});
$("#stems").hover(function() {
$(this).css("cursor", "no-drop");
});
$("#barlines").hover(function() {
$(this).css("cursor", "no-drop");
});
}
if (label === "select") {
$("path").attr("style", "");
$("#notes").hover(function() {
$(this).css("cursor", "pointer");
});
}
if (["stemup", "stemdown"].includes(label)) {
$("#notes").hover(function() {
$(this).css("cursor", "auto");
});
}
if (["stemup", "stemdown"].includes(label) && notestems.length) {
$("path").attr("style", "");
$("#notes").attr("style", "stroke: black; stroke-width: 1px; fill: black; fill-rule: evenodd;");
for (let i = 0; i < notestems.length; i++) {
let x = notestems[i].x;
let y;
let v;
switch (label) {
case "stemup":
x += 10;
y = Math.max(...notestems[i].y);
v = Math.min(...notestems[i].y)-y-35;
break;
case "stemdown":
y = Math.min(...notestems[i].y);
v = Math.max(...notestems[i].y)-y+35;
break;
}
let element = document.createElementNS('http://www.w3.org/2000/svg', 'path');
element.setAttributeNS(null, "d", `M ${x} ${y} v ${v}`);
document.getElementById("stems").appendChild(element);
}
notestems = [];
}
});
$(svg).on("click", (e) => {
if (["note2","note3"].includes(label) && $(e.target).is("rect")) {
let y = Math.ceil(Number($(e.target).attr("y"))/5)*5;
if (label === "note2") y+=3.5;
console.log(y);
let element = document.createElementNS('http://www.w3.org/2000/svg', 'path');
element.setAttributeNS(null, "d", `M ${Number($(e.target).attr("x"))+12} ${y} ${info[label].path}`);
let notes = document.getElementById("notes");
notes.appendChild(element);
} else if (label === "eraser" && $(e.target).is("path")) {
console.log($(e.target).parent().attr("id"));
let notes = document.getElementById($(e.target).parent().attr("id"));
notes.removeChild(e.target);
} else if (label === "barline" && $(e.target).is("rect")) {
let element = document.createElementNS('http://www.w3.org/2000/svg', 'path');
element.setAttributeNS(null, "d", `M ${Number($(e.target).attr("x"))+17} 80 v 120`);
document.getElementById("barlines").appendChild(element);
} else if (label === "select" && $(e.target).parent().attr("id") === "notes") {
$(e.target).attr("style", "fill:blue; stroke:blue");
let arr = $(e.target).attr("d").split(" ");
let x = Number(arr[1]);
let i = notestems.findIndex(o => o.x === x);
if (i > -1) {
notestems[i].y.push(Number(arr[2])-3.5);
} else {
notestems.push({x: x, y: [Number(arr[2])-3.5]});
}
console.log(notestems);
}
});
|
import React, { Component } from 'react';
import { connect } from 'react-redux';
import fetchPosts, { thumbnailDefault } from '../actions/FetchPosts';
import Pagination from './Pagination';
class PostsList extends Component {
constructor(props) {
super(props);
this.state = {
paginationCount: 25
}
this.handleClickPagination = this.handleClickPagination.bind(this);
}
componentWillMount() {
this.props.fetchPosts(this.props.location.pathname);
}
renderPosts() {
if (!this.props.posts.data) {
return (
<h5>____Loading...</h5>
);
}
const posts = this.props.posts.data.children
return posts.map((post) => {
const thumbnail = this.isUrl(post.data.thumbnail) ? post.data.thumbnail : thumbnailDefault;
return (
<li className="list-group-item" key={post.data.id}>
<img src={thumbnail} width="70" height="52" alt="" />
<a onClick={(event) => this.didSelectLink(event, post)}>
<strong > {post.data.title} </strong>
</a>
</li>
);
})
}
didSelectLink(e, post) {
window.open(post.data.url, "_self")
}
handleClickPagination(pathComponent) {
if (!pathComponent) return;
var count = this.state.paginationCount;
count = (pathComponent && pathComponent.includes('before')) ? (count - 25) : (count + 25);
this.props.fetchPosts(this.props.location.pathname, pathComponent, count);
this.setState((prevState, props) => {
return { paginationCount: count }
});
}
render() {
const data = this.props.posts.data || {}
const title = this.props.location.pathname;
return (
<div >
<h1> Posts for - {title}</h1>
<ul className="list-group">
{this.renderPosts()}
</ul>
<Pagination after={data.after}
before={data.before}
onClickPagination={this.handleClickPagination} >
</Pagination>
</div>
);
}
isUrl(s) {
var regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
return regexp.test(s);
}
}
function mapStateToProps(state) {
return { posts: state.posts.all };
}
export default connect(mapStateToProps, { fetchPosts })(PostsList);
|
const { Stream: $ } = require('xstream')
const Cycle = require('component')
const dropRepeats = require('xstream/extra/dropRepeats').default
const Factory = require('utilities/factory')
const WithFocusable = (options = {}) => {
const {
key = 'isFocused',
getFocusEvent$ = (sinks, sources) => sources.DOM.events('focus'),
getBlurEvent$ = (sinks, sources) => sources.DOM.events('blur')
} = options
return component => {
return Cycle(component)
.after((sinks, sources) => ({
...sinks,
setFocused$: sinks.setFocused$ || $.merge(
getFocusEvent$(sinks, sources).mapTo(true),
getBlurEvent$(sinks, sources).mapTo(false),
).startWith(false)
.compose(dropRepeats())
}))
.transition({
name: 'setFocused',
from: (sinks) => sinks.setFocused$
.map(Boolean),
reducer: isFocused => (state = {}) => ({
...state,
[key]: isFocused,
isFocusable: true
})
})
}
}
const makeFocusable = Factory(WithFocusable)
module.exports = {
default: makeFocusable,
makeFocusable,
WithFocusable
}
|
$(document).ready(function() {
"use strict";
var av_name = "RegExConvertCON";
var av = new JSAV(av_name, {animationMode: "none"});
var url1 = "../../../AV/VisFormalLang/Regular/Machines/RegExCon1.jff";
var url2 = "../../../AV/VisFormalLang/Regular/Machines/RegExCon2.jff";
new av.ds.FA({left: 0, url: url1});
new av.ds.FA({left: 400, url: url2});
av.displayInit();
av.recorded();
});
|
import axios from "axios";
const createAccount = async (username, password) => {
try {
return await axios.post(
"/api/createAccount",
{
username,
password,
},
{
headers: {
"Content-Type": "application/json",
},
}
);
} catch (err) {
console.log(err);
}
};
export default createAccount;
|
function VerifForm(form) {
var nomPrenom = document.getElementById('form').nomPrenom.value;
var codeClient = document.getElementById('form').codeClient.value;
var adresse = document.getElementById('form').adresse.value;
if (codeClient == "") {
document.getElementById('msg_erreur_code').innerHTML= '▼Veuillez Saisir un Code Client Unique !';
document.getElementById('msg_erreur_code').style.display='block';
document.getElementById('msg_erreur_code').className='focus';
form.codeClient.focus();
return false;
} else {
document.getElementById('msg_erreur_code').style.display='none';
}
if (nomPrenom == "") {
document.getElementById('msg_erreur_nom').innerHTML= '▼Veuillez indiquer Nom et Prenom !';
document.getElementById('msg_erreur_nom').style.display='block';
document.getElementById('msg_erreur_nom').className='focus';
form.nomPrenom.focus();
return false;
} else {
document.getElementById('msg_erreur_nom').style.display='none';
}
if (adresse == "") {
document.getElementById('msg_erreur_adresse').innerHTML= '▼Veuillez Saisir l\'adresse !';
document.getElementById('msg_erreur_adresse').style.display='block';
document.getElementById('msg_erreur_adresse').className='focus';
form.adresse.focus();
return false;
} else {
document.getElementById('msg_erreur_adresse').style.display='none';
}
return true;
}
function resetForm() {
document.getElementById("form").reset();
}
// function search to filter table
function search() {
// Declare variables
var input, filter, table, tr, td, i;
input = document.getElementById("searchInput");
filter = input.value.toUpperCase();
table = document.getElementById("clientTable");
tr = table.getElementsByTagName("tr");
// Loop through all table rows, and hide those who don't match the search query
for (i = 0; i < tr.length; i++) {
td = tr[i].getElementsByTagName("td")[1];
if (td) {
if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
} else {
tr[i].style.display = "none";
}
}
}
}
|
import React, {useState} from 'react';
import styled from 'styled-components'
// Test git branch
// ===============
const theme = {
green: {
default: '#21D19F',
hover: '#45B69C'
}
}
const Container = styled.div`
display: flex;
justify-content: center;
width:100%;
`
const Button = styled.button`
background-color: ${props => theme[props.theme].default};
border: none;
border-radius: 5px;
box-shadow: 0px 4px 4px lightgray;
color: white;
cursor: pointer;
display: inline;
font-size: 2em;
margin: 0px 50px;
margin-top: 50vh;
outline: 0;
/*padding: 15px;*/
text-transform: uppercase;
transition: ease background-color 300ms;
width: 20%;
&:hover {
background-color: ${props => theme[props.theme].hover};
}
}
`
Button.defaultProps ={
theme: 'green'
}
const ButtonToggle = styled(Button)`
opacity: .5;
${({active}) => active&& `
opacity: 1;
`}
`;
const types = ['BTN1', 'BTN2', 'BTN3'];
function ToggleGroup() {
const [active, setActive] = useState(types[0]);
return <>
{types.map(type=>(
<ButtonToggle
active={active === type}
onClick={() => setActive(type)}>
{type}
</ButtonToggle>
))}
</>
}
export default function App() {
return (
<>
<Container>
<ToggleGroup/>
</Container>
</>
)
}
|
app.controller('LogoutController', ['$scope','$location', 'LoginService', function($scope, $location, LoginService){
localStorage.removeItem('player');
$location.path("/login");
}]);
|
/**
* CSS unicode-bidi property
* No description available.
* @see This feature comes from MDN: https://developer.mozilla.org/en-US/search?q=CSS+unicode-bidi+property
*/
/**
* @type {import('../features').Feature}
*/
export default {
'unicode-bidi': true,
};
|
const imATOM = artifacts.require('IMATOM');
module.exports = function (deployer) {
deployer.deploy(imATOM);
};
|
import { useState, useEffect } from "react";
import axios from "axios";
function useFetch() {
const [data, setData] = useState([]);
const fetchData = async () => {
const { data } = await axios.get("http://localhost:3001/cars");
setData(data);
};
useEffect(() => {
fetchData();
}, []);
return [...data];
}
export default useFetch;
|
import ZUser from "./user.vue"
const zUser = {
install:function(Vue){
Vue.component("zUser",ZUser)
}
}
export default zUser;
|
'use strict';
angular.module('projetCineFilms')
.factory('NewUser', function ($location, authRef) {
function createnewuser (email, password) {
console.log(authRef);
authRef.$createUser({
email: email,
password: password
}).then(function(userData) {
console.log('User created with uid : ' + userData.uid);
}).catch(function(error) {
console.log('User not created : ' + error);
});
$location.path('/login');
};
return {
createnewuser: createnewuser
}
});
|
import "./index.css"
import React from "react";
import ReactDOM from "react-dom";
import Header from "../header/header.js";
import Nav from "../nav/nav.js";
import Main from "../main/main.js"
class App extends React.Component{
constructor(props){
super(props);
this.state = {
filter: null
}
}
setFilter(filter){
this.setState({
filter: filter
})
}
render(){
return <>
<Nav setFilter={this.setFilter.bind(this)}/>
<Header/>
<Main filter={this.state.filter}/>
</>;
}
}
ReactDOM.render(
<App/>,
document.querySelector("#root")
);
|
import styled from 'styled-components'
const Text = styled.p`
font-size: ${({fontSize}) => fontSize};
font-weight: ${({fontWeight}) => fontWeight};
text-transform: ${({textTransform}) => textTransform};
padding: ${({padding}) => padding};
margin: ${({margin}) => margin};
`
Text.defaultProps = {
fontSize: '1.4em',
fontWeight: 'normal',
textTransform: 'initial',
padding: '0',
margin: '0',
}
export default Text
|
import React from 'react';
import Avatar from '@material-ui/core/Avatar';
import CheckCircleOutlinedIcon from '@material-ui/icons/CheckCircleOutlined';
import './chnnelRow.css';
function ChnnelRow({image,chnnel,verifed,subs,numofvideos,description}) {
return (
<div className="chnnel_row">
<Avatar className="chnnel_row_logo"
alt={chnnel} src={image} />
<div className="chnnel_text">
<h4>{chnnel} {verifed && <CheckCircleOutlinedIcon />}</h4>
<p>
{subs} subscribers * {numofvideos} videos
</p>
<p>
{description}
</p>
</div>
</div>
)
}
export default ChnnelRow
|
var pageSize = 20;
/**********************************************************************群組管理主頁面**************************************************************************************/
//群組管理Model
Ext.define('gigade.WCT4', {
extend: 'Ext.data.Model',
fields: [
{ name: "content_id", type: "int" },
{ name: "site_id", type: "int" },
{ name: "site_name", type: "string" },
{ name: "page_id", type: "int" },
{ name: "page_name", type: "string" },
{ name: "area_id", type: "int" },
{ name: "area_name", type: "string" },
{ name: "type_id", type: "int" },
{ name: "content_html", type: "string" },
{ name: "content_image", type: "string" },
{ name: "content_default", type: "int" },
{ name: "content_status", type: "int" },
{ name: "link_url", type: "string" },
{ name: "brand_name", type: "string" },
{ name: "link_mode", type: "int" },
{ name: "update_on", type: "string" },
{ name: "created_on", type: "string" }
]
});
//到Controller獲取數據
var WCT4Store = Ext.create('Ext.data.Store', {
autoDestroy: true, //自動消除
pageSize: pageSize,
model: 'gigade.WCT4',
proxy: {
type: 'ajax',
url: '/WebContentType/WebContentTypelist4',
reader: {
type: 'json',
root: 'data',
totalProperty: 'totalCount'//總行數
}
}
});
//勾選框
var sm = Ext.create('Ext.selection.CheckboxModel', {
listeners: {
selectionchange: function (sm, selections) {
Ext.getCmp("gdFgroup").down('#edit').setDisabled(selections.length == 0);
}
}
});
WCT4Store.on('beforeload', function () {
Ext.apply(WCT4Store.proxy.extraParams, {
serchcontent: Ext.getCmp('serchcontent').getValue()
});
});
function Query(x) {
WCT4Store.removeAll();
Ext.getCmp("gdFgroup").store.loadPage(1, {
params: {
serchcontent: Ext.getCmp('serchcontent').getValue()
}
});
}
Ext.onReady(function () {
var gdFgroup = Ext.create('Ext.grid.Panel', {
id: 'gdFgroup',
store: WCT4Store,
width: document.documentElement.clientWidth,
columnLines: true,
frame: true,
columns: [
{ header: CONTENTID, dataIndex: 'content_id', width: 70, align: 'center' },
{ header: SITEID, dataIndex: 'site_name', width: 120, align: 'center' },
{ header: PAGEID, dataIndex: 'page_name', width: 120, align: 'center' },
{ header: AREAID, dataIndex: 'area_name', width: 130, align: 'center' },
{ header: TYPRID, dataIndex: 'type_id', width: 130, align: 'center', hidden: true },
{ header: BRANDID, dataIndex: 'brand_name', width: 130, align: 'center' },
{ header: HOMETEXT, dataIndex: 'content_html', width: 130, align: 'center',
renderer: function (val) {
var xiaohao = new RegExp("<", "g");
var dahao = new RegExp(">", "g");
val = val.replace(xiaohao, "<").replace(dahao, ">");
return val;
}
},
{ header: CONTENTDEFAULT, dataIndex: 'content_default', width: 130, align: 'center',
renderer: function (val) {
switch (val) {
case 0:
return CONTENTDEFAULT;
break;
case 1:
return NOCONTENTDEFAULT;
break;
}
}
},
{ header: LINKURL, dataIndex: 'link_url', width: 130, align: 'center' },
{ header: LINKMODE, dataIndex: 'link_mode', width: 130, align: 'center',
renderer: function (val) {
switch (val) {
case 0:
return NOLINKMODE;
break;
case 1:
return OLDLINKMODE;
break;
case 2:
return LINKMODE;
break;
}
}
},
{ header: UPDATEON, dataIndex: 'update_on', width: 130, align: 'center' },
{ header: CREATEDON, dataIndex: 'created_on', width: 130, align: 'center' },
{ header: CONTENTSTATUS,
dataIndex: 'content_status',
id: 'con_status',
// hidden: true,
align: 'center',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
if (value == 1) {
return "<a href='javascript:void(0);' onclick='UpdateActive(" + record.data.content_id + "," + record.data.page_id + "," + record.data.area_id + ")'><img hidValue='0' id='img" + record.data.content_id + "' src='../../../Content/img/icons/accept.gif'/></a>";
} else {
return "<a href='javascript:void(0);' onclick='UpdateActive(" + record.data.content_id + "," + record.data.page_id + "," + record.data.area_id + ")'><img hidValue='1' id='img" + record.data.content_id + "' src='../../../Content/img/icons/drop-no.gif'/></a>";
}
}
}
],
tbar: [
{ xtype: 'button', text: ADD, id: 'add', hidden: false, iconCls: 'icon-user-add', handler: onAddClick },
{ xtype: 'button', text: EDIT, id: 'edit', hidden: true, iconCls: 'icon-user-edit', disabled: true, handler: onEditClick }
,
'->',
{ xtype: 'textfield', fieldLabel: "查詢內容", id: 'serchcontent', labelWidth: 55 },
{
text: "搜索",
iconCls: 'icon-search',
id: 'btnQuery',
hidden: false,
handler: Query
}
],
bbar: Ext.create('Ext.PagingToolbar', {
store: WCT4Store,
pageSize: pageSize,
displayInfo: true,
displayMsg: NOW_DISPLAY_RECORD + ': {0} - {1}' + TOTAL + ': {2}',
emptyMsg: NOTHING_DISPLAY
}),
listeners: {
scrollershow: function (scroller) {
if (scroller && scroller.scrollEl) {
scroller.clearManagedListeners();
scroller.mon(scroller.scrollEl, 'scroll', scroller.onElScroll, scroller);
}
}
},
selModel: sm
});
Ext.create('Ext.container.Viewport', {
layout: 'fit',
items: [gdFgroup],
renderTo: Ext.getBody(),
autoScroll: true,
listeners: {
resize: function () {
gdFgroup.width = document.documentElement.clientWidth;
this.doLayout();
}
}
});
ToolAuthority();
WCT4Store.load({ params: { start: 0, limit: pageSize} });
});
/********************************************新增*****************************************/
onAddClick = function () {
editFunction(null, WCT4Store);
}
/*********************************************編輯***************************************/
onEditClick = function () {
var row = Ext.getCmp("gdFgroup").getSelectionModel().getSelection();
if (row.length == 0) {
Ext.Msg.alert(INFORMATION, NO_SELECTION);
} else if (row.length > 1) {
Ext.Msg.alert(INFORMATION, ONE_SELECTION);
} else if (row.length == 1) {
editFunction(row[0], WCT4Store);
}
}
//更改活動狀態(設置活動可用與不可用)
function UpdateActive(id, pageId, areaId) {
var activeValue = $("#img" + id).attr("hidValue"); //hidValue=1時是將要變成啟用
var limitN = 0;
var listN = 0;
Ext.Ajax.request({
url: "/WebContentType/GetDefaultLimit",
method: 'post',
async: false, //true為異步,false為異步
params: {
storeType: "web_content_type4",
site: "7",
page: pageId,
area: areaId
},
success: function (form, action) {
var result = Ext.decode(form.responseText);
if (result.success) {
listN = result.listNum;
limitN = result.limitNum;
}
}
});
if (activeValue == "1" && listN >= limitN && limitN != 0) {//list的值大於或等於limit的值時提示信息,yes時執行,no時返回
Ext.Msg.confirm(CONFIRM, Ext.String.format(STATUSTIP), function (btn) {
if (btn == 'yes') {
Ext.Ajax.request({
url: "/WebContentType/UpdateActive",
method: 'post',
params: { id: id,
active: activeValue,
storeType: "type4"
},
success: function (form, action) {
var result = Ext.decode(form.responseText);
if (result.success) {
WCT4Store.load();
if (activeValue == 1) {
$("#img" + id).attr("hidValue", 0);
$("#img" + id).attr("src", "../../../Content/img/icons/accept.gif");
} else {
$("#img" + id).attr("hidValue", 1);
$("#img" + id).attr("src", "../../../Content/img/icons/drop-no.gif");
}
}
else {
Ext.Msg.alert(INFORMATION, FAILURE);
}
},
failure: function () {
Ext.Msg.alert(INFORMATION, FAILURE);
}
});
}
else { return; }
});
}
else {
Ext.Ajax.request({
url: "/WebContentType/UpdateActive",
method: 'post',
params: { id: id,
active: activeValue,
storeType: "type4"
},
success: function (form, action) {
var result = Ext.decode(form.responseText);
if (result.success) {
//WCT4Store.load();
WCT4Store.load({ params: { serchcontent: Ext.getCmp('serchcontent').getValue() } });
if (activeValue == 1) {
$("#img" + id).attr("hidValue", 0);
$("#img" + id).attr("src", "../../../Content/img/icons/accept.gif");
} else {
$("#img" + id).attr("hidValue", 1);
$("#img" + id).attr("src", "../../../Content/img/icons/drop-no.gif");
}
}
else {
Ext.Msg.alert(INFORMATION, FAILURE);
}
},
failure: function () {
Ext.Msg.alert(INFORMATION, FAILURE);
}
});
}
}
|
import FeedPreviewTable from './FeedPreviewTable';
export default FeedPreviewTable;
|
// Requires jQuery and jQuery Color
// Extend jQuery object, requires jQuery Color:
$.fn.animateBGColor = function(color, duration) {
var prevBGColor = this.css('backgroundColor');
this.stop().css('background-color', color).
animate({backgroundColor: prevBGColor }, duration);
};
$(document).ready(function() {
var form = $('#main-form');
var messageContainer = $('#message');
messageContainer.hide(); // Initially hidden
errorMessage = "No hemos podido procesar su petición. Por favor, vuelva a intentarlo más adelante.";
successMessage = "Muchas gracias por enviarnos su oferta.";
highlightColor = '#FFFF9C';
highlightDurationMs = 1000;
form.submit(function(event) {
var fields = form.serializeArray();
$.ajax(form.attr('action'), {
dataType: 'json',
type: 'POST',
data: fields,
error: function() {
messageContainer.text(errorMessage);
if(!messageContainer.is(':visible')) {
messageContainer.fadeIn(600);
}
else {
messageContainer.animateBGColor(highlightColor, highlightDurationMs);
}
},
success: function(data) {
var storeSucceeded = (data.stored == 'Success');
if(storeSucceeded) {
messageContainer.text(successMessage);
// No need to animate this. The form is going to be hidden.
messageContainer.show();
form.fadeOut(400, function() { form.hide() });
}
else {
this.error();
}
}
});
event.preventDefault();
});
});
|
angular.module('app.controller',['app.service'])
.controller('postController',function($scope,Service){
$scope.posts={};
//função para pega os dados da APIs
function GetAllPosts()
{
var getPostsData = Service.getPosts();
getPostsData.then(function (post) {
$scope.posts = post.data;
}, function(err) {
console.error('ERR', err.status);
});
}
GetAllPosts();
});
|
import React from 'react';
import ReactDOM from 'react-dom';
import PersonManager from './PersonManager';
// import TestManager from './TestManager';
import './index.css';
import './styles/borders.css';
import './styles/colors.css';
import './styles/fonts.css';
import './styles/heights.css';
import './styles/margins.css';
import './styles/misc.css';
import './styles/paddings.css';
import './styles/text.css';
import './styles/widths.css';
import 'primeflex/primeflex.css';
ReactDOM.render(<PersonManager />, document.getElementById('root'));
// ReactDOM.render(<TestManager />, document.getElementById('root'));
|
let http = require("request")
function getZingMp3URL(id) {
http.get({
"headers": {
"Sec-Fetch-Site": "cross-site",
"Sec-Fetch-Mode": "cors",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "vi-VN,vi;q=0.9,fr-FR;q=0.8,fr;q=0.7,en-US;q=0.6,en;q=0.5",
"Accept": "*/*",
"User-Agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Mobile Safari/537.36",
"Cookie": " _zlang=vn; __zi=2000.SSZzejyD0jSbZUgxWaGPoJIFlgNCIW6BQ9sqkzu84vrxtklztWrVq7tIw_xT15-UUDRjkjm4NfTzq-wuC0.1; visitorId=2000.SSZzejyD0jSbZUgxWaGPoJIFlgNCIW6BQ9sqkzu84vrxtklztWrVq7tIw_xT15-UUDRjkjm4NfTzq-wuC0.1; _ga=GA1.2.849683028.1580916858; _gid=GA1.2.649969061.1580916858; session_key=; _fbp=fb.1.1580916860706.23961274; adtimaUserId=2000.SSZzejyD0jSbZUgxWaGPoJIFlgNCIW6BQ9sqkzu84vrxtklztWrVq7tIw_xT15-UUDRjkjm4NfTzq-wuC0.1; fuid=2bc1a334b6ff2c3c69803567337ad18f; fpsend=146381; __gads=ID=f3b0160026926ca8:T=1580927790:S=ALNI_Mb73vPNTGLMamACvl4I0-FiRCFZ3g"
},
uri: "https://m.zingmp3.vn/bai-hat/Yeu-Motq%C6%B0ong%C3%A1dg/" + id + ".html#!",
gzip: true
},
function (err, resp, body) {
let data = /\/media\/get-source\?type=audio&key=([a-zA-Z0-9]+)/g.exec(body)
let key = data[1]
/**
* Get MP3 URL
*/
http.get({
"headers": {
"Sec-Fetch-Site": "cross-site",
"Sec-Fetch-Mode": "cors",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "vi-VN,vi;q=0.9,fr-FR;q=0.8,fr;q=0.7,en-US;q=0.6,en;q=0.5",
"Accept": "*/*",
"User-Agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Mobile Safari/537.36",
"Cookie": " _zlang=vn; __zi=2000.SSZzejyD0jSbZUgxWaGPoJIFlgNCIW6BQ9sqkzu84vrxtklztWrVq7tIw_xT15-UUDRjkjm4NfTzq-wuC0.1; visitorId=2000.SSZzejyD0jSbZUgxWaGPoJIFlgNCIW6BQ9sqkzu84vrxtklztWrVq7tIw_xT15-UUDRjkjm4NfTzq-wuC0.1; _ga=GA1.2.849683028.1580916858; _gid=GA1.2.649969061.1580916858; session_key=; _fbp=fb.1.1580916860706.23961274; adtimaUserId=2000.SSZzejyD0jSbZUgxWaGPoJIFlgNCIW6BQ9sqkzu84vrxtklztWrVq7tIw_xT15-UUDRjkjm4NfTzq-wuC0.1; fuid=2bc1a334b6ff2c3c69803567337ad18f; fpsend=146381; __gads=ID=f3b0160026926ca8:T=1580927790:S=ALNI_Mb73vPNTGLMamACvl4I0-FiRCFZ3g"
},
uri: "https://m.zingmp3.vn/xhr/media/get-source?type=audio&key=" + key,
gzip: true
},
function (err, resp, body) {
console.log("https:" + JSON.parse(body).data.source["128"])
})
})
}
getZingMp3URL('ZWB0ZUDO')
|
$(window).scroll(function() {
if($(window).scrollTop() == $(document).height() - $(window).height()) {
// ajax call get data from server and append to the div
$(".container").append(" <p>Appended text</p>.");
}
});
|
import React from 'react'
import { storiesOf } from '@kadira/storybook'
import Task from './index'
const users = [
{
name: 'Faizaan',
picture: 'https://placehold.it/64x64'
},
{
name: 'Faizaan',
picture: 'https://placehold.it/64x64'
}
]
let assignee, assigner
assignee = assigner = {
name: 'Faizaan',
picture: 'https://placehold.it/64x64'
}
storiesOf('Task', module)
.add('task in mini view', () =>
<Task
name="Demo task"
description="Task to be completed"
status="Pending"
contributors={users}
/>
)
.add('task in full view', () =>
<Task
name="Demo task"
description="Task to be completed"
status="Pending"
assignee={assignee}
assigner={assigner}
full={true}
/>
)
|
import React from "react";
import styled from "styled-components";
const BackgroundImage = ({ src, alt }) => {
return (
<div>
<Image
src={ src }
alt={ alt }
filter="true"/>
</div>
);
}
const Image = styled.img `
z-index: -1;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
object-fit: cover;
`
export default BackgroundImage;
|
/**
* INTEGRATION TESTS - SETUP FILE FOR MOCHA
* Runs before any *.int.spec.js file as long as one level above other *.int.spec.js files
*/
const mongoose = require('mongoose');
const cors = require('cors');
// Define app for supertest
const express = require('express');
const app = express();
// Middleware
app.use(cors())
app.use(express.json())
// Import routers
const usersRouter = require('../routes/users')
const projectsRouter = require('../routes/projects')
app.use('/users', usersRouter)
app.use('/projects', projectsRouter)
// // Setup Jest and Chai by aliasing Jest global expect
// const chai = require('chai')
// // Make sure chai and jasmine ".not" play nice together
// const originalNot = Object.getOwnPropertyDescriptor(chai.Assertion.prototype, 'not').get;
// Object.defineProperty(chai.Assertion.prototype, 'not', {
// get() {
// Object.assign(this, this.assignedNot);
// return originalNot.apply(this);
// },
// set(newNot) {
// this.assignedNot = newNot;
// return newNot;
// },
// });
// Combine both jest and chai matchers on expect
// console.log(global.expect)
// const originalExpect = global.expect;
// global.expect = (actual) => {
// const originalMatchers = originalExpect(actual);
// const chaiMatchers = chai.expect(actual);
// const combinedMatchers = Object.assign(chaiMatchers, originalMatchers);
// return combinedMatchers;
// };
// Setup test DB
beforeEach((done) => {
// Define clearDB function - loop through all collections in Mongoose connection & drop
function clearDB() {
// console.log('Clearing test db...')
for(var i in mongoose.connection.collections) {
mongoose.connection.collections[i].deleteMany(function() {})
}
// console.log('Test db cleared...')
return done();
}
// If Mongoose connection is closed, startup using test url and database name
if (mongoose.connection.readyState == 0) {
// console.log('Connection to test db closed, attempting to connect...')
// database name changes based on test suite currently running
mongoose.connect(`mongodb://127.0.0.1:27017/${process.env.TEST_SUITE}`, { useNewUrlParser: true, useCreateIndex: true, useUnifiedTopology: true });
// Handle promise
mongoose.connection
.once('open', () => {
// console.log('Connected to test database...')
return clearDB()
})
// .on('error', (err) => {console.log('Error: ' + err)});
}
else {
// console.log('Test DB exists, clearing DB...')
clearDB()
}
});
// Disconnect from database after each test
// afterEach((done) => {
// console.log('Disconnecting from test db...')
// mongoose.disconnect();
// console.log('Disconnected...')
// return done();
// });
module.exports = app;
|
import React from 'react';
import { Fragment } from 'react';
import { OverlayTrigger, Tooltip } from 'react-bootstrap';
const MovieWatchlink = ({ watchlinks }) => {
return (
<Fragment>
<div className="mt-3 ml-5 mr-5">
<span className="pl-3">
Where to watch?{' '}
<a href={watchlinks.link} target="_blank" rel="noreferrer">
TMDB
</a>
</span>
<div className="pt-2 pl-3">
{watchlinks['flatrate'] != null && (
<div className="d-flex align-items-center">
<span style={{ width: '100px' }}>Streaming</span>
{watchlinks.flatrate.map((stream, index) => {
return (
<span key={`stream_${stream.provider_id}`} className="pl-4">
<img
className="watch-logo"
src={`https://image.tmdb.org/t/p/original${stream.logo_path}`}
alt={stream.provider_name}
/>
</span>
);
})}
</div>
)}
</div>
<div className="pt-2 pl-3">
{watchlinks['buy'] != null && (
<div className="d-flex align-items-center">
<span style={{ width: '100px' }}>Buy</span>
{watchlinks.buy.map((buy, index) => {
return (
<span key={`buy${buy.provider_id}`} className="pl-4">
<img
className="watch-logo"
src={`https://image.tmdb.org/t/p/original${buy.logo_path}`}
alt={buy.provider_name}
/>
</span>
);
})}
</div>
)}
</div>
<div className="pt-2 pl-3">
{watchlinks['rent'] != null && (
<div className="d-flex align-items-center">
<span style={{ width: '100px' }}>Rent</span>
{watchlinks.rent.map((rent, index) => {
return (
<OverlayTrigger
key={`tooltip_rent_${rent.provider_id}`}
placement="right"
overlay={
<Tooltip id={`tooltip-${rent.provider_id}`}>
{rent.provider_name}
</Tooltip>
}
>
<span key={`rent${rent.provider_id}`} className="pl-4">
<img
className="watch-logo"
src={`https://image.tmdb.org/t/p/original${rent.logo_path}`}
alt={rent.provider_name}
/>
</span>
</OverlayTrigger>
);
})}
</div>
)}
</div>
</div>
</Fragment>
);
};
export default MovieWatchlink;
|
Engine.Utilities.PreloadedImage = function(src){
this.image = new Image();
this.imageReady = false;
var me = this;
this.image.addEventListener("load", function(){
me.imageReady = true;
});
this.image.src = src;
};
Engine.Utilities.ImageLoader = {
images: {},
Load: function Load(src){
if(typeof Engine.Utilities.ImageLoader.images[src] !== 'undefined'){
return Engine.Utilities.ImageLoader.images[src];
}
Engine.Utilities.ImageLoader.images[src] = new Engine.Utilities.PreloadedImage(src);
return Engine.Utilities.ImageLoader.images[src];
}
};
|
import React, { useState } from 'react';
import Dropdown from './components/dropdown/dropdown';
import Slider from './components/slider/slider';
import './App.css';
const options = [
{ value: 1000, text: 'Option 1' },
{ value: 1001, text: 'Option 2' },
{ value: 1002, text: 'Option 3' },
{ value: 1003, text: 'Option 4' },
{ value: 1004, text: 'Option 5' },
{ value: 1005, text: 'Option 6' },
];
const covers = [
{ url: 'https://picsum.photos/id/900/1200/500', alt: 'random1' },
{ url: 'https://picsum.photos/id/400/1200/500', alt: 'random2' },
{ url: 'https://picsum.photos/id/990/1200/500', alt: 'random3' },
{ url: 'https://picsum.photos/id/891/1200/500', alt: 'random4' },
{ url: 'https://picsum.photos/id/892/1200/500', alt: 'random5' },
{ url: 'https://picsum.photos/id/893/1200/500', alt: 'random6' },
{ url: 'https://picsum.photos/id/894/1200/500', alt: 'random7' },
{ url: 'https://picsum.photos/id/885/1200/500', alt: 'random8' },
{ url: 'https://picsum.photos/id/886/1200/500', alt: 'random10' }
];
function App() {
const [selected, setselected] = useState(1000)
const handleChangeDropdown = (event, value) => setselected(value);
const labelDropdown = (selected, show) => <span>{selected} {show ? <i class="fas fa-chevron-up" /> : <i class="fas fa-chevron-down" />}</span>
return (
<div className="App">
<div>
<div className="covers">
<Slider className="covers-slider">
<Slider.Window className="covers-window">
{covers.map(cover => <Slider.Slide className="cover-image">
<div style={{backgroundImage: `url(${cover.url})`}}/>
</Slider.Slide>)}
</Slider.Window>
<div>
<Slider.Button first>First</Slider.Button>
<Slider.Button prev>Prev</Slider.Button>
<Slider.Button next>Next</Slider.Button>
<Slider.Button last>Last</Slider.Button>
</div>
</Slider>
</div>
<div className="form-field">
<label>Dropdown</label>
<Dropdown value={selected} onChange={handleChangeDropdown} label={labelDropdown}>
{options.map(({value, text}) => <Dropdown.Option value={value}>{text}</Dropdown.Option>)}
</Dropdown>
</div>
</div>
</div>
);
}
export default App;
|
const { ethers } = require("hardhat");
const { expect } = require("chai");
describe("Vault", () => {
before(async function () {
this.VaultFactory = await ethers.getContractFactory("Vault");
});
beforeEach(async function () {
this.vaultContract = await this.VaultFactory.deploy(
ethers.utils.formatBytes32String("secretpassword")
);
await this.vaultContract.deployed();
});
it("Initially vault should be locked", async function () {
expect(await this.vaultContract.locked()).to.equal(true);
});
it("Attacker should be able to unlock the vault", async function () {
//connect with the attacker account
[, attacker] = await ethers.getSigners();
this.vaultContract = await this.vaultContract.connect(attacker);
//get the password from storage
const password = await ethers.provider.getStorageAt(
this.vaultContract.address,
1
);
// unlock the vault
await this.vaultContract.unlock(password);
//check if unlocked
expect(await this.vaultContract.locked()).to.equal(false);
});
});
|
/**
* Created by debal on 27.02.2016.
*/
var React = require('react');
var Actions = require('../../actions/user');
var UserInfo = require('./info-instagram');
var AuthInstagram = require('./auth-instagram');
var UserMenu = React.createClass({
contextTypes: {
store: React.PropTypes.object.isRequired
},
propTypes: {
isAuthorized: React.PropTypes.bool.isRequired,
userInfo: React.PropTypes.object.isRequired
},
componentDidMount: function () {
this.context.store.dispatch(Actions.fetchUserData());
},
render: function () {
if (this.props.isAuthorized) {
var profile = this.props.userInfo;
return (
<UserInfo
profileUrl={profile.url}
profileImage={profile.image}
profileLogin={profile.login}
profileName={profile.name}
profilePhotosCount={profile.photosCount}
profileFollowersCount={profile.followersCount}
/>
);
}
else return <AuthInstagram/>
}
});
module.exports = UserMenu;
|
var files________________3________8js____8js__8js_8js =
[
[ "files________3____8js__8js_8js", "files________________3________8js____8js__8js_8js.html#af29ba3c2c85449822718166be61b26fe", null ]
];
|
'use strict';
var isUint32Array = require( './../lib' );
console.log( isUint32Array( new Uint32Array( 10 ) ) );
// returns true
console.log( isUint32Array( new Int8Array( 10 ) ) );
// returns false
console.log( isUint32Array( new Uint8Array( 10 ) ) );
// returns false
console.log( isUint32Array( new Uint8ClampedArray( 10 ) ) );
// returns false
console.log( isUint32Array( new Int16Array( 10 ) ) );
// returns false
console.log( isUint32Array( new Uint16Array( 10 ) ) );
// returns false
console.log( isUint32Array( new Int32Array( 10 ) ) );
// returns false
console.log( isUint32Array( new Float32Array( 10 ) ) );
// returns false
console.log( isUint32Array( new Float64Array( 10 ) ) );
// returns false
console.log( isUint32Array( new Array( 10 ) ) );
// returns false
console.log( isUint32Array( {} ) );
// returns false
console.log( isUint32Array( null ) );
// returns false
|
var mySocket = function (server) {
// const io = require('socket.io')(server);
// io.on('connection', function(socket){
// //本次连接的socket发消息
// socket.emit('news', { "meg": 'hello' });
//
// //接受消息
// socket.on('news2', function (data) {
// console.log(data);
// //给除了自己以外的所有连接的socket发广播消息
// socket.broadcast.emit('broadcast',{ "meg": 'hello broadcast' });
//
// });
//
// //所有连接数量
// //console.log(io.eio.clientsCount );
//
// });
}
module.exports = mySocket;
|
/*global define */
(function() {
"use strict";
var jsav, // The JSAV object
answerArr = [], // The (internal) array that stores the correct answer
listArr = [], //
status = 0, // Nothing is currently selected, status = 0;
// Data area of the node is selected, status = 1;
// pointer area is selected, status = 2.
newNodeGen, //
newLinkNode, // New node
search_value,
search_index,
exe_head, // head of the list
connections = [], //
fromNode, //
toNode, //
jsavList, // JSAV list
listSize, // JSAV list size
selected_node; // Position that has been selected by user for swap
// JSAV extensions
/* JSAV._types.ds.ListNode.prototype.exe_next = {};
JSAV._types.ds.ListNode.prototype.exe_tail = {};
JSAV._types.ds.ListNode.prototype.exe_edgeToNext = {};*/
// Add an edge from obj1 to obj2
function connection(obj1, obj2){
if(obj1 == obj2){ return;}
var fx = $('#' + obj1.id()).position().left + 37 + 2;
var tx = $('#' + obj2.id()).position().left +2;
var fy = $('#' + obj1.id()).position().top + 15 + 1 + 54;
var ty = $('#' + obj2.id()).position().top + 15 +1 + 54;
var fx1 = fx, fy1 = fy, tx1 = tx, ty1 = ty;
var disx = (fx - tx - 22) > 0 ? 1 : (fx - tx - 22) == 0 ? 0 : -1;
var disy = (fy - ty) > 0 ? 1 : (fy - ty) == 0 ? 0 : -1;
var dx = Math.max(Math.abs(fx - tx) / 2, 35);
var dy = Math.max(Math.abs(fy - ty) / 2, 35);
if(fy - ty > -25 && fy - ty < 25 && (tx - fx < 36 || tx - fx > 38)){
dx = Math.min(Math.abs(fx - tx), 20);
dy = Math.min(Math.abs(fx - tx)/3, 50);
tx += 22;
ty -= 15;
fx1 = fx;
fy1 = fy - dy;
tx1 = tx - dx;
ty1 = ty - dy;
}else{
if(disx == 1){
tx += 22;
ty += 15 * disy;
fx1 = fx + dx;
fy1 = fy - dy * disy;
tx1 = tx;
ty1 = ty + dy * disy;
}else if(disx == -1){
fx1 = fx + dx;
fy1 = fy;
tx1 = tx - dx;
ty1 = ty;
}
}
var edge = jsav.g.path(["M", fx, fy , "C", fx1, fy1, tx1 , ty1, tx, ty].join(","),{"arrow-end": "classic-wide-long", "opacity": 100,"stroke-width": 2} );
if(obj1.exe_next){
obj1.exe_edgeToNext.element.remove();
}else{
obj1.exe_tail.element.remove();
obj1.exe_tail = null;
}
obj1.exe_edgeToNext = edge;
}
// Function for connecting to nodes when click them
function Connect(obj1, obj2){
if(obj1 == obj2){ return;}
connection(obj1,obj2);
obj1.exe_next = obj2;
obj1._next = obj2;
for(var i=0; i<connections.length; i++)
{
if(connections[i].from == obj1 && connections[i].to != obj2){
connections[i].to = obj2;
return;
}
}
connections.push({from: obj1, to: obj2});
}
// Click event handler on the list
function clickHandler(e) {
var x = parseInt(e.pageX - $('#' + this.id()).offset().left);
var y = parseInt(e.pageY - $('#' + this.id()).offset().top);
if(x > 31 && x < 42 && y > 0 && y < 31){
if(status == 1){
selected_node.removeClass('bgColor');
selected_node = null;
}else if(status == 2){
$('#' + fromNode.id() + " .jsavpointerarea:first").removeClass('bgColor');
}
if(status == 0 || status == 1){
$('#' + this.id() + " .jsavpointerarea:first").addClass('bgColor');
fromNode = this;
status = 2;
}else if(status == 2){
if(this.id() == fromNode.id()){
$('#' + this.id() + " .jsavpointerarea:first").removeClass('bgColor');
fromNode = null;
status = 0;
}else{
$('#' + this.id() + " .jsavpointerarea:first").addClass('bgColor');
fromNode = this;
status = 2;
}
}
}else{
if(status == 0){
this.addClass('bgColor');
selected_node = this;
status = 1;
}else if(status == 1){
selected_node.removeClass('bgColor');
selected_node = null;
status = 0;
}else if(status == 2){
toNode = this;
Connect(fromNode, toNode);
$('#' + fromNode.id() + " .jsavpointerarea:first").removeClass('bgColor');
$('#' + toNode.id()).removeClass('bgColor');
fromNode = null;
toNode = null;
status = 0;
}
SelfOrgMove_to_FrontPro.userInput = true;
}
}
// reset function definition
function f_reset() {
SelfOrgMove_to_FrontPro.userInput = false;
newNodeGen = false;
connections = [];
selected_node = null;
status = 0;
if($("#jsav .jsavcanvas")){
$("#jsav .jsavcanvas").remove();
}
if($("#jsav .jsavshutter")){
$("#jsav .jsavshutter").remove();
}
jsav = new JSAV("jsav");
jsav.recorded();
if($("#jsav path")){
$("#jsav path").remove();
}
if(jsavList){
jsavList.clear();
}
jsavList = jsav.ds.list({"nodegap": 30, "top": 40, left: 0});
jsavList.addFirst("null");
for(var i = listSize - 2; i > 0; i--)
{
jsavList.addFirst(listArr[i]);
}
jsavList.addFirst("null");
jsavList.layout();
exe_head = jsavList.get(0);
for(i = 0; i < listSize; i ++)
{
jsavList.get(i).exe_next = jsavList.get(i).next();
jsavList.get(i).exe_edgeToNext = jsavList.get(i).edgeToNext();
}
jsavList.get(listSize - 1).exe_tail = jsav.g.line(34 + (listSize - 1)*74, 32 + 55,
44 + (listSize - 1)*74, 1 + 55,{"opacity": 100,"stroke-width": 1});
//JSAV array for insert animation
var jsavArr = jsav.ds.array([search_value], {indexed: false, center: false,left: 650, top: -70});
jsavList.click(clickHandler); // Rebind click handler after reset
SelfOrgMove_to_FrontPro.userInput = false;
}
var SelfOrgMove_to_FrontPro = {
// Initialise the exercise
userInput : false, // Boolean: Tells us if user ever did anything
initJSAV : function(size, pos) {
answerArr.length = 0;
listSize = size;
// Give random numbers in range 0..999
answerArr[0] = "null";
for (i = 1; i < size-1; i++) {
answerArr[i] = Math.floor(Math.random() * 1000);
}
answerArr[size-1] = "null";
listArr = answerArr.slice(0);
search_index = Math.floor((Math.random() * (size - 2)) + 1);
search_value = listArr[search_index];
f_reset();
// correct answer
if (search_index>1){
answerArr.splice(search_index, 1);
answerArr.splice(1, 0, search_value);
}
// Set up handler for reset button
$("#reset").click(function () { f_reset(); });
},
// Check user's answer for correctness: User's array must match answer
checkAnswer: function(arr_size) {
var i = 0;
var curr = exe_head;
/*
i = 0;
var curr = exe_head;
*/
while(curr.exe_next){
if(curr.value() == answerArr[i]){
curr = curr.exe_next;
i++;
}else{
return false;
}
}
return true;
},
getSearch: function (){
return search_value;
}
}
window.SelfOrgMove_to_FrontPro = window.SelfOrgMove_to_FrontPro || SelfOrgMove_to_FrontPro;
}());
|
import Image from "next/image";
import { signIn, signOut, useSession } from 'next-auth/client'
import { FlagIcon, SearchIcon,PlayIcon,ShoppingCartIcon } from "@heroicons/react/outline";
function Login() {
return (
<div className="grid place-items-center">
<Image src="https://links.papareact.com/t4i" width={400} height={400} objectFit="contain"/>
<h1
onClick={signIn}
className="p-5 bg-blue-500 rounded-full text-white text-center cursor-pointer
">
login with facebook
</h1>
</div>
);
}
export default Login;
|
const crypto = require('crypto');
const connection = require('../database/connection');
module.exports = {
async store(req, res) {
const { name, email, wpp, cnpj, city, uf } = req.body;
const id = crypto.randomBytes(4).toString('HEX');
await connection('enterprises').insert({
id,
name,
email,
wpp,
cnpj,
city,
uf
});
return res.json({ id });
},
async index(req, res) {
const enterprises = await connection('enterprises').select('*');
return res.json(enterprises);
},
async update(req, res) {
const { name, email } = req.body;
const enterpriseData = await connection('enterprises').where('id', req.userIdToken).select('name', 'email');
const [enterprise] = enterpriseData;
if (name && name === enterprise.name) {
const enterpriseExists = await connection('enterprises').where('name', name).select('*');
if (enterpriseExists) {
return res.status(400).json({ error: "User already exists. No name changes." });
}
}
if (email && email === enterprise.email) {
const enterpriseExists = await connection('enterprises').where('email', email).select('*');
if (enterpriseExists) {
return res.status(400).json({ error: "User already exists. No email changes." });
}
}
await connection('enterprises').update({ name, email }).where('id', req.userIdToken);
return res.json({ success: true });
},
async delete(req, res) {
const { id } = req.params;
const enterprise_id = req.headers.authorization;
if (!enterprise_id) {
return res.status(400).json({ error: 'Enterprise authorization required.' });
}
const enterprise = await connection('enterprises').where('id', id).first();
// const enterprise = await connection('enterprises').where('id', id).select('enterprise_id').first();
await connection('enterprises').where('id', id).delete();
return res.status(204).send();
}
}
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Tests;
(function (Tests) {
var Main = /** @class */ (function () {
function Main(id) {
this.currentTestId = id;
this.testRoot = $('#testRoot');
this.loadForm();
}
Main.prototype.loadForm = function () {
var _this = this;
this.testRoot.html('<span class="text-muted">Loading...</span>');
$.get('/Home/TestItem/' + this.currentTestId, function (data) {
_this.testRoot.html(data);
_this.btnNextQuestion = $('#btnNextQuestion');
_this.btnNextQuestion.click(function (e) { e.target.setAttribute('disabled', 'disabled'); _this.btnNextQuestionOnClick(); });
});
};
Main.prototype.btnNextQuestionOnClick = function () {
var obj = new UserAnswer(this.currentTestId);
if (!obj.IsValid) {
alert('Answer is empty!');
this.btnNextQuestion.removeAttr('disabled');
return;
}
var url = '/Home/UserTestAnswer/';
var thisRef = this;
$.ajax({
type: "POST",
url: url,
data: obj,
dataType: "json",
async: true,
success: function (msg) {
if (msg.error) {
alert(msg.error);
return;
}
thisRef.loadForm();
}
});
};
return Main;
}());
Tests.Main = Main;
var UserAnswer = /** @class */ (function () {
function UserAnswer(testId) {
var _this = this;
this.UserTetstId = testId;
this.QuestionId = $('[name="QuestionId"]').val();
this.IsValid = true;
this.IsTextAnser = $('[name="answer"]').length == 0;
if (!this.IsTextAnser) {
this.Answers = [];
$('[name="answer"]:checked').each(function (i, e) {
_this.Answers.push(parseInt($(e).attr('id')));
});
if (this.Answers.length == 0) {
this.IsValid = false;
}
this.AnswerText = null;
}
else {
this.Answers = null;
this.AnswerText = $('#tbAnsertText').val();
if (this.AnswerText.length == 0) {
this.IsValid = false;
}
}
}
return UserAnswer;
}());
})(Tests = exports.Tests || (exports.Tests = {}));
|
(function() {
'use strict';
angular
.module('traveltotemApp')
.controller('TransferDialogController', TransferDialogController);
TransferDialogController.$inject = ['$timeout', '$scope', '$stateParams', '$uibModalInstance', 'entity', 'Transfer', 'User', 'Totem'];
function TransferDialogController ($timeout, $scope, $stateParams, $uibModalInstance, entity, Transfer, User, Totem) {
var vm = this;
vm.transfer = entity;
vm.clear = clear;
vm.datePickerOpenStatus = {};
vm.openCalendar = openCalendar;
vm.save = save;
vm.users = User.query();
vm.totems = Totem.query();
$timeout(function (){
angular.element('.form-group:eq(1)>input').focus();
});
function clear () {
$uibModalInstance.dismiss('cancel');
}
function save () {
vm.isSaving = true;
if (vm.transfer.id !== null) {
Transfer.update(vm.transfer, onSaveSuccess, onSaveError);
} else {
Transfer.save(vm.transfer, onSaveSuccess, onSaveError);
}
}
function onSaveSuccess (result) {
$scope.$emit('traveltotemApp:transferUpdate', result);
$uibModalInstance.close(result);
vm.isSaving = false;
}
function onSaveError () {
vm.isSaving = false;
}
vm.datePickerOpenStatus.date = false;
function openCalendar (date) {
vm.datePickerOpenStatus[date] = true;
}
}
})();
|
const customError = require("../domain/customError");
const fs = require("fs");
const User = require("../domain/user");//not used anymore? todo:check if we still want domain classes since nodejs lose the stronlytyped properties
const SessionModule = require('../modules/sessionModule');
const log = require('../modules/loggingModule');
const encryption = require('../modules/encryptionModule');
const ProjectModule = require('../modules/projectModule');
/**
* note there is a downside to loading json (or any file) with require:
* question: https://stackoverflow.com/questions/35389060/read-json-file-content-with-require-vs-fs-readfile
* answer: https://stackoverflow.com/a/35389796/1108772
* require is synchronous and only reads the file once, following calls return the result from cache
*/
const Users = require("../storage/users/users.json");
module.exports = {
getUser: getUser,
getUsers: getUsers,
addUser: addUser,
getUserByKind: getUserByKind,
getCurrent: getCurrent,
checkUserHasProjectAccessUsingInfo: checkUserHasProjectAccessUsingInfo,
checkUserHasProjectAccessUsingProjectUuid: checkUserHasProjectAccessUsingProjectUuid
};
/**
* getUser()
* get a specific user based on uuid or username
* @param input {obj.username || obj.uuid}
* @returns {Promise}
*/
function getUser(input) {
return new Promise(function (resolve, reject) {
let getBy = "";
if (input.uuid) getBy = "uuid";
else if (input.username) getBy = "username";
else return reject(new customError(500, "One of the parameters is not valid.!", input));
var user = {};
for (let index in Users.users) {
let u = Users.users[index];
if (getBy === "username" && u.username === input.username) {
user = u;
break; //stop the for loop
} else if (getBy === "uuid" && u.uuid === input.uuid) {
user = u;
break; //stop the for loop
}
}
/**
* throw error when the user does not exist
*/
if (!user.hasOwnProperty("username") || user.username === "") {
return reject(new customError(500, "This user does not exist", input));
}
return resolve(user);
});
}
function getUserByKind(input, type) {
return new Promise(function (resolve, reject) {
if (type !== 'uuid' && type !== 'username') return reject(new customError(500, "One of the parameters is not valid.!", input));
var user = {};
for (let index in Users.users) {
let u = Users.users[index];
if (type === "username" && u.username === input) {
user = u;
break; //stop the for loop
} else if (type === "uuid" && u.uuid === input) {
user = u;
break; //stop the for loop
}
}
/**
* throw error when the user does not exist
*/
if (!user.hasOwnProperty("username") || user.username === "") {
return reject(new customError(500, "This user does not exist", input));
}
//Set passwordhash to undefine to make sure we don't have information leak
let retUser = {};
retUser.uuid = user.uuid;
retUser.username = user.username;
retUser.color = user.color;
retUser.picture = user.picture;
return resolve(retUser);
});
}
/**
* getUsers
* returns all users
* @returns {Promise}
*/
function getUsers() {
return new Promise(function (resolve, reject) {
let existingUsers = Users.users;
let cleandedUsers = [];
// console.info(users);
for (var i = 0; i < existingUsers.length; i++) {
// console.info(existingUsers[i]);
let userWithoutPassHash = {};
userWithoutPassHash.uuid = existingUsers[i].uuid;
userWithoutPassHash.username = existingUsers[i].username;
userWithoutPassHash.color = existingUsers[i].color;
userWithoutPassHash.picture = existingUsers[i].picture;
cleandedUsers.push(userWithoutPassHash);
}
return resolve(cleandedUsers);
});
}
function addUser(user) {
return new Promise(function (resolve, reject) {
var users = Users;
/**
* todo: make sure the user object we want to add is valid!
*/
users.users.push(user);
fs.writeFile('../storage/users/users.json', JSON.stringify(users, null, 4), function (err) {
if (err) return reject(err);
return resolve("user added");
});
});
}
function getCurrent(req) {
return new Promise(function (resolve, reject) {
return resolve(SessionModule.getUUID(req));
});
}
/**
* Checks if the current user has access to the specified project.
* @param {*} info Info file target project containing all users.
*/
function checkUserHasProjectAccessUsingInfo(req, infoParsed)
{
return new Promise(function (resolve, reject)
{
let userUuid = SessionModule.getUUID(req);
let users = infoParsed.users;
if (users.indexOf(userUuid) > -1)
{
return resolve(true);
}
else
{
return resolve(false);
}
});
}
/**
* Checks if the current user has access to the specified project.
* @param {*} projectUuid Uuid of target project.
*/
function checkUserHasProjectAccessUsingProjectUuid(req, projectUuid)
{
let userUuid = SessionModule.getUUID(req);
return ProjectModule.getProjectInfo(projectUuid).then((info) =>
{
if (info.users.indexOf(userUuid) > -1)
{
return true;
}
else
{
return false;
}
}).catch(() =>
{
return false;
});
}
|
$(function(){
$('#search').click(function(e){
var query = $('search-box').text;
var jqxhr = $.get('http://search.twitter.com/search.json/',{'q': query});
jqxhr.success(function(response){
});
});
});
|
import React, { useState, useEffect, useRef } from "react";
import { useDispatch } from "react-redux";
import { setTextFilter, setTypeFilter } from "../store/app/actions";
import { getEventTypesArray } from "../utilities/time";
/**
* Event Type filter drop down component.
* @param {string} prop.className Class name string.
* @param {object} props The remainder of the props.
*/
const EventTypeDropdown = ({ className, ...props }) => {
const dispatch = useDispatch();
const eventTypes = getEventTypesArray();
const [value, setValue] = useState();
useEffect(() => {
dispatch(setTypeFilter(value));
}, [value]);
return (
<div className={className} {...props}>
<label
className={`${className}__label`}
onClick={(e) => {
inputRef.current.focus();
}}
>
Type
</label>
<select
className={`${className}__select`}
value={value}
onChange={(e) => setValue(e.currentTarget.value)}
{...props}
>
<option value="">-- Filter Type --</option>
{eventTypes.map((eventType) => (
<option key={eventType.value} value={eventType.value}>
{eventType.label}
</option>
))}
</select>
</div>
);
};
/**
* Event Text filter input component.
* @param {string} prop.className Class name string.
* @param {object} props The remainder of the props.
*/
const EventTextInput = ({ className, ...props }) => {
const dispatch = useDispatch();
const inputRef = useRef();
const [value, setValue] = useState("");
useEffect(() => {
dispatch(setTextFilter(value));
}, [value]);
return (
<div className={className} {...props}>
<label
className={`${className}__label`}
onClick={(e) => {
inputRef.current.focus();
}}
>
Search
</label>
<input
ref={inputRef}
className={`${className}__input`}
type="text"
value={value}
onChange={(e) => setValue(e.target.value)}
placeholder="Enter text to filter..."
/>
</div>
);
};
/**
* Filter component.
* This handles all filtering for the countdown list.
*/
const Filter = () => {
return (
<form className="form-filter">
<EventTextInput className="form-filter__event-text" />
<EventTypeDropdown className="form-filter__event-type" />
</form>
);
};
export default Filter;
|
// Creación de la tabla para comentarios
//
// Estructura de la tabla:
//
// ------------------------
// | id | texto |
// ------------------------
//
module.exports = function(sequelize, DataTypes) {
return sequelize.define(
'Comment',
{ texto: {
type: DataTypes.STRING,
validate: { notEmpty: {msg: "-> Falta comentario"}}
},
publicado: {
type: DataTypes.BOOLEAN,
defaultValue: false
}
});
}
|
var devicon = angular.module('devicon', ['ngSanitize', 'ngAnimate']);
/*
||==============================================================
|| Devicons controller
||==============================================================
*/
devicon.controller('IconListCtrl', function($scope, $http, $compile) {
// Determination of the latest release tagging
// which is used for showing in the header of the page
// as well as for CDN links
var gitHubPath = 'devicons/devicon';
var url = 'https://api.github.com/repos/' + gitHubPath + '/tags';
$scope.latestReleaseTagging = 'master';
$http.get(url).success(function (data) {
if(data.length > 0) {
$scope.latestReleaseTagging = data[0].name;
}
}).error(function () {
console.log('Unable to determine latest release version, fallback to master.')
});
var versionStr = '@' + $scope.latestReleaseTagging;
var baseUrl = `https://cdn.jsdelivr.net/gh/${gitHubPath}${versionStr}/`
// Get devicon.json
$http.get(baseUrl + 'devicon.json').success(function(data) {
/*
| Re-format devicon.json
|-----------------------------------------
*/
// icons related stuff
$scope.icons = [];
$scope.selectedIcon = {};
// background color related stuff
// default is the default site background color
$scope.DEFAULT_BACKGROUND = "#60be86";
$scope.fontBackground = $scope.DEFAULT_BACKGROUND;
$scope.svgBackground = $scope.DEFAULT_BACKGROUND;
// whether to display the checkerboard img in the background
// for the font and svg respectively
$scope.fontDisplayChecker = false;
$scope.svgDisplayChecker = false;
// Loop through devicon.json
angular.forEach(data, function(devicon, key) {
// New icon format
var icon = {
name: devicon.name,
svg: devicon.versions.svg,
font: devicon.versions.font,
main: ""
};
// Loop through devicon.json icons
for (var i = 0; i < devicon.versions.font.length; i++) {
// Store all versions that should become main in order
var mainVersionsArray = [
"plain",
"line",
"original",
"plain-wordmark",
"line-wordmark",
"original-wordmark",
];
// Loop through mainVersionsArray
for (var j = 0; j < mainVersionsArray.length; j++) {
// Check if icon version can be "main", if not continue, if yes break the loops
if (devicon.name + devicon.versions.font[i] == devicon.name + mainVersionsArray[j]) {
icon.main = devicon.name + "-" + devicon.versions.font[i];
i = 99999; // break first loop (and second)
}
}
}
// Push new icon format to $scope.icons
$scope.icons.push(icon);
});
// Select first icon by default in scope
$scope.selectedIcon = $scope.icons[0];
$scope.selectedFontIcon = $scope.icons[0].font[0];
$scope.selectedSvgIcon = $scope.selectSvg($scope.icons[0].svg[0], 0);
$scope.selectedFontIndex = 0;
$scope.selectedSvgIndex = 0;
/*------ End of "Re-format devicon.json" ------*/
});
/*
| Change selected icon
| param icon: the new icon.
|--------------------------------
*/
$scope.selectIcon = function(icon) {
$scope.selectedIcon = icon;
$scope.selectedFontIcon = icon.font[0];
$scope.selectedFontIndex = 0;
$scope.selectedSvgIcon = $scope.selectSvg(icon.svg[0], 0);
$scope.selectedSvgIndex = 0;
// reset color
$scope.fontBackground = $scope.DEFAULT_BACKGROUND;
$scope.svgBackground = $scope.DEFAULT_BACKGROUND;
}
/*---- End of "Change selected icon" ----*/
/*
| Change selected icon font version
|--------------------------------
*/
$scope.selectFont = function(fontVersion, colored, index) {
$scope.selectedFontIcon = fontVersion;
$scope.colored = colored ? true : false;
$scope.selectedFontIndex = index;
}
/*---- End of "Change selected font icon" ----*/
/*
| Change selected icon svg version
|--------------------------------
*/
$scope.selectSvg = function(svgVersion, index) {
$http.get(baseUrl + 'icons/' + $scope.selectedIcon.name + '/' + $scope.selectedIcon.name + '-' + svgVersion + '.svg').success(function(data){
var svgElement = angular.element(data);
var innerSvgElement = null;
/**
* Loop trough svg image to find
* the actual svg content (not any comments or stuff
* we don't care for).
* See https://github.com/devicons/devicon/issues/444#issuecomment-753699913
*/
for (const [key, value] of Object.entries(svgElement)) {
/** [object SVGSVGElement] ensures we have the actual svg content */
if(value.toString() == '[object SVGSVGElement]') {
innerSvgElement = value;
break;
}
}
if(innerSvgElement === null) {
console.error('Could not find content of given SVG.')
} else {
var innerSVG = (innerSvgElement.innerHTML);
$scope.selectedSvgIcon = innerSVG;
$scope.selectedSvgIndex = index;
}
});
}
/*---- End of "Change selected svg icon" ----*/
/**
* Copy the text located using `id` into the user's clipboard.
* @param {Event} event - a JS Event object.
* @param {String} id - id of the element we are copying its text
* content from.
*/
$scope.copyToClipboard = function(event, id) {
let text = document.getElementById(id).textContent
navigator.clipboard.writeText(text)
.then(() => {
$scope.displayTooltip("Copied", event.target)
})
.catch(() => {
$scope.displayTooltip("Failed to copy", event.target)
})
}
/**
* Display a tooltip.
* @param {String} text - text the tooltip should have.
* @param {Element} copyBtn - the copyBtn element, which is an <img>
*/
$scope.displayTooltip = function(text, copyBtn) {
let tooltip = copyBtn.parentElement.getElementsByClassName("tooltip")[0]
tooltip.textContent = text
// reset opacity (for some reason, default opacity is null)
tooltip.style.opacity = 1
tooltip.style.visibility = "visible"
// create fade out effect after 2 sec
setTimeout(() => {
let count = 10
let intervalObj
intervalObj = setInterval(() => {
tooltip.style.opacity -= 0.1
if (--count == 0) {
clearInterval(intervalObj)
tooltip.style.visibility = "hidden"
}
}, 50)
}, 2000)
}
/**
* Display the color picker.
* @param {String} id - id of the menu we are showing.
*/
$scope.toggleColorPickerMenu = function(id) {
let menu = document.getElementById(id)
menu.style.display = menu.style.display == "none" || menu.style.display == "" ? "inherit" : "none"
}
});
/*================ End of "Devicons controller" ================*/
/*
||==================================================================
|| Convert icon img to svg
||==================================================================
*/
devicon.directive('imgToSvg', function ($http, $compile) {
var baseUrl = window.location.href;
return {
link : function($scope, $element, $attrs) {
$attrs.$observe('src', function(val){
$http.get(baseUrl + val).success(function(data){
var svg = angular.element(data);
svg = svg.removeAttr('xmlns');
svg = svg.addClass('not-colored');
svg = svg.attr('svg-color', '');
var $e = $compile(svg)($scope);
$element.replaceWith($e);
$element = $e;
});
});
}
};
});
/*================ End of "Convert icon img to svg" ================*/
/*
||==================================================================
|| Add color to svg when hovering
||==================================================================
*/
devicon.directive('svgColor', function () {
return {
link : function($scope, $element, $attrs) {
$element.on('mouseenter', function(){
$element.removeClass('not-colored');
});
$element.on('mouseleave', function(){
$element.addClass('not-colored');
});
}
};
});
/*================ End of "Add color to svg when hovering" ================*/
/*
||==================================================================
|| Show all icons on click
||==================================================================
*/
devicon.directive('iconDetails', function ($http, $compile) {
return {
template: '<div class="icon"><article class="icon-detail"><div ng-repeat="svg in icon.svg"><img ng-src="/icons/{{icon.name}}/{{icon.name}}-{{svg}}.svg" alt="{{icon.name}}" /></div></article><img ng-src="/icons/{{icon.name}}/{{icon.main}}.svg" alt="{{icon.name}}" img-to-svg /></div>',
replace: true,
scope: {
icon: "="
},
compile: function CompilingFunction($templateElement) {
$element.on('click', function(){
$templateElement.replaceWith(this.template);
});
}
};
});
/*================ End of "Add color to svg when hovering" ================*/
|
Ext.define('Gvsu.modules.orgs.model.OrgsModel', {
extend: "Core.data.DataModel"
,collection: 'gvsu_orgs'
,fields: [{
name: '_id',
type: 'ObjectID',
visable: true
},{
name: 'active',
type: 'boolean',
filterable: true,
editable: true,
visable: true
},{
name: 'date_reg',
type: 'date',
filterable: true,
editable: true,
visable: true
},{
name: 'date_act',
type: 'date',
filterable: true,
editable: true,
visable: true
},{
name: 'name',
type: 'string',
sort: 1,
filterable: true,
unique: true,
editable: true,
visable: true
},{
name: 'fullname',
type: 'string',
editable: true,
filterable: true,
visable: true
},{
name: 'headers',
type: 'string',
editable: true,
filterable: false,
visable: true
},{
name: 'founders',
type: 'string',
editable: true,
filterable: false,
visable: true
},{
name: 'inn',
type: 'string',
editable: true,
filterable: true,
visable: true
},{
name: 'kpp',
type: 'string',
editable: true,
filterable: true,
visable: true
},{
name: 'ogrn',
type: 'string',
editable: true,
filterable: true,
visable: true
},{
name: 'legal_address',
type: 'string',
editable: true,
filterable: false,
visable: true
},{
name: 'fact_address',
type: 'string',
editable: true,
filterable: false,
visable: true
},{
name: 'www',
type: 'string',
editable: true,
filterable: false,
visable: true
},{
name: 'headers_phones',
type: 'string',
editable: true,
filterable: false,
visable: true
},{
name: 'contact_person',
type: 'string',
editable: true,
filterable: false,
visable: true
},{
name: 'phone',
type: 'string',
editable: true,
filterable: false,
visable: true
},{
name: 'email',
type: 'string',
editable: true,
filterable: false,
visable: true
},{
name: 'sro',
type: 'number',
editable: true,
filterable: true,
visable: true
},{
name: 'info',
type: 'string',
editable: true,
filterable: false,
visable: true
},{
name: 'distinations',
type: 'arraystring',
editable: true,
filterable: false,
visable: true
},{
name: 'notes',
type: 'string',
editable: false,
filterable: false,
visable: true
}
]
,beforeSave: function(data, cb) {
if(data.active === 'on' || data.active === true) {
this.src.db.collection(this.collection).findOne({_id: data._id}, {active: 1}, function(e,d) {
var l = parseInt(d.active)
if(!l)
data.date_act = new Date()
data.active = true
cb(data)
})
} else
cb(data);
}
,afterSave: function(data, cb) {
var me = this;
[
function(next) {
me.src.db.collection('gvsu_users').update({org: data._id}, {$set: {status: data.active}}, function(e,d) {
next()
})
}
,function(next) {
if(data.active) {
me.src.db.collection('gvsu_userdocs').update({org: data._id, status: {$in:[0,1]}}, {$set: {status: 2}}, function(e,d) {
next()
})
} else cb(data)
}
,function() {
me.src.db.collection('gvsu_userdocs').update({org: data._id, status: {$in:[0,1]}}, {$set: {status: 2}}, function(e,d) {
cb(data)
})
}
].runEach()
}
})
|
var resultGrid = null;
var resultGridSortColumn = '';
var resultGridColumnFilters = {};
$(function() {
$('#searchInput').focus()
.keypress(function (e) {
if(e.keyCode == 13){
search();
}
});
});
search = function() {
$.ajax({
type: 'POST',
url: '/search',
dataType: 'json',
data: {'searchString': $('#searchInput').val()},
success: function(data) {
setupResultGrid(data);
}
});
}
setupResultGrid = function(results) {
var dataView, groupItemMetadataProvider;
var columns = [
{id: "name", name: "Name", field: "name", sortable: true,
formatter: linkFormatter = function (row, cell, value, columnDef, dataContext) {
return '<a href="' + dataContext['url'] + '" target="_blank">' + value + '</a>';
}
},
{id: "position", name: "Position", field: "position", sortable: true},
{id: "college", name: "College", field: "college", sortable: true},
{id: "draftYear", name: "Draft", field: "draftYear", sortable: true},
{id: "debutYear", name: "Debut", field: "debutYear", sortable: true}
];
var options = {
explicitInitialization: true,
enableCellNavigation: true,
enableColumnReorder: false,
forceFitColumns: true,
autoHeight: true,
showHeaderRow: true,
headerRowHeight: 37
};
groupItemMetadataProvider = new Slick.Data.GroupItemMetadataProvider();
dataView = new Slick.Data.DataView({
groupItemMetadataProvider: groupItemMetadataProvider,
inlineFilters: true
});
// wire up model events to drive the grid
dataView.onRowCountChanged.subscribe(function (e, args) {
resultGrid.updateRowCount();
resultGrid.render();
});
dataView.onRowsChanged.subscribe(function (e, args) {
resultGrid.invalidateRows(args.rows);
resultGrid.render();
});
resultGrid = new Slick.Grid('#searchResults',
dataView,
columns,
options);
resultGrid.registerPlugin(groupItemMetadataProvider);
resultGrid.setSelectionModel(new Slick.CellSelectionModel());
resultGrid.onSort.subscribe(function (e, args) {
resultGridSortColumn = args.sortCol.field;
dataView.sort(resultGridComparer, args.sortAsc);
});
$(resultGrid.getHeaderRow()).delegate(":input", "change keyup", function (e) {
var columnId = $(this).data("columnId");
if (columnId != null) {
resultGridColumnFilters[columnId] = $.trim($(this).val());
dataView.refresh();
}
});
resultGrid.onHeaderRowCellRendered.subscribe(function(e, args) {
$(args.node).empty();
$('<input type="text" width="' + (resultGrid.getColumns(args.column.id).width - 4) + '" />')
.data("columnId", args.column.id)
.val(resultGridColumnFilters[args.column.id])
.appendTo(args.node);
});
$('#searchResults .grid-header .ui-icon')
.addClass('ui-state-default ui-corner-all')
.mouseover(function (e) {
$(e.target).addClass('ui-state-hover');
})
.mouseout(function (e) {
$(e.target).removeClass('ui-state-hover');
});
$('#searchResults').show();
resultGrid.init();
dataView.beginUpdate();
dataView.setItems(results, 'name');
dataView.setFilter(filterResultGrid);
dataView.endUpdate();
}
filterResultGrid = function(item) {
for (var columnId in resultGridColumnFilters) {
if (columnId !== undefined && resultGridColumnFilters[columnId] !== "") {
var column = resultGrid.getColumns()[resultGrid.getColumnIndex(columnId)];
if (item[column.field].toLowerCase().indexOf(resultGridColumnFilters[columnId].toLowerCase()) < 0) {
return false;
}
}
}
return true;
}
resultGridComparer = function(a, b) {
var x = a[resultGridSortColumn], y = b[resultGridSortColumn];
return (x == y ? 0 : (x > y ? 1 : -1));
}
|
const Footnote = ({ unlinkedText, linkedText, onClickLink }) => (
<div className="flex flex-row mt-1">
<p className="text-xs text-gray-400">{unlinkedText}</p>
<p
className="text-xs text-gray-400 underline ml-1 cursor-pointer"
onClick={onClickLink}
>
{linkedText}
</p>
</div>
);
export default Footnote;
|
import {renderElement, appendElement} from '../utils';
import GameHeaderView from './items/game-header-view';
import AnswersHistoryView from './items/answers-history';
import {globalGameData, GameType} from '../data/game-data';
import TwoOfTwoGameView from './two-of-two-game-view';
import OneOfOneGameView from './one-of-one-game-view';
import OneOfThreeGameView from './one-of-three-game-view';
import Application from '../application';
import state from '../data/state';
import timer from './items/timer';
export default class GameView {
constructor(questData, name) {
this.name = name;
this.questData = questData;
this.round = state.currentRound;
this.task = this.questData[this.round.currentTask];
this.header = this.renderHeader();
this.level = this.renderLevel();
this.game = document.createDocumentFragment();
this.game.appendChild(this.header);
this.game.appendChild(this.level);
}
renderHeader() {
const header = new GameHeaderView(this.round.lives);
return header.element;
}
renderLevel() {
const gameScreen = renderElement(``, `section`, `game`);
gameScreen.appendChild(this.renderGameTask());
gameScreen.appendChild(this.renderGameContent());
gameScreen.appendChild(this.renderGameStats());
return gameScreen;
}
renderGameTask() {
return renderElement(this.questData[this.round.currentTask].question, `p`, `game__task`);
}
renderGameContent() {
switch (this.task.gameType) {
case GameType.TwoOfTwo:
return new TwoOfTwoGameView(this.task, GameView.TwoOfTwoCallback).element;
case GameType.OneOfOne:
return new OneOfOneGameView(this.task, GameView.OneOfOneCallback).element;
case GameType.OneOfThree:
return new OneOfThreeGameView(this.task, GameView.OneOfThreeCallback).element;
default:
throw new Error(`Unknown game type`);
}
}
renderGameStats() {
return appendElement(new AnswersHistoryView(this.round.stats).element, `ul`, `stats`);
}
startLevel() {
state.configure(this.questData, this.name);
timer.configure(globalGameData.START_TIME, this.game.querySelector(`.game__timer`), GameView.timeWarningCallback, GameView.timeOverCallback).start();
return this.game;
}
returnQuestions() {
return this.questData;
}
static timeWarningCallback() {
this.container.classList.add(`blink`);
}
static timeOverCallback() {
state.setResult([], 0);
GameView.goToNextScreen();
}
static TwoOfTwoCallback(e) {
TwoOfTwoGameView.setGame(e, state, GameView);
}
static OneOfOneCallback(e) {
OneOfOneGameView.setGame(e, state, GameView);
}
static OneOfThreeCallback(e) {
OneOfThreeGameView.setGame(e, state, GameView);
}
static goToNextScreen() {
const round = state.currentRound;
const current = round.currentTask;
if (round.lives < globalGameData.MIN_LIVES || current >= globalGameData.MAX_ANSWERS) {
state.countTotal();
Application.showResults(state);
} else {
Application.showGame();
}
}
}
|
import React from 'react';
import { Form, Select } from 'antd';
import { uuid } from 'utils';
const Option = Select.Option;
@Form.create()
class ConSelect extends React.Component {
render() {
const {
formItemLayout = {
labelCol: { sm: { span: 6 } },
wrapperCol: { sm: { span: 18 } },
},
defValue,
disabled,
form,
required = false,
label,
id,
message,
placeholder,
data = [],
mode,
optionKey = 'id',
optionValue = 'value',
allowClear=true,
formItemStyle,
formItemClass,
} = this.props;
const { getFieldDecorator } = form;
const children = [];
for (const item of data) {
if (item[optionValue]) {
children.push(<Option key={uuid()} value={item[optionKey]}>{item[optionValue]}</Option>);
} else {
children.push(<Option key={uuid()} value={item}>{item}</Option>);
}
}
return (
<div>
<Form.Item
{...formItemLayout}
label={label}
style={formItemStyle}
className={formItemClass}
>
{getFieldDecorator(id, {
rules: [{ required, message }],
initialValue: defValue,
})(
<Select placeholder={placeholder}
disabled={disabled}
mode={mode}
allowClear={allowClear}
style={{ width: '100%' }}
>
{children}
</Select>,
)}
</Form.Item>
</div>
);
}
}
export default ConSelect;
|
//call set all note-category
callAllMenu().then(result => {
setAllNoteCategory(result);
})
|
document.querySelector('[data-hook="pick"]').innerHTML = '<a><img data-hook="img-swap" src="https://xplatform.org/ext/lorempixel/200/300/nightlife"/></a>';
let images = ['https://xplatform.org/ext/lorempixel/200/300/nightlife/', 'https://xplatform.org/ext/lorempixel/200/300/cats/'];
document.querySelector('[data-hook="change"]')
.addEventListener('click', ()=>{
let max = images.length - 1;
let min = 0;
document.querySelector('[data-hook="img-swap"]').src = images[Math.floor(Math.random()*(max - min + 1)) + min];
console.log('success!');
});
|
(function () {
angular
.module('myApp')
.controller('TextViewController', TextViewController)
TextViewController.$inject = ['$state', '$scope', '$rootScope', '$sce'];
function TextViewController($state, $scope, $rootScope, $sce) {
$rootScope.setData('showMenubar', true);
$rootScope.setData('backUrl', "textAnswer");
$scope.question = $rootScope.settings.questionObj;
if ($scope.question.result_videoID) {
$scope.question.result_videoURL = $sce.trustAsResourceUrl('https://www.youtube.com/embed/' + $scope.question.result_videoID + "?rel=0&enablejsapi=1");
$rootScope.removeRecommnedVideo()
}
let uid = $rootScope.settings.userId
$rootScope.safeApply();
$scope.$on("$destroy", function () {
if ($rootScope.instFeedRef) $rootScope.instFeedRef.off('value');
if ($rootScope.privateNoteRef) $rootScope.privateNoteRef.off('value')
if ($rootScope.publicNoteRef) $rootScope.publicNoteRef.off('value')
if ($rootScope.teacherNoteRef) $rootScope.teacherNoteRef.off('value')
if ($scope.groupSettingRef) $scope.groupSettingRef.off('value')
if ($scope.answerRef) $scope.answerRef.off('value')
if ($scope.stGroupRef) $scope.stGroupRef.off('value')
});
$scope.init = function () {
$scope.setData("loadingfinished", false)
$scope.groupSetting()
$scope.getAllAnswer()
$scope.getStudentGroups()
}
$scope.groupSetting = function () {
$scope.groupSettingRef = firebase.database().ref('Groups/' + $rootScope.settings.groupKey + '/groupTextSettings/group/' +
$rootScope.settings.questionSetKey + '/' + $rootScope.settings.questionKey)
$scope.groupSettingRef.on('value', snapshot => {
let setting = snapshot.val() || {}
$scope.groupSetting = {
thumbup: setting.thumbup ? true : false,
otherGroup: setting.otherGroup ? true : false
}
$scope.ref_1 = true
$scope.finalCalc()
})
}
$scope.getAllAnswer = function () {
$scope.answerRef = firebase.database().ref('NewAnswers/' + $rootScope.settings.questionKey + '/answer');
$scope.answerRef.on('value', function (snapshot) {
$scope.allAnswers = snapshot.val() || {}
$scope.ref_2 = true
$scope.finalCalc()
});
}
$scope.getStudentGroups = function () {
$scope.stGroupRef = firebase.database().ref('StudentGroups');
$scope.stGroupRef.on('value', function (snapshot) {
$scope.usersInGroup = [];
let allGserGroups = snapshot.val() || {}
for (userKey in allGserGroups) {
if (Object.values(allGserGroups[userKey]).indexOf($rootScope.settings.groupKey) > -1) {
$scope.usersInGroup.push(userKey);
}
}
$scope.ref_3 = true
$scope.finalCalc()
});
};
$scope.finalCalc = function () {
if (!$scope.ref_1 || !$scope.ref_2 || !$scope.ref_3) return
$scope.otherAnswers = [];
for (userKey in $scope.allAnswers) {
var ans = $scope.allAnswers[userKey];
if (userKey != uid) {
ans.key = userKey;
if ($scope.groupSetting.thumbup) {
ans.checked = false; //selected thumb up or down
if (!ans.likeUsers) {
ans.likeUsers = [];
} else {
if (ans.likeUsers.indexOf(uid) > -1) {
ans.checked = true;
ans.like = true;
}
}
if (!ans.dislikeUsers) {
ans.dislikeUsers = [];
} else {
if (ans.dislikeUsers.indexOf(uid) > -1) {
ans.checked = true;
ans.dislike = true;
}
}
ans.likeCount = ans.likeUsers.length;
ans.dislikeCount = ans.dislikeUsers.length;
ans.order = ans.likeCount - ans.dislikeCount;
}
ans.existInGroup = $scope.usersInGroup.indexOf(userKey) > -1 ? true : false,
$scope.otherAnswers.push(ans);
} else {
$scope.myAns = ans
}
}
$scope.groupChoice = $scope.groupChoice ? $scope.groupChoice : 'main';
$scope.changeGroupChoice()
$scope.setData("loadingfinished", true)
$rootScope.safeApply();
}
$scope.changeGroupChoice = function () {
switch ($scope.groupChoice) {
case 'main':
$scope.description = "Answers in current group.";
break;
case 'other':
$scope.description = "Answers in all groups except current group.";
break;
case 'all':
$scope.description = "Answers in all groups.";
break;
}
$rootScope.safeApply();
}
$scope.getLikeClass = function (ans) {
if (!ans.checked) return "";
var classStr = 'checked';
if (ans.like) {
classStr += ' like';
}
return classStr;
}
$scope.getDisLikeClass = function (ans) {
if (!ans.checked) return "";
var classStr = 'checked';
if (ans.dislike) {
classStr += ' dislike';
}
return classStr
}
$scope.thumbUp = function (ans) {
if (ans.checked && ans.dislike) return;
if (ans.checked) {
ans.likeUsers.splice(ans.likeUsers.indexOf(uid), 1);
} else {
ans.likeUsers.push(uid);
}
var updates = {};
updates['NewAnswers/' + $rootScope.settings.questionKey + '/answer/' + ans.key + '/likeUsers'] = ans.likeUsers;
firebase.database().ref().update(updates);
}
$scope.thumbDown = function (ans) {
if (ans.checked && ans.like) return;
if (ans.checked) {
ans.dislikeUsers.splice(ans.dislikeUsers.indexOf(uid), 1);
} else {
ans.dislikeUsers.push(uid);
}
var updates = {};
updates['NewAnswers/' + $rootScope.settings.questionKey + '/answer/' + ans.key + '/dislikeUsers'] = ans.dislikeUsers;
firebase.database().ref().update(updates);
}
}
})();
|
const express = require('express');
const app = express();
const UsersRoute = require('./UsersRoute');
app.use('/users', UsersRoute);
module.exports = app;
|
export {
FETCH_INVENTORY,
ADD_ITEM,
ADD_CATEGORY,
EDIT_NAME,
EDIT_DESCRIPTION,
DELETE_ITEM,
FETCH_CATEGORIES,
FETCH_ITEM,
DELETE_CATEGORY,
} from "./actions";
|
const $ = jQuery = jquery = require ("jquery")
const switchElement = require ("cloudflare/generic/switch")
$(document).on ( "cloudflare.ssl_tls.certificate_transparency_monitoring.initialize", switchElement.initializeCustom ( "enabled", true ) )
$(document).on ( "cloudflare.ssl_tls.certificate_transparency_monitoring.toggle", switchElement.toggle )
|
// Ex 1 Classe
console.log("Exercice 1");
let codingSchool17 = [];
let ajout = (nom) => {
console.log(`${nom}, rentre dans la classe`);
return (codingSchool17.push(nom));
};
let retrait = (nom) => {
console.log(`${nom}, sort dans la classe`);
return (codingSchool17.splice(codingSchool17.indexOf(nom), 1));
};
ajout('antoine');
ajout('saïd');
ajout('Abdel');
ajout('Nathan');
ajout('Yasmina');
console.log("tableau de la coding après 5 ajouts " + codingSchool17);
retrait('Abdel');
ajout('gauthier');
console.log("tableau de la coding à la fin " + codingSchool17);
// Ex 2 Premier
console.log("Exercice 2");
let estPremier = (nbr) => {
if (nbr<2){
return (`le nombre ${nbr} est premier`);
};
for (let i = 2; i < nbr; i++) {
return (`le nombre ${nbr} n'est pas premier`);
}
return (`le nombre ${nbr} est premier autre`);
}
console.log(estPremier(45));
console.log(estPremier(5));
console.log(estPremier(0));
console.log(estPremier(8));
|
import {StyleSheet} from 'react-native';
import {colors} from '../../const/colors';
export default style = StyleSheet.create({
blurWrapper: {
flex: 1,
backgroundColor: '#C0C0C030',
},
wrapper: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#ffffff00',
},
itemContainer: {
maxHeight: '90%',
width: '89%',
borderRadius: 30,
backgroundColor: 'white',
padding: 10,
},
calendarStyle: {},
});
|
var num1 = Number(prompt("Enter First Number"));
var num2 = Number(prompt("Enter Second Number"));
var op = prompt("Enter Operator (+,-,*,/,%");
var sum = 0;
if (op === "+") {
sum = eval(num1 + op + num2);
document.write(num1 + " + " + num2 + " = " + sum);
} else if (op == "-") {
sum = eval(num1 + op + num2);
document.write(num1 + " - " + num2 + " = " + sum);
} else if (op == "*") {
sum = eval(num1 + op + num2);
document.write(num1 + " * " + num2 + " = " + sum);
} else if (op == "/") {
sum = eval(num1 + op + num2);
document.write(num1 + " / " + num2 + " = " + sum);
} else if (op == "%") {
sum = eval(num1 + op + num2);
document.write(num1 + " % " + num2 + " = " + sum);
} else {
document.write("Wrong Input");
}
|
import { colors } from "../styles/main";
import { dependencies as Mods } from "../../package";
export default {
isExpo() {
return !!Mods.expo;
},
getElementStyles(props, baseStyle) {
const elStyle = {
...props,
style: [baseStyle],
};
if (!!props.customStyle) {
elStyle.style.push([props.customStyle]);
}
return elStyle;
},
logError(Error) {
console.log("error", Error);
},
formatDiacritics(string) {
if (!string) {
return "";
}
const start = string.match("&");
const end = string.match(";");
const entity =
!start || !end ? null : string.slice(start.index, end.index + 1);
const entityClean = entity
? "&" + entity.replace(/[^0-9a-z]/gi, "") + ";"
: "";
if (entity) {
const replacement = this.diacriticEntities.find(
(e) => e.html === entityClean.trim()
);
if (replacement) {
return string.replace(entity, replacement.diacritic);
}
}
return string;
},
isValidEmail(email) {
return /^(([^<>()\[\]\\.,;:\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(
email
);
},
formatPhone(s) {
var s2 = ("" + s).replace(/\D/g, "");
var m = s2.match(/^(\d{3})(\d{3})(\d{4})$/);
return !m ? null : "(" + m[1] + ") " + m[2] + "-" + m[3];
},
upperCaseFirst(str) {
return str.charAt(0).toUpperCase() + str.slice(1);
},
sortTerritory(a, b) {
return a.number - b.number;
},
sortAddress(a, b) {
if (a.streetName == b.streetName) {
return (
parseInt(a.address.replace("APT", "").trim()) -
parseInt(b.address.replace("APT", "").trim())
);
}
if (a.streetName < b.streetName) {
return -1;
} else {
return 1;
}
},
sortNotes(a, b) {
return new Date(b.date) - new Date(a.date);
},
sortPublisher(a, b) {
if (a.firstName < b.firstName) return -1;
if (a.firstName > b.firstName) return 1;
return 0;
},
sortUser(a, b) {
if (a.publisher && b.publisher) {
if (a.publisher.firstName < b.publisher.firstName) return -1;
if (a.publisher.firstName > b.publisher.firstName) return 1;
}
if (a.publisher) return 1;
if (b.publisher) return -1;
if (a.email < b.email) return -1;
if (a.email > b.email) return 1;
return 0;
},
getToday() {
return this.getDateString(new Date());
},
getDateString(date) {
return typeof date === "string"
? date
: typeof date === "object"
? this.formatDate(date, "YYYY-MM-DD")
: "";
},
getDateObject(dateStr) {
if (!dateStr) return new Date();
// If already Date object
if (typeof dateStr.getMonth === "function") {
return dateStr;
}
const parts = dateStr.match(/(\d+)/g);
return new Date(parts[0], parts[1] - 1, parts[2]);
},
formatDate(date, format) {
switch (format) {
case "YYYY-MM-DD":
return (
date.getFullYear() +
"-" +
this.getDateSingleDigit(parseInt(date.getMonth()) + 1) +
"-" +
this.getDateSingleDigit(date.getDate())
);
default:
return date;
}
},
getDateSingleDigit(dateInt) {
return dateInt < 10 ? "0" + dateInt : dateInt;
},
getDateStatusColor(date) {
return this.isPassedDueDate(date) ? { color: colors.red } : null;
},
isPassedDueDate(date) {
var d = new Date();
d.setMonth(d.getMonth() - 3);
const passDueDate = d.toDateString();
if (!/Invalid|NaN/.test(new Date(date))) {
return new Date(date) < new Date(passDueDate);
}
return false;
},
getStreetsList(addresses) {
const streetsList = [];
addresses.forEach((s) => {
if (!streetsList.find((i) => i.id === s.streetId))
streetsList.push({
id: s.streetId,
name: s.streetName,
isApt: s.isApt || false,
});
});
return streetsList;
},
mapStreetsToLabelAndValue(data) {
return {
value: data.id,
label: data.name,
};
},
getListingAddress(list) {
if (!list) {
return "";
}
if (list.isApt) return list.building + ", " + list.address;
if (list.apt) return list.address + " " + list.streetName + " " + list.apt;
return list.address + " " + list.streetName;
},
getLastNote(list) {
return list.notes && list.notes.length
? " - " + list.notes.sort(this.sortNotes)[0].note
: "";
},
getListingAddressWithLastNote(list) {
return `${this.getListingAddress(list)} ${this.getLastNote(list)}`;
},
getListingCallablePhones(address) {
if (!address.phones || !address.phones.length) {
return "";
}
return address.phones
.filter((p) => this.isCallable(p))
.map((p) => this.getListingPhoneNumber(p));
},
getListingPhoneNumber(phone) {
return phone && phone.number;
},
isCallable({ notes = [], status = 0 }) {
if (notes.length) {
const fourMonthsAgo = new Date(
new Date().setDate(this.getDateObject().getDate() - 120)
);
return (
notes[0].symbol === "" ||
notes[0].symbol === this.phoneStatuses.STATUS_UNVERIFIED ||
(notes[0].symbol === this.phoneStatuses.STATUS_VALID &&
this.getDateObject(notes[0].date) < fourMonthsAgo)
);
}
return status === "" || status === this.phoneStatuses.STATUS_UNVERIFIED;
},
hasWarning({ notes, status }) {
if (status === this.phoneStatuses.STATUS_DO_NOT_CALL) {
return true;
}
if (!notes) {
return false;
}
return notes[0].symbol === this.phoneStatuses.STATUS_DO_NOT_CALL;
},
navigateToUrl(url) {
window.open(
window.location.protocol + "//" + window.location.host + url,
"_blank"
);
return false;
},
addSlashToUrl(url) {
return url + (url.slice(-1) === "/" ? "" : "/");
},
removeLastSlashFromUrl(url) {
return url.slice(-1) === "/" ? url.substring(0, url.length - 1) : url;
},
urlHasValidProtocol(url) {
const protocol = url && (url.split(":") || [])[0].toLowerCase();
return process.env.NODE_ENV === "development" || protocol === "https";
},
loadExternalScript(url, propName) {
return new Promise((resolve, reject) => {
if (!!propName && !!window[propName]) {
return resolve(window[propName]);
}
var s = document.createElement("script");
s.type = "text/javascript";
s.src = url;
document.body.appendChild(s);
if (!propName) return resolve(true);
this.waitForIt(
() => !!window[propName],
() => {
resolve(window[propName]);
}
);
});
},
waitForIt(conditionIsMet, doAction, time = 100) {
const waitForInterval = setInterval(() => {
if (!!conditionIsMet()) {
clearInterval(waitForInterval);
doAction();
}
}, time);
},
headerNavOptionsDefault: {
headerTitle: () => null,
headerTitleStyle: {
fontSize: 18,
textAlign: "center",
},
headerTitleContainerStyle: {
width: "50%",
},
headerTitleAlign: "center",
headerStyle: {
backgroundColor: colors["territory-blue"],
},
headerTintColor: "#fff",
headerBackTitle: null,
},
brToLineBreaks(strData) {
return strData.replace(/<br>/g, "\n");
},
userTypeLabel(userType) {
return (this.userTypes.find((t) => t.value === userType) || {}).label;
},
userTypes: [
{ value: "Viewer", label: "Viewer" },
{ value: "NoteEditor", label: "Note Editor" },
{ value: "Editor", label: "Editor" },
{ value: "Manager", label: "Manager" },
{ value: "Admin", label: "Admin" },
],
diacriticEntities: [
// acute
{ html: "á", diacritic: "á" },
{ html: "Á", diacritic: "Á" },
{ html: "é", diacritic: "é" },
{ html: "É", diacritic: "É" },
{ html: "ó", diacritic: "ó" },
{ html: "Ó", diacritic: "Ó" },
// grave
{ html: "à", diacritic: "à" },
{ html: "À", diacritic: "À" },
{ html: "è", diacritic: "è" },
{ html: "È", diacritic: "È" },
{ html: "ò", diacritic: "ò" },
{ html: "Ò", diacritic: "Ò" },
{ html: "ù", diacritic: "ù" },
{ html: "À", diacritic: "Ù" },
// ç cedil
{ html: "ç", diacritic: "ç" },
{ html: "Ç", diacritic: "Ç" },
// ˆ circ
{ html: "Â", diacritic: "Â" },
{ html: "â", diacritic: "â" },
{ html: "Ê", diacritic: "Ê" },
{ html: "ê", diacritic: "ê" },
{ html: "Ô", diacritic: "Ô" },
{ html: "ô", diacritic: "ô" },
{ html: "Û", diacritic: "Û" },
{ html: "û", diacritic: "û" },
{ html: "Î", diacritic: "Î" },
{ html: "î", diacritic: "î" },
// ¨ uml
{ html: "Ä", diacritic: "Ä" },
{ html: "ä", diacritic: "ä" },
{ html: "Ë", diacritic: "Ë" },
{ html: "ë", diacritic: "ë" },
{ html: "Ö", diacritic: "Ö" },
{ html: "ö", diacritic: "ö" },
{ html: "Ü", diacritic: "Ü" },
{ html: "ü", diacritic: "ü" },
{ html: "Ï", diacritic: "Ï" },
{ html: "ï", diacritic: "ï" },
],
phoneStatuses: {
STATUS_UNVERIFIED: 0,
STATUS_VALID: 1,
STATUS_NOT_CURRENT_LANGUAGE: 2,
STATUS_NOT_IN_SERVICE: 3,
STATUS_DO_NOT_CALL: 4,
},
phoneStatusLabel(status = 0) {
const statusInx = parseInt(status);
return [
"Unverified",
"Valid",
"Not English Speaking",
"Not In Service",
"DO NOT CALL",
][statusInx];
},
canMakeCall({ number, status, notes = [] }) {
// Check if condition met for making a call
// Example: Not DO NOT CALL, Not In Service, or Not English Speaking
// Allow only "Unverified", "Valid", or empty
if (notes.length) {
return notes[0].symbol === 1 || !notes[0].symbol;
}
return status === 1 || !status;
},
getNumbersOnly(str) {
return str.replace(/[^0-9]+/gi, "");
},
addressStatuses: {
STATUS_NOT_HOME: 0,
STATUS_REVISIT: 1,
STATUS_CHILDREN: 2,
STATUS_BUSY: 3,
STATUS_MAN: 4,
STATUS_WOMAN: 5,
STATUS_DO_NOT_CALL: 6,
STATUS_SENT_LETTER: 7,
STATUS_WITNESS_STUDENT: 8,
},
getLegacyNoteSymbol(note = "") {
const legacyNotes = note.split("-") || [];
return (legacyNotes.length && legacyNotes[0].trim()) || "";
},
isLegacyNote(note = "") {
return note !== "" && note.length <= 2;
},
modeOptionsValues: {
PHONE: "phone",
ADDRESS: "address",
},
};
|
var all________________1________8js____8js__8js_8js =
[
[ "all________1____8js__8js_8js", "all________________1________8js____8js__8js_8js.html#a879bdbf16d71c43f8ea0ccc750afa5df", null ]
];
|
'use strict';
import React, { Component } from 'react'
import { connect } from 'react-redux'
import {
PageNavigator,
actions
} from 'kn-react-native-router'
import * as types from '../../router'
import LoginContainer from './login'
import RegisterContainer from './register'
const {
navigationPop,
navigationPush,
navigationLoginReset
} = actions
class LoginNavigator extends PageNavigator {
constructor(props) {
super(props)
this.name = 'login'
this.container = {
LoginPage: {
routeKey: 'LoginPage',
component: LoginContainer
},
RegisterPage: {
routeKey: 'RegisterPage',
component: RegisterContainer
}
}
//this.showHeader = false
}
}
function mapStateToProps(state) {
return {
navigationState: state.navigation.navigationStates[types.NAVIGATOR_NAME_LOGIN]
}
}
export default connect(mapStateToProps, {
navigationPop,
navigationPush,
navigationLoginReset
}
)(LoginNavigator)
|
export const FETCH_EXPERIENCE = 'FETCH_EXPERIENCE';
export const FETCH_EXPERIENCES = 'FETCH_EXPERIENCES';
export const REQUEST_LOADING_EXPERIENCE = 'REQUEST_LOADING_EXPERIENCE';
export const REQUEST_REJECTED_EXPERIENCE = 'REQUEST_REJECTED_EXPERIENCE';
|
(function () {
'use strict';
// intersection observer
var observerOptions = {
root: null,
rootMargin: "0px",
threshold: .1
};
var condition = false
var callback = function (entries, observer) {
entries.forEach(function (entry) {
if (entry.intersectionRatio > 0) {
// entry.target;
// console.log(entry.target)
// Bug fix for repeated rendering of gallery section
if (!condition) {
renderExamples();
condition = true
}
loadVjs();
initScriptExamples();
observer.unobserve(entry.target);
}
});
let gallerySlider = new Slider('gallery');
gallerySlider.init();
};
var observer = new IntersectionObserver(callback, observerOptions);
var timelapses = JSON.parse($('#timelapses-data').text());
// examples videos
var observerExamples = document.querySelector('.gallery');
observer.observe(observerExamples);
// function render examples
function renderExamples() {
let examplesContainer = document.createElement('div');
examplesContainer.classList.add('slides');
timelapses.forEach((timelapse, index) => {
let slide = document.createElement('div');
slide.classList.add('slide');
slide.innerHTML = `
<div class="card">
<div class="card-img-top">
<video id="tl-${timelapse.id}" class="video-js vjs-default-skin vjs-big-play-centered" controls poster="${timelapse.p_json_url.replace('json', 'poster.jpg')}" data-setup='{"fluid": true, "playbackRates": [0.5, 1, 1.5, 2], "controlBar": {"fullscreenToggle": false}}'>
<source src="${timelapse.p_json_url.replace('.json', '')}" type='video/mp4'>
<p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="https://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p>
</video>
</div>
<div class="card-body">
<div id="alert-banner-${timelapse.id}" class="bg-warning alert-banner text-center">
Possible failure detected!
</div>
<div class="text-center gauge">
<canvas id="gauge-${timelapse.id}" data-type="radial-gauge" data-value-dec="0" data-value-int="0" data-width="240" data-height="240" data-units="false" data-title="Looking Good" data-value-box="false" data-min-value="0" data-max-value="100" data-major-ticks='["","","",""]' data-minor-ticks="4" data-highlights='[{ "from": 0, "to": 33, "color": "#5cb85c" },{ "from": 33, "to": 67, "color": "#f0ad4e" },{ "from": 67, "to": 100, "color": "#d9534f" }]' data-color-plate="rgba(255,255,255,.0)" data-color-title="#5cb85c" data-color-stroke-ticks="#EBEBEB" data-color-numbers="#eee" data-color-needle-start="rgba(240, 128, 128, 1)" data-color-needle-end="rgba(255, 160, 122, .9)" data-value-box="true" data-animation-rule="bounce" data-animation-duration="500" data-animated-value="true" data-start-angle="90" data-ticks-angle="180" data-borders="false"></canvas>
</div>
</div>
</div>
`;
examplesContainer.append(slide);
});
document.getElementById('gallerySlider').querySelector('.slides-wrapper').append(examplesContainer);
}
// load video vjs
function loadVjs() {
let examples = document.getElementById('gallery');
var linkVjs = document.createElement('link');
linkVjs.rel = 'stylesheet';
linkVjs.href = 'https://vjs.zencdn.net/7.4.1/video-js.css';
var scriptCanvasGauges = document.createElement('script');
scriptCanvasGauges.defer = true;
scriptCanvasGauges.src = 'https://cdn.rawgit.com/Mikhus/canvas-gauges/gh-pages/download/2.1.5/all/gauge.min.js';
examples.appendChild(linkVjs);
examples.appendChild(scriptCanvasGauges);
}
function initScriptExamples() {
function scaleP(p) {
var CUT_OFF = 0.45;
var scaleAboveCutOff = 100.0 / 3.0 / (1 - CUT_OFF);
var scaleBelowCutOff = 200.0 / 3.0 / CUT_OFF;
if (p > CUT_OFF) {
return (p - CUT_OFF) * scaleAboveCutOff + 200.0 / 3.0;
} else {
return p * scaleBelowCutOff;
}
}
function updateGauge(gaugeEle, p) {
var scaledP = scaleP(p);
gaugeEle.attr('data-value', scaledP);
if (scaledP > 66) {
gaugeEle.attr('data-title', 'Failing!');
gaugeEle.attr('data-color-title', 'rgba(255,30,0,.75)');
} else if (scaledP > 33) {
gaugeEle.attr('data-title', 'Fishy...');
gaugeEle.attr('data-color-title', 'rgb(255,165,0,.75)');
} else {
gaugeEle.attr('data-title', 'Looking Good');
gaugeEle.attr('data-color-title', 'rgba(0,255,30,.75)');
}
}
for (var i = 0; i < timelapses.length; i++) {
(function () {
// Self-invoking function for closure scope
var tl = timelapses[i];
$.ajax({
type: 'GET',
url: tl.p_json_url,
dataType: 'json',
crossDomain: true,
success: function (frame_p) {
if ($('#tl-' + tl.id).length < 1) return;
var gauge = $('#gauge-' + tl.id);
var vjs = videojs('tl-' + tl.id);
var alertBanner = $('#alert-banner-' + tl.id);
vjs.on('timeupdate', function (e) {
var num = Math.floor(this.currentTime() * 25);
var p = frame_p[num].p;
updateGauge(gauge, p);
if (p > 0.45) {
alertBanner.show();
} else {
alertBanner.hide();
}
});
$('#fullscreen-btn-' + tl.id).click(function () {
vjs.pause();
var currentTime = vjs.currentTime();
$('#tl-modal-title').text('By ' + tl.creator_name);
var modalVjs = videojs('tl-fullscreen-vjs');
modalVjs.src(tl.video_url);
modalVjs.currentTime(currentTime);
modalVjs.play();
modalVjs.on('timeupdate', function (e) {
var num = Math.floor(this.currentTime() * 25);
var p = frame_p[num].p;
updateGauge($('#gauge-fullscreen'), p);
});
});
}
});
})();
}
$('#tl-fullscreen-modal').on('hide.bs.modal', function (e) {
var player = videojs('tl-fullscreen-vjs');
player.pause();
});
}
})();
|
'use strict';
const {DateRestrict} = require(`~/constants`);
const {getRandomInt} = require(`.`);
const getDate = () => {
const date = new Date();
const year = date.getFullYear();
const monthI =
date.getMonth() + 1 - getRandomInt(DateRestrict.MIN, DateRestrict.MAX - 1);
const month = (monthI < 10 && `0`) + monthI;
const dayI = date.getDate();
const day = (dayI < 10 && `0`) + dayI;
const hoursI = date.getHours();
const hours = (hoursI < 10 && `0`) + hoursI;
const minutesI = date.getMinutes();
const minutes = (minutesI < 10 && `0`) + minutesI;
const secondsI = date.getSeconds();
const seconds = (secondsI < 10 && `0`) + secondsI;
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
};
module.exports = {
getDate
};
|
require("dotenv").config();
// PACKAGES
const express = require("express"),
app = express(),
mongoose = require("mongoose"),
bodyParser = require("body-parser"),
methodOverride = require("method-override"),
expressSanitizer = require("express-sanitizer"),
session = require("express-session"),
cookieParser = require("cookie-parser"),
flash = require("connect-flash");
// APP CONFIG
app.set("view engine", "ejs");
app.use(bodyParser.urlencoded({ extended: true }));
app.use(expressSanitizer());
app.use(express.static("public"));
app.use(methodOverride("method"));
app.use(cookieParser());
app.use(
session({
secret: "hang onehundred guy!",
resave: false,
saveUninitialized: true
})
);
app.use(flash());
// CONNECT TO THE DATABASE
mongoose.connect(
`mongodb+srv://mostrtor:bruteforcehill1234@@cluster0-h8mqp.mongodb.net/test?retryWrites=true&w=majority`,
{
useNewUrlParser: true,
useFindAndModify: false
}
);
const db = mongoose.connection;
db.on("error", console.error.bind(console, "connection error:"));
db.once("open", () => console.log("successfully connected to the DB!"));
// ROUTES
app.use("/blogs", require("./routes/blogs"));
// STARTUP SERVER
app.listen(process.env.PORT, process.env.IP, () =>
console.log("BLOG'S SERVER STARTED!")
);
|
module.exports = async function () {
console.log('enter dapp init')
console.log('calling dept contract')
app.registerContract(1330, 'department.department');
console.log('calling employee contract')
app.registerContract(1551, 'employee.employee');
console.log('employee contract registered');
console.log("calling country contract");
console.log("app.contract: ", app.contract);
app.events.on('newBlock', (block) => {
console.log('new block received', block.height)
})
}
|
// [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
/*
3rd = 2nd + 1st
4th = 3rd + 2nd
5th = 4th + 3rd
16th = 15th + 14th
nth = (n-1)th + (n-2)th
ith = (i-1)th + (n-2)th
*/
/*
function fibonacci(n){
if(n < 0 || typeof n != 'number'){
return 'Give a valid number greater than 2'
}
if (n < 2 && n >= 0){
return n;
}
return fibonacci(n-1) + fibonacci(n-2);
}
const fiboElement = fibonacci([31]);
console.log(fiboElement);
*/
function fibonacciSeries(n){
if(n == 0){
return [0];
}
if(n == 1){
return [0, 1];
}
const fibo = fibonacciSeries(n - 1);
fibo[n] = fibo[n - 1] + fibo[n - 2];
return fibo;
}
const fiboElement = fibonacciSeries(6);
console.log(fiboElement);
|
const kedi_btn = document.getElementById('kedi_btn');
const köpek_btn = document.getElementById('köpek_btn');
const kedi_sonucu = document.getElementById('kedi_sonucu');
const köpek_sonucu = document.getElementById('köpek_sonucu');
kedi_btn.addEventListener('click', getRandomCat);
köpek_btn.addEventListener('click', getRandomDog);
function getRandomCat() {
fetch('https://aws.random.cat/meow').
then(res => res.json()).
then(data => {
kedi_sonucu.innerHTML = `<img src=${data.file} alt="cat" />`;
});
}
function getRandomDog() {
fetch('https://random.dog/woof.json').
then(res => res.json()).
then(data => {
if (data.url.includes('.mp4')) {
getRandomDog();
} else
{
köpek_sonucu.innerHTML = `<img src=${data.url} alt="dog" />`;
}
});
}
|
self.__precacheManifest = (self.__precacheManifest || []).concat([
{
"revision": "3ce67189bd2cffb7bee6fc9be1bc21da",
"url": "./index.html"
},
{
"revision": "8beb05bff9d522ef41c9",
"url": "./static/css/main.b3146071.chunk.css"
},
{
"revision": "0e18444e9bb3e9b1c405",
"url": "./static/js/2.a631219f.chunk.js"
},
{
"revision": "71c4abc3071f79554879c334de34ee64",
"url": "./static/js/2.a631219f.chunk.js.LICENSE.txt"
},
{
"revision": "8beb05bff9d522ef41c9",
"url": "./static/js/main.4eeef6de.chunk.js"
},
{
"revision": "3c7327598f2e18f280be",
"url": "./static/js/runtime-main.6acaafd1.js"
},
{
"revision": "5e13c0c8781a0ce846acf0e9d670e26b",
"url": "./static/media/S01E01-a-walk-in-the-woods.5e13c0c8.png"
},
{
"revision": "dffc35a400eeecc4e5a902f36cdd496c",
"url": "./static/media/S01E02-mt-mckinley.dffc35a4.png"
},
{
"revision": "5a2ff9da85b905070941306d5f740a43",
"url": "./static/media/S01E03-ebony-sunset.5a2ff9da.png"
},
{
"revision": "39ec8af1d59a6a2b88467bf47f923979",
"url": "./static/media/S01E04-winter-mist.39ec8af1.png"
},
{
"revision": "2d1e5e9e2b4bb9e74095b569bd14a838",
"url": "./static/media/S01E05-quiet-stream.2d1e5e9e.png"
},
{
"revision": "20a1bbcdaf4f5d227013c380c3985670",
"url": "./static/media/S01E06-winter-moon.20a1bbcd.png"
},
{
"revision": "29c8f11e58cd5a4e33214657e78721d0",
"url": "./static/media/S01E07-autumn-mountain.29c8f11e.png"
},
{
"revision": "3e80b49b7b1b946bc96c1f7325094d5a",
"url": "./static/media/S01E08-peaceful-valley.3e80b49b.png"
},
{
"revision": "11cf046528f2462cfaaba21d5e023264",
"url": "./static/media/S01E09-seascape.11cf0465.png"
},
{
"revision": "e7c0e2e04dfe6967fd556dbd7e1a1c83",
"url": "./static/media/S01E10-mountain-lake.e7c0e2e0.png"
},
{
"revision": "65a4a269d694b39e1716c3abb316fb42",
"url": "./static/media/S01E11-winter-glow.65a4a269.png"
},
{
"revision": "70159e3813347a7f0b0d3f183b84481d",
"url": "./static/media/S01E12-snow-fall.70159e38.png"
},
{
"revision": "5102d40f30f884cff7b597ae0f04a3c0",
"url": "./static/media/S01E13-final-reflections.5102d40f.png"
},
{
"revision": "0eed77248c2ca27b2b9fef786ec20bf7",
"url": "./static/media/S02E01-meadow-lake.0eed7724.png"
},
{
"revision": "fb698212e19e69e669c70617677baed6",
"url": "./static/media/S02E02-winter-sun.fb698212.png"
},
{
"revision": "f5c38cc89b9d3c2fed2bfb9f9d00bb0b",
"url": "./static/media/S02E03-ebony-sea.f5c38cc8.png"
},
{
"revision": "e94297d4f4adc9d28010339fb7b8a870",
"url": "./static/media/S02E04-shades-of-grey.e94297d4.png"
},
{
"revision": "ca8c1f2545b0d1640c8f03145c52d958",
"url": "./static/media/S02E05-autumn-splendor.ca8c1f25.png"
},
{
"revision": "f746371e15b964e0b325f3164cc84371",
"url": "./static/media/S02E06-black-river.f746371e.png"
},
{
"revision": "888e93c9ed67909090520cdd6e23c4f7",
"url": "./static/media/S02E07-brown-mountain.888e93c9.png"
},
{
"revision": "1a0fda59a13a9399d3e06faba5c9a32d",
"url": "./static/media/S02E08-reflections.1a0fda59.png"
},
{
"revision": "e073f686beda8fe9a040e4a5129c3ade",
"url": "./static/media/S02E09-black-and-white-seascape.e073f686.png"
},
{
"revision": "a01917db8751646075677cb9a2d43d64",
"url": "./static/media/S02E10-lazy-river.a01917db.png"
},
{
"revision": "406deff3a8793f2fefbf541cebcb5d03",
"url": "./static/media/S02E11-black-waterfall.406deff3.png"
},
{
"revision": "0e80ac82f931cadce19e9f3557dc5a2a",
"url": "./static/media/S02E12-mountain-waterfall.0e80ac82.png"
},
{
"revision": "48a9b7758eda8b2d3b31addd062b34f3",
"url": "./static/media/S02E13-final-grace.48a9b775.png"
},
{
"revision": "1d027b451928d385cefd11dafb89fad0",
"url": "./static/media/S03E01-mountain-retreat.1d027b45.png"
},
{
"revision": "9cb6dfefd67128b71794446abb4ad7e7",
"url": "./static/media/S03E02-blue-moon.9cb6dfef.png"
},
{
"revision": "89ecb838a0fa5adcf89cd583444b530c",
"url": "./static/media/S03E03-bubbling-stream.89ecb838.png"
},
{
"revision": "7743f37008e9909e90517a4e2e314952",
"url": "./static/media/S03E04-winter-night.7743f370.png"
},
{
"revision": "d7ebf5b8954c0747a5a8b52320891761",
"url": "./static/media/S03E05-distant-hills.d7ebf5b8.png"
},
{
"revision": "1b7de73929177771fd20d5d1584b3e9d",
"url": "./static/media/S03E06-covered-bridge.1b7de739.png"
},
{
"revision": "18a93b398cbaa08aa64b19b4fe5ffc1c",
"url": "./static/media/S03E07-quiet-inlet.18a93b39.png"
},
{
"revision": "58c18b71ab191e7dd50b3ee57d1eff93",
"url": "./static/media/S03E08-night-light.58c18b71.png"
},
{
"revision": "019dff3a427ccda7fc65bd2389eb081d",
"url": "./static/media/S03E09-the-old-mill.019dff3a.png"
},
{
"revision": "a249b7436928850fd1a7ec1b8425a8c7",
"url": "./static/media/S03E10-campfire.a249b743.png"
},
{
"revision": "1de681b2ad141f7cbf0200a3e1d64d7a",
"url": "./static/media/S03E11-rustic-barn.1de681b2.png"
},
{
"revision": "56bbb937715a3f85f9744e26872ce4a8",
"url": "./static/media/S03E12-hidden-lake.56bbb937.png"
},
{
"revision": "a59ba0815664a8d0e866c9811e19b09d",
"url": "./static/media/S03E13-peaceful-waters.a59ba081.png"
},
{
"revision": "e5798df9c6e247e5ac941aeb04166063",
"url": "./static/media/S04E01-purple-splendor.e5798df9.png"
},
{
"revision": "8860d3575db2f736bad40e3cba254347",
"url": "./static/media/S04E02-tranquil-valley.8860d357.png"
},
{
"revision": "1e577269f0e73f9e4a968b1038e17608",
"url": "./static/media/S04E03-majestic-mountains.1e577269.png"
},
{
"revision": "32fee64d0214dd47f3653f55b2d7506a",
"url": "./static/media/S04E04-winter-sawscape.32fee64d.png"
},
{
"revision": "5c255d23a7bb6e804cb6c581bfc7224b",
"url": "./static/media/S04E05-evening-seascape.5c255d23.png"
},
{
"revision": "4cd81b894cfacc4c59e6b0eb9d63b055",
"url": "./static/media/S04E06-warm-summer-day.4cd81b89.png"
},
{
"revision": "54221b03ac01fd4a1b11f490e20639ee",
"url": "./static/media/S04E07-cabin-in-the-woods.54221b03.png"
},
{
"revision": "696e4a9b92ca5d66695622ab9f5ea786",
"url": "./static/media/S04E08-wetlands.696e4a9b.png"
},
{
"revision": "698f06d5ff6387316239d6bd4218fc30",
"url": "./static/media/S04E09-cool-waters.698f06d5.png"
},
{
"revision": "0be2eb3c6c7beb9b9e06d7098e0d21ef",
"url": "./static/media/S04E10-quiet-woods.0be2eb3c.png"
},
{
"revision": "a984bacb99eb73a5a20d2d24b2607cc1",
"url": "./static/media/S04E11-northwest-majesty.a984bacb.png"
},
{
"revision": "09a234e893eae49a7c819dba3f7f81bd",
"url": "./static/media/S04E12-autumn-days.09a234e8.png"
},
{
"revision": "b21520c7b45db38c255659d31e9ef3f6",
"url": "./static/media/S04E13-mountain-challenge.b21520c7.png"
},
{
"revision": "ddd7a3880d41cc945cbdf58245045c46",
"url": "./static/media/S05E01-mountain-waterfall.ddd7a388.png"
},
{
"revision": "6a29301e0c1e52833e97601d08bfb17d",
"url": "./static/media/S05E02-twilight-meadow.6a29301e.png"
},
{
"revision": "4dff903c117ee573f7e9db82c8829cea",
"url": "./static/media/S05E03-mountain-blossoms.4dff903c.png"
},
{
"revision": "91102c5136e4f9383bb4a0b258c4a3fc",
"url": "./static/media/S05E04-winter-stillness.91102c51.png"
},
{
"revision": "4670ff30edd3271b20b70addcc777b76",
"url": "./static/media/S05E05-quiet-pond.4670ff30.png"
},
{
"revision": "0af20697085b10bed74584b6235b7d88",
"url": "./static/media/S05E06-ocean-sunrise.0af20697.png"
},
{
"revision": "1b607bb1a71205255c2e69dd30ec6165",
"url": "./static/media/S05E07-bubbling-brook.1b607bb1.png"
},
{
"revision": "17cac3266e9236ced24dfcfbbf56dff3",
"url": "./static/media/S05E08-arizona-splendor.17cac326.png"
},
{
"revision": "f65beef6dc1967f062e43e213afd34c6",
"url": "./static/media/S05E09-anatomy-of-a-wave.f65beef6.png"
},
{
"revision": "1b3d1bb99a359b9966d1f97b0bf8c00e",
"url": "./static/media/S05E10-the-windmill.1b3d1bb9.png"
},
{
"revision": "b23480609325dc7cc10607cc51047aea",
"url": "./static/media/S05E11-autumn-glory.b2348060.png"
},
{
"revision": "c58b7719912fcbe515b2b9c44d894f2a",
"url": "./static/media/S05E12-indian-girl.c58b7719.png"
},
{
"revision": "4c1615fae18130d1dfe37a70f479cc0d",
"url": "./static/media/S05E13-meadow-stream.4c1615fa.png"
},
{
"revision": "09cbfcec15c59c1bd87356aa361084a4",
"url": "./static/media/S06E01-blue-river.09cbfcec.png"
},
{
"revision": "36ca786dee8dbe838c144dd9902fd95f",
"url": "./static/media/S06E02-natures-edge.36ca786d.png"
},
{
"revision": "dff01312128e5ceaab5e28eed0e5189a",
"url": "./static/media/S06E03-morning-mist.dff01312.png"
},
{
"revision": "5115f69c7a4020fa286f882ceebccabc",
"url": "./static/media/S06E04-whispering-stream.5115f69c.png"
},
{
"revision": "86ffae5b035ba4270dbb34c6725ceae4",
"url": "./static/media/S06E05-secluded-forest.86ffae5b.png"
},
{
"revision": "5a42ba334c74db1424870687235eaa5a",
"url": "./static/media/S06E06-snow-trail.5a42ba33.png"
},
{
"revision": "7c05e1bfa092d5c1c0ba54f0ea919ac5",
"url": "./static/media/S06E07-arctic-beauty.7c05e1bf.png"
},
{
"revision": "6e6fab8606922cf8e3122c499a11ddb1",
"url": "./static/media/S06E08-horizons-west.6e6fab86.png"
},
{
"revision": "9a9eb695f589570e327ab4ff0c3ee8f6",
"url": "./static/media/S06E09-high-chateau.9a9eb695.png"
},
{
"revision": "72ea699423fc3d4e1f19fce1feacc373",
"url": "./static/media/S06E10-country-life.72ea6994.png"
},
{
"revision": "0bd59ae85ff76862b2163299ddf66a4e",
"url": "./static/media/S06E11-western-expanse.0bd59ae8.png"
},
{
"revision": "12e57f87d72f7b1fa0e385e7634151f0",
"url": "./static/media/S06E12-marshlands.12e57f87.png"
},
{
"revision": "d345b8c9bc8fac6bf5d280f03329d457",
"url": "./static/media/S06E13-blaze-of-color.d345b8c9.png"
},
{
"revision": "30c0915e680e950119f9027c5145bfa1",
"url": "./static/media/S07E01-winter-cabin.30c0915e.png"
},
{
"revision": "e4521a84c40c8d5bfda7f6c548c01111",
"url": "./static/media/S07E02-secluded-lake.e4521a84.png"
},
{
"revision": "fa28946c32bc06f6e5039da5f540a69f",
"url": "./static/media/S07E03-evergreens-at-sunset.fa28946c.png"
},
{
"revision": "2be5ad8f94c4cf7f0e34365bd1b34718",
"url": "./static/media/S07E04-mountain-cabin.2be5ad8f.png"
},
{
"revision": "8497d22679df7aea171ffbe20456264b",
"url": "./static/media/S07E05-portrait-of-sally.8497d226.png"
},
{
"revision": "a261443c1548274d7292eafda33a476a",
"url": "./static/media/S07E06-misty-waterfall.a261443c.png"
},
{
"revision": "dccbb3ec2a06c99a6614e4e4e0907601",
"url": "./static/media/S07E07-barn-at-sunset.dccbb3ec.png"
},
{
"revision": "793d0033ce885f4babac2b072e721159",
"url": "./static/media/S07E08-mountain-splendor.793d0033.png"
},
{
"revision": "8ec679eb179c75f2ff0124948a85a19c",
"url": "./static/media/S07E09-lake-by-mountain.8ec679eb.png"
},
{
"revision": "2f6347e6bd87d12c37b55dc03e6c58d3",
"url": "./static/media/S07E10-mountain-glory.2f6347e6.png"
},
{
"revision": "02cfeaa471531fd9e79e38bedf660969",
"url": "./static/media/S07E11-grey-winter.02cfeaa4.png"
},
{
"revision": "15f490f0cc187bf9a2529889912b84d5",
"url": "./static/media/S07E12-dock-scene.15f490f0.png"
},
{
"revision": "deb723f0bc1c94cc5ce41dce3bbd6b59",
"url": "./static/media/S07E13-dark-waterfall.deb723f0.png"
},
{
"revision": "ad6a1db05054ec8c11d994092f18e7ab",
"url": "./static/media/S08E01-misty-rolling-hills.ad6a1db0.png"
},
{
"revision": "c42e4523eff9886a90dcf559cbd7c347",
"url": "./static/media/S08E02-lakeside-cabin.c42e4523.png"
},
{
"revision": "9cfe4f21a5f1375dcc3c29c5dbafb41f",
"url": "./static/media/S08E03-warm-winter-day.9cfe4f21.png"
},
{
"revision": "846a7235ad0511ea7b75aa70a5fae9d6",
"url": "./static/media/S08E04-waterside-way.846a7235.png"
},
{
"revision": "5080b2bd482a3975544d41bed3c9b459",
"url": "./static/media/S08E05-hunters-haven.5080b2bd.png"
},
{
"revision": "538ef031e231287d5be3b452c777ab5d",
"url": "./static/media/S08E06-bubbling-mountain-brook.538ef031.png"
},
{
"revision": "15228157c12efcf78f946e7ca53515c2",
"url": "./static/media/S08E07-winter-hideaway.15228157.png"
},
{
"revision": "306d092514bcc6721d546c0143513c32",
"url": "./static/media/S08E08-foot-of-the-mountain.306d0925.png"
},
{
"revision": "4f9ce6c327c5174c6f04b9b903e63317",
"url": "./static/media/S08E09-majestic-pine.4f9ce6c3.png"
},
{
"revision": "8ce462ecd9fa8a3f5f6b42a902e257fb",
"url": "./static/media/S08E10-cactus-at-sunset.8ce462ec.png"
},
{
"revision": "2417fe15a0710976d3dec0f161c9d0a5",
"url": "./static/media/S08E11-mountain-range.2417fe15.png"
},
{
"revision": "fef222f497d6f4e3d897e2418e0ea5f7",
"url": "./static/media/S08E12-lonely-retreat.fef222f4.png"
},
{
"revision": "c6f53db4622cf869dfd70b793bb7f8d9",
"url": "./static/media/S08E13-northern-lights.c6f53db4.png"
},
{
"revision": "fb2e9919a8c7c3e9742548ec422cb067",
"url": "./static/media/S09E01-winter-evergreens.fb2e9919.png"
},
{
"revision": "b5a4947ba37b066fa8bf4d3142a5ff46",
"url": "./static/media/S09E02-surfs-up.b5a4947b.png"
},
{
"revision": "f2be2cd1427ae0540d1c2943d6ac0f0a",
"url": "./static/media/S09E03-red-sunset.f2be2cd1.png"
},
{
"revision": "15bcd38d17c1946d715a6bf3368dea00",
"url": "./static/media/S09E04-meadow-road.15bcd38d.png"
},
{
"revision": "c8d24e167813ce43ad0b676e8d98d029",
"url": "./static/media/S09E05-winter-oval.c8d24e16.png"
},
{
"revision": "6632852bb3781c9672e5f9410a4a2d13",
"url": "./static/media/S09E06-secluded-beach.6632852b.png"
},
{
"revision": "32d3e92b1e2fbe903727d275c17bbaad",
"url": "./static/media/S09E07-forest-hills.32d3e92b.png"
},
{
"revision": "89b8ff529638c309a21a36b12373bacd",
"url": "./static/media/S09E08-little-house-by-the-road.89b8ff52.png"
},
{
"revision": "926355803fa56d0f4c242c1d2f64336d",
"url": "./static/media/S09E09-mountain-path.92635580.png"
},
{
"revision": "c5d0ca4487a6d1fe2a664be102236e56",
"url": "./static/media/S09E10-country-charm.c5d0ca44.png"
},
{
"revision": "a90d04337631442d60b7be5c402bab90",
"url": "./static/media/S09E11-natures-paradise.a90d0433.png"
},
{
"revision": "5fb7db99a9ca4bc1d99e223d8e46b578",
"url": "./static/media/S09E12-mountain-by-the-sea.5fb7db99.png"
},
{
"revision": "b37553fa5649e16a34b3b54f19e6b31c",
"url": "./static/media/S09E13-mountain-hideaway.b37553fa.png"
},
{
"revision": "c65216713beb3c9e4ba9cf7f8c19c6d3",
"url": "./static/media/S10E01-towering-peaks.c6521671.png"
},
{
"revision": "92374f81f5959756a87c7b325e05cb32",
"url": "./static/media/S10E02-cabin-at-sunset.92374f81.png"
},
{
"revision": "a97e862b768d9d649b7f35ed7c5ffeb7",
"url": "./static/media/S10E03-twin-falls.a97e862b.png"
},
{
"revision": "15b56e3ae2ef2f9f48b0707b94e25adb",
"url": "./static/media/S10E04-secluded-bridge.15b56e3a.png"
},
{
"revision": "43fc7718f27a85313ce332f1071858dd",
"url": "./static/media/S10E05-ocean-breeze.43fc7718.png"
},
{
"revision": "a395b9f93069ea6821709a759c0fc8d9",
"url": "./static/media/S10E06-autumn-woods.a395b9f9.png"
},
{
"revision": "5852f8892630520c5e1540d90644a5e5",
"url": "./static/media/S10E07-winter-solitude.5852f889.png"
},
{
"revision": "2aae602b8238a9812ec2b7b1e5a837f2",
"url": "./static/media/S10E08-golden-sunset.2aae602b.png"
},
{
"revision": "23e3fa210b8eb02915076f20349466ed",
"url": "./static/media/S10E09-mountain-oval.23e3fa21.png"
},
{
"revision": "a42fd17518d22a0af1b6abf2bcb60219",
"url": "./static/media/S10E10-ocean-sunset.a42fd175.png"
},
{
"revision": "3dd9a9d59fe8274bc84dd6313f7df9f6",
"url": "./static/media/S10E11-triple-view.3dd9a9d5.png"
},
{
"revision": "94bc935ca148ee3d5a8c1ffc06e4a8b0",
"url": "./static/media/S10E12-winter-frost.94bc935c.png"
},
{
"revision": "40dab05c72e141df8701fb08af7c1810",
"url": "./static/media/S10E13-lakeside-cabin.40dab05c.png"
},
{
"revision": "e50280f46c271fd7dd9f18cbeb290907",
"url": "./static/media/S11E01-mountain-stream.e50280f4.png"
},
{
"revision": "ce6bb85e39b4d6eace69c4c7de87b87d",
"url": "./static/media/S11E02-country-cabin.ce6bb85e.png"
},
{
"revision": "75d3c001effa53e4e0c0fc93a2d58895",
"url": "./static/media/S11E03-daisy-delight.75d3c001.png"
},
{
"revision": "9f163900e3816e39b248401b3d777008",
"url": "./static/media/S11E04-hidden-stream.9f163900.png"
},
{
"revision": "7f13c354677d90bc9b61b36689d44636",
"url": "./static/media/S11E05-towering-glacier.7f13c354.png"
},
{
"revision": "3aa510a877a599d0845807e6ae8f8388",
"url": "./static/media/S11E06-oval-barn.3aa510a8.png"
},
{
"revision": "56bfc2bed261263f6aea63604ab1f424",
"url": "./static/media/S11E07-lakeside-path.56bfc2be.png"
},
{
"revision": "4868f5f6a9d6edf84f899643366f4a5e",
"url": "./static/media/S11E08-sunset-oval.4868f5f6.png"
},
{
"revision": "3184e94736403fc579ed2a11052f7a5d",
"url": "./static/media/S11E09-winter-barn.3184e947.png"
},
{
"revision": "e6ab17c20d359ea8752baa0d09488f89",
"url": "./static/media/S11E10-sunset-over-the-waves.e6ab17c2.png"
},
{
"revision": "c3cbb833a67daab57b0b84e3009f933f",
"url": "./static/media/S11E11-golden-glow.c3cbb833.png"
},
{
"revision": "927568326278a46203fc9c27be3f45e6",
"url": "./static/media/S11E12-roadside-barn.92756832.png"
},
{
"revision": "b913238de2b4b9a1a9ac3d63dd5c61c3",
"url": "./static/media/S11E13-happy-accident.b913238d.png"
},
{
"revision": "b19c02673027472626c63234c7bf5e41",
"url": "./static/media/S12E01-golden-knoll.b19c0267.png"
},
{
"revision": "eb79ed0ecd74292daab72bf15c339e0b",
"url": "./static/media/S12E02-mountain-reflections.eb79ed0e.png"
},
{
"revision": "c9815b6451bafca8bf3fdc4a538694d1",
"url": "./static/media/S12E03-secluded-mountain.c9815b64.png"
},
{
"revision": "ce848e1f24896bbd5b053f229200a514",
"url": "./static/media/S12E04-bright-autumn-trees.ce848e1f.png"
},
{
"revision": "0753c07d3acbe2663604b6d2ec05de36",
"url": "./static/media/S12E05-black-seascape.0753c07d.png"
},
{
"revision": "31c0117b859ef0eb427622003648ec07",
"url": "./static/media/S12E06-steep-mountains.31c0117b.png"
},
{
"revision": "8774b8358ab2c5bbfc80a4b9e6ee80d0",
"url": "./static/media/S12E07-quiet-mountains-river.8774b835.png"
},
{
"revision": "85f02ec5f952a38a68998259b63e8557",
"url": "./static/media/S12E08-evening-waterfall.85f02ec5.png"
},
{
"revision": "10d020b1610475f82c84513efcec1d97",
"url": "./static/media/S12E09-tropical-seascape.10d020b1.png"
},
{
"revision": "81acd605c5ec5fdcfa9892effcc53725",
"url": "./static/media/S12E10-mountain-at-sunset.81acd605.png"
},
{
"revision": "f17c024171585ac709b293d5e34191f6",
"url": "./static/media/S12E11-soft-mountain-glow.f17c0241.png"
},
{
"revision": "40f7f58949166045ddcc98f373b14620",
"url": "./static/media/S12E12-mountain-in-an-oval.40f7f589.png"
},
{
"revision": "02d6f40b1f6a044fce8bc4a8445977ef",
"url": "./static/media/S12E13-winter-mountain.02d6f40b.png"
},
{
"revision": "b97024f29f60b461ee715e5bc527c5a7",
"url": "./static/media/S13E01-rolling-hills.b97024f2.png"
},
{
"revision": "3a363156719b2d9fd78577e88d1db09a",
"url": "./static/media/S13E02-frozen-solitude.3a363156.png"
},
{
"revision": "9375ca3128ca28025cb18f57b00f7d3e",
"url": "./static/media/S13E03-meadow-brook.9375ca31.png"
},
{
"revision": "af3e78dd0c94ea318bfcd519ed75970a",
"url": "./static/media/S13E04-evening-at-sunset.af3e78dd.png"
},
{
"revision": "527f40da897782bc133f248f8dd0f5ae",
"url": "./static/media/S13E05-mountain-view.527f40da.png"
},
{
"revision": "f0ecd9896763490a0b212ba9e9c92912",
"url": "./static/media/S13E06-hidden-creek.f0ecd989.png"
},
{
"revision": "83c54ba44a83b6efdd4be7b27ea1e403",
"url": "./static/media/S13E07-peaceful-haven.83c54ba4.png"
},
{
"revision": "3f3fae93b3af97d23555c77bbee5f49b",
"url": "./static/media/S13E08-mountain-exhibition.3f3fae93.png"
},
{
"revision": "14b2cfe5341bb4ee1da896175595f868",
"url": "./static/media/S13E09-emerald-waters.14b2cfe5.png"
},
{
"revision": "71dc0628f8547f1aabe5249d5d30fa88",
"url": "./static/media/S13E10-mountain-summit.71dc0628.png"
},
{
"revision": "110f402040b8a3c25359bdd85c573b73",
"url": "./static/media/S13E11-cabin-hideaway.110f4020.png"
},
{
"revision": "29fbbd47d51cd46f19eba4d578694ed1",
"url": "./static/media/S13E12-oval-essence.29fbbd47.png"
},
{
"revision": "5e46274feb18fc628aa89e4bf4d862a8",
"url": "./static/media/S13E13-lost-lake.5e46274f.png"
},
{
"revision": "1a4e043978d42aacb00c3902ae175429",
"url": "./static/media/S14E01-distant-mountains.1a4e0439.png"
},
{
"revision": "e1a9db5c2da9b6a6b2a1057f553a20b4",
"url": "./static/media/S14E02-meadow-brook-surprise.e1a9db5c.png"
},
{
"revision": "9a9d820a15eed37c799bf66c261b2b4f",
"url": "./static/media/S14E03-mountain-moonlight-oval.9a9d820a.png"
},
{
"revision": "c8c32e492b6793e22b662ac052ec1cae",
"url": "./static/media/S14E04-snowy-solitude.c8c32e49.png"
},
{
"revision": "b7d80ed25d5708778ff19f4f052df147",
"url": "./static/media/S14E05-mountain-river.b7d80ed2.png"
},
{
"revision": "be97d7415b22f8d1e4ba1f4194149ecf",
"url": "./static/media/S14E06-graceful-mountains.be97d741.png"
},
{
"revision": "22b9383ea6e9afcaa2b9318f615055e8",
"url": "./static/media/S14E07-windy-waves.22b9383e.png"
},
{
"revision": "c6ec211b2394db2971d628eab6a13dcd",
"url": "./static/media/S14E08-on-a-clear-day.c6ec211b.png"
},
{
"revision": "b7cdc9fa88c09c7c02ae8f597564bfaf",
"url": "./static/media/S14E09-riverside-escape-oval.b7cdc9fa.png"
},
{
"revision": "7b91d8da98a70e1ae28951bbd2db927a",
"url": "./static/media/S14E10-surprising-falls.7b91d8da.png"
},
{
"revision": "f3df39b9f596993c78058a9caa03be53",
"url": "./static/media/S14E11-shadow-pond.f3df39b9.png"
},
{
"revision": "205d66661eb43f2a948603c8f2f959d7",
"url": "./static/media/S14E12-misty-forest-oval.205d6666.png"
},
{
"revision": "2d8575d23023111f76f2755d91fcb298",
"url": "./static/media/S14E13-natural-wonder.2d8575d2.png"
},
{
"revision": "60ad682f59505a3aab3bf0998e7ee2f7",
"url": "./static/media/S15E01-splendor-of-winter.60ad682f.png"
},
{
"revision": "15b701479f6368f82064451f9588b031",
"url": "./static/media/S15E02-colors-of-nature.15b70147.png"
},
{
"revision": "a0ecb5a3aee776e4471a8b58e4ea3902",
"url": "./static/media/S15E03-grandpas-barn.a0ecb5a3.png"
},
{
"revision": "332b5fc1158a5b89ce4a844988d441ee",
"url": "./static/media/S15E04-peaceful-reflections.332b5fc1.png"
},
{
"revision": "a1124c1b59817ce25e67259f54fbe99c",
"url": "./static/media/S15E05-hidden-winter-moon-oval.a1124c1b.png"
},
{
"revision": "a057c585d3beab7f3ebf910967450ebb",
"url": "./static/media/S15E06-waves-of-wonder.a057c585.png"
},
{
"revision": "1832f72f649937ef38d5baaf7d499e44",
"url": "./static/media/S15E07-cabin-by-the-pond.1832f72f.png"
},
{
"revision": "57a94a4ab0926de213eb2594786932f4",
"url": "./static/media/S15E08-fall-stream.57a94a4a.png"
},
{
"revision": "38e8394005ef307efc2914bd44d32404",
"url": "./static/media/S15E09-christmas-eve-snow.38e83940.png"
},
{
"revision": "7178a3d1955de129b1da3d927fb44e63",
"url": "./static/media/S15E10-forest-down-oval.7178a3d1.png"
},
{
"revision": "09fc4632bd20634d3001d9f78e4cef44",
"url": "./static/media/S15E11-pathway-to-autumn.09fc4632.png"
},
{
"revision": "67c9ffac586b468dd84ae8e8fb2a050b",
"url": "./static/media/S15E12-deep-forest-lake.67c9ffac.png"
},
{
"revision": "42ce9e355c8a57928f0508f724d0d8d4",
"url": "./static/media/S15E13-peaks-of-majesty.42ce9e35.png"
},
{
"revision": "a8ff040656fe3b818b9aa4a8c286bed5",
"url": "./static/media/S16E01-two-seasons.a8ff0406.png"
},
{
"revision": "e9710274e30aa390300cb8fbbecff555",
"url": "./static/media/S16E02-nestled-cabin.e9710274.png"
},
{
"revision": "27d0d441132839ab7b925ccb138a7fa1",
"url": "./static/media/S16E03-wintertime-discovery.27d0d441.png"
},
{
"revision": "7712fb6402f6b3a29c4a37a5ec7570d2",
"url": "./static/media/S16E04-mountain-mirage-wood-shape.7712fb64.png"
},
{
"revision": "8df1742541bce567594eb25ae7d3b5b3",
"url": "./static/media/S16E05-double-oval-fantasy.8df17425.png"
},
{
"revision": "32b2ba8d9126a23749b0a3b66019ab04",
"url": "./static/media/S16E06-contemplative-lady.32b2ba8d.png"
},
{
"revision": "8c394e091d60320106f5c7933fc9db57",
"url": "./static/media/S16E07-deep-woods.8c394e09.png"
},
{
"revision": "c6702ab923ea1185b1bcf6ece291edcf",
"url": "./static/media/S16E08-high-tide.c6702ab9.png"
},
{
"revision": "aebab015cb20ffd4684538a6a93bfc68",
"url": "./static/media/S16E09-barn-in-snow-oval.aebab015.png"
},
{
"revision": "5db7d235e7f647550d3dd1d0630f79b0",
"url": "./static/media/S16E10-that-time-of-year.5db7d235.png"
},
{
"revision": "4a5d736dede16fba5ea431dc1a2c340c",
"url": "./static/media/S16E11-waterfall-wonder.4a5d736d.png"
},
{
"revision": "1148e04dd6a2156643cedfb9ee0ed38c",
"url": "./static/media/S16E12-mighty-mountain-lake.1148e04d.png"
},
{
"revision": "1199df15069cec30083dafe1f67bf6bf",
"url": "./static/media/S16E13-wooded-stream-oval.1199df15.png"
},
{
"revision": "07d9063e87f2caf606eefba21db9446f",
"url": "./static/media/S17E01-golden-mist-oval.07d9063e.png"
},
{
"revision": "4bf14d50a1a230052db5bab6c22dbd2c",
"url": "./static/media/S17E02-the-old-home-place.4bf14d50.png"
},
{
"revision": "d678e0a59bc4fe67f6bc101eb2d6b566",
"url": "./static/media/S17E03-soothing-vista.d678e0a5.png"
},
{
"revision": "0e0e12c60adc16e7982d049313852636",
"url": "./static/media/S17E04-stormy-seas.0e0e12c6.png"
},
{
"revision": "037814bf893225443fe04c91bedde517",
"url": "./static/media/S17E05-country-time.037814bf.png"
},
{
"revision": "49c6cc6f877770239d5841350f252a48",
"url": "./static/media/S17E06-a-mild-winters-day.49c6cc6f.png"
},
{
"revision": "1d9b9d16e8034a4369f581e53d576729",
"url": "./static/media/S17E07-spectacular-waterfall.1d9b9d16.png"
},
{
"revision": "42a863a60a3088039ddef3582b70ba73",
"url": "./static/media/S17E08-view-from-the-park.42a863a6.png"
},
{
"revision": "af755536c650a6dc7abb031bcc2d1e43",
"url": "./static/media/S17E09-lake-view.af755536.png"
},
{
"revision": "70c12e6c8ffa26fdf3f7dfa7d41d9616",
"url": "./static/media/S17E10-old-country-mill.70c12e6c.png"
},
{
"revision": "4b6e7227a8b13648c775f57548ac1b9f",
"url": "./static/media/S17E11-morning-walk.4b6e7227.png"
},
{
"revision": "03930af2cec0fe5a5bcd064d6614b344",
"url": "./static/media/S17E12-natures-splendor.03930af2.png"
},
{
"revision": "9d01ad1185da2aaec8271b05d80aa094",
"url": "./static/media/S17E13-mountain-beauty.9d01ad11.png"
},
{
"revision": "f83fa6f3d469c319e3e017bbf2b77562",
"url": "./static/media/S18E01-halfoval-vignette.f83fa6f3.png"
},
{
"revision": "1a83d39ed2bc5f99ca5329290583afba",
"url": "./static/media/S18E02-absolutely-autumn.1a83d39e.png"
},
{
"revision": "296eaa088b675433e4ecae95089e6a90",
"url": "./static/media/S18E03-mountain-seclusion.296eaa08.png"
},
{
"revision": "2373e4a173a39f7ad12c246ded845907",
"url": "./static/media/S18E04-crimson-oval.2373e4a1.png"
},
{
"revision": "35258302510c46a8730524bb84f04fab",
"url": "./static/media/S18E05-autumn-exhibition.35258302.png"
},
{
"revision": "7307d5dc6172663409641d90a981ef1e",
"url": "./static/media/S18E06-majestic-peaks.7307d5dc.png"
},
{
"revision": "bafb2752926dca8aaf4f3e14aaf62722",
"url": "./static/media/S18E07-golden-morning-mist.bafb2752.png"
},
{
"revision": "01c8f0566c7c254c93f03a6cb205e928",
"url": "./static/media/S18E08-winter-lace.01c8f056.png"
},
{
"revision": "4da7357bb00af26560fbf980d397fe5f",
"url": "./static/media/S18E09-seascape-fantasy.4da7357b.png"
},
{
"revision": "b8c935f0dfd6dfb826525fb23401a9c4",
"url": "./static/media/S18E10-double-oval-stream.b8c935f0.png"
},
{
"revision": "dfcef311f3cd9da17c47975a8ac4f23f",
"url": "./static/media/S18E11-enchanted-forest.dfcef311.png"
},
{
"revision": "7b6ab800ecf7bd71990f4041d0e05d9c",
"url": "./static/media/S18E12-southwest-serenity.7b6ab800.png"
},
{
"revision": "d512a796b5661514216f1075a5b9c1f6",
"url": "./static/media/S18E13-rippling-waters.d512a796.png"
},
{
"revision": "21033d26c5b84d1562b04816c52c9711",
"url": "./static/media/S19E01-snowfall-magic.21033d26.png"
},
{
"revision": "4298a2a826e6e6901a0375f50c18ade9",
"url": "./static/media/S19E02-quiet-mountain-lake.4298a2a8.png"
},
{
"revision": "7d22d30525e570c9f616be87b669c1e9",
"url": "./static/media/S19E03-final-embers-of-sunlight.7d22d305.png"
},
{
"revision": "a4658ccbccc81ca23cfc4d33a96788fd",
"url": "./static/media/S19E04-snowy-morn.a4658ccb.png"
},
{
"revision": "7df32ca5bbe60ef490838a87034791d4",
"url": "./static/media/S19E05-campers-haven.7df32ca5.png"
},
{
"revision": "280a0e67b7f15a91a2b57da9a078dac4",
"url": "./static/media/S19E06-waterfall-in-the-woods.280a0e67.png"
},
{
"revision": "b0e5fd9c550212f97625d0fb17e61f9c",
"url": "./static/media/S19E07-covered-bridge-oval.b0e5fd9c.png"
},
{
"revision": "f7849a758085c0e1be4280ea17132531",
"url": "./static/media/S19E08-scenic-seclusion.f7849a75.png"
},
{
"revision": "7ec994dbc49c11b62bb3dc472e332bac",
"url": "./static/media/S19E09-ebb-tide.7ec994db.png"
},
{
"revision": "85011cc344954e380f515c66f31434c4",
"url": "./static/media/S19E10-after-the-rain.85011cc3.png"
},
{
"revision": "89f09f18fc5adb36582f2587522db834",
"url": "./static/media/S19E11-winter-elegance.89f09f18.png"
},
{
"revision": "0fe7b11ec4a3e4265e053033d4ed29c8",
"url": "./static/media/S19E12-evenings-peace.0fe7b11e.png"
},
{
"revision": "ee5085c14aec82b2bc79785d7776b675",
"url": "./static/media/S19E13-valley-of-tranquility.ee5085c1.png"
},
{
"revision": "e718446710b6a9840b2e3db40a603212",
"url": "./static/media/S20E01-mystic-mountain.e7184467.png"
},
{
"revision": "6feb79430c8e1f216e016174b9a38bec",
"url": "./static/media/S20E02-new-days-dawn.6feb7943.png"
},
{
"revision": "0cc0544221e378bf5832d7c043b20e16",
"url": "./static/media/S20E03-winter-in-pastel.0cc05442.png"
},
{
"revision": "2be66048963200fffe835e75ffe77904",
"url": "./static/media/S20E04-hazy-day.2be66048.png"
},
{
"revision": "68c90153dfa616b0510047ef5f892e80",
"url": "./static/media/S20E05-divine-elegance.68c90153.png"
},
{
"revision": "e2f460ff63cfe1a8dfaba1f091fd1611",
"url": "./static/media/S20E06-cliffside.e2f460ff.png"
},
{
"revision": "b675f162e033f0cd7baf4a14abde78f0",
"url": "./static/media/S20E07-autumn-fantasy.b675f162.png"
},
{
"revision": "498efa0b2dd26455de7bb0138408c190",
"url": "./static/media/S20E08-the-old-oak-tree.498efa0b.png"
},
{
"revision": "a1debfa539ad12db6e96a802fa9ae9e3",
"url": "./static/media/S20E09-winter-paradise.a1debfa5.png"
},
{
"revision": "c6c37e7a80285d386d99338bceca85c9",
"url": "./static/media/S20E10-days-gone-by.c6c37e7a.png"
},
{
"revision": "08431cbe1a1a2143e6438e76a9480cc8",
"url": "./static/media/S20E11-change-of-seasons.08431cbe.png"
},
{
"revision": "64f7ffb11708be426e65b9d3f50c2961",
"url": "./static/media/S20E12-hidden-delight.64f7ffb1.png"
},
{
"revision": "a856d3719dc04bef8901395cab275665",
"url": "./static/media/S20E13-double-take.a856d371.png"
},
{
"revision": "799b259a422a682891e262bd5cc4045e",
"url": "./static/media/S21E01-valley-view.799b259a.png"
},
{
"revision": "1c436d69f74d812cc56341fd7812bc22",
"url": "./static/media/S21E02-tranquil-dawn.1c436d69.png"
},
{
"revision": "9711842b282b5fe9e19f1332ab370704",
"url": "./static/media/S21E03-royal-majesty.9711842b.png"
},
{
"revision": "31050b5de4112cc149546e73feac3a06",
"url": "./static/media/S21E04-serenity.31050b5d.png"
},
{
"revision": "4b99863277f3c9fb2acd0c58be067c29",
"url": "./static/media/S21E05-cabin-at-trails-end.4b998632.png"
},
{
"revision": "4d2fa5ed0e266dfca5455d80f9ae32d6",
"url": "./static/media/S21E06-mountain-rhapsody.4d2fa5ed.png"
},
{
"revision": "f9ebdffa05425c09683892f4872c5607",
"url": "./static/media/S21E07-wilderness-cabin.f9ebdffa.png"
},
{
"revision": "3ff0739c2ba3f499deda375c9000756a",
"url": "./static/media/S21E08-by-the-sea.3ff0739c.png"
},
{
"revision": "b6beb157e3868e19c9af7b223f9f8400",
"url": "./static/media/S21E09-indian-summer.b6beb157.png"
},
{
"revision": "22e8142e47f459095514352e3522cd29",
"url": "./static/media/S21E10-blue-winter.22e8142e.png"
},
{
"revision": "ef14d055bffab816a84713ceeea35d73",
"url": "./static/media/S21E11-desert-glow.ef14d055.png"
},
{
"revision": "b5f8f76e1e8464ace4634c0233a50357",
"url": "./static/media/S21E12-lone-mountain.b5f8f76e.png"
},
{
"revision": "83037e827f9dd6d47c64726293a4d0a8",
"url": "./static/media/S21E13-floridas-glory.83037e82.png"
},
{
"revision": "0d33207975f90968d1fadb4a681461c4",
"url": "./static/media/S22E01-autumn-images.0d332079.png"
},
{
"revision": "e9614eeb73f8afc0f535e242cbd7b3b7",
"url": "./static/media/S22E02-hint-of-springtime.e9614eeb.png"
},
{
"revision": "ef0b0c12299fddf488b39f60a3cc53ea",
"url": "./static/media/S22E03-around-the-bend.ef0b0c12.png"
},
{
"revision": "58da8982be8c9ceb45e5b6ba67e5c5b8",
"url": "./static/media/S22E04-countryside-oval.58da8982.png"
},
{
"revision": "ca7f490023174ab9d70754736371e346",
"url": "./static/media/S22E05-russet-winter.ca7f4900.png"
},
{
"revision": "59f7588d19d8b9b64fa76ff1fa74528b",
"url": "./static/media/S22E06-purple-haze.59f7588d.png"
},
{
"revision": "b2751728fd76230cbb3bbf449a49535b",
"url": "./static/media/S22E07-dimensions.b2751728.png"
},
{
"revision": "b0c55fed73767e65f15ef300718ba2d3",
"url": "./static/media/S22E08-deep-wilderness-home.b0c55fed.png"
},
{
"revision": "cebc786b2fdaf3c228974d4cd90346a9",
"url": "./static/media/S22E09-haven-in-the-valley.cebc786b.png"
},
{
"revision": "df76ac492f1050cd97791fcb76249c58",
"url": "./static/media/S22E10-wintertime-blues.df76ac49.png"
},
{
"revision": "ff1d556e1149861bc24e2e78d694546e",
"url": "./static/media/S22E11-pastel-seascape.ff1d556e.png"
},
{
"revision": "e284ac0fda640ada3c11a334b94d12c4",
"url": "./static/media/S22E12-country-creek.e284ac0f.png"
},
{
"revision": "2711f7c13e9532cbdb6e766ccf660649",
"url": "./static/media/S22E13-silent-forest.2711f7c1.png"
},
{
"revision": "dc129b65cc127ed4b582964872b6901f",
"url": "./static/media/S23E01-frosty-winter-morn.dc129b65.png"
},
{
"revision": "cae16793acefbb5f89ea94986523b510",
"url": "./static/media/S23E02-forest-edge.cae16793.png"
},
{
"revision": "6155a1162243ec486a01c673aff1b835",
"url": "./static/media/S23E03-mountain-ridge-lake.6155a116.png"
},
{
"revision": "682a186fd53161c0bd53051fa71963b0",
"url": "./static/media/S23E04-reflections-of-gold.682a186f.png"
},
{
"revision": "cc525d3e1cae26d3a1ac31cf4e87aa90",
"url": "./static/media/S23E05-quiet-cove.cc525d3e.png"
},
{
"revision": "862fcab78693c0155449c0c92146bc11",
"url": "./static/media/S23E06-rivers-peace.862fcab7.png"
},
{
"revision": "713a0062d79900d46c4ee44debb30134",
"url": "./static/media/S23E07-at-dawns-light.713a0062.png"
},
{
"revision": "1123d64b8eb42049bcbfb7ba89aa5153",
"url": "./static/media/S23E08-valley-waterfall.1123d64b.png"
},
{
"revision": "273f17024c264d51bedc7a6eb4d98aad",
"url": "./static/media/S23E09-toward-days-end.273f1702.png"
},
{
"revision": "75767345e8536195d1d09475febb2692",
"url": "./static/media/S23E10-falls-in-the-glen.75767345.png"
},
{
"revision": "0096e786229232e3b25742fe07996878",
"url": "./static/media/S23E11-frozen-beauty-in-vignette.0096e786.png"
},
{
"revision": "4952381c60d078355dad2ccf91b1d523",
"url": "./static/media/S23E12-crimson-tide.4952381c.png"
},
{
"revision": "7495aeebf61f711b247afaf4eecbc72e",
"url": "./static/media/S23E13-winter-bliss.7495aeeb.png"
},
{
"revision": "991e729474e839ef20658bc210521271",
"url": "./static/media/S24E01-gray-mountain.991e7294.png"
},
{
"revision": "26d2ac5bb9221fbd30ecf27a09b1bd53",
"url": "./static/media/S24E02-wayside-pond.26d2ac5b.png"
},
{
"revision": "7bc52a82bfc91ceb9bb9d845ee5dc3cd",
"url": "./static/media/S24E03-teton-winter.7bc52a82.png"
},
{
"revision": "5cd004b07d969dfa6d58ab898e78332f",
"url": "./static/media/S24E04-little-home-in-the-meadow.5cd004b0.png"
},
{
"revision": "080d9a616519ff683a69d977aaa2a2ec",
"url": "./static/media/S24E05-a-pretty-autumn-day.080d9a61.png"
},
{
"revision": "06216b664245a496ae05cca9bb167c4b",
"url": "./static/media/S24E06-mirrored-images.06216b66.png"
},
{
"revision": "8402bfe3b85e9d9e4a15adf2268704e6",
"url": "./static/media/S24E07-backcountry-path.8402bfe3.png"
},
{
"revision": "557b8c5bb198a496ac0fae1a7107d11e",
"url": "./static/media/S24E08-graceful-waterfall.557b8c5b.png"
},
{
"revision": "ef1ca1c72e9c372fc305b2bd37a4edea",
"url": "./static/media/S24E09-icy-lake.ef1ca1c7.png"
},
{
"revision": "6692532f485425cf9e60946b1b5ab7a2",
"url": "./static/media/S24E10-rowboat-on-the-beach.6692532f.png"
},
{
"revision": "70f2e66a2e1fdede57c0dba93bb2968d",
"url": "./static/media/S24E11-portrait-of-winter.70f2e66a.png"
},
{
"revision": "0ae9d3010d6843502f41e851389e6ea5",
"url": "./static/media/S24E12-the-footbridge.0ae9d301.png"
},
{
"revision": "299b9e2628bed7a019bee68125f65bbb",
"url": "./static/media/S24E13-snowbound-cabin.299b9e26.png"
},
{
"revision": "aa0750a866df1afa01d08c535a9daada",
"url": "./static/media/S25E01-hide-a-way-cove.aa0750a8.png"
},
{
"revision": "a9c9a2caadaafadaaa5ae45e14a46b09",
"url": "./static/media/S25E02-enchanted-falls-oval.a9c9a2ca.png"
},
{
"revision": "68b404f4fa5bb2c8afdfd8af7cf84e9a",
"url": "./static/media/S25E03-not-quite-spring.68b404f4.png"
},
{
"revision": "ec57166c7b74956bde9b5cc6a1d0fbd0",
"url": "./static/media/S25E04-splashes-of-autumn.ec57166c.png"
},
{
"revision": "b8b7f9eee27a369e2f05c76cf6f16bbc",
"url": "./static/media/S25E05-summer-in-the-mountain.b8b7f9ee.png"
},
{
"revision": "e68e9953757b082163b3bc19b0ce2fe8",
"url": "./static/media/S25E06-oriental-falls.e68e9953.png"
},
{
"revision": "85d1f80c2ccd132a9d140853f014ad99",
"url": "./static/media/S25E07-autumn-palette.85d1f80c.png"
},
{
"revision": "883180553fc6c214f8ee6541f56b08a9",
"url": "./static/media/S25E08-cypress-swamp.88318055.png"
},
{
"revision": "c9e4176b28d0f26bd7ac12c8d5a76841",
"url": "./static/media/S25E09-downstream-view.c9e4176b.png"
},
{
"revision": "a54a253d37f3c444ffe30ebed6992592",
"url": "./static/media/S25E10-just-before-the-storm.a54a253d.png"
},
{
"revision": "88b2c2e4b26cc34857dd6c8370fab985",
"url": "./static/media/S25E11-fishermans-paradise.88b2c2e4.png"
},
{
"revision": "01a468f9c570ba53b8f8e233d99ed39c",
"url": "./static/media/S25E12-desert-hues.01a468f9.png"
},
{
"revision": "7240ae5d9322cd020173a607c7130a77",
"url": "./static/media/S25E13-the-property-line.7240ae5d.png"
},
{
"revision": "eddd90406cf1b665d5efd1aaa8e5b13a",
"url": "./static/media/S26E01-in-the-stillness-of-morning.eddd9040.png"
},
{
"revision": "fb6d8dae63fb8a5e273f97ad0c69d628",
"url": "./static/media/S26E02-delightful-meadow-home.fb6d8dae.png"
},
{
"revision": "d2e9c496d45785647edde07a88fb8000",
"url": "./static/media/S26E03-first-snow.d2e9c496.png"
},
{
"revision": "a072082dda21a603979378bdc1283985",
"url": "./static/media/S26E04-lake-in-the-valley.a072082d.png"
},
{
"revision": "96d87d7bb67f94b77d2ff172b701e5f5",
"url": "./static/media/S26E05-a-trace-of-spring.96d87d7b.png"
},
{
"revision": "88ffd11038c2e57e79d9776b0a45660b",
"url": "./static/media/S26E06-an-arctic-winter-day.88ffd110.png"
},
{
"revision": "b305cd387af0c13cc885675dc02f0032",
"url": "./static/media/S26E07-snow-birch.b305cd38.png"
},
{
"revision": "a0bc46c6a961308396d3cbfb3b66940b",
"url": "./static/media/S26E08-early-autumn.a0bc46c6.png"
},
{
"revision": "1a2c8dc516310ade0d9b4d6482b4fcae",
"url": "./static/media/S26E09-tranquil-wooded-stream.1a2c8dc5.png"
},
{
"revision": "2f1aa8340519bcc778bf1828b2c00db2",
"url": "./static/media/S26E10-purple-mountain-range.2f1aa834.png"
},
{
"revision": "17d120112a05b543ed73c3e1dc4e6eee",
"url": "./static/media/S26E11-storms-a-comin.17d12011.png"
},
{
"revision": "7fc9664f7a02f67dbab8cdc1a36236a0",
"url": "./static/media/S26E12-sunset-aglow.7fc9664f.png"
},
{
"revision": "e99ceec4f5bd8a7553c9dcbc8b980721",
"url": "./static/media/S26E13-evening-at-the-falls.e99ceec4.png"
},
{
"revision": "62ff038b0c23d50f0098150faa788a45",
"url": "./static/media/S27E01-twilight-beauty.62ff038b.png"
},
{
"revision": "f789a1e2241dcee6fa129716ccc3a031",
"url": "./static/media/S27E02-anglers-haven.f789a1e2.png"
},
{
"revision": "1e32b7c775c5ed708988dcd704dcea8e",
"url": "./static/media/S27E03-rustic-winter-woods.1e32b7c7.png"
},
{
"revision": "c6b884faf422543650768cb096aa23e8",
"url": "./static/media/S27E04-wilderness-falls.c6b884fa.png"
},
{
"revision": "62f8a163c09ef04198bd5049412e9f3f",
"url": "./static/media/S27E05-winter-at-the-farm.62f8a163.png"
},
{
"revision": "a8d28bf11322795d5f0c7a0b17bf3f16",
"url": "./static/media/S27E06-daisies-at-dawn.a8d28bf1.png"
},
{
"revision": "79d0bd77d0eed65b6281bbf2a855daa2",
"url": "./static/media/S27E07-a-spectacular-view.79d0bd77.png"
},
{
"revision": "e65963bac39c4f6361d02b35e035e281",
"url": "./static/media/S27E08-daybreak.e65963ba.png"
},
{
"revision": "0e9a0e006d59d5a28b8923f377ecfafd",
"url": "./static/media/S27E09-island-paradise.0e9a0e00.png"
},
{
"revision": "67b31b0f03ae3513eeb00933ba442079",
"url": "./static/media/S27E10-sunlight-in-the-shadows.67b31b0f.png"
},
{
"revision": "c1c87b55d23121e7eb9150a33a496021",
"url": "./static/media/S27E11-splendor-of-a-snowy-winter.c1c87b55.png"
},
{
"revision": "ec05ffc911ac78b9d5cce150560586d4",
"url": "./static/media/S27E12-forest-river.ec05ffc9.png"
},
{
"revision": "7998bb5443e854b327d5842e92759e63",
"url": "./static/media/S27E13-golden-glow-of-morning.7998bb54.png"
},
{
"revision": "95fb201d3ab99b9a2335654d81b80a0b",
"url": "./static/media/S28E01-fishermans-trail.95fb201d.png"
},
{
"revision": "7ff6dcb25ad3f5a462622a1914da483a",
"url": "./static/media/S28E02-a-warm-winter.7ff6dcb2.png"
},
{
"revision": "e02c737dc0b7b47af854c82a4e08bd06",
"url": "./static/media/S28E03-under-pastel-skies.e02c737d.png"
},
{
"revision": "7503597299d396e57f1979cef1c8909b",
"url": "./static/media/S28E04-golden-rays-of-sunshine.75035972.png"
},
{
"revision": "2731c5373b41c3e40536e602d09859a2",
"url": "./static/media/S28E05-the-magic-of-fall.2731c537.png"
},
{
"revision": "a4be9ee97bce57d681dff539528b33f2",
"url": "./static/media/S28E06-glacier-lake.a4be9ee9.png"
},
{
"revision": "13c54240efee1b134ef5e78d6d893446",
"url": "./static/media/S28E07-the-old-weathered-barn.13c54240.png"
},
{
"revision": "af2bf7ace80af2308421d793e5f772d6",
"url": "./static/media/S28E08-deep-forest-falls.af2bf7ac.png"
},
{
"revision": "caa89624408cdbd3e7eff0114ad21ef7",
"url": "./static/media/S28E09-winters-grace.caa89624.png"
},
{
"revision": "d5e6adafadeb2a030064c5190425ebc1",
"url": "./static/media/S28E10-splendor-of-autumn.d5e6adaf.png"
},
{
"revision": "e8b7de45249e2cd6da48b4846b44b08f",
"url": "./static/media/S28E11-tranquil-seas.e8b7de45.png"
},
{
"revision": "cd1276482249de2d90112fc5b7b53dbe",
"url": "./static/media/S28E12-mountain-serenity.cd127648.png"
},
{
"revision": "54c1c66d4bfa480c26d1be06a464fb8e",
"url": "./static/media/S28E13-home-before-nightfall.54c1c66d.png"
},
{
"revision": "da5ac5f49ce7653f8952837901495f9b",
"url": "./static/media/S29E01-island-in-the-wilderness.da5ac5f4.png"
},
{
"revision": "7cbaecacc0978c4aae6ac2890760d1f6",
"url": "./static/media/S29E02-autumn-oval.7cbaecac.png"
},
{
"revision": "630805fae7a5162564b105fcc20cee72",
"url": "./static/media/S29E03-seasonal-progression.630805fa.png"
},
{
"revision": "684da17843ea5caef2de0413697edfab",
"url": "./static/media/S29E04-light-at-the-summit.684da178.png"
},
{
"revision": "99c1b5713ab5dbb68d810fb88c691423",
"url": "./static/media/S29E05-countryside-barn.99c1b571.png"
},
{
"revision": "fd1795e0e2f66d84779800ce111fdb2f",
"url": "./static/media/S29E06-mountain-lake-falls.fd1795e0.png"
},
{
"revision": "c8ac5ab5cea51ac0391386e672a3b796",
"url": "./static/media/S29E07-cypress-creek.c8ac5ab5.png"
},
{
"revision": "44b2235d17abd046bd137aa772aae937",
"url": "./static/media/S29E08-trappers-cabin.44b2235d.png"
},
{
"revision": "7b636ce1deccb6144723e0cc9cb8fcbd",
"url": "./static/media/S29E09-storm-on-the-horizon.7b636ce1.png"
},
{
"revision": "c313464e1f18ae5a3eab5c3157ea5f20",
"url": "./static/media/S29E10-pot-o-posies.c313464e.png"
},
{
"revision": "950c416b17a5eb9170223a2b531f660a",
"url": "./static/media/S29E11-a-perfect-winter-day.950c416b.png"
},
{
"revision": "02b043cd7499f0dbe6e10653a2fd3020",
"url": "./static/media/S29E12-auroras-dance.02b043cd.png"
},
{
"revision": "26edb4b35a661d47db2829baabe8641a",
"url": "./static/media/S29E13-woodmans-retreat.26edb4b3.png"
},
{
"revision": "541bbd84376e1d32d437ae8c6a406fae",
"url": "./static/media/S30E01-babbling-brook.541bbd84.png"
},
{
"revision": "fbb5ec5755df3fdd6884bd87cc5b560b",
"url": "./static/media/S30E02-woodgrain-view.fbb5ec57.png"
},
{
"revision": "db4e0875d32ff9dc43fae0dec6281d85",
"url": "./static/media/S30E03-winters-peace.db4e0875.png"
},
{
"revision": "e86074a11fa0f78a438f3cb5d63292c8",
"url": "./static/media/S30E04-wilderness-trail.e86074a1.png"
},
{
"revision": "1dff68d4b4780e24e8b89f4aad9f4f1f",
"url": "./static/media/S30E05-a-copper-winter.1dff68d4.png"
},
{
"revision": "d0c86fea2b84550b0c9a33acf45f6eea",
"url": "./static/media/S30E06-misty-foothills.d0c86fea.png"
},
{
"revision": "b39ac1aa2c4dcb94d7606b7876549a78",
"url": "./static/media/S30E07-through-the-window.b39ac1aa.png"
},
{
"revision": "f39ba19b89564dfdab9b0ccbe605a3be",
"url": "./static/media/S30E08-home-in-the-valley.f39ba19b.png"
},
{
"revision": "c53e8d458e2aec9b17c2e9b4e3de455f",
"url": "./static/media/S30E09-mountains-of-grace.c53e8d45.png"
},
{
"revision": "663ff59b63a66c920fd87cae121d01e1",
"url": "./static/media/S30E10-seaside-harmony.663ff59b.png"
},
{
"revision": "be4e9ceedfe5da5f48472aeaa7e43477",
"url": "./static/media/S30E11-a-cold-spring-day.be4e9cee.png"
},
{
"revision": "716d4bb90f34fafa9226020e5a0af627",
"url": "./static/media/S30E12-evenings-glow.716d4bb9.png"
},
{
"revision": "6fbe416573b7b8b7da95eb2056ec4f59",
"url": "./static/media/S30E13-blue-ridge-falls.6fbe4165.png"
},
{
"revision": "9d16702fc27cc97e3c509147cdfe30e5",
"url": "./static/media/S31E01-reflections-of-calm.9d16702f.png"
},
{
"revision": "88b485f46605ae950431d2dbd9b6d528",
"url": "./static/media/S31E02-before-the-snowfall.88b485f4.png"
},
{
"revision": "adff2b9359837c6b4f9bbddcc8808ec7",
"url": "./static/media/S31E03-winding-stream.adff2b93.png"
},
{
"revision": "d698d26575a038b8d816e1d692530785",
"url": "./static/media/S31E04-tranquility-cove.d698d265.png"
},
{
"revision": "87a4b1ff06f50d001c2c267d6788f001",
"url": "./static/media/S31E05-cabin-in-the-hollow.87a4b1ff.png"
},
{
"revision": "2498bcc45ef54501592a7774897d9e7f",
"url": "./static/media/S31E06-view-from-clear-creek.2498bcc4.png"
},
{
"revision": "87a0205e3cfe209c00666e456a922c17",
"url": "./static/media/S31E07-bridge-to-autumn.87a0205e.png"
},
{
"revision": "0eed930eee9f156cb87aabbf2855002c",
"url": "./static/media/S31E08-trails-end.0eed930e.png"
},
{
"revision": "1ec987458fce4bdfeab98a50b737c111",
"url": "./static/media/S31E09-evergreen-valley.1ec98745.png"
},
{
"revision": "60d1d42c6f6f652ccd6c5ca38486351d",
"url": "./static/media/S31E10-balmy-beach.60d1d42c.png"
},
{
"revision": "c9fb692461433490e9d39fba959a26f0",
"url": "./static/media/S31E11-lake-at-the-ridge.c9fb6924.png"
},
{
"revision": "a37208124423758b269fcdfc087859be",
"url": "./static/media/S31E12-in-the-midst-of-winter.a3720812.png"
},
{
"revision": "26789f6b22523306a0ad3918998327eb",
"url": "./static/media/S31E13-wilderness-day.26789f6b.png"
},
{
"revision": "d73385c3bd7c351c39f3e1fdac3f1ed2",
"url": "./static/media/_linked_readme.d73385c3.md"
},
{
"revision": "d3a5d4c6197a37901fd9fe52cbe6493e",
"url": "./static/media/ross-data.d3a5d4c6.csv"
}
]);
|
import React from 'react'
import { Button, Spinner } from './custom-button.styles'
const CustomButton = ({ children, loading, ...props }) => {
return <Button {...props}>{loading ? <Spinner /> : children}</Button>
}
export default CustomButton
|
"use strict";
var server = require("./servers/server"); //Gør server modulet tilgængeligt for resten
var router = require("./routers/router"); // Router modulet required, sådan så den altid tjekker om routing er gjort rigtigt
server.start(router); // start server
// callback to route
|
import express from 'express'
import path from 'path'
import {requestTime, logger} from './middlewares.js'
const __dirname = path.resolve()
const PORT = process.env.PORT ?? 3000
const app = express()
app.use(express.static(path.resolve(__dirname, 'static')))
app.use(requestTime)
app.use(logger)
// app.get('/', (req, res) => {
// // res.send('<h1>Hello Express</h1>')
// res.sendFile(path.resolve(__dirname, 'static', 'index.html'))
// })
// app.get('/features', (req, res) => {
// res.sendFile(path.resolve(__dirname, 'static', 'features.html'))
// })
// app.get('/download', (req, res) => {
// console.log(req.requestTime)
// res.download(path.resolve(__dirname, 'static', 'index.html'))
// })
app.listen(PORT, () => {
console.log(`Server has been running on port ${PORT}...`)
})
|
const Web3 = require("web3");
const ethers = require("ethers");
const ethProvider = require("eth-provider");
tokenAddress = "0x68ea056d4fb87147a9a237c028b6b1476bf7b367";
const run = async () => {
// we use 'eth-provider' so frame works as expected
// unfortunatly it returns an web3 provider so we wrap this again
// to make it work with ethers
const provider = new ethers.providers.Web3Provider(
new Web3(ethProvider())._provider
);
const signer = provider.getSigner();
const token = new ethers.Contract(
tokenAddress,
["function mint(address to, uint256 amount) public"],
signer
);
await token.mint("0x" + "F".repeat(40), (1e18).toString());
};
run()
.then(() => process.exit(0))
.catch((e) => {
console.error(e);
process.exit(1);
});
|
import React from 'react';
import ReactDOM from 'react-dom';
import {BrowserRouter as Router, Switch, Route, NavLink, Redirect} from "react-router-dom";
import Home from './pages/Home';
import Search from './pages/Search';
import List from './pages/List';
import './css/main.min.css';
class App extends React.Component {
render() {
return <div className="app">
<div className="header">
<h1 className="header__title">WatchList</h1>
</div>
<Router>
<Switch>
<Route exact path="/">
<Redirect to="/home" />
</Route>
<Route path="/home">
<Home />
</Route>
<Route path="/search">
<Search />
</Route>
<Route path="/list">
<List />
</Route>
</Switch>
<div className="tab">
<NavLink to="/home" className="tab__link" activeClassName="tab__link--active">
<div className="tab__icon home"></div>
<span className="tab__label">Home</span>
</NavLink>
<NavLink to="/search" className="tab__link" activeClassName="tab__link--active">
<div className="tab__icon search"></div>
<span className="tab__label">Search</span>
</NavLink>
<NavLink to="/list" className="tab__link" activeClassName="tab__link--active">
<div className="tab__icon list"></div>
<span className="tab__label">My list</span>
</NavLink>
</div>
</Router>
</div>
}
}
const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);
|
import Vue from 'vue'
import VueResource from 'vue-resource'
import ElementUi from 'element-ui' //ElementUi 组件库
import 'element-ui/lib/theme-chalk/index.css' //ElementUi 组件样式
import LvlPlugin from './plugins/lvlPlugin'
Vue.use(ElementUi,{size:'small'}) //使用ElementUi
Vue.use(VueResource) //$http
Vue.use(LvlPlugin)
|
/* eslint-disable no-console */
const pm2 = require("pm2");
const instances = process.env.WEB_CONCURRENCY || -1;
const maxMemory = process.env.WEB_MEMORY || 512;
pm2.connect(() => {
pm2.start(
{
script: "index.js",
instances: instances,
max_memory_restart: `${maxMemory}M`,
env: {
NODE_ENV: "production",
NODE_PATH: "."
}
},
err => {
if (err) {
return console.error(
"Error while launching applications",
err.stack || err
);
}
console.log("PM2 and application has been succesfully started");
pm2.launchBus((err, bus) => {
console.log("[PM2] Log streaming started");
bus.on("log:out", packet => {
console.log("[App:%s] %s", packet.process.name, packet.data);
});
bus.on("log:err", packet => {
console.error("[App:%s][Err] %s", packet.process.name, packet.data);
});
});
}
);
});
|
/* eslint-disable @typescript-eslint/no-var-requires */
const { readdirSync } = require('fs');
const { fork } = require('child_process');
const { build } = require('esbuild');
const { notify } = require('node-notifier');
const pkg = require('./package.json');
async function bootstrap() {
const configFiles = readdirSync('./config');
await build({
entryPoints: configFiles.map((filename) => `config/${filename}`),
platform: 'node',
bundle: true,
incremental: true,
outdir: 'dist/config',
});
const { dev, prod } = require('./dist/config/env');
const { globals } = require('./dist/config/globals');
let nodeFork;
await build({
entryPoints: ['src/main.ts'],
platform: 'node',
bundle: true,
incremental: true,
outfile: 'dist/main.js',
define: {
'process.env.VERSION': JSON.stringify(process.env.npm_package_version),
'process.env.NAME': JSON.stringify(process.env.npm_package_name),
...globals,
},
target: 'es2018',
// We can mark all non-dev dependencies as external as they will be installed on the server
// with npm install, so all imports in the code still work.
external: Object.keys(pkg.dependencies),
watch: dev && {
onRebuild(err) {
if (err) {
console.error('watch build failed:', err);
process.exit(1);
}
console.log('Rebuilding server...');
nodeFork.kill();
nodeFork = fork('dist/main.js');
notify({
title: process.env.npm_package_name,
message: 'Rebuild complete',
});
},
},
});
if (dev) {
nodeFork = fork('dist/main.js');
}
notify({
title: process.env.npm_package_name,
message: 'Build complete',
});
if (prod) {
process.exit();
}
}
bootstrap();
|
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const globalVars_1 = require("../core/globalVars");
const app_1 = __importDefault(require("./config/app"));
const knexHelper_1 = require("../infra/data/knexHelper");
knexHelper_1.setknexHelper(globalVars_1.NODE_ENV);
app_1.default.listen(globalVars_1.PORT, () => { console.log(globalVars_1.PORT, globalVars_1.NODE_ENV); });
|
var Settings : GUIStyle;
function OnGUI()
{
GUI.Label(new Rect (Screen.width / 2 - 90, Screen.height / 2 - 250, 200, 200), "Settings", Settings);
GUI.BeginGroup (new Rect (Screen.width / 2 - 100, Screen.height / 2 - 200, 200, 600));
if(GUI.Button (new Rect (10,30,180,30), "Fastest"))
QualitySettings.currentLevel = QualityLevel.Fastest;
if(GUI.Button (new Rect (10,70,180,30), "Fast"))
QualitySettings.currentLevel = QualityLevel.Fast;
if(GUI.Button (new Rect (10,110,180,30), "Simple"))
QualitySettings.currentLevel = QualityLevel.Simple;
if(GUI.Button (new Rect (10,150,180,30), "Good"))
QualitySettings.currentLevel = QualityLevel.Good;
if(GUI.Button (new Rect (10,190,180,30), "Beautiful"))
QualitySettings.currentLevel = QualityLevel.Beautiful;
if(GUI.Button (new Rect (10,230,180,30), "Fantastic"))
QualitySettings.currentLevel = QualityLevel.Fantastic;
if(GUI.Button (new Rect (10,270,180,30), "Back"))
{
GetComponent("Menu").enabled = true;
GetComponent("Settings").enabled = false;
}
GUI.EndGroup ();
}
|
import { combineResolvers } from "graphql-resolvers";
import bcrypt from "bcrypt";
import mongoose from "mongoose";
import { isAdmin } from "./authorization";
import redis from "../redis";
import sendEmail from "../utils/sendEmail";
import {
confirmUserPrefix,
forgotPasswordPrefix
} from "../constants/redisPrefixes";
import createConfirmationUrl from "../utils/createConfirmationUrl";
import createChangePasswordUrl from "../utils/createChangePasswordUrl";
import fromCursorHash from "../utils/fromCursorHash";
import toCursorHash from "../utils/toCursorHash";
export default {
Query: {
users: async (parent, args, { models }) => {
return await models.User.find();
},
user: async (parent, { id, username }, { models }) => {
if (id) {
if (!mongoose.Types.ObjectId.isValid(id)) return null;
return await models.User.findById(id);
}
if (username) {
return await models.User.findOne({ username });
}
},
me: async (parent, args, { req, models }) => {
const { userId } = req.session;
if (!userId) return null;
return await models.User.findById(userId);
}
},
Mutation: {
signUp: async (
parent,
{ input: { firstName, lastName, username, email, password } },
{ models }
) => {
const user = new models.User({
firstName,
lastName,
username,
email,
password:
password.length >= 6 && password.length <= 42
? await bcrypt.hash(password, 12)
: ""
});
await user.save();
const url = await createConfirmationUrl(user.id);
sendEmail(user.email, url);
return user;
},
signIn: async (parent, { login, password }, { req, models }) => {
let user = await models.User.findByLogin(login);
if (!user) return null;
const valid = await bcrypt.compare(password, user.password);
if (!valid) return null;
if (!user.confirmed) return null;
req.session.userId = user.id;
return user;
},
deleteUser: combineResolvers(
isAdmin,
async (parent, { id }, { models }) => {
if (!mongoose.Types.ObjectId.isValid(id)) return false;
return await models.User.findByIdAndDelete(id);
}
),
confirmUser: async (parent, { token }, { models }) => {
const userId = await redis.get(`${confirmUserPrefix}${token}`);
if (!userId) return false;
await models.User.findByIdAndUpdate(userId, { confirmed: true });
await redis.del(`${confirmUserPrefix}${token}`);
return true;
},
forgotPassword: async (parent, { login }, { models }) => {
const user = await models.User.findByLogin(login);
if (!user) return true;
const url = await createChangePasswordUrl(user.id);
sendEmail(user.email, url);
return true;
},
changePassword: async (
parent,
{ input: { token, password } },
{ req, models }
) => {
const userId = await redis.get(`${forgotPasswordPrefix}${token}`);
if (!userId) return null;
const user = await models.User.findByIdAndUpdate(userId, {
password:
password.length >= 6 && password.length <= 42
? await bcrypt.hash(password, 12)
: ""
});
await redis.del(`${forgotPasswordPrefix}${token}`);
req.session.userId = userId;
return user;
},
logout: (parent, args, { req, res }) => {
return new Promise((resolve, reject) =>
req.session.destroy(err => {
if (err) return reject(false);
res.clearCookie("qid");
return resolve(true);
})
);
},
editAccount: async (parent, { input }, { req, models }) => {
await models.User.findOneAndUpdate(req.session.userId, input);
return await models.User.findById(req.session.userId);
}
},
User: {
fullName: user => {
return `${user.firstName} ${user.lastName}`;
},
posts: async (user, { cursor, limit = 100 }, { models }) => {
let options = { author: user.id };
if (cursor) options.createdAt = { $lt: fromCursorHash(cursor) };
const posts = await models.Post.find(options, null, {
limit: limit + 1,
sort: {
createdAt: -1 //Sort by Date Added DESC
}
});
const hasNextPage = posts.length > limit;
const edges = hasNextPage ? posts.slice(0, -1) : posts;
const totalCount = await models.Post.countDocuments({ author: user.id });
return {
edges,
pageInfo: {
hasNextPage,
totalCount,
endCursor:
posts.length > 0 &&
toCursorHash(posts[posts.length - 1].createdAt.toString())
}
};
}
}
};
|
require('http').createServer(function (request, response) {
if (request.method !== 'POST')
return response.end('favor enviar un POST!\n')
request.pipe(require('through2-map')(function (chunk) {
return chunk.toString().toUpperCase()
})).pipe(response)
}).listen(process.argv[2] | 0)
/*
var http = require('http')
, map = require('through2-map')
upper = map(function(chunk) {
return chunk.toString().toUpperCase()
})
server = http.createServer(function(request, response) {
if (request.method == 'POST') {
request.pipe(upper).pipe(response)
}
})
server.listen(Number(process.argv[2]))
*/
|
const worker = require("./test.worker.js")
worker.run("sayHelloWorld", "hello", "world")
.then(res => {
console.log(res)
})
|
var pathRX = new RegExp(/\/[^\/]+$/)
, locationPath = location.pathname.replace(pathRX, '/');
dojoConfig = {
parseOnLoad: false,
async: true,
tlmSiblingOfDojo: false,
locale: "zh-cn",
has: {
'extend-esri': 1
},
paths:{
"echarts": locationPath + "../libs/echart/echarts.min",
"Viewer": locationPath + "../libs/Viewer/viewer.min",
"PouchDB": locationPath + "../libs/pouchdb.min"
//,"jQuery": locationPath + "../libs/jquery-1.10.1"
},
"shim": {
// 'jqueryLibs' : { 'deps' : ['jQuery'] },
"jqueryLibs/jquery.alpha": { 'deps' : ['jQuery'] },
"jqueryLibs/jquery.beta": { 'deps' : ['jQuery'] },
"jqueryLibs/jquery.alpha": ['jQuery']
},
deps : ['jQuery'] ,
packages : [{
name: 'controllers',
location: locationPath + '../gis.js/controllers'
}, {
name: 'services',
location: locationPath + '../gis.js/services'
}, {
name: 'utils',
location: locationPath + '../gis.js/utils'
},{
name: 'stores',
location: locationPath + '../gis.js/stores'
}, {
name: 'widgets',
location: locationPath + '../gis.js/widgets'
}, {
name : "onemap",
location : locationPath + "../onemap"
},
{name: "jQuery", location: locationPath + "../libs", main: "jquery-1.10.1"},
{name: "jqueryLibs", location: locationPath + "../libs/jquery"}]
};
|
$(function() {
$(document).ready(function() {
var mobileAnchor = $('#mobile-anchor'),
mobileNav = $('#header');
mobileAnchor.click(function(e) {
mobileNav.toggleClass('visible');
});
});
});
|
var baseURL = "/_fasheholic/";
var apiURL = "/_fasheholic/api/";
var img_base64 = "";
var filename = "";
// var file_extension = "";
// you can do this once in a page, and this function will appear in all your files
File.prototype.convertToBase64 = function(callback){
var FR = new FileReader();
FR.onload = function(e) {
callback(e.target.result)
};
FR.readAsDataURL(this);
}
$("#fash-profile-image").on('change',function(){
var selectedFile = this.files[0];
// console.log(this.files[0]['name']);
filename = this.files[0]['name'];
// file_extension = getFileNameExtension(this.files[0]['name']);
// console.log(file_extension);
// $("#fash-profile-image-filename").html(filename);
selectedFile.convertToBase64(function(base64){
img_base64 = base64;
// var test64 = splitBase64Image(img_base64);
// console.log(test64);
})
});
function splitBase64Image(base64_image) {
var img_b = base64_image.split(",");
return img_b[1];
}
/*
function getFileNameExtension(filename) {
return filename.substr(filename.lastIndexOf('.')+1);
}
*/
$(".edit-profile-update-btn").click(function(){
var profile_email = $('#edit-profile-email').val();
var profile_name = $('#edit-profile-name').val();
var profile_username = $('#edit-profile-username').val();
var profile_desc = $('#edit-profile-desc').val();
var img_base64_split = splitBase64Image(img_base64);
var url = apiURL + "member.php";
var inputObj = {
"action":"memberEditProfile",
"member_email":profile_email,
"member_name":profile_name,
"member_username":profile_username,
"member_desc":profile_desc,
"member_image_base64":img_base64_split,
"member_image_name":filename
};
$.post(url, inputObj, function(data)
{
var output = $.parseJSON(data);
if((output.status == "true") && (output.message == 'Member Edit success'))
{
location.reload();
}
else
{
alert("Member Edit Fail");
}
});
});
function memberGetProfile() {
var url = apiURL + "member.php";
var inputObj = {
"action":"memberGetProfile"
};
$.post(url, inputObj, function(data)
{
var output = $.parseJSON(data);
if((output.status == "true") && (output.message == 'Member Get Profile success'))
{
var member_email = output.data[0].member_email;
var member_name = output.data[0].member_name;
var member_username = output.data[0].member_username;
var member_dir = output.data[0].member_dir;
var member_logo_image_name = output.data[0].member_logo_image_name;
var member_description = output.data[0].member_description;
var img_html = "";
$('#edit-profile-email').val(member_email);
$('#edit-profile-name').val(member_name);
$('#edit-profile-username').val(member_username);
$('#edit-profile-desc').val(member_description);
if (member_logo_image_name)
img_html = "<img class='col-xs-12' src='" + member_dir + member_logo_image_name + "' />";
else
img_html = "No logo yet";
$('#edit-profile-logo').html(img_html);
}
else
{
if(output.message == 'No Shop yet') {
}
}
});
}
$(document).ready(function(){
memberGetProfile();
});
|
QUnit.test( "implicitly skipped test", function( assert ) {
assert.true( false, "test should be skipped" );
} );
QUnit.only( "run this test", function( assert ) {
assert.true( true, "only this test should run" );
} );
QUnit.test( "another implicitly skipped test", function( assert ) {
assert.true( false, "test should be skipped" );
} );
QUnit.only( "all tests with only run", function( assert ) {
assert.true( true, "this test should run as well" );
} );
|
'use strict';
const userDao = require('../dao/user');
const produtoDao = require('../dao/product');
module.exports = {
getDashboard: async (req, res) => {
if (req.session.loggedin) {
let dados = req.session;
let produtos = await produtoDao.getAllProducts();
let chartRetirada = await produtoDao.chartWithdraw();
let chartRetiradaQuilograma = await produtoDao.chartWithdrawByUnity(2);
let chartRetiradaUnidade = await produtoDao.chartWithdrawByUnity(3);
res.render('admin/dashboard.ejs', {
title: "Painel de controle | John of the fish",
activePage: "painel",
dados: dados,
pageName: "Painel de controle",
produtos: produtos,
chartRetirada: chartRetirada[0],
chartRetiradaQuilograma: chartRetiradaQuilograma[0],
chartRetiradaUnidade: chartRetiradaUnidade[0]
});
} else {
res.redirect('/');
}
res.end();
},
login: async (req, res) => {
let login = req.body.login;
let senha = md5(req.body.senha);
let results = await userDao.getUserByLoginAndPass(login, senha);
if (login && senha) {
if (results.length > 0) {
req.session.loggedin = true;
req.session.login = login;
req.session.email = results[0].email;
req.session.userid = results[0].id;
await userDao.getUserByLoginAndPass(login, senha);
await res.redirect('/painel');
} else {
req.session.error_msg = {
error_msg: "Usuário ou senha estão incorretos!"
}
res.redirect('/');
}
res.end();
} else {
req.session.error_msg = {
error_msg: "Preencha os dados de acesso!"
}
res.redirect('/');
res.end();
}
},
logout: async (req, res) => {
if (req.session.loggedin) {
req.session.destroy();
res.redirect('/');
} else {
res.redirect('/');
}
},
getProfilePage: async (req, res) => {
if (req.session.loggedin) {
let id = req.session.userid;
let dados = await userDao.getUserByid(id);
res.render('admin/user/profile', {
activePage: "",
pageName: "Meu perfil",
dados: dados
});
} else {
res.redirect('/');
}
},
editProfile: async (req, res) => {
if (req.session.loggedin) {
let id = req.session.userid;
let login = req.body.login;
let senha = md5(req.body.senha);
let confirm_password = md5(req.body.confirmar_senha);
let email = req.body.email;
if (senha == confirm_password) {
await userDao.editUser(login, senha, email, id);
req.session.success_msg = {
success_msg: "Perfil editado com sucesso!"
}
res.redirect('/perfil');
} else {
req.session.error_msg = {
error_msg: "As senhas não são iguais!"
}
res.redirect('/perfil');
}
} else {
res.redirect('/');
}
}
};
|
import React from 'react';
export default class Class extends React.Component {
render() {
return (
<div
className="well well-sm"
onClick={this.onItemClick}
>
<h4>id : {this.props.item.id}</h4>
<h4>Name : {this.props.item.teacher}</h4>
</div>
)
}
onItemClick = () => {
this.props.handleItemClick(this.props.item.id);
}
}
|
const Instruments = require('../Instruments');
function Pick(itemId) {
Instruments.apply(this, new Array(15, 'INSTRUMENTS', itemId, 100));
this.usableObjId = new Array (8, 9, 10);
}
Pick.prototype = Object.create(Instruments.prototype);
Pick.prototype.create = function (itemId) {
return new Pick(itemId);
};
module.exports=Pick;
|
$( document ).ready(function() {
$('.leftmenutrigger').on('click', function(e) {
$('.side-nav').toggleClass("open");
e.preventDefault();
});
});
// With JQuery
//$("#ex2").slider({});
// Without JQuery
var slider = new Slider('#ex2', {});
|
import { getAttribute } from './_get_attribute';
describe('getAttribute', () => {
it('should get the integer value', () => {
const mockElement = {
style: {
width: '10px',
},
};
expect(getAttribute(mockElement, 'width')).toBe(10);
});
});
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.