sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
1789ceb179ae6bf845dfa8883dac2974c1a663f8c09e1d40df7ac760ef804441 | JavaScript | 1,263 | 61 | const { MongoClient } = require('mongodb');
let db = null;
let client = null;
async function connectDB() {
if (db) {
return db;
}
const uri = process.env.MONGODB_URI || 'mongodb://localhost:27017';
const dbName = process.env.MONGODB_DATABASE || 'neuronbridge';
const options = {
maxPoolSize: 10,
... |
2563dc84c5f8b1cede3719b632db80dd60926f5ac72c9b2fce41fb837cdc1cbf | JavaScript | 1,276 | 48 | $('.scale').transition('scale in', 1000);
$('.shake').transition('shake');
$('.ui.checkbox').checkbox();
$('.dropdown').dropdown();
$('.ui.accordion').accordion();
// Semantic UI file upload integration.
$('.ui.action.input input:text, .ui.action.input .ui.button').click(function() {
$(this).siblings('input:f... |
bcde399b52bff86542a1cf35be98a8335c294b55af794dff696186402858420f | JavaScript | 1,282 | 42 | 'use strict';
const path = require('path');
const camelcase = require('camelcase');
// This is a custom Jest transformer turning file imports into filenames.
// http://facebook.github.io/jest/docs/en/webpack.html
module.exports = {
process(src, filename) {
const assetFilename = JSON.stringify(path.basename(fil... |
86db1c91d87aa99b8108acc8fe014ac5baeef7517378afbf611d98ffbed86cf5 | JavaScript | 1,290 | 31 | //crypto.js文件内容
import CryptoJS from 'crypto-js'
export default { // 加密
/**
* @description: 加密
* @param {*} word
* @param {*} keyStr
*/
set(word, keyStr) {
keyStr = keyStr || 'abcdef0123456789' // 16位的密钥,自己定义,和下面的密钥要相同
var srcs = CryptoJS.enc.Utf8.parse(word) // 字符串到数组转换,解析明文
var key = Cryp... |
aa3771d5cd4274730c4894ab1b8e241402477fba8d3dd77954facceaa5a20508 | JavaScript | 1,306 | 54 | // General code for all seminar (sub)pages.
if( $('#main-content-seminar')[0] ||
$('#main-content-seminar-users')[0] || $('#main-content-seminar-settings')[0] || $('#main-content-seminar-faqs')[0] ||
$('#main-content-seminar-lection')[0] || $('#main-content-seminar-contact')[0])
{
/*
* Show delete al... |
24d1377331c89850a9df27a6a2dea7f667a8aa01a5c9a4335e8f147e48480120 | JavaScript | 1,310 | 46 | import { isUserAdmin } from "../../main/nodejs/announcements";
describe('testing user access', () => {
test('call with no parameters should return false', () => {
expect(isUserAdmin()).toBe(false);
});
test('call with a string should return false', () => {
expect(isUserAdmin('test')).toBe(false);
});
... |
826c71246ffef7b1ae0ef5fb45a4718b1cdf036acc87191765debb6ee4566b3e | JavaScript | 1,355 | 70 | /* eslint-disable */
// this is an auto generated file. This will be overwritten
export const getSearch = /* GraphQL */ `
query GetSearch($id: ID!) {
getSearch(id: $id) {
id
owner
identityId
upload
searchDir
searchMask
errorMessage
alignmentErrorMessage
align... |
eefc32182621de1401caf43abd872827093c3bbff9c616423be9d9171d88a05c | JavaScript | 1,378 | 47 | import * as tf from '@tensorflow/tfjs-core';
import { loadLayersModel } from '@tensorflow/tfjs-layers';
import '@tensorflow/tfjs-backend-webgl';
import '@tensorflow/tfjs-backend-cpu';
import { vocab, vocab_stoi } from './vocab.json';
export async function loadModel(url) {
const model = await loadLayersModel(url,
... |
12f7aa349091228249b7d1fefd2f6df56efe32f9db01190022a117033d91989b | JavaScript | 1,382 | 41 | /*
* svgfix.js - Javascript SVG parser and renderer on Canvas
* version: 0.2
* MIT Licensed
*
* Fixes svg graphics:
* - Adds xmlns:xlink
* - xlink:href instad of href
* - trim
*
* To be used before calls to canvg.js
*
* Ignacio Vazquez (ivazquez@adooxen.com)
* Requires JQuery <--- no longer (PP 14/02/14)
... |
e2aad18c2e0b07d4ef6e7e466caad32e798351f329d371baf0eb045c506bc6aa | JavaScript | 1,383 | 1 | !function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var r=window.webpackJsonp;window.webpackJsonp=function(t,i,a){for(var c,u,f,p=0,s=[];p<t.length;p++)u=t[p],o[u]&&s.push(o[u][0]),o[u]=0;for(c in i)Object.prototype.hasOwnPro... |
a43aac67553f07ad1fc1df63c1efda97499f3e67b22d7a26e6067df08c1318b6 | JavaScript | 1,404 | 42 | describe("anonymous neuronbridge user", () => {
it("can load the home page but not see the search input", () => {
cy.visit("/");
cy.findByText(/Search light and electron/i);
cy.findByLabelText("Search")
.should("not.exist");
});
it("can see the about page", () => {
cy.visit("/about")
cy.... |
2b7786b564d23c3c73fd4747d352db948b7159e3b11f40537d230c352a453549 | JavaScript | 1,426 | 41 | 'use strict';
function populate_streamtable(hits) {
$(function() {
// This is mostly copied from <https://michigangenomics.org/health_data.html>.
var data = hits;
// data = _.sortBy(data, _.property('pval'));
var template = _.template($('#streamtable-template').html());
var ... |
328a1d6b3594f62d2479c1a1ce6d00fbb7b219208b64b6677cbf0955987f913d | JavaScript | 1,442 | 75 | import {request} from "@/utils/request";
// 获取图形验证码
export function getCaptcha(key) {
return request({
url: '/sys/randomImage/'+ key,
// url:'/sys/randomImage/',
method:"get"
})
}
// 获取手机号验证码
export function getPhoneCode(data) {
return request({
url: '/sys/sms',
method: 'post',
data
})... |
b6a903a3c3734f38536441603a653e7965a88e5c57be46367779f4950d059d07 | JavaScript | 1,447 | 42 | import { select } from 'd3';
import { transitionDur } from './init';
function _barGroupColor(sel, z) {
sel.transition().duration(transitionDur)
.style('fill', d => z(d.index));
}
export default function plotBars(chart, x, y, z, dataMeta, sortMap) {
// Details
const details = select('.details > div');
de... |
66b2dc49fc406028234a882c6ac4fa52ab15f3b31232b1e15b851e24d39c6047 | JavaScript | 1,453 | 61 | import {request} from "@/utils/request";
// 任务提醒
export function sendJobNotic(params,id) {
return request({
url: '/sys/annountCement/sendJobNotic',
headers: {
'Content-Type' : 'application/x-www-form-urlencoded',
'tenant_id': id
},
method: 'get',
para... |
4ee7258d73f5a4176064c3679fff716af7df32961196d8d0e21c812efa739db1 | JavaScript | 1,460 | 41 | 'use strict';
function populate_streamtable(phenotypes) {
$(function() {
// This is mostly copied from <https://michigangenomics.org/health_data.html>.
var data = phenotypes;
// data = _.sortBy(data, _.property('pval'));
var template = _.template($('#streamtable-template').html());
... |
edefdc553b9d1606200eaea7113b28f05ad93dc6f8efd274e23e8a74df234818 | JavaScript | 1,487 | 57 | import AWS from "aws-sdk";
const db = new AWS.DynamoDB.DocumentClient({
maxRetries: 3,
httpOptions: {
timeout: 5000
}
});
async function getDOIs(jwt, query) {
const params = {
TableName: process.env.NAMES_TABLE,
KeyConditionExpression: "#name = :name",
ExpressionAttributeNames: { "#name": "nam... |
9df473920c6fa42eaeb97d7661b1288c4583e0ec5f5cf76d4abc7912939c063e | JavaScript | 1,508 | 52 | import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import '@/styles/index.scss'
import '@/icons'
import Axios from "axios"
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import "normalize.css/normalize.css"; // A modern alterna... |
df615c22206fc6b311c5c08a40b3fd8f6ff5e2bce648f415d3e16f0f5611c849 | JavaScript | 1,524 | 47 | function escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
}
// Callback when a copy button is clicked. Will be passed the node that was clicked
// should then grab the text and replace pieces of text that shouldn't be used in output
export function f... |
82a258f4fb65257171f7062fe13666636016b18cc09ab8284e7715d20cd12d24 | JavaScript | 1,550 | 47 | import js from '@eslint/js';
import tseslint from '@typescript-eslint/eslint-plugin';
import tsparser from '@typescript-eslint/parser';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
/**
* Flat ESLint config. Strict-ish but not annoying — matches pycaret-se... |
c3183ab0635f1f8f35617d9c55590f87a4684feba9347d4331a8aad1de75321b | JavaScript | 1,557 | 77 | /*
* Setup Info WYSIWYG editor.
*/
$('.info-wysiwyg').trumbowyg({
lang: 'de',
semantic: true,
removeformatPasted: true,
btns: [
'btnGrp-semantic',
['superscript', 'subscript'],
['link'],
['removeformat']
]}
);
/*
* Setup Info JS Validator.
*/
// Init basic vali... |
a40fdade177f96b465344d52cc1d6c68dc5cf809ec2a4da2366b5cdae87d298d | JavaScript | 1,600 | 41 | document.addEventListener("DOMContentLoaded", () => {
// Always sync Material palette with current system preference.
// This prevents stale localStorage palette values from locking the theme.
try {
const isDark = window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches;
const scheme... |
c1b244829f29d51e0b72c51d630d18c58825e5426cc2f8d9e7c226f072e45ab4 | JavaScript | 1,638 | 58 | import { DynamoDBDocumentClient, QueryCommand } from "@aws-sdk/lib-dynamodb";
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
const dbDocClient = DynamoDBDocumentClient.from(new DynamoDBClient({
maxRetries: 3,
httpOptions: {
timeout: 5000
}
}));
async function getDOIs(jwt, query) {
const params... |
26d43d3219341cad97c38831465a4977fb803c1552535b063f62d9f06647de1d | JavaScript | 1,670 | 42 | import AWS from 'aws-sdk';
import {getSearchMaskId, getSearchSubFolder} from './searchutils';
import {updateSearchMetadata, ALIGNMENT_JOB_COMPLETED} from './awsappsyncutils';
const s3 = new AWS.S3();
const searchBucket = process.env.SEARCH_BUCKET;
const TEST_IMAGE_BUCKET = process.env.SEARCH_BUCKET;
const TEST_IMAGE ... |
0beaa9e0546c9658e4b7ec2e0d8961ce16f17b4da6b6cd73d66f58d04344ccf9 | JavaScript | 1,694 | 65 | // General code for all seminar (sub)pages.
if( $('#main-content-seminar')[0] ||
$('#main-content-seminar-users')[0] || $('#main-content-seminar-settings')[0] || $('#main-content-seminar-faqs')[0] ||
$('#main-content-seminar-lection')[0] || $('#main-content-seminar-contact')[0])
{
if (typeof disqus_shortn... |
ac684cceca837db2cba39cdedb4c7c79dfabc1cbefb0b0fc838d1510cff8bcdb | JavaScript | 1,734 | 42 | import { S3Client, CopyObjectCommand } from "@aws-sdk/client-s3";
import { getSearchMaskId, getSearchSubFolder } from './searchutils';
import { updateSearchMetadata, ALIGNMENT_JOB_COMPLETED } from './awsappsyncutils';
const s3Client = new S3Client();
const searchBucket = process.env.SEARCH_BUCKET;
const TEST_IMAGE_BU... |
3604249805e8216c9399e3b89b7b470f95844c863947641c0eba09b1e7ea9c28 | JavaScript | 1,748 | 63 | let selfieWorker = null;
const resolvers = {};
let id = 0;
const MAX_ID = 2 ** 10
const startSelfiesWorker = () => {
if (selfieWorker !== null)
return;
const file_dir = import.meta.url.replace(/[^/]*$/, '');
///const worker_url = new URL(file_dir + 'selfies_worker.js');
const worker_url = new U... |
a77fb3a7d3bbd485cf574c24fdc3012ece3cb1a79c66fe3af6eb97ced58bf5ec | JavaScript | 1,755 | 74 | export function getToken() {
return sessionStorage.getItem("token");
}
export function setToken(token) {
return sessionStorage.setItem("token", token);
}
export function removeToken() {
return sessionStorage.removeItem("token");
}
export function getRefreshToken() {
return sessionStorage.getItem("refr... |
e074f13b1b3050959a56570cc0225a296dca340bc81d23fa7512b2401d3c0ce7 | JavaScript | 1,844 | 60 |
window._ = require('lodash');
/**
* We'll load jQuery and the Bootstrap jQuery plugin which provides support
* for JavaScript based Bootstrap features such as modals and tabs. This
* code may be modified to fit the specific needs of your application.
*/
window.$ = window.jQuery = require('jquery');
/**
* Vue i... |
8a463f9dd566889ae6b9c9c85f56e8d31ca134d7db9fd5d745c29a13f06e323b | JavaScript | 1,856 | 78 | import Vue from 'vue'
// import { ACCESS_TOKEN } from "@/store/mutation-types"
import { getToken } from "@/utils/auth";
import store from '@/store'
/**
* 单点登录
*/
const init = (callback) => {
if (process.env.VUE_APP_SSO == 'true') {
console.log("-------单点登录开始-------");
let token = getToken()
let st = get... |
72a6d985394aad4352041c7ce6d120dccd624cbe662bb2bd18a4135d3e31a7d5 | JavaScript | 1,858 | 80 | /* eslint-disable */
// this is an auto generated file. This will be overwritten
// Had to remove id and status variables to allow subscription
// to show events for all searches. If present but not specified
// the null value would not match any searches,
export const onCreateSearch = /* GraphQL */ `
subscription O... |
1255bd5351d1bbff71df819e0acc6ed538964cf6904649160ec7863ee904bf0f | JavaScript | 1,885 | 1 | !function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer su... |
9b889ef63c5c309f65d4eae1283bcdd4573ae5f2e4421cbe2e62f80c01a2c26c | JavaScript | 1,890 | 61 | export function dataVersionFile() {
return process.env.REACT_APP_LEVEL.match(/^prod/)
? "current.txt"
: "next.txt";
}
export function alt() {
return true;
}
// new function,
// expects an object with a files key,
// takes that object and replaces all the urls in the files object
// returns the updated obj... |
327cc2495a2f7338957c1fb6bfe1e0f61e5bad42d03934688ac54f181b4cfee7 | JavaScript | 1,964 | 67 | require('dotenv').config();
const express = require('express');
const path = require('path');
const cors = require('cors');
const morgan = require('morgan');
const compression = require('compression');
const { connectDB } = require('./src/config/database');
const app = express();
const PORT = process.env.PORT || 3000;... |
cc3acc4573e703dcf5be5031ab737535255bb67fc919cbe7aaf3611aa7075101 | JavaScript | 1,970 | 85 | /**
* Utility functions for serializing MongoDB data for JSON responses
* or preparing it for a query
*/
const { Long } = require('bson');
const convertStringToId = (sid) => Long.fromString(sid);
/**
* Convert MongoDB Long _id to string
* MongoDB Long is represented as { high: number, low: number }
*/
const c... |
19fe6d73a4fef2b4a612c661e98161d358eb3074ca0e034ea405fd0e3fcf44d1 | JavaScript | 1,996 | 86 | /* eslint-disable */
// this is an auto generated file. This will be overwritten
// Had to remove id and status variables to allow subscription
// to show events for all searches. If present but not specified
// the null value would not match any searches,
export const onCreateSearch = /* GraphQL */ `
subscription O... |
1c63fff37825224639c8fa095bba78097826a60cd4bf456048a7e8b6989b9317 | JavaScript | 2,031 | 53 | describe("logged in neuronbridge user", () => {
beforeEach(() => {
cy.visit("/login");
cy.findByLabelText("Email")
.type(Cypress.env("username"));
cy.findByLabelText("Password").type(Cypress.env("password"));
cy.findByLabelText("Login").click();
cy.wait(2000);
});
/*
it("can see pages on... |
86673991b96331ca2d9f84d76deaa05e0572e35a2050b2eeab1bfbcbf5bbb063 | JavaScript | 2,043 | 53 | describe("logged in neuronbridge user", () => {
beforeEach(() => {
cy.visit("/login");
cy.findByLabelText("Email")
.type(Cypress.env("username"));
cy.findByLabelText("Password").type(Cypress.env("password"));
cy.findByLabelText("Login").click();
cy.wait(2000);
});
/*
it("can see pages on... |
f867495e93dc7628388e4f9ac74275c63e60dcb93c57324fd46e261ffe0c0b9c | JavaScript | 2,052 | 65 | importScripts('https://cdn.jsdelivr.net/pyodide/v0.20.0/full/pyodide.js');
const selfiesVersion = 2.0;
let pyodide = null;
// make fake function to start with
const selfiesMod = {
decoder: s => { return null },
encoder: s => { return null },
pyodideLoaded: 'loading',
selfiesLoaded: 'loading'
};
onmess... |
11799d12565763ef17d36fb635a3db11922b432ad051642503bc40ce1087505c | JavaScript | 2,181 | 74 |
importClass(Packages.ij.IJ);
importClass(Packages.ij.measure.ResultsTable)
importClass(Packages.ij.gui.Roi);
importClass(Packages.ij.gui.OvalRoi);
importClass(Packages.ij.measure.Measurements);
importClass(Packages.ij.gui.GenericDialog);
//construct the dialog
gd = new GenericDialog("Options");
gd.addStringField("Se... |
1bf28168521da95c12fdac8687005b664f8b5b0a896e9cd428abaa94111e2b18 | JavaScript | 2,186 | 51 | import * as THREE from 'three';
/* eslint-disable import/prefer-default-export */
export function makeFluoTransferTex(alpha0, peak, dataGamma, alpha1, colorStr)
{
// See Wan et al., 2012, "FluoRender: An Application of 2D Image Space Methods for
// 3D and 4D Confocal Microscopy Data Visualization in Neurob... |
a7a3c320e5be0d86f014a5eaaa731efdb2250a7384bbc595c3bf92a5a1224726 | JavaScript | 2,196 | 69 | import {
scaleOrdinal,
scaleBand,
scaleLinear,
scaleSequential,
axisBottom,
axisLeft,
format,
} from 'd3';
import { setupXAxis, setupYAxis } from './axis';
import plotBars from './bar';
import { availableColorSchemes } from './toolbar';
export const transitionDur = 500;
export default function render(s... |
b065fc81688f3264d552b42b1ccad4dee09b78b1c99b453bc96c768630a0574e | JavaScript | 2,218 | 89 | import AWS from "aws-sdk";
const db = new AWS.DynamoDB.DocumentClient({
maxRetries: 3,
httpOptions: {
timeout: 5000
}
});
async function deletePreferences(jwt) {
const params = {
TableName: process.env.TABLE,
Key: {
'username': jwt.claims.username
}
};
const result = await db.delete(... |
9f7d849edbd1adde29b1583a89c5002426a04becfb731f03f1ec4d0e1d939dc4 | JavaScript | 2,257 | 68 | 'use strict';
window.debug = window.debug || {};
// deal with IE11 problems
if (!Math.log10) { Math.log10 = function(x) { return Math.log(x) / Math.LN10; }; }
if (!!window.MSInputMethodContext && !!document.documentMode) { /*ie11*/ $('<style type=text/css>.lz-locuszoom {height: 400px;}</style>').appendTo($('head')); ... |
d2b00850ba55c574dab06495207e7590b2d2cd6d747cf229321a0903ce697421 | JavaScript | 2,284 | 77 | export function dataVersionFile() {
return process.env.REACT_APP_LEVEL.match(/^prod/)
? "current.txt"
: "next.txt";
}
export function isInternalSite() {
return process.env.REACT_APP_LEVEL && process.env.REACT_APP_LEVEL.match(/pre$/);
}
export function alt() {
return true;
}
export function libraryForma... |
911bf40a93a28b2ee191034b39d3c1f8db1f8c4e05bb50d2d6932ad113f9a673 | JavaScript | 2,316 | 90 | import { useRef, useEffect } from 'react';
import PropTypes from 'prop-types';
import { useCoords } from '../contexts/MouseCoordsContext';
function getMousePos(evt) {
const canvas = evt.target;
const rect = canvas.getBoundingClientRect();
return {
x: ((evt.clientX - rect.left) * canvas.width) / canvas.client... |
d27b10ccb5cbc9b581c01ce8655fc6f856c18496d90e7f648166a79ad7d93d17 | JavaScript | 2,337 | 81 | "use strict";
const path = require("path");
function resolve(dir) {
return path.join(__dirname, dir);
}
const name = ""; // page title = defaultSettings.title ||
module.exports = {
publicPath: "/",
productionSourceMap: false,
configureWebpack: {
name: name,
resolve: {
alias: {
... |
e4c21c57164c7f89d7262beb22a60f36348e42a245fd481eb65df7db2f0b5a0d | JavaScript | 2,409 | 71 | const express = require('express');
const router = express.Router();
const path = require('path');
const fs = require('fs').promises;
const sharp = require('sharp');
const IMAGE_BASE_PATH = process.env.IMAGE_BASE_PATH || '';
const THUMBNAIL_WIDTH = parseInt(process.env.THUMBNAIL_WIDTH) || 200;
const THUMBNAIL_HEIGHT =... |
79dbb80012920877af67b2f58af6cd11f0f2bc3d2b8e148e0a603072f24fc3cc | JavaScript | 2,437 | 91 | import { DynamoDBDocumentClient, DeleteCommand,
QueryCommand, PutCommand } from "@aws-sdk/lib-dynamodb";
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
const dbDocClient = DynamoDBDocumentClient.from(new DynamoDBClient({
maxRetries: 3,
httpOptions: {
timeout: 5000
}
}));
async function ... |
f609a8920136265041de5ccd4256c4493e53ef197116aa7350aeb1e34e51c34b | JavaScript | 2,469 | 73 | import { select, selectAll } from 'd3';
import { transitionDur } from './init';
function _swatchColor(sel, z, stackOrder) {
sel.transition().duration(transitionDur)
.style('fill', d => z(stackOrder.indexOf(d)));
}
export default function plotLegend(legendCol, chartInfo) {
const { keys, z, stackOrder, newHeig... |
ee0d5dfa14eb5db0f330d79423cfa3c513e664c9df3ad0ddf3d3e802312bf3ed | JavaScript | 2,493 | 125 | /* eslint-disable */
// this is an auto generated file. This will be overwritten
export const getSearch = /* GraphQL */ `
query GetSearch($id: ID!) {
getSearch(id: $id) {
id
owner
identityId
upload
searchDir
searchMask
errorMessage
alignmentErrorMessage
align... |
10b691c8910bfe09d427364e21da4aa7b47af3fd2bbe3628e1797138f52b7295 | JavaScript | 2,527 | 76 |
window.initializeCodeFolding = function(show) {
// handlers for show-all and hide all
$("#rmd-show-all-code").click(function() {
$('div.r-code-collapse').each(function() {
$(this).collapse('show');
});
});
$("#rmd-hide-all-code").click(function() {
$('div.r-code-collapse').each(function() {
... |
b2eceeddfcd0f303bfb48545b7b3d772ba0f8e556e62197feb2cfcde137c3bdb | JavaScript | 2,623 | 76 | import { select } from 'd3';
import render from './render';
import {
addTaxaPicker,
addWidthSlider,
addColorPicker,
addSortByPicker,
addDownloadLinks,
} from './toolbar';
import { setupData, sort } from './data';
import plotLegend from './legend';
/* Re-initializes the display.
*
* "state" is an object t... |
58baa7c1095385cc2461830d2dbfd471e25784b2fa231c8a1e87c03232fc7fb3 | JavaScript | 2,650 | 100 | import { useLocation } from "react-router-dom";
import { useState, useEffect, useLayoutEffect, useCallback, useRef } from "react";
export function useInterval(callback, delay) {
const savedCallback = useRef();
// Remember the latest callback.
useEffect(() => {
savedCallback.current = callback;
}, [callbac... |
593622976412cc0251e12dd9923f07299fb40c69f366559140451717da9c79bf | JavaScript | 2,653 | 110 | /*
* Setup Section JS Validator.
*/
// Init basic validation rules.
var rules = {
name: {
rules: [
{
type : 'empty',
prompt : 'Bitte einen Namen eingeben.'
}
]
},
filepath: {
rules: [
{
... |
d976d63b911afd0e8cc0d3d5821a437bacd67599f100f85c0e4b99fdb9381f0a | JavaScript | 2,834 | 89 | /** @type {import('tailwindcss').Config} */
export default {
content: ['./index.html', './src/**/*.{ts,tsx}'],
// Light theme by default. We keep the `class` strategy in case we
// re-introduce a dark toggle later, but no `dark` class is set on
// <html>, so dark variants are inert today.
darkMode: 'class',
... |
954437a0c96bd7fea37e87312a1a3d7f209f819da53b8dca6ec4807e12feec70 | JavaScript | 2,860 | 61 | // Strips extension from filepath, e.g.
// mask5876558744700983093.png -> mask5876558744700983093
const getKeyWithNoExt = (searchInputKey) => {
const extSeparatorIndex = searchInputKey.lastIndexOf('.');
return extSeparatorIndex > 0 ? searchInputKey.substring(0, extSeparatorIndex) : searchInputKey;
};
// If ext... |
7215e074cac69cee7b9720f3c3478376fcee2ac95278586ce7210504d9a336db | JavaScript | 2,930 | 134 | /*
* Setup Seminar JS Validator.
*/
// Add new semantic ui form validation rule.
$.fn.form.settings.rules.unique = function(value, title) {
return( value != title);
};
// Recieve the used titles.
// var seminar_titles is provided by Laravel.
var createUniqueTitleRules = function (form_titles) {
var ... |
3061a081688115890e8345ee03da4e6c820a70946ca81b4fa82b4186f55d0a54 | JavaScript | 2,961 | 99 | import * as THREE from 'three';
import { BufferGeometryUtils } from 'three/examples/jsm/utils/BufferGeometryUtils';
/* eslint-disable prefer-template */
// From https://github.com/JaneliaSciComp/SharkViewer/blob/master/src/viewer/util.js
export function parseSwc(swcFile) {
// split by lines
const swcA... |
18f7bef64f2d8fcca28686eece432f3137706ee98be65cb0f6a8193d14d79fa7 | JavaScript | 3,006 | 89 | const ThreadsPlugin = require('threads-plugin');
module.exports = {
publicPath: '',
assetsDir: '',
configureWebpack: {
devtool: 'source-map',
plugins: [
new ThreadsPlugin({
target: 'electron-node-worker',
globalObject: 'self',
})
... |
a86e222da45fad02216311e04414179860459d6604e9919e1198a5f05559c57d | JavaScript | 3,074 | 67 | import * as THREE from 'three';
/* eslint-disable import/prefer-default-export */
// Build a 1D RGBA transfer texture for fluorescence-style rendering.
//
// The optional `watermark` argument is used for verification by the peak-finder
// calibration pipeline. When `watermark` is set (to a value between 0 and... |
e80749ed5429bb663e22e8ab1ea06d43dadd194d7ff1f339ad74bb0f135c206c | JavaScript | 3,097 | 107 | /* migrate users from the original user pool, to the
* current user pool, on either successful login or after
* a request to reset their password. */
import AWS from "aws-sdk";
const isp = new AWS.CognitoIdentityServiceProvider();
const OLD_CLIENT_ID = process.env.OLD_CLIENT_ID;
const OLD_USER_POOL_ID = process.env... |
eb60e106a6b8c7b724bdf2b90d73b6e632ec05a7725da1f781d8ab1ed5362a08 | JavaScript | 3,156 | 89 | describe('config testing', () => {
const OLD_ENV = process.env;
beforeEach(() => {
jest.resetModules() // most important - it clears the cache
process.env = { ...OLD_ENV }; // make a copy
});
afterAll(() => {
process.env = OLD_ENV; // restore old env
});
test('test REACT_APP_LEVEL = dev', ()... |
bc087bdaa70992b164c1537a4222a649b7d60f50e418c8c32716eb578f0fbf77 | JavaScript | 3,164 | 114 | import AWS from "aws-sdk";
import { getOldSubs, searchesToMigrate } from "./utils";
const db = new AWS.DynamoDB.DocumentClient();
const s3 = new AWS.S3();
// save data to new dynamodb table
async function saveSearchToDynamoDB(item, TableName) {
const params = {
TableName,
Item: item
};
try {
await ... |
0f30675af23ace8220ce6857f20ec9f4cf9b410cea15fdcb3799797a57097612 | JavaScript | 3,172 | 100 | import AWS from 'aws-sdk';
import { getSearchMetadata, updateSearchMetadata} from './awsappsyncutils';
const bc = new AWS.Batch({
apiVersion: '2016-08-10'
});
export const isJobDone = async (event) => {
console.log('Input event:', JSON.stringify(event));
try {
return await monitorAlignmentJob(ev... |
a1def8b45616c650f95084eecf4c3fdfc926fcafcf2597e0a94c1f9ab87f1e93 | JavaScript | 3,213 | 116 | if( $('#message-new')[0] )
{
/*
* Setup Message WYSIWYG editor.
*/
$('.message-wysiwyg').trumbowyg({
lang: 'de',
semantic: true,
removeformatPasted: true,
btns: [
'btnGrp-semantic',
['superscript', 'subscript'],
['link'],
... |
fb1ea073894f00508bfca24c17f131003b07da864405ce3494d9a40156cdad4c | JavaScript | 3,214 | 98 | import { BatchClient, DescribeJobsCommand } from "@aws-sdk/client-batch";
import { getSearchMetadata, updateSearchMetadata} from './awsappsyncutils';
const batchClient = new BatchClient();
export const isJobDone = async (event) => {
console.log('Input event:', JSON.stringify(event));
try {
return aw... |
c0850b1ae42acf62530f0ce4dd94017a5f30fbc96a366ff174e93882fa592635 | JavaScript | 3,226 | 1 | Search.setIndex({"docnames": ["index", "usage"], "filenames": ["index.md", "usage.md"], "titles": ["<no title>", "Usage"], "terms": {"index": [], "modul": [], "search": [], "page": [], "thi": 1, "repositori": [], "contain": [], "notebook": [], "code": [], "The": 1, "main": [], "goal": [], "i": 1, "provid": [], "t... |
5cf50589ec163b499d03f255d8efee7f45f08634de469cd365967efb52fed720 | JavaScript | 3,243 | 106 | import { Auth } from "aws-amplify";
const validLevels = ["prod", "val", "dev", "devpre", "prodpre"];
const UNDER_MAINTENANCE = process.env.REACT_APP_UNDER_MAINTENANCE || false;
const dataLevel =
process.env.REACT_APP_DATA_TARGET || process.env.REACT_APP_LEVEL;
let BUCKET_NAME = "janelia-neuronbridge-data-prod";
i... |
c2c46730a8e62735b2f99d6e0ad4a529cb7399d8e8fd66b784cdf07e1404f945 | JavaScript | 3,258 | 183 | /**
* User: CHT
* Date: 2020/5/8
* Time: 14:01
*/
import {
minus,
uuid,
vector
} from './utils'
import {
direction,
directionVector
} from './types'
export default class GraphNode {
constructor(props, graph) {
const {
id = uuid('node'),
width = 180,
height = 100,
coordinat... |
c76da3553eb5a7b1935f0cd0dc5ddeb917ee78bb173b9d9ac7a823f528825db0 | JavaScript | 3,275 | 111 | importClass(Packages.ij.IJ);
importClass(Packages.ij.measure.ResultsTable)
importClass(Packages.ij.gui.Roi);
importClass(Packages.ij.gui.OvalRoi);
importClass(Packages.ij.measure.Measurements);
importClass(Packages.ij.gui.GenericDialog);
importClass(Packages.ij.plugin.ImageCalculator);
//construct the dialog
gd = ne... |
43130f3ee81e3daa406a791d5ec57107ae82f072db5482ce13b98966e12598d5 | JavaScript | 3,279 | 128 | const express = require('express');
const router = express.Router();
const { getDB } = require('../config/database');
const DEFAULT_PAGE_SIZE = parseInt(process.env.DEFAULT_PAGE_SIZE) || 50;
const MAX_PAGE_SIZE = parseInt(process.env.MAX_PAGE_SIZE) || 500;
/**
* POST /api/search
* Search neurons with complex criter... |
64b8a53b1782f3ea6906efc199580738dee75205eb7d23d04065c91f3465b502 | JavaScript | 3,542 | 118 | importClass(Packages.ij.IJ);
importClass(Packages.ij.measure.ResultsTable)
importClass(Packages.ij.gui.Roi);
importClass(Packages.ij.gui.OvalRoi);
importClass(Packages.ij.measure.Measurements);
importClass(Packages.ij.gui.GenericDialog);
importClass(Packages.ij.plugin.ImageCalculator);
//construct the dialog
gd = ne... |
b32af55743e34f34e3ec854e2e3778986c63f094cb55a23ba1c84e87de9c859e | JavaScript | 3,575 | 119 | import { v1 as uuidv1 } from "uuid";
import { copyS3Content, getAllKeys } from "./utils";
import {
createSearchMetadata,
updateSearchMetadata,
getSearchMetadata,
ALIGNMENT_JOB_COMPLETED
} from "./awsappsyncutils";
const searchBucket = process.env.SEARCH_BUCKET;
async function getSearchRecord(searchId) {
con... |
2ae0b9628df32e39e62aa6c26789b11c46185ff6aa48b2c3d80e276c4c01a82a | JavaScript | 3,643 | 1 | !function(r,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(r.lunr)}(this,function(){return function(r){r.stemmerSupport={Among:function(r,t,i,s){if(this.toCharArray=function(r){for(var t=r.length,i=new Array(t),s=0;s<t;s++)i[s]=r.charCodeAt(s);return i},!r&&""!=r||!t&... |
ff8a69bc3d3d6bfb220b196dba68c55257522cdf755fd8a83baa25150672373d | JavaScript | 3,698 | 129 | import AWS from "aws-sdk";
const db = new AWS.DynamoDB.DocumentClient({
maxRetries: 3,
httpOptions: {
timeout: 5000
}
});
function isUserAdmin(token) {
// get data from event.requestContext.authorizer.jwt
// if 'cognito:groups' contains neuronbridge-admins then return true
if (token) {
const cogni... |
04ec12fbc6fcb36baf75fdcdc133092fd774e34bf4bf2d007d452050cb38429f | JavaScript | 3,704 | 184 | /**
* User: CHT
* Date: 2020/5/8
* Time: 14:03
*/
export function uuid(before = '', after = '') {
const chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('')
const charsLen = chars.length
let uuid = []
const len = 16
for (let i = 0; i < len; i++) {
uuid[i] = chars[0 | Ma... |
9882811f305b7623ff3dff964934a40555a7134cb9832325e95cb22bfee2b57c | JavaScript | 3,764 | 110 | import { v1 as uuidv1 } from "uuid";
import { copyS3Content } from "./utils";
import {
createSearchMetadata,
ALIGNMENT_JOB_COMPLETED
} from "./awsappsyncutils";
const searchBucket = process.env.SEARCH_BUCKET;
/*
* Given an s3 image url and a users identity, this function will
* copy that image into a new sear... |
3a69e3a279fc9fac77043347dbe91efc73ad6a7e7faf358126d6c011b6400361 | JavaScript | 3,771 | 132 | if( $('#infoblock-new')[0] )
{
/*
* Setup Message WYSIWYG editor.
*/
$('.infoblock-wysiwyg').trumbowyg({
lang: 'de',
semantic: true,
removeformatPasted: true,
btns: [
'btnGrp-semantic',
['superscript', 'subscript'],
['link'],
... |
45678d29efe7c76000bd3a89a776d8606b55df19f83794065ac36184603a1459 | JavaScript | 3,820 | 167 | /*
* Setup Admin JS Validator.
*/
// Init basic validation rules.
var rules = {
username: {
rules: [
{
type : 'empty',
prompt : 'Bitte einen Benutzernamen eingeben.'
}
]
},
firstname: {
rules: [
{
... |
3656805620a64e7d4a0d2b0acf55beb63a270315e7b968bf7d903da52d561bc1 | JavaScript | 3,822 | 143 | import AWS from "aws-sdk";
const db = new AWS.DynamoDB.DocumentClient({
maxRetries: 3,
httpOptions: {
timeout: 5000
}
});
export function isUserAdmin(token) {
// get data from event.requestContext.authorizer.jwt
// if 'cognito:groups' contains neuronbridge-admins then return true
if (token) {
con... |
beeaaf3b11dc9900eb6fcd95c2ffc2957c3542413d53e073974d3ff55ef09482 | JavaScript | 3,830 | 118 |
;(function(win, lib) {
var doc = win.document;
var docEl = doc.documentElement;
var metaEl = doc.querySelector('meta[name="viewport"]');
var flexibleEl = doc.querySelector('meta[name="flexible"]');
var dpr = 0;
var scale = 0;
var tid;
var flexible = lib.flexible || (lib.flexible = {});
... |
ffc4f36732364f030b8e9f9b85c2f2d38c55f8b5fccf98bfe9628e098075d77a | JavaScript | 3,896 | 139 | import { login } from "@/api/login/index";
import { getToken, setToken, removeToken ,
getUserInfo, setUserInfo, removeUserInfo,getRefreshToken,setRefreshToken,removeRefreshToken
} from "@/utils/auth";
const state = {
token: getToken(),
userInfo: JSON.parse(getUserInfo()) ,
refreshToken: getRefreshToken()
};
... |
3484e302e2b13bcfd79c468ffde163559102360f6c791162544d39a9cd2ee2aa | JavaScript | 3,929 | 2 | !function(e,t){"function"==typeof define&&define.amd?define([],function(){return t(e)}):"object"==typeof exports?module.exports=t(e):e.Gumshoe=t(e)}("undefined"!=typeof global?global:"undefined"!=typeof window?window:this,function(u){"use strict";function d(e,t,n){n.settings.events&&(n=new CustomEvent(e,{bubbles:!0,can... |
6fabf82801127b31c8f634848231c32e928286f225ef3eb435b5bd86696c46a1 | JavaScript | 3,931 | 104 | import { rest } from "msw";
import publishedNames12288 from "./published_names_12288.json";
import devPreConfig from "./dev_pre_config.json";
/*
import metadata1537331894 from "./1537331894_metadata.json";
import LH173metadata from "./LH173_metadata.json";
import R16F12metadata from "./R16F12_metadata.json";
import con... |
7071e3bc9ca5075bacc2bc3aa66a0bc334815661d7bf1d11f053b177bb4e7e0b | JavaScript | 3,945 | 129 | import { CognitoIdentityProviderClient, ListUsersCommand } from "@aws-sdk/client-cognito-identity-provider";
import { DynamoDBDocumentClient, ScanCommand } from "@aws-sdk/lib-dynamodb";
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
const dbDocClient = DynamoDBDocumentClient.from(new DynamoDBClient({
max... |
dfff992747ff5b4a85c1b3c1437ced60334ccc13b26380200555103636932257 | JavaScript | 3,994 | 202 | /**
* User: CHT
* Date: 2020/5/8
* Time: 14:00
*/
import GraphEvent from './GraphEvent'
import GraphNode from './GraphNode'
import GraphLink from './GraphLink'
import {
arrayReplace
} from './utils'
class Graph extends GraphEvent {
constructor(options) {
const {
nodeList = [],
linkList = [],
... |
7f7cb5e5843e114c44d534e104be4d9b8b17a3e9b03d12636c940804fcbf7b0b | JavaScript | 4,031 | 111 | import Jimp from "jimp";
import {
getS3ContentWithRetry,
copyS3Content,
putS3Content,
} from "./utils";
import { getSearchKey, getSearchMaskId } from "./searchutils";
import {
updateSearchMetadata,
getSearchMetadata,
ALIGNMENT_JOB_COMPLETED
} from "./awsappsyncutils";
const searchBucket = process.env.SEARC... |
b7fd9d3ea6b17b2785dffbc69c62f186e7dc6b7c3ffccd34d128493388b525c1 | JavaScript | 4,035 | 143 | import { DynamoDBDocumentClient, DeleteCommand, QueryCommand, PutCommand } from "@aws-sdk/lib-dynamodb";
import { DynamoDBClient } from '@aws-sdk/client-dynamodb';
const ddbDocClient = DynamoDBDocumentClient.from(new DynamoDBClient({
maxRetries: 3,
httpOptions: {
timeout: 5000
}
}));
export function isUserA... |
509ded2417532d3961f146b385be083705b02066c1f000eefcc8871b695f8575 | JavaScript | 4,138 | 154 | import {
stack,
stackOffsetExpand,
stackOrderAscending,
ascending,
descending,
} from 'd3';
import naturalSort from 'natural-sort';
import firstBy from 'thenby';
function _stableAscending(a, b, key) {
const aVal = a[key];
const bVal = b[key];
if (aVal === bVal) {
return ascending(a.position, b.pos... |
df4bc3795e8ab9070dd7ec3d238f981f1acc3b2241ff1f822e26e8706cd13503 | JavaScript | 4,141 | 140 | const express = require('express');
const router = express.Router();
const { getDB } = require('../config/database');
const { convertStringToId, serializeDocument, serializeDocuments } = require('../utils/serialization');
const DEFAULT_PAGE_SIZE = parseInt(process.env.DEFAULT_PAGE_SIZE) || 50;
const MAX_PAGE_SIZE = pa... |
1649ff4efa6e7d0fcaa4212bb21644067cc0659db4aab3dc6d22874f4b1f430b | JavaScript | 4,161 | 137 | import { matchers } from "jest-json-schema";
import { convertSearchResults } from "../../main/nodejs/migration_utils";
import * as clientDbUtils from "../../main/nodejs/clientDbUtils";
import lm2emBrainInputJSON from "../resources/old_brain_search_lm2em.json";
import lm2emBrainOutputJSON from "../resources/converted_... |
147fe8cf56f148ed54d4dfa74c16eec1e7bcee1c1a7d465a5a4cbb109d92bf6e | JavaScript | 4,170 | 1 | !function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer su... |
a72a05a25fe1ba21c35f30a3965ce9131b157a94bd3c489e0682b592563bfd0d | JavaScript | 4,209 | 127 | const { auto } = require("@popperjs/core");
const path = require("path");
const fs = require("fs");
const {version} = require('../../package.json');
const commitRefSplit = process.env.APP_COMMIT_REF && process.env.APP_COMMIT_REF.split("/");
let COMMIT_REF = '';
if (commitRefSplit){
COMMIT_REF = "Commit Reference - B... |
63beea446d91dae547a69dfd472f4a14af7e20465bca86037d86fdf3e31ebe4c | JavaScript | 4,302 | 1 | !function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer su... |
55d52e1b0181778d5af1c77efb05e0cf0a492eb0b874153fdba5cffcd2d3ac3f | JavaScript | 4,399 | 1 | !function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer su... |
33664e22c0f93b579e9b2e920f019c3c76b2de6c3321223b2b3353390ff9e9ea | JavaScript | 4,534 | 120 | jest.mock('node-fetch', () => jest.fn());
jest.mock('../../main/nodejs/awsappsyncutils');
jest.mock('../../main/nodejs/utils');
import fs from 'fs';
import * as utils from '../../main/nodejs/utils';
import * as awsappsyncutils from '../../main/nodejs/awsappsyncutils';
import { searchCreateDefaultChannel } from '../..... |
e5764aa8f1f74a3b1e78161601ffafd576f4febf726e0778b85301725fc4f265 | JavaScript | 4,569 | 142 | import { v1 as uuidv1 } from "uuid";
import { copyS3Content, getAllKeys } from "./utils";
import {
createSearchMetadata,
updateSearchMetadata,
getSearchMetadata,
ALIGNMENT_JOB_COMPLETED
} from "./awsappsyncutils";
const searchBucket = process.env.SEARCH_BUCKET;
async function getSearchRecord(searchId) {
con... |
f217075e26294e53e9807ba73029020e703db5dcfec4089195b5bb13921f7e31 | JavaScript | 4,656 | 144 | /* Highlighting utilities for Sphinx HTML documentation. */
"use strict";
const SPHINX_HIGHLIGHT_ENABLED = true
/**
* highlight a given string on a node by wrapping it in
* span elements with the given class name.
*/
const _highlight = (node, addItems, text, className) => {
if (node.nodeType === Node.TEXT_NODE) ... |
2d9591361f92dc1bdcc499fc33321adbeb6e9ecf99252d6559dda12670a34c20 | JavaScript | 4,664 | 126 | import { Jimp } from 'jimp';
import {
copyS3Content,
putS3Content,
getS3ContentAsByteBufferWithRetry,
} from "./utils";
import { getSearchKey, getSearchMaskId } from "./searchutils";
import {
updateSearchMetadata,
getSearchMetadata,
ALIGNMENT_JOB_COMPLETED
} from "./awsappsyncutils";
const s3Retries = proc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.