text stringlengths 7 3.69M |
|---|
// ==UserScript==
// @name Udacity Plus
// @namespace https://udacityplus.appspot.com
// @description Enhances Udacity lessons
// @match http*://udacityplus.appspot.com/*
// @match http*://*.udacity.com/*
// @match http*://udacity.com/*
// @require http://ajax.googleapis.com/... |
import * as React from 'react';
import { View,ActivityIndicator } from 'react-native';
import firebase from 'firebase';
export default class LoadingScreen extends React.Component {
toCheckUserLoggedIn=()=>{
firebase.auth().onAuthStateChanged((user)=>{
if(user){
this... |
import express from 'express';
import expressAsyncHandler from 'express-async-handler';
import Data from '../Data.js';
import Product from '../models/productModel.js';
const productRouter=express.Router();
productRouter.get('/',expressAsyncHandler(async(req,res)=>{
const products=await Product.find({}); // this w... |
function fetchData() {
const url = window.location.href;
return {
url: url
}
};
const sendData = (data) => {
// const site_url = window.location.href;
const url = 'http://127.0.0.1:3000/api/v1/audios';
fetch(url, {
method: 'POST',
headers: { "Content-Type": "application/json",
... |
import React, { Component } from "react";
import Form from "./Form";
import TweetCard from "./TweetCard";
import Trend from "./Trend";
import Header from "./Header";
import Notification from "./Notification";
import { connect } from "react-redux";
import { fetchTweets, notifyPortals, fetchTrends } from "../actions";
im... |
//实现验证开始时间必须小于结束时间
Ext.apply(Ext.form.field.VTypes, {
daterange: function (val, field) {
var date = field.parseDate(val);
if (!date) {
return false;
}
this.dateRangeMax = null;
this.dateRangeMin = null;
if (field.startDateField && (!this.dateRangeMax || ... |
"use strict";
const newImage = new Image();
const imageCanvas = document.querySelector("#imageCanvas");
const ctx = imageCanvas.getContext("2d");
const zoomCtx = zoomCanvas.getContext("2d");
const imageWidth = ctx.canvas.width;
const imageHeight = ctx.canvas.height;
let imageData;
const zoomWidth = zoomCtx.canvas.widt... |
export default function () {
console.log("我是foo")
} |
// You are trying to put a hash in ruby or an object in javascript or java into an array, but it always returns error, solve it and keep it as simple as possible!
// items = []
// items.push{a: "b", c: "d"}
// I wasn't sure what was exactly wrong with this solution so I had to do research. I realized... |
import styled from "styled-components";
export const Button = styled.button`
min-width: 100px;
margin: 5px;
padding: 5px 20px;
color: #ffffff;
background-color: #2EA44F;
border: 1px solid lightgrey;
border-radius: 5px;
outline: none;
cursor: pointer;
&:hover {
background-color: #2b8444;
}
... |
import React from 'react';
import VerifyCode from 'component/verify-code/index.jsx';
import BaseUtil from 'util/base-util.jsx';
import User from 'service/user-service.jsx';
import './index.css';
const _baseUtil = new BaseUtil();
const _user = new User();
class VerifyPage extends React.Component{
constructor(prop... |
/**
* @param {number} num
* @return {string}
*/
var convertToBase7 = function(num) {
if( num === 0) return "0";
var res = "";
var positive = num > 0;
while (num !== 0) {
res = Math.abs(num %7).toString() + res;
if (num > 0) {
num = Math.floor( num / 7);
} else {
num = Math.ceil( num /... |
module.exports.createServiceLocator = function() {
var
self = {};
/**
* Registers a service but make it read only
* @param {String} name To get the service by
* @param {Object} service What you want to register
*/
function register(name, service) {
if (self[name] !== undefined) {
throw new Error('Se... |
function Awake(){
if(!networkView.isMine){
enabled = false;
}
}
function OnCollisionEnter(collision : Collision){
transform.parent.GetComponent("BoxMove").collisionEnterProxy(collision);
}
function OnCollisionExit(collision : Collision){
transform.parent.GetComponent("BoxMove").collisionExitProxy(collision);
} |
import React, { Component, PropTypes } from 'react'
import { connect } from 'react-redux'
import { getUser } from 'actions/user'
import { Map } from 'immutable'
import styles from './ChatMessage.css'
class ChatMessage extends Component {
static propTypes = {
message: PropTypes.instanceOf(Map).isRequired,
get... |
import React, { useState } from "react";
import { Grid } from "@material-ui/core";
import ArrowDropDownIcon from '@material-ui/icons/ArrowDropDown';
import ArrowDropUpIcon from '@material-ui/icons/ArrowDropUp';
import { connect } from "react-redux";
function Process(props) {
const [processReadMores, setProcessReadMo... |
function esPrimo(numero) {
if (numero > 0 && numero < 4 || numero === 5) {
return true;
}
if ( (numero % 2 === 0) || (numero % 3 === 0) || (numero % 5 === 0) ) {
return false;
}
return true;
}
function cantidadPrimos(cantidad) {
const primos = [];
let count = 1;
... |
const secret = "@@n@nl@jnlk-02r-9i0uq4ohifuho9UEF0-I9@$@%@#!$-20-9U#$#$@$OUFHIFO-0EIF9H"
exports = module.exports = {
secret
} |
import styles from "../styles/hands.module.scss";
const Hands = ({ setUserHand }) => {
return (
<div className={styles.hands}>
<div className={styles.paper} onClick={() => setUserHand("paper")}>
<img src="./images/Paper.png" />
</div>
<div className={styles.scissor} onClick={() => setU... |
function load_wysiwyg($par){
$par.find('textarea:not(.no_wysiwyg)').tinymce({
// Location of TinyMCE script
script_url : '/site_media/static/tinymce/jscripts/tiny_mce/tiny_mce_src.js',
// relative_urls are awful. I want to never, ever see them.
relative_urls : false,
// General options
valid... |
import React from 'react';
import { render } from 'react-dom';
import { BrowserRouter } from 'react-router-dom';
import MoviesApp from './moviesApp/moviesApp.js';
render((
<BrowserRouter >
<MoviesApp />
</BrowserRouter>
), document.getElementById('movies-app'));
|
const
db = require('../../core/config/sequalize'),
Crypto = require('crypto-js'),
crypto = require('crypto');
exports.mapUserToResponseModel = (user) => {
const userTypes = [];
if (user.is_expert) {
userTypes.push('expert');
}
userTypes.push('user');
return {
... |
var express = require('express');
var mongoose = require('mongoose');
var db = require('./config.js')
var Inventory = require('./inventory.js');
var bodyParser = require('body-parser');
var app = express();
app.use(bodyParser.json());
app.use(express.static('public'));
app.post('/api/inventory', function(req, re... |
var assert = require("assert")
describe(' basic mocha test', () => {
it ('thorw some errors', () => {
assert.equal(3,3)
// try {
// assert.equal(2,3)
// }
// catch(e){
// console.log(e)
// }
// throw({message: 'some... |
// HunterDouglas Platinum Shades plugin for HomeBridge
//
// Remember to add platform to config.json. Example:
// "platforms": [
// {
// "platform": "HunterDouglas",
// "name": "Hunter Douglas",
// "ip_address": "127.0.0.1",
// "port": 522
// }
// ],
//
// If you do not know the ... |
import { shuffleArray } from "./utils";
export const URLS = shuffleArray([
"https://findtheinvisiblecow.com/",
"https://www.mapcrunch.com/",
"https://theuselessweb.com/",
"http://hackertyper.com/",
"http://papertoilet.com/",
"https://pointerpointer.com/",
"http://www.staggeringbeauty.com/",
"https://sc... |
import Link from 'next/link'
export default ({ sideNav, children }) => (
<nav className='blue darken-4'>
<div className='nav-wrapper'>
<a href='#' data-activates='mobile-nav' className='button-collapse'><i className='material-icons'>menu</i></a>
<ul className='left hide-on-med-and-down'>
<li... |
// @flow
import React, { Component } from "react";
import {
Container,
Button,
Text,
Input,
Item,
Icon,
Spinner,
List,
ListItem,
Body
// $FlowFixMe
} from "native-base";
import store from "../store/store";
import type { Repo } from "./Repo";
type GitReposState = {
repos: Repo[],
filterBySt... |
const User = require('./user');
const john = new User('John Doe');
console.log(john.getUser()); |
/**
* 全局动画配置
* @author: terry <[email protected]>
* @date: 2013-10-21 10:47
*/
define(function(require, exports, module) {
var $ = require('jquery');
$('.tableTh, .saletable').delegate('a.del', 'click', function(){
$(this).parents('tr').fadeOut();
});
// module.exports = Move;
}); |
const express = require("express");
const router = express.Router();
const getProjectSummary = require("../library/getProjectSummary");
const getProteoform = require("../library/getProteoform");
/**
* Express router for /seqQuery
*
* Query proteoform by projectCode and scan,
* send back proteoform result to user
... |
import { createStore, applyMiddleware } from "redux";
import { persistReducer } from "redux-persist";
import { composeWithDevTools } from 'redux-devtools-extension'
import storage from "../redux/storage";
import rootReducers from "./reducers/index";
import thunk from "redux-thunk";
const persistConfig = {
timeout: 0... |
// Created by Boris Schneiderman.
// Copyright (c) 2014 Readium Foundation and/or its licensees. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
// 1. Redistributions of source code must ... |
/*
Write a function that accepts two arguments: an array of integers and another integer n.
Determine the number of times where two integers in the array have a difference of n.
For example:
int_diff([1, 1, 5, 6, 9, 16, 27], 4) # 3 ([1, 5], [1, 5], [5, 9])
int_diff([1, 1, 3, 3], 2) # 4 ([1, 3], [1, 3], [1, 3], [1, ... |
import React, { useState, useEffect } from 'react'
import { useDispatch, useSelector } from 'react-redux'
import { Input, Button, List, ListItem } from '@material-ui/core'
import {
postMessageAction,
getMessagesAction,
} from 'Utilities/redux/messageReducer'
const MessageComponent = () => {
const dispatch = use... |
import React, { useState, useEffect } from "react";
import axios from "axios";
function SearchInput({ searchHandler }) {
return (
<div>
find countries:
<br />
<input onChange={searchHandler} />
</div>
);
}
function CountryDisplay({ country }) {
const languages = country.languages;
co... |
import Vue from 'vue'
import VueSemantic from 'croud-vue-semantic'
import Loader from '../../../src/components/shared/misc/ProfileHeader'
import CroudImageUploader from '../../../src/components/shared/misc/ImageUploader'
import CroudAvatar from '../../../src/components/shared/misc/Avatar'
import '../../../semantic/dist... |
import React, { Fragment } from "react";
import "./css/style.css"
const Portafolio = () => {
return(
<Fragment>
<div id="notfound">
<div className="notfound">
<div className="notfound-404">
<h1>404</h1>
</div>
<h2>Oops! No se pudo encontrar esta página</h2>
<p>Lo sentimos, pero la págin... |
/*global ODSA,MathJax */
// Written by Mohammed Farghally and Cliff Shaffer
// Expanding a Divide and Conquer Recurrence
$(document).ready(function() {
"use strict";
var av_name = "ExpandRecurrenceCON";
// Load the config object with interpreter and code created by odsaUtils.js
var config = ODSA.UTILS.loadConfi... |
import React from 'react';
import styled from 'styled-components';
//import Nabvar from './Navbar/Navbar'
import Login from './Login/Login'
import firebase from 'firebase';
firebase.initializeApp({
apiKey: "AIzaSyD6dwZetB7GNS528bQhV4lgB-pl34_n2X0",
authDomain: "test-firebase-app-c039f.firebaseapp.com",
d... |
import { f, s } from "./helpers/index";
export default function Nonpreemptive({ processes, comparator, criteria }) {
let uncompleted = processes.length;
let readyQueue = processes.map((e) => ({ ...e })).sort(comparator);
let clock = 0;
let frames = [];
let frame = null;
let findCurrent = () => {
let t... |
var Promise = require('bluebird');
var router = require('express').Router();
var activityModel = require('../../models/activity')
router.get('/', function (req, res, next) {
activityModel.findAll()
.then(res.json.bind(res))
.catch(next)
})
module.exports = router;
|
var searchData=
[
['orientation',['orientation',['../classRobot.html#affc0c754c8dc2133cb6171e9a34579fd',1,'Robot']]]
];
|
ejs.zip.Deflate = function(){
}
ejs.zip.Deflate.prototype.MAX_BITS = 15;
ejs.zip.Deflate.prototype.MAX_LITERAL_CODES = 286;
ejs.zip.Deflate.prototype.MAX_LENGTH = 258;
ejs.zip.Deflate.prototype.MIN_LENGTH = 3;
ejs.zip.Deflate.prototype.MAX_DISTANCE = 32768;
ejs.zip.Deflate.prototype.lengths = [
{ bits : 0,... |
/*const comportamiento = document.querySelectorAll('[name=comportamiento') //! OBTENIENDO EL VALOR DE UN RADIOBUTTON CON UN FOR
console.log(comportamiento)
let resultado= ""
function obtenerRadio(){
for(let i = 0;i<comportamiento.length;i++){
if(comportamiento[i].checked){
console.log(comportami... |
var state = {
menuList: [
{msg: '全部事项', count: 14, icon: 'glyphicon glyphicon-list-alt'},
{msg: '完成事项', count: 14, icon: 'glyphicon glyphicon-ok'},
{msg: '在忙事项', count: 14, icon: 'glyphicon glyphicon-option-horizontal'},
{msg: '清除事项', count: 14, icon: 'glyphicon glyphicon-remove'}
... |
import React ,{useEffect,useState} from 'react';
import Webcam from "react-webcam" ;
import Container from '@material-ui/core/Container';
import Grid from '@material-ui/core/Grid';
import { Button } from '@material-ui/core';
const videoConstraints = {
width: 300,
height: 300,
facingMode: "user"
};
... |
module.exports = (function() {
// Constructor
var robotCls = function() { };
// Fields
robotCls.statusCode = -1,
robotCls.error = null, // Should be refactored to a custom object
robotCls.pass = true,
robotCls.domBase = null,
robotCls.asserts = [];
robotCls.o... |
var tokki = angular.module("pedidoController", []);
tokki.controller("Pedido", ['$scope', '$rootScope', '$state', '$filter', 'tokkiData', 'tokkiApi', 'Notification',
function($scope, $rootScope, $state, $filter, tokkiData, tokkiApi, Notification) {
$rootScope.navigation = 'pedido';
$scope.sucursales = tokkiData[... |
import auth_reducer from './auth_reducer.js';
import project_reducer from './project_reducer.js';
import dom_elements_reducer from './dom_elements_reducer.js';
import { combineReducers } from 'redux';
const root_reducer = combineReducers({
auth: auth_reducer,
project: project_reducer,
dom_elements: dom_elements_red... |
// Implement a function called, areThereDuplicates which accepts a
// variable number of arguments, and checks whether there are any
// duplicates among the arguments passed in. You can solve this using the
// frequency counter pattern OR the multiple pointers pattern
// frequency counter pattern
function areThereDupl... |
///**
// * Service
// */
//angular.module('ngApp.profile').factory('ProfileService', function ($http, config, SessionService) {
//}); |
import React from 'react';
import { Link } from 'react-router-dom';
import { connect } from 'react-redux'
import { updateImg } from '../../../ducks/reducer';
function Step2(props) {
const { img, updateImg } = props
return (
<div>
<div>
<h2>Image URL</h2>
<... |
class Random {
constructor (seed) {
if (typeof seed === 'string') {
seed = parseInt(seed.toLowerCase().replace(/[^a-z0-9]/,''), 36);
}
this._seed = seed;
this._rnd = new MersenneTwister(seed);
}
random (a, b) {
var min = 0;
var max = ... |
var activeTurn = false,
actives = [];
var square = {},
allSquares = $(".grid-square");
square.validate = function(){
var self = {};
//candidate = $(this);
console.log("validate starting");
//console.log(this);
//console.log(square.current);
//$( candidate ).on('mouseenter', this.activeTurn());
... |
// Criação do Formulário
let formulario = document.createElement('form');
formulario.setAttribute('class','formulario');
document.body.appendChild(formulario);
// Seleçao do Formulário
let form = document.querySelector('.formulario');
// Inserção do Título
let titulo = document.createElement('h1');
let tituloTexto =... |
// == Copy ==
function Copy(target, {
onOk = () => {},
onErr = () => {}
} = {}){
if(!navigator.clipboard){
console.warn('navigator.clipboard not support.');
return;
}
if(!target){
console.warn('Text to copy or target DOM is required.');
return;
}
let txt;
if(typeof target === 'string' && !target.tagNa... |
import BaseDisplay from './BaseDisplay';
import Rms from '../../common/operator/Rms';
const log10 = Math.log10;
const definitions = {
offset: {
type: 'float',
default: -14,
metas: { kind: 'dyanmic' },
},
min: {
type: 'float',
default: -80,
metas: { kind: 'dynamic' },
},
max: {
ty... |
const axios = require("axios");
const db = require("../../models/");
module.exports ={
findAll:function(req,res){
axious.get("https://arxiv.org/find/grp_cs/1/ti:+Encryption/0/1/0/2009,2010/0/1?per_page=10").then(response=>{
console.log(response);
}
},
findAll:function(req,res){
db.eprint
... |
import React, { useState, createContext } from "react"
// module retrieves maintenance events from the DB in various ways to be utilized differently
export const LotNoteContext = createContext()
export const LotNoteProvider = (props) => {
const [lotNotes, setLotNotes] = useState([])
//const user = localStor... |
import React from "react";
class Counter extends React.Component {
changeColor() {
let h2ClassName = { color: "blue" };
if (this.props.count > 0) h2ClassName = { color: "green" }
if (this.props.count < 0) h2ClassName = { color: "red" }
return h2ClassName
};
render() {
... |
angular.module("myApp").controller("DeliveryListCtrl",["$scope","$rootScope","DeliveryService",function ($scope,$rootScope,DeliveryService) {
var page,time,status;
$scope.changeStatus = function(newStatus){
page = 0;
time = 0;
status = newStatus;
status = newStatus;
if(s... |
(function () {
'use strict';
angular
.module('DivineChMS')
.factory('DivineFactory', factory)
.service('LoggerApi', LoggerApi);
function LoggerApi() {
return {
createLogger : create
};
function create() {
var page = window.location.hr... |
function displayData() {
var displayArea = document.getElementById("displayArea");
var username = document.getElementById("username").value;
var email = document.getElementById("email").value;
var password = document.getElementById("password").value;
var firstName = document.getElementById("firstName").value;
v... |
(function () {
angular.module('OnePushApp.portfolios.services',[])
.factory('PortfoliosService', PortfoliosService);
PortfoliosService.$inject = ["$timeout", "$q", "$http", "$timeout", "appConstants"];
function PortfoliosService($timeout, $q, $http, $timeout, appConstants) {
var Portf... |
const submitBtn = document.querySelector("#submit");
const resetBtn = document.querySelector("#reset");
const timer = document.querySelector(".timer");
let seconds;
submitBtn.addEventListener("click", () => {
seconds = 60;
let minutes = document.querySelector("#minutes").value;
minutes--;
console.log(minutes);
... |
define('/static/script/lib/json/jsonToStr', [], function(require, exports, module) {
function jsonToStr(json)
{
var arr = [];
var str = "";
if(Object.prototype.toString.apply(json)=='[object Array]')
{
var num=json.length;
for (var i=0;i<num;i++)
{
arr.push(... |
/*
* @Author: HuYanan
* @Date: 2022-08-26 14:00:24
* @LastEditTime: 2022-08-30 19:01:13
* @LastEditors: HuYanan
* @Description: 时间相关操作
* @Version: 0.0.1
* @FilePath: /HynScript/src/time/index.js
* @Contributors: [HuYanan, other]
*/
import { fillZero } from "../String/numberFormat";
/**
* 输入一个时间点,获取其最近15分钟的时间点... |
import styled from "styled-components";
const LinksBackground = styled.div`
background-color: ${props => props.theme.colors.purple.primaryPurple};
`;
const LinkName = styled.span`
font-size: ${props => props.theme.fontSizes.sizeFour};
padding-left: 10px;
`;
const SocialLink = styled.a`
color: ${props... |
import Vue from 'vue'
import App from '@/App.vue'
import store from '@/common/store.js'
import mixins from '@/common/mixins.js'
import moment from 'moment'
Vue.mixin(mixins)
moment.locale('zh-cn')
import WxdocDesc from '@/components/learun-app/desc.vue'
Vue.component('wxdoc-desc', WxdocDesc)
import LButton from '@/c... |
/**
* Created by michael on 6/12/2017.
*/
import React, {PureComponent} from "react";
import {
StyleSheet,
Image,
Text,
TouchableOpacity,
TouchableWithoutFeedback,
View,
Dimensions
} from "react-native";
import PropTypes from "prop-types";
import FontAwesome from "react-native-vector-icons... |
/*
*
var menu_selector = "nav";
function onScroll(){
var scroll_top = $(document).scrollTop();
$(menu_selector + " a").each(function(){
var hash = $(this).attr("href");
var target = $(hash);
if (target.position().top <= scroll_top && target.position().top + target.outerHeight() > scroll_top) {
$(menu_sele... |
import React, { Component, Fragment } from 'react';
export default class ErrorCatch extends Component {
constructor(props) {
super(props)
this.state = { hasError: null }
}
static getDerivedStateFromError(error) {
return { hasError: true }
}
componentDidCatch(error, errorIn... |
var facebookConnect;
function onDeviceReady(){
// After device ready, create a local alias
facebookConnect = window.plugins.facebookConnect;
}
loginCallback = function(result){
alert(result);
}
logoutCallback = function(result){
alert(result);
}
meCallback = function(result){
alert(JSON.stringify(result));... |
( function (){
angular
.module('app.maps.controllers')
.controller('MapsController',MapsController);
MapsController.$inject = ['$scope'];
function MapsController($scope){
console.log('init map');
};
})();
|
import React, { useEffect } from "react";
import { ReactComponent as Ok } from "../images/ok.svg";
import { useHistory } from "react-router-dom";
import "../Styles/ok.css";
function Thankyou() {
const history = useHistory();
useEffect(() => {
setTimeout(() => {
history.push("/");
}, 3000);
});
... |
var $extend = require('extend');
const $promise = require("bluebird");
module.exports = function restfulErrors(req,res){
var self = this;
this._errors = [];
this._req = req;
this._res = res;
this.$init = function(){};
this.error = function(status,code,msg,field,obj){
// console.log('lo... |
var React = require("react");
class Newlistsong extends React.Component {
render() {
let formAction;
if (this.props.message.includes("Favorites")) {
formAction = '/favorites/new';
} else {
formAction = '/playlists/' + this.props.id + '/newsong';
}
let song = this.props.songs.map(s... |
/**
* 微信公众号信息, 需设置IP名单
*/
module.exports = {
appid: '',
secret: '',
url: '', // 签名url, 需设置JSAPI安全域名
};
|
$(document).ready( function ()
{
$('#tabel_nonpemakalah').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"info": false,
"responsive": true,
"autoWidth": false,
"pageLength": 10,
"ajax": {
... |
const express = require('express');
const path = require('path');
const indexRouter = require('./routes/index');
const epd_tool = require('./modules/app_tools');
const log = require('./modules/log');
// 初始化模板
epd_tool.initAllTemplate(path.join(__dirname, 'public', 'rules'));
// 启动应用
const app = express();
// 设置acce... |
import Mixin from '@ember/object/mixin';
import { debounce } from '@ember/runloop';
export default Mixin.create({
attributeBindings: ['data-toggle', 'data-placement'],
tooltipValuesObserver: [],
init() {
this._super(...arguments);
this.tooltipValuesObserver.forEach((key) => {
this.addObserver(ke... |
import React, { useEffect, useRef, useState } from "react";
import { useDispatch,useSelector } from "react-redux";
import { PostControlsNav, PostControlsOverlay, HiddenInput } from "./style";
import { Link } from "react-router-dom";
import { Button, Form, Modal } from "react-bootstrap";
import { deletePost, togglePinPo... |
// Game objects - will probably separate this out when I get an idea what's actually
// going to be in the game
// Coordinates explained:
// X = angle with respect to north pole
// y = height above surface
// vx = speed with respect to x, which is X * (r + y)
var ClipsToCamera = {
init: function (r) {
... |
import React, { useState, useEffect } from "react";
import axios from "axios";
import { Card, CardTitle, CardText, } from "reactstrap";
import FormModal from './FormModal'
function Event () {
const [info, setInfo] = useState({ events: [] });
useEffect(() => {
const fetch = async () => {
try {
... |
const express = require('express')
const bodyParser = require('body-parser')
const { Author, Book } = require('./sequelize')
const app = express()
app.use(bodyParser.json())
app.get('', (req, res) => res.status(200).send({
message: 'Welcome to the beginning of nothingness.',
}));
// Create a restaurant
app.po... |
app.activeDocument.activeLayer.locked ^= 1; |
class Developer {
askQuestions() {
console.log('Asking about design patterns!')
}
}
class CommunityExecutive {
askQuestions() {
console.log('Asking about community building')
}
}
module.exports = {
Developer,
CommunityExecutive
}
|
/**
* Inserts an element after another element.
* @param {Node Element} newNode Node to insert.
* @param {Node Element} referenceNode Reference of insert.
* @return {void}
*/
function insertAfter(newNode, referenceNode) {
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
}
/**
* AJAX... |
exports.up = function(knex, Promise) {
return knex.schema.createTable('action_log', function(table) {
table.increments();
table.string('method').defaultTo(null);
table.string('action').defaultTo(null);
table.string('name').defaultTo(null);
table.string('value').defaultTo(null);
table.string... |
import React from 'react';
import { View, StyleSheet, TextInput } from 'react-native';
import Icon from 'react-native-vector-icons/Entypo';
const IconTextInput = ({ icon, value, placeholder, name, onKeyPress, width = 145 }) => (
<View style={styles.searchSection}>
<Icon style={styles.searchIcon} name={icon... |
'use strict';
const fs = require('fs');
const buffer = fs.readFileSync('input.txt');
const file = String(buffer);
// Part 1
function part1() {
let list = file.split('\n'),
/*list = [
'aaaaa-bbb-z-y-x-123[abxyz]',
'a-b-c-d-e-f-g-h-987[abcde]',
'not-a-real-room-404[oarel]'... |
/**
* 公共JS处理类库
**/
var _init_serachform_name='searchfrom';
var _init_listform_name='listfrom';
//---查找---//
function searchList(fname){
if("undefined" == typeof fname) fname=_init_serachform_name;
alert(fname);
var pro =document.getElementById(fname);
pro.method = "post";
pro.submit();
}
//搜索
function search(ur... |
// eslint-disable-next-line no-unused-vars
import styles from './styles.scss';
const defaultTheme = () =>
`<div class="mstr-container" data-mstr-directive="autoHideShow,togglePlayPauseClick">
<div class="mstr-centerbar">
<span data-mstr-standard="spinner"></span>
</div>
<div cla... |
function randomBodyColour(){
document.body.style.backgroundColor=bodyColour ();
}
function bodyColour () {
var getColour = Math.floor(Math.random() * 0xFFFFFF);
return "#" + (getColour.toString(16)).substr(-6);
}
function randomBtnColour(){
document.getElementById("btn").style.backgroundColor =bt... |
import React from "react";
import { makeStyles, useTheme } from '@material-ui/core/styles';
import { useRouter } from 'next/router';
import Typography from '@material-ui/core/Typography';
import Button from 'components/Button';
import Grid from '@material-ui/core/Grid';
import { cdnURL } from 'utils/constants';
c... |
var stylist = angular.module('stylistCtrl', []);
stylist.controller('stylist', ['$scope', 'Stylist', 'Message', function($scope, Stylist, Message) {
Stylist.all().success(function(data) {
$scope.stylists = data;
});
$scope.showAddForm = function() {
if($(".top .form").is(':visible')) {
... |
// document ready starts here
$(document).ready(function () {
//PopOver for selecting voucher type
$('#changeType').popover({
placement: 'right',
html: true,
content: $('#typeWrap').html()
}).on('click', function () {
//inititalize select 2 ddl
$("#ddlChangeType").s... |
var bgColor = localStorage.getItem('userTheme');
$(function(){
/*将皮肤选中默认选中缓存中的值*/
//$("input[value="+bgColor+"]")[0].setAttribute("checked",'true');
$("input[value="+bgColor+"]").attr('checked',true);
if(bgColor){ $("#bgBox").removeClass().addClass(bgColor); }
//背景色切换选框
$('input[type=radio][nam... |
import React from 'react'
import styles from './Post.module.scss'
const Post = (props) => {
const renderMedia = (media = {}) => {
if (Object.keys(media).length) {
return (
<div styleName="post-thumb-wrap">
<img src={media.file} alt={media.alt_text} title={media.title.rendered} className={... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.