text stringlengths 7 3.69M |
|---|
import React from "react";
import {Box, IconButton, useColorMode, useColorModeValue,} from "@chakra-ui/react";
import {GiMoon, GiSun} from "react-icons/gi";
const ColorSwitch = (props) => {
const {toggleColorMode} = useColorMode();
const text = useColorModeValue("dark", "light");
const SwitchIcon = useColo... |
import { createStore, applyMiddleware, compose } from 'redux';
import reducer from './reducers/index';
import { persistReducer } from 'redux-persist';
import storage from 'redux-persist/lib/storage';
import createSagaMiddleware from 'redux-saga';
import watchAllRequest from '../redux/actions/actionCreator';
const sagaM... |
import "babel-polyfill";
import {Player} from './mixins/Player';
// expose player Class publicaly
window.ViewsayPlayer = Player; |
/**
* 2016, Rastislav Bertusek
*/
'use strict';
angular.module('$translate.mock', []).provider('$translate', function(){
const $translateProvider = jasmine.createSpyObj('$translateProvider',
['useLocalStorage', 'preferredLanguage', 'useLoaderCache', 'useSanitizeValueStrategy', 'useLoader']);
return ... |
const webpack = require('webpack')
//const fs = require('fs')
if (process.env.NODE_ENV !== 'production') {
require('dotenv/config')
}
module.exports = {
webpack: config => {
config.plugins.push(
new webpack.DefinePlugin({
'process.env.CMS_URL': JSON.stringify(process.env.CMS_URL),
'proce... |
/**
* sayHello
* @param {String} name Represents a person's name.
* @throws Will throw a TypeError if the argument is not an String.
* @returns {String} The string that includes the person's name.
*/
module.exports.sayHello = function (name) {
if (typeof name !== 'string') {
throw new TypeError('ERR_INVALID_... |
// chat app users
export default [
{
id: 2,
first_name: 'Elisabeth',
last_name: 'Ortega',
photo_url: require('Assets/avatars/user-1.jpg'),
last_chat_date: 'yesterday',
isActive: true,
status: "online",
last_chat: 'Ut vel consectetur ligula, non tincidu... |
import React from 'react';
import { Nav, Navbar, Container } from 'react-bootstrap';
import { Link, NavLink } from 'react-router-dom';
import styled from 'styled-components';
const Styles = styled.div`
.navbar {
height: 3.5rem;
box-shadow : none;
}
`;
const Navigation = () => {
return (
<Styles... |
var mn = mn || {};
mn.services = mn.services || {};
mn.services.MnApp = (function (Rx) {
"use strict";
MnApp.annotations = [
new ng.core.Injectable()
];
return MnApp;
function MnApp() {
this.stream = {};
this.stream.loading = new Rx.BehaviorSubject(false);
this.stream.httpResponse = new Rx.... |
import React from "react";
import Song from "./Song";
const SongList = ({ songs }) => {
const songNodes = songs.map((song) => {
return (
<li key={song.id.attributes["im:id"]}>
{song["im:artist"].label} - {song["im:name"].label}
</li>
);
});
return <ul>{songNodes}</ul>;
};
export defa... |
import React from 'react'
import SearchResultList from '../components/SearchResultList'
import SurveyTable from '../components/SurveyTable'
/**
*
* 종료된 설문조사 모음 페이지
* by : 우혜경
*
**/
function ClosedSurvey() {
const data=[
{
key: '1',
title:'ddd',
p... |
({
shouldDeps: [
{
block: 'yummy'
}
]
});
|
// HLS sti fra this.options
define("dr-media-flash-video-player", ["dr-media-video-player"], function (VideoPlayer) {
"use strict";
var FlashPlayer = new Class({
Extends: VideoPlayer,
options: {
'appData': {
'errorMessages': {
'obsolete_flash_play... |
var routes = {};
routes.home = function(req, res) {
res.render("home", {"heading": "Welcome to Jessica's burgers!",
"message": "Things to do:",
"links": ["/ingredients",
"/order",
"/kitchen"
]});
}
module.exports = routes;
|
const { Client } = require("discord.js");
const JoinCodeCommand = require("./commands/joincode_command");
const RegisterCodeCommand = require("./commands/registercode_command");
const bot = new Client();
const commands = [new JoinCodeCommand(), new RegisterCodeCommand()];
bot.on("ready", () => {
console.log("Bot ac... |
var auctionNotification = require('./auction-close');
var timedEvents = {};
module.exports = {
addAuction: function(auction) {
// find time to true end
var currentTime = new Date().getTime();
var timeTill = auction.trueEnd - currentTime;
// for auctions in the future, build queue to notify winners
... |
import React, { Component } from 'react';
import Aux from '../../hoc/Aux/Aux';
import Cards from '../../components/Cards/Cards';
import classes from './FriendFinder.scss';
import typography from '../../sass/base/_typography.scss';
class FriendFinder extends Component {
state = {
fish: [
{
name... |
import './index.css'
const Message = props => {
const {isLogin} = props
return (
<h1 className="app-heading">{isLogin ? 'Welcome User' : 'Please Login'}</h1>
)
}
export default Message
|
const {VlElement} = require('vl-ui-core').Test;
const {By} = require('vl-ui-core').Test.Setup;
const {VlProgressBar} = require('vl-ui-progress-bar').Test;
const VlWizardPane = require('./vl-wizard-pane');
class VlWizard extends VlElement {
async next() {
const pane = await this.getActivePane();
return pane.n... |
class View {
renderQuestion(target, question) {
const getInput = () => {
const getOptions = () => {
let markup = ``;
question.choices.map(el => {
markup += `<option value="${el}">${el}</option>`
});
return markup;
}
switch (question.ans... |
import axios from "axios";
var paginationWrapper = document.querySelector(".pagination");
var postListWrapper = document.querySelector(".list-unstyled");
var perPageCount = 10;
var getContent = (start, end, stopPaginationRender = false) => {
axios
.get(`http://localhost:3000/posts?_start=${start}&_end=${end}`)
... |
import React, { Component } from 'react';
import { Table } from 'antd';
import '../index1.css';
import '../AudioBooks/AudioBooks.css';
import './tables.css';
import Checkbox from '@material-ui/core/Checkbox';
import FormControlLabel from '@material-ui/core/FormControlLabel';
const visible = false;
// const checked = ... |
import React, { Component } from 'react';
import {BrowserRouter as Router, Link, Route, Switch} from 'react-router-dom';
import ListEOfficerComponent from '../components/ListEOfficerComponent';
import CreateEOfficerComponent from '../components/CreateEOfficerComponent';
import ViewEOfficerComponent from '../compone... |
export default {
computed: {
getPermissionsTranslation() {
return (permission) => {
if (this.$te('role.permissions.' + permission)) {
return this.$t('role.permissions.' + permission)
} else {
return permission
... |
/* Maps and Sets Exercise */
// Quick Question #1
//What does the following code return?
new Set([1,1,2,2,3,4]);
//Answer: it removes duplicates and returns Set { 1, 2, 3, 4 }
// Quick Question #2
// What does the following code return?
[...new Set("referee")].join("");
//Answer: this ... |
import { createStackNavigator, createSwitchNavigator } from 'react-navigation';
import LoadingScreen from './Loading';
import HomeScreen from './Home';
import SignUpScreen from './SignUp';
import SignUpVerificationScreen from './SignUpVerification';
import LogonScreen from './Logon';
import LogonVerificationScreen from... |
import React from "react";
import ProductGroup from "../../layouts/ProductGroup";
import ProductList from "../../components/ProductList";
import styles from "./ProductsPage.module.css";
const ProductsPage = ({ pageTitle, category, products }) => {
return (
<ProductGroup pageTitle={pageTitle}>
{products.l... |
var client = require('./Mailgun.js');
var utils = require('./util/user.js');
var base64 = require('./util/base64.js');
Parse.Cloud.define("sendSignupEmail", function(request, response) {
utils.getUser(request.params.userid, function(user) {
var fs = require('fs');
var ejsFileContents = fs.readFileSync('./cloud/v... |
/// <reference path="../../../core/plugins/lz-string.d.ts" />
/// <reference path="../../../core/PagesPositionsCache/PPCache.ts" />
var LocalBookmarks;
(function (LocalBookmarks) {
var LocalBookmarksClass = /** @class */ (function () {
function LocalBookmarksClass(ArtID) {
this.ArtID = ArtID;
... |
export function isFnKey(name) {
return name.match(/^[fF]([2-9]|(1([0-2]?)))$/)
}
export function isSpaceKey(name) {
return name === ' ' || name.match(/^[sS]pace$/);
}
export function isCtrlKey(name) {
return name.match(/(^([cC]ontrol)|ctrl)$/);
}
export function isAltKey(name) {
return name.match(/^[... |
import axios from 'axios'
import qs from 'qs'
axios.defaults.headers.post['Content-Type']
= 'application/x-www-form-urlencoded';
// axios.defaults.baseURL
// = 'http://120.78.90.119:8099';
axios.defaults.baseURL ="http://120.78.164.247:9999";
axios.defaults.withCredentials = true;
export default function(flag){... |
import chai from 'chai'
import chatHttp from 'chai-http'
import 'chai/register-should'
import app from '../index'
chai.use(chatHttp)
const { expect } = chai
const product = {
menu: 'allDay',
name: 'Bolo',
price: '5.00',
type: 'doces',
}
const order = {
client: 'Jessika',
status: 'em produção',
table: 1,
... |
class HashTable {
constructor(size = 53) {
this.keyMap = new Array(size);
}
_hash(key) {
let result = 0;
let WEIRD_PRIME = 31;
// loops through at most 100 characters
for (let i = 0; i < Math.min(key.length, 100); i++) {
// map "a" to 1, "b" to 2, etc. by using charCodeAt() - 96
... |
"use strict";
let debug = require('debug')('APP:socket');
// GLOBALS
let confuser = [];
let io = (socket) =>{
debug('Sending conection true');
socket.emit('news', { hello: 'world' });
socket.on('my other event', (data) => {
console.log(data);
});
}
module.exports = io;
|
export const procedureXslt = '\
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">\
<xsl:output method="html"/>\
\
<xsl:template match="/dmodule/content">\
<div class="content">\
<xsl:apply-templates select="procedure" />\
</div>\
</xsl:template>\
\
<xsl:template m... |
import Enzyme, { shallow, render, mount } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
Enzyme.configure({ adapter: new Adapter() });
global.shallow = shallow;
global.render = render;
global.mount = mount;
global.spyMount = (component, ...methodNames) => {
const mount = require('enzyme').mount;
con... |
import React, { createContext, useEffect, useState } from "react";
import axios from "axios";
export const NewsContext = createContext();
export const NewsContextProvider = (props) => {
const [data, setData] = useState();
const apiKey = "81f8edbb675e40dc8735ccee0e159315";
useEffect(() => {
axios
.get... |
// Importing npm modules
const [mongoose, path, dotenv] = [
require("mongoose"),
require("path"),
require("dotenv").config(),
];
// Importing app module from index.js
const app = require(path.join(__dirname, "index"));
// Environment Variables
const { PORT, MONGODB_URI, MONGO_LOCAL, MONGODB_PASS } = process.env... |
// Connecting to ROS
// -----------------
var ros = new ROSLIB.Ros({
url : 'ws://localhost:9090'
});
ros.on('connection', function() {
console.log('Connected to websocket server.');
});
ros.on('error', function(error) {
console.log('Error connecting to websocket server: ', error);
});
ros.on('close', function() ... |
//declare the main variables and array
let roundMoves = 0;
let gameMoves = 0;
let gameEndCount = 0;
let clicksCounts = 0;
let symbols = ['images/boat.png', 'images/boat.png', 'images/building.png', 'images/building.png', 'images/daruma.png', 'images/daruma.png', 'images/doll.png', 'images/doll.png', 'images/star.png', ... |
const road ={
"results":
[
{
"id":1,
"user_id":"",
"date":"2019-03-01",
"heading":"Poor road infrastructure",
"detail":"The problem of poorly constructed roads is long engraved in India, not only in the rural areas but the issue concerns urban population alike. Potholes, roads under construct... |
const the100 = artifacts.require('RugPullGame');
contract('RugPullGame', (account) => {
beforeEach(async () => {
this.the100 = await the100.new("th1e00.eth.link","t100",1000);
});
it('should have correct name and symbol and decimal', async () => {
const name = await this.the100.name()... |
green_20_1_interval_name = ["玉井","虎頭山"];
green_20_1_interval_stop = [
["玉井站","玉井農會","新天宮","明泉寺","天后宮"], // 玉井
["虎頭山"] // 虎頭山
];
green_20_1_fare = [
[26],
[26,26]
];
// format = [time at the start stop] or
// [time, other] or
// [time, start_stop, end_stop, other]
green_20_1_main_stop_name = ["玉井站","玉井農會","新天宮","明泉寺","天... |
'use strict';
dmtApplication.factory("clientService", clientService);
function clientService($http, $window, __env) {
var service = {
getAllClients : getAllClients,
getAllTechnologies : getAllTechnologies,
create : create,
update : update,
deleteRow:deleteRow,
getContactsById:getContactsById
}, ... |
var PagedCollection = exports.PagedCollection = exports.Collection.extend({
collectionField: 'item',
countField: 'totalCount',
pageSize: 20,
page: 0,
offset: function() {
return this.pageSize * this.page;
},
nextPage: function(callback, error, options) {
if (!this.hasMore()) {
return;
... |
/**
* @author v.lugovksy
* created on 16.12.2015
*/
(function () {
'use strict';
angular.module('BlurAdmin.pages.safeEdu')
.directive('calendar', calendar);
/** @ngInject */
function calendar() {
return {
restrict: 'E',
controller: 'calendarCtrl',
templateUrl: 'app/pages/safeEdu... |
/*:
@include:
{
"class-moment": "Moment"
}
@end-include
@module-configuration:
{
"moduleName": "editorLinker",
"authorName": "Richeve S. Bebedor",
"isGlobal": true
}
@end-module-configuration
*/
Agreement = function Agreement( name ){
if( this instanceof Agreement ){
this.name = name;
}els... |
importScripts('http://localhost:9090/static/sm-sw.js');
|
// @param {number} num
// @return {boolean}
const isPerfectSquare = num => {
let index = 0;
while (index * index <= num) {
if (index * index === num) {
return true;
}
index++;
}
return false;
};
export default isPerfectSquare;
|
const launchScreen = LaunchScreen.hold();
Reloader = {
_options: {},
configure(options) {
check(options, {
check: Match.Optional(Match.OneOf('everyStart', 'firstStart', false)),
checkTimer: Match.Optional(Match.Integer),
refresh: Match.Optional(Match.OneOf('startAndResume', 'start', 'instan... |
#!/usr/bin/env node
const branch = require('git-branch');
const fs = require('fs');
const uid = require('uuid');
const buildNumber = `${branch.sync()}${uid()}`;
fs.writeFileSync('./.githooks/pre-commit/build-number', buildNumber);
|
const awsIot = require('aws-iot-device-sdk');
const config = {
keyPath: './certs/climateberry-client.private.key',
certPath: './certs/climateberry-client.cert.pem',
caPath: './root-CA.crt',
clientId: process.env.AWS_IOT_CLIENT_ID,
host: process.env.AWS_IOT_HOST
};
const thingName = 'ClimateBerry';
functio... |
import chai from 'chai';
import chatHttp from 'chai-http';
import 'chai/register-should';
import app from '../../main/app';
import db from '../../main/utils/db';
import AuthService from '../../main/services/AuthService';
chai.use(chatHttp);
const { expect } = chai;
const test = () => {
describe('AuthRoutes', () => ... |
var todos = require('./todos')
, debug = require('debug')('ff:api:util')
, _ = require('lodash')
module.exports = {
mergeTodos: mergeTodos,
todosFor: todosFor,
todomap: todomap,
activeTodos: activeTodos
}
var MAP = module.exports.map = todomap()
function activeTodos(todos) {
for (var i=0; i<todos.len... |
var tone=["green","red","yellow","blue"];
var col=[];
var levelrem="Level - ";
var levelup=[];
var counter=0;
var gamecounter=0;
//key click
$(document).keydown(function (event){
if(gamecounter==0)
{
if(event.key=="a" || event.key=="A")
{
$(".right").fadeOut();
setTimeout(tr... |
const axios = require('axios').default;
const methodArray = ['swapExactETHForTokens','swapETHForExactTokens','swapTokensForExactTokens','swapExactTokensForTokens']
const stable = ['0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48','0xdac17f958d2ee523a2206206994597c13d831ec7',
'0... |
/**
* Frosting is an extension for Twine 2 (mainly intended for use with the Snowman story format).
*
* @module frosting
**/
/**
* Actually there is no Frosting class per se, it's just a main frosting object.
*
* @class Frosting
**/
var package_json = require('./../package.json')
/*
This "frosting" is... |
class Option {
constructor(entity, cost) {
this.entity = entity;
this.cost = cost;
}
} |
const express = require('express')
const bodyParser = require('body-parser')
const expressValidator = require('express-validator')
const cors = require('cors')
require('dotenv').load()
const config = require('./config')
const routes = require('./lib/routes')
const app = express()
app.config = config
app.use(cors())... |
//@flow
import React from 'react';
import PropTypes from 'prop-types';
import {withStyles} from '@material-ui/core/styles';
import Card from '@material-ui/core/Card';
import CardActions from '@material-ui/core/CardActions';
import CardContent from '@material-ui/core/CardContent';
import Typography from '@material-ui/co... |
// options Api 通过一个选项进行配置
import { initMixin } from './init'
import { lifeCycleMinix } from './liftcycle'
import { renderMixin } from './vdom/index.js'
import { initGlobalApi } from './global-api/index'
import { stateMixin } from './state'
// 用 Vue 的构造函数,创建组件
function Vue (options) {
this._init(options)
}
initMixin(... |
/*
Request an up-to-date biog
- Simple contact form, email address only
- Sends email to client requesting up-to-date emails
- Hits api endpoint 'bio-request'
*/
import { useState } from 'react'
import styles from './styles/ParallaxBiog.module.css'
import axios from 'axios'
export default ... |
import HomePage from 'views/Home/Home'
var publicRoutes = [{ path: '/', name: 'Página Inicial', component: HomePage }]
export default publicRoutes
|
import _ from "lodash";
function greet(one, two = "2", { three_a, three_b }, ...four) {
return {
one,
two,
three_a,
three_b,
four
};
}
greet.defaultParams = [
{
default_one: "default_1"
},
"default_2",
{
three_a: "default_3_a",
three_b: "default_3_b"
},
"default_4_a",
... |
import React from "react";
import AppBar from '@material-ui/core/AppBar';
import Toolbar from '@material-ui/core/Toolbar';
import IconButton from '@material-ui/core/IconButton';
import Badge from '@material-ui/core/Badge';
import Grid from '@material-ui/core/Grid';
import TableData from "./TableData";
import { makeStyl... |
import Router from './router'
import './index.scss'
const router = new Router()
const view = document.querySelector('#view')
router.add('/', () => {
view.innerHTML = 'Router: /'
})
router.add('/page1', () => {
view.innerHTML = 'Router: /page1'
})
router.add('/page2', () => {
view.innerHTML = 'Router: /page2'
... |
const { Router } = require("express");
const quesionerController = require("../controllers/quesionerController");
const router = Router();
router.get("/add", quesionerController.quesioner_add_get);
router.get("/", quesionerController.quesioner_index);
router.post("/", quesionerController.quesioner_add_post);
router.ge... |
import React, { useContext, useReducer } from 'react';
import { BrowserRouter as Router } from "react-router-dom";
import jwtDecode from 'jwt-decode';
// import CssBaseline from '@material-ui/core/CssBaseline/index';
import Header from "./Layouts/Header";
import Footer from "./Layouts/Footer";
import Main from "./Main... |
$(document).ready(function(){
var client_id="GXNBFANOLBS3KJKAZG0BLVEIRELHKCE5OJGK5PC1MQPCKKXV";
var client_secret="1RKNC0YQH045LCE4AVJVD3PAGKTUCVUGVCJKNHZKVJFH5ATJ";
var v="20211110";
var limit="5";
var near="Yokohama"
getVenues(client_id,client_secret,v,limit,near);
$("#search_area").click(function(){
var city... |
import React, { Component } from 'react';
import {Switch, Route} from 'react-router-dom';
import Home from './Components/Home/Home.js';
import Layout from './hoc/Layout/Layout';
class Routers extends Component{
render(){
return(
<Layout>
<Switch>
<Route path... |
const Koa = require('koa')
const app = new Koa()
const views = require('koa-views')
const bodyparser = require('koa-bodyparser')
const Router = require('koa-router')
const router = new Router() // 初始化router
// middlewares
app.use(bodyparser({
enableTypes:['json', 'form', 'text']
}))
//两种写法
app.use(require('koa-stat... |
//Remove the king from the list.
var asteroidList = document.querySelector('ul.asteroids');
var king = document.querySelector('li');
asteroidList.removeChild(king);
//Fill the list based on the following list of objects.
//only add the asteroids to the list.
//each list item should have its category as a class
//and ... |
module.exports = {
port: 1234,
numberProperty: 1,
testServer: {
host: 'localhost',
port: 2121
},
mongo: 'mongodb://localhost:27017/test'
}; |
const {router} = require('../../../config/expressconfig')
const passport = require('passport')
const User = require('../../models/user')
// Auth with Google
let authWithGoogle = router.get('/auth/google/simpleUser', passport.authenticate('google',
{scope: ['profile', 'email']}, function () {
}));
// Google ... |
// @desc this is the Order component on admin's dashboard
// @author Sylvia Onwukwe
import React from "react";
// @material-ui/core components
// core components
import GridItem from "../../components/Grid/GridItem";
import Card from "../../components/Card/Card";
import CardHeader from "../../components/Card/CardHeade... |
/**
* @author Raoul Harel
* @license The MIT license (LICENSE.txt)
* @copyright 2015 Raoul Harel
* @url https://github.com/rharel/webgl-dm-voronoi
*/
/**
* The 3D context holds the webgl interface (with the help of three.js) and
* exposes only the most general interface to the Diagram component.
*
* @construc... |
import { astish } from '../astish';
describe('astish', () => {
it('regular', () => {
expect(
astish(`
prop: value;
`)
).toEqual({
prop: 'value'
});
});
it('nested', () => {
expect(
astish(`
prop: value;
... |
const mongoose=require("mongoose");
mongoose.connect("mongodb://localhost:27017/erpDB",{ useNewUrlParser: true, useUnifiedTopology: true});
const studentsSchema=new mongoose.Schema({
reg_no:String,
password:String,
name:String,
phone_no:Number,
gpa:Number,
hostel:String,
image:String,
});
... |
var app = require('../../server/server.js');
function login(email, cb) {
var opts = {
host: 'http://localhost:3005',
};
app.models.Purchaseuser.getLoginUrl(email, opts, cb);
}
module.exports = login;
|
const db = require('../models')
const { sendMail } = require('../sendEmail/nodemailer')
const CheckEmailIfExists = async (email) => {
user = await db.User.findOne({ where: { email: email }, })
if (user) {
const codeRandom = Math.floor(Math.random() * 10000);
sendMail(email , "hi is test ?... |
import axios from 'axios'
const { REACT_APP_BASE_URL } = process.env
const BASE_URL = REACT_APP_BASE_URL
// get all events by organization, with nested regsitration, reviews, attendees
const getEventsByOrg = async (orgId) => {
const token = localStorage.getItem('token_org')
const res = await axios(`${BASE_URL}/... |
/* eslint-disable no-undef */
const express = require('express')
const router = express.Router()
const mongoose = require('mongoose')
require('../models/Moedas.model')
const Moeda = mongoose.model('Moedas')
const descritor = require('../crawllers/wikipediaInfos')
const api = require('../apis/apimoeda')
router.get('/va... |
const moment = require('moment');
const _ = require('lodash');
const { User, Wobj, paymentHistory } = require('models');
const campaignValidation = (campaign) => !!(campaign.reservation_timetable[moment().format('dddd').toLowerCase()]
&& _.floor(campaign.budget / campaign.reward) > _.filter(campaign.users, (user) ... |
import React from 'react'
import { shallow } from 'enzyme'
import EpisodeList from './EpisodeList'
describe('EpisodeList Component', () => {
it('should render', () => {
const component = shallow(<EpisodeList />)
expect(component.find('.c-episodelist').exists()).toBe(true)
})
it('should render the correct... |
module.exports = function(sequelize, DataTypes) {
return sequelize.define(
'article',
{
id: {
autoIncrement: true,
type: DataTypes.INTEGER.UNSIGNED,
allowNull: false,
primaryKey: true
},
title: {
type: DataTypes.STRING(255),
allowNull: false,
... |
'use strict';
const express = require('express');
const router = express.Router();
const MatchController = require('../controllers').Matches;
const LobbyController = require('../controllers').Lobby;
const ProfileController = require('../controllers').Profiles;
router.route('/')
.get(MatchController.getAll)
;
rou... |
"use strict";
var Tag = require('../Tag');
var utils = require('../support/utils');
var append = utils.append;
Tag.extend('verbatim', {
block:true,
evaluate: function(template)
{
// Echo the scope inputs.
this.setSource(append(JSON.stringify(this.scope.input)));
}
}); |
$(function(){
var $container = $('#masonry-container');
$container.imagesLoaded( function(){
$container.masonry({
itemSelector: '.post-masonry',
columnWidth: 278,
gutterWidth: 16,
isAnimated: !Modernizr.csstransitions,
isFitWidth: true
});
});
}); |
import React from 'react'
import Icon from './Icon'
const ArrowUpIcon = props => (
<Icon originalWidth={32} originalHeight={32} {...props}>
<g>
<path
d='M27.414 12.586l-10-10c-0.781-0.781-2.047-0.781-2.828 0l-10 10c-0.781 0.781-0.781 2.047
0 2.828s2.047 0.781 2.828 0l6.586-6.586v19.172c0 ... |
/* jshint expr: true */
/* globals it, describe */
'use strict';
var expect = require('chai').expect;
var parseAccountString = require('../lib/utils').parseAccountString;
describe('parseAccountString', function() {
it('should return account info for properly constructed account string', function() {
var returne... |
import {BrowserRouter as Router, Switch, Route, useHistory,} from "react-router-dom";
import Header from "./components/header/Header";
import NewsPage from "./pages/news/NewsPage"
import Login from "./pages/login/Login";
import Schedule from "./pages/schedule/Schedule";
import Classest from "./pages/lessons/teacher/Cl... |
const fs = require("fs");
const map = fs.readFileSync("./map.txt").toString();
let mapByLine = map.split("\n");
let count1 = 0; // Right 3, down 1
let j = 0;
for (let i = 0; i < mapByLine.length; i++) {
if (j > mapByLine[i].length - 1) {
j = (j % (mapByLine[i].length));
}
if (mapByLine[i][j] ===... |
/*
FUNCTION TO LOG INTO THE BOT
*/
const botLogin = (token, vars, destroy) => {
if(vars.firstRun) {
vars.bot.login(token);
} else {
if(destroy !== null) {
if(destroy === true) {
vars.bot.destroy();
vars.bot.login(token);
} else {
vars.bot.login(token);
}
}
}
}
module.expo... |
#!/usr/bin/env node
const glob = require("glop");
const path = require("path");
const fs = require("fs");
console.log(path.join(process.cwd(), process.argv[2]));
glob(path.join(process.cwd(), process.argv[2]), function (err, file) {
if (err) throw new Error(err);
console.log(file);
fs.writeFileSync... |
// カメラ
exports.createWindow = function(_type, _userData){
Ti.API.debug('[func]winCamera.createWindow:');
Ti.API.debug('_type:' + _type);
var offsetX = 0;
var offsetY = 0;
var currentScale = 1;
// 画像のリサイズ・切り抜き
var editImage = function(_image) {
Ti.API.debug('[func]editImage:');
var croppedImage = null;
v... |
import logo from './logo.svg';
import './App.css';
import React, {Component} from 'react';
import {Route,Switch} from "react-router-dom";
import GetAll from './GetAll';
import Create from './Create';
import Get from './Get';
import Update from './Update';
import Delete from './Delete';
class App extends Component {
... |
'use strict';
var Customer = {
tableName: 'mds_customers',
attributes: {}
}
module.exports = Customer;
|
#!/usr/bin/node
const args = process.argv;
if (!isNaN(args[2])) {
console.log('My number: ' + args[2]);
} else {
console.log('Not a number');
}
|
import express from 'express';
import http from 'http';
import bodyParser from 'body-parser';
import morgan from 'morgan';
import mongoose from 'mongoose';
import cors from 'cors';
import compression from 'compression';
import router from './router';
import { dbConfig } from './config';
const app = express();
// Use ... |
const Computer = require('./int');
module.exports = input => {
let inp = [1];
let out = [];
let map = new Map();
let computer = new Computer(input.split(',').map(Number), inp, out);
let position = [0, 0];
let direction = [0, 1];
const id = ([x, y]) => `${x}#${y}`;
while (!computer.isFinished()) {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.