text stringlengths 1 1.05M |
|---|
import React, { useState } from 'react';
import {
View,
Text,
Button,
FlatList,
} from 'react-native';
const App = () => {
const [diningList, setDiningList] = useState([]);
const addToList = () => {
setDiningList(diningList.concat({
key: Math.random().toString(),
name: 'Name of food',
isConsumed: false
}))... |
<filename>src/main/java/Grafic/MainWindow.java
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Grafic;
import java.awt.event.ActionEvent;
import java.awt.event.ComponentEvent... |
<reponame>Pleksus2022/pleksus-api
import { Module } from '@nestjs/common';
import { MongooseModule } from '@nestjs/mongoose';
import { USER } from 'src/common/models/models';
import { UserSchema } from './schema/user.schema';
import { UsersService } from './users.service';
import { UsersController } from './users.contr... |
function getFileExtension(filePath: string): string {
const lastDotIndex = filePath.lastIndexOf('.');
if (lastDotIndex <= 0 || lastDotIndex === filePath.length - 1) {
return ''; // No valid file extension found
}
return filePath.slice(lastDotIndex + 1);
}
// Test cases
console.log(getFileExtension("/path/t... |
#!/bin/bash
./triggerfs-cli
|
<gh_stars>100-1000
// https://uva.onlinejudge.org/external/6/657.pdf
#include<bits/stdc++.h>
using namespace std;
using vs=vector<string>;
using vi=vector<int>;
using vvi=vector<vi>;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
for(int t=1;;t++){
int n,m;
cin>>m>>n;
if(!n)break;
vs a(n);
f... |
#!/bin/sh
forever stop linode-manager
|
import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import {Like, Repository} from 'typeorm';
import {DesignerCollection} from "./designer-collection.entity";
import {IconTwin} from "../icon-twins/icon-twin.entity";
@Injectable()
export class DesignerCollectionService {
... |
<gh_stars>1-10
/* test4033.exec.cpp */
//----------------------------------------------------------------------------------------
//
// Project: CCore 3.50
//
// Tag: HCore
//
// License: Boost Software License - Version 1.0 - August 17th, 2003
//
// see http://www.boost.org/LICENSE_1_0.txt or the local c... |
# Function to flatten a nested dictionary
def flatten_dictionary(dictionary, flattened = None):
# Initialize an empty dictionary
if flattened == None:
flattened = {}
for key, value in dictionary.items():
# If the value is not a dictionary, add it
# to the result
if not... |
def replace_vowels(sentence):
"""
This function replaces all the vowels in a sentence with an underscore(_).
"""
vowels = ['a', 'e', 'i', 'o', 'u']
string = ""
for char in sentence:
if char.lower() in vowels:
char = "_"
string += char
return string
# Test code... |
/*
Jameleon - An automation testing tool..
Copyright (C) 2003-2007 <NAME> (<EMAIL>)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the Licens... |
#pragma once
#include <utility>
#define CONCAT(left, right) left##right
#if defined(__COUNTER__)
#define MAKE_UNIQUE_NAME CONCAT(__defer__, __COUNTER__)
#elif defined(__LINE__)
#define MAKE_UNIQUE_NAME CONCAT(__defer__, __LINE__)
#else
#error The __COUNTER__ and __LINE__ directives are not defined.
#endif
#define D... |
/*
* Copyright (c) 2008-2019, Hazelcast, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required ... |
<filename>src/trace/listener.ts
import { Context } from "aws-lambda";
import {
addLambdaFunctionTagsToXray,
TraceContext,
readStepFunctionContextFromEvent,
StepFunctionContext,
} from "./context";
import { patchHttp, unpatchHttp } from "./patch-http";
import { TraceContextService } from "./trace-context-servic... |
<gh_stars>10-100
package com.semmle.ts.ast;
import com.semmle.js.ast.SourceLocation;
import com.semmle.js.ast.Visitor;
import java.util.List;
/** A union type such as <tt>number | string | boolean</tt>. */
public class UnionTypeExpr extends TypeExpression {
private final List<ITypeExpression> elementTypes;
publi... |
<filename>shared-types/transaction-category-mapping.d.ts
interface ITransactionCategoryMapping {
_id?: any;
owner?: string;
amount: number;
description?: string;
transaction_id?: string;
category_id: string;
}
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.bookOpen = void 0;
var bookOpen = {
"viewBox": "0 0 24 24",
"children": [{
"name": "path",
"attribs": {
"d": "M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"
},
"children": []
}, {
"name": "path",
"attr... |
<filename>main.go
package main
import (
"flag"
"log"
"time"
"github.com/andrewloable/obs-html-recorder/config"
"github.com/andrewloable/obs-html-recorder/obs"
"github.com/andrewloable/obs-html-recorder/profile"
)
func main() {
widthFlag := flag.Int("w", 1920, "width of the browser")
heightFlag := flag.Int("... |
<filename>spec/cloaked_spec.rb
# frozen_string_literal: true
RSpec.describe Cloaked do
it 'has a version number' do
expect(Cloaked::VERSION).not_to be nil
end
describe 'with default values' do
subject { PostWithDefaultOptions.new }
before do
@stubbed_base64 = SecureRandom.urlsafe_base64(Cloak... |
#!/usr/bin/env bash
# XXX: this script is intended to be run from
# a fresh Digital Ocean droplet with Ubuntu
# upon its completion, you must either reset
# your terminal or run `source ~/.profile`
# change this to a specific release or branch
BRANCH=master
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-ge... |
<reponame>vivekthangathurai/github-coverage-reporter-plugin<filename>src/main/java/io/jenkins/plugins/gcr/models/CoverageType.java
package io.jenkins.plugins.gcr.models;
import java.util.Arrays;
import java.util.stream.Stream;
public enum CoverageType {
JACOCO("jacoco"),
COBERTURA("cobertura"),
SONARQUBE... |
<filename>Chapter10-AdvancedAWSCloudFormation/10-02-CR-Lambda-Function.js
/**
* This is a custom resource handler that creates an S3 bucket
* and then populates it with test data.
*/
var aws = require("aws-sdk");
var s3 = new aws.S3();
const SUCCESS = 'SUCCESS';
const FAILED = 'FAILED';
const KEY = 'test_data.csv... |
import * as vscode from "vscode";
import env from "@esbuild-env";
import { createWebviewManager, IWebviewManager } from "./webview-handler";
import { createEventHubAdapter } from "./events/event-manager";
import { Commands } from "./commands";
import { loadSnowpackConfig } from "./debug/snowpack-dev";
import { createCo... |
def extract_license_info(file_path: str) -> str:
with open(file_path, 'r') as file:
lines = file.readlines()
license_info = ''
for line in lines:
if line.strip().startswith('#'):
license_info += line.replace('#', '').strip() + ' '
else:
... |
#pragma once
#include <string>
//returns true if opening bracket
bool isOpeningBracket(const char &symbol);
//returns true if closing bracket
bool isClosingBracket(const char &symbol);
//returns true if family bracket
bool isFamilyBracket(const char &symbol1, const char &symbol2);
//the function returns true if t... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package test;
import java.net.URL;
import org.fhwa.c2cri.testmodel.NRTM;
import org.fhwa.c2cri.testmodel.Need;
import org.fhwa.c2cri.testmodel.OtherRequirement;
import org.fhwa.c2cri.testmodel.Requirement;
/**
* The ... |
#!/bin/bash
# Copyright 2015 and onwards Sanford Ryza, Juliet Hougland, Uri Laserson, Sean Owen and Joshua Wills
#
# See LICENSE file for further information.
curl -o $2/$1.csv https://ichart.yahoo.com/table.csv?s=$1&a=0&b=1&c=2000&d=0&e=31&f=2013&g=d&ignore=.csv
|
def bubble_sort(lst):
# Traverse through all list elements
for i in range(len(lst)):
# Last i elements are already in place
for j in range(0, len(lst)-i-1):
# traverse the list from 0 to n-i-1
# Swap if the element found is greater
# than the ne... |
import { Vec2 } from "../vectors/Vec2";
import { addVectors } from "./addVectors";
describe("addVectors", () => {
it("adds two vectors of the same type.", () => {
const inputVector = new Vec2(1, 2);
const outputVector = addVectors(inputVector, inputVector);
// @ts-ignore
expect(outputVector.x).toEqu... |
export * from "./Downloads";
|
<reponame>Morlack/unleash
'use strict';
const joi = require('joi');
const Controller = require('../controller');
const { clientMetricsSchema } = require('./metrics-schema');
class ClientMetricsController extends Controller {
constructor({ clientMetricsStore, clientInstanceStore }, getLogger) {
super();
... |
#!/bin/bash
# Additional configuration and packages that our Vagrantbox requires
# We will need php7.0, so install it
sudo apt-get -y update
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get -y install php7.0
sudo apt-get -y update
# This includes the base php7.0 packages, plus a couple mbstring and dom that
# so... |
/*
* C compiler file mcdpriv.h, version 1
* (Private interfaces within machine-dependent back end).
* Copyright (C) Acorn Computers Ltd., 1988, Codemist Ltd 1994
* SPDX-Licence-Identifier: Apache-2.0
*/
/*
* RCS $Revision$
* Checkin $Date$
* Revising $Author$
*/
#ifndef __mcdpriv_h
#define __mcdpriv_h 1
#i... |
#!/bin/sh
## Simplistic ReaPack index.xml generator
## v0.1.1 (2018-08-07)
##
## Copyright (C) 2016-2018 Przemyslaw Pawelczyk <przemoc@gmail.com>
##
## This script is licensed under the terms of the MIT license.
## https://opensource.org/licenses/MIT
cd "${0%/*}"
if [ -r .reapack-index.conf ]; then
while read -r ... |
# bounding box
bbox=[-18.0, 18.0, -1.0, 20.0, -18.0, 18.0]
#starting to define obstacles
obstacle={
size=1
geo = broken_t.obj
color = (0.9, 0.7, 0.3)
position = (4, 0)
angle = 0
}
#define flocks
shepherd={
type = simple
size = 1
geo = ../../shepherd/behaviors.py/env/robot2.g
color = (0.1,0.4,0.1)
mass = 0.2
view... |
<filename>src/shared/scheduler/TaskSchedulerData.h
/* Copyright (c) 2019 Skyward Experimental Rocketry
* Authors: <NAME>, <NAME>, <NAME>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software... |
#!/bin/sh
set -e
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
install_framework()
{
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
local source="${BUILT_PRO... |
#pragma once
#include "ShaderEnum.h"
#include "ShaderClass.h"
#include "impl/SimpleShader.h"
#include "impl/LightShader.h"
class ShaderManager
{
private:
DetailedArray<Enum::ShaderType> mShaderTypes;
std::unique_ptr<SimpleShader> mSimpleShader;
std::unique_ptr<LightShader> mLightShader;
public:
Shade... |
package os.failsafe.executor.schedule;
import java.time.LocalDateTime;
import java.util.Optional;
public interface Schedule {
/**
* With a {@link Schedule} you can either plan a one time execution in future or a recurring execution.
*
* <p>For a <b>one-time</b> execution just let this method retur... |
<gh_stars>1-10
const BaseComponent = require('../BaseComponent');
module.exports = class ImageComponent extends BaseComponent {
build(parent) {
return {
/**
* Returns a random image URL
*
* @param {mixed} inOpts {width = 640, height = 480, category}
*/
image: (inOpts = {})... |
CREATE TABLE people (
id INTEGER PRIMARY KEY,
name VARCHAR(255),
age INTEGER
); |
function kotsadm() {
local src="$DIR/addons/kotsadm/1.37.0"
local dst="$DIR/kustomize/kotsadm"
try_1m_stderr object_store_create_bucket kotsadm
kotsadm_rename_postgres_pvc_1-12-2 "$src"
cp "$src/kustomization.yaml" "$dst/"
cp "$src/operator.yaml" "$dst/"
cp "$src/postgres.yaml" "$dst/"
... |
<filename>src/main/scala/net/koseburak/api/AppointmentChecker.scala
package net.koseburak.api
import cats.effect.Sync
import cats.implicits._
import io.chrisdavenport.log4cats.Logger
import net.koseburak.model.AppointmentHttpResponse
import net.koseburak.model.AppointmentHttpResponse.ErrorResponse
import org.http4s.Ur... |
#!/usr/bin/env bash
echo "Starting run.sh"
cat /var/www/html/config/crontab.default > /var/www/html/config/crontab
if [[ ${CRONJOB_ITERATION} && ${CRONJOB_ITERATION-x} ]]; then
sed -i -e "s/0/1-59\/${CRONJOB_ITERATION}/g" /var/www/html/config/crontab
fi
crontab /var/www/html/config/crontab
echo "Starting Cronjob... |
<reponame>nrc34/angular2<gh_stars>0
import {Injectable} from 'angular2/core';
import {IAnimal} from './IAnimal';
@Injectable()
export class FirebaseService {
fbUrl: string = 'https://crackling-heat-1694.firebaseio.com/animals/';
fbRef: any;
animals:IAnimal[];
snapshot:any;
public isFirstTimeLoad:... |
<gh_stars>1-10
package zsync
import (
"fmt"
"io"
"testing"
"time"
)
var _ io.ReadWriter = &Buffer{}
func TestBuffer(t *testing.T) {
t.Skip()
buf := NewBuffer(nil)
go buf.Write([]byte("one "))
go fmt.Println(buf.String())
go buf.Write([]byte("two "))
go fmt.Println(buf.String())
go buf.Write([]byte("three... |
function printProperties(object) {
for (const property in object) {
if (Object.prototype.hasOwnProperty.call(object, property)) {
console.log(property, object[property]);
}
}
} |
export * from './Status.js'
export * from './TestFile.js'
export * from './TestSuite.js'
export * from './Test.js'
export * from './Run.js'
export * from './RunTestFile.js'
export * from './Settings.js'
|
import java.util.ArrayList;
public class JobInterviewSimulator {
// list of questions
private ArrayList<String> questions;
// constructor
public JobInterviewSimulator(ArrayList<String> questions) {
this.questions = questions;
}
// method for submitting questions
public void submitQuestions() {
// code fo... |
from dataclasses import asdict
from elasticsearch import Elasticsearch
import os
class Author:
def __init__(self, id: str, first_name: str, last_name: str):
self.id = id
self.first_name = first_name
self.last_name = last_name
class AuthorManager:
def add_author(self, author: Author) ->... |
import numpy as np
import pandas as pd
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.naive_bayes import MultinomialNB
from sklearn.model_selection import train_test_split
# Create a list of labels
labels = ["Billing", "Feedback", "Shipping"]
# Read in the data from the customer emails
data... |
let computerGuess;
let userGuesses = [];
let attempts = 0;
let maxGuesses;
let low = 1;
let high = 100;
function updateRange() {
const rangeOutput = document.getElementById("rangeOutput");
rangeOutput.innerText = `${low} - ${high}`;
rangeOutput.style.marginLeft = low + "%";
rangeOutput.style.marginRight = 100 ... |
#!/bin/bash
build='builder/builder'
src_dir='data/animations/'
dst_dir='data/animations/'
actor_dir='data/built/'
ybot_dir='data/animations/ybot_retargeted/fbx/'
sampling_frequency='--sampling_frequency 15'
#$build 'data/models_actors/armadillo.fbx' 'data/built/armadillo' '--actor' '--root_bone' 'mixamorig:Hips' #'--... |
<gh_stars>1-10
import { Component, OnInit } from '@angular/core';
import {Router} from "@angular/router";
import { AuthService } from 'src/app/services/solid.auth.service';
import { RdfService } from 'src/app/services/rdf.service';
@Component({
selector: 'app-navbar',
templateUrl: './navbar.component.html',
styl... |
def generate_report(data):
# create an empty output dictionary
output = {}
# Iterate over the data
for employee in data:
# get the employee name
name = employee['name']
# get the employee salary
salary = employee['salary']
# add the salary info to the output di... |
def smallestNumber(nums):
smallest = nums[0]
for i in range(1, len(nums)):
if nums[i] < smallest:
smallest = nums[i]
return smallest
nums = [4, 5, 6, 7, 8]
smallestNum = smallestNumber(nums)
print('The smallest number is', smallestNum) |
#include <opencv2/opencv.hpp>
using namespace cv;
int FromBinary(bool b1, bool b2, bool b3, bool b4, bool b5) {
int result = (b1 ? 16 : 0) + (b2 ? 8 : 0) + (b3 ? 4 : 0) + (b4 ? 2 : 0) + (b5 ? 1 : 0);
return result;
}
bool ReadBox(Mat image, int size, Point p1, Point p2) {
// Implementation to read a box f... |
export function getQueryString(field, url) {
var href = url ? url : window.location.href;
var reg = new RegExp( '[?&]' + field + '=([^&#]*)', 'i' );
var string = reg.exec(href);
return string ? string[1] : null;
}
export function postData(url, data, callback, self) {
const request = new XMLHttpRequest();
reques... |
#!/bin/bash
#Get Wordpress installer
sudo setenforce 0
sudo sed -i 's/permissive/disabled/' /etc/sysconfig/selinux
wget http://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz
sudo rsync -avP ~/wordpress/ /var/www/html/
sudo mkdir -p /var/www/html/wp-content/uploads
sudo chown -R apache:apache /var/www/html/*
#Conf... |
# The Book of Ruby - http://www.sapphiresteel.com
class X
def x
print( "x:" )
def y
print("y:")
end
def z
print( "z:" )
y
end
end
end
ob = X.new
ob.x
puts
ob.y
puts
ob.z
|
appledoc SERemoteWebDriver.h --project-name selenium --project-company "Appium" --company-id com.appium --output ~/Desktop/help .
|
import {IFFFieldModel, IFFFieldModelProps } from ".";
export interface IFFTextAreaFieldModelProps extends IFFFieldModelProps {}
export interface IFFTextAreaFieldModel extends IFFFieldModel {
props: IFFTextAreaFieldModelProps;
}
|
<reponame>cotarr/collab-backend-api<gh_stars>0
// -----------------------------------------------------------------------------
//
// ExpressJs Web Server
//
// Public Routes:
// /status
// /.well-known/security.txt (only if configured)
//
// Secure Routes:
// /secure
// /v1/* (Mock REST API)
// ... |
#!/bin/bash
REPOS_DIR=/etc/yum.repos.d
DISTRO_NAME=centos8
LSB_RELEASE=redhat-lsb-core
EXCLUDE_UPGRADE=fuse,mercury,daos,daos-\*
bootstrap_dnf() {
:
}
group_repo_post() {
# Nothing to do for EL
:
}
distro_custom() {
# install the debuginfo repo in case we get segfaults
cat <<"EOF" > $REPOS_DIR/C... |
#!/bin/bash
# submit all sims
./submit_sim.sh "aipw" 1000 5 "sim-aipw"
./submit_sim.sh "ipw" 1000 5 "sim-ipw"
|
<reponame>Nikscorp/datadog-mock
// Copyright (c) 2017-2018, <NAME> <<EMAIL>>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unl... |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Services;
import Controllers.ControllerAnimal;
import Objects.*;
import java.util.ArrayList;
import javax.swing.Icon;
import j... |
<gh_stars>0
// pool-model.js - A mongoose model
//
// See http://mongoosejs.com/docs/models.html
// for more of what you can do here.
import addressSchema from './schemas/addressSchema';
const PoolStatus = {
PENDING_DEPLOYMENT: 'pending_deployment',
ACTIVE: 'active',
PENDING_CLOSE_POOL: 'pending_close_pool',
... |
export PYTHONPATH="$(pwd)"
export CUDA_VISIBLE_DEVICES="1"
OUTDIR=checkpoints/slkces/multi_m2m_dds/
python generate.py data-bin/ted_slkces/ \
--task multilingual_translation \
--gen-subset test \
--path "$OUTDIR"/checkpoint_best.pt \
--batch-size 16 \
--lenpen 1.5 \
... |
def smallest_divisible(n):
res = 1
for i in range(2, n + 1):
if res % i != 0:
for j in range(i, n+1, i):
if j % i == 0:
res *= j
break
return res |
echo "This file will reorganize your bed file, such that lines correspond to a chromosome are grouped together. And the starting coordinate in lines are ordered ascendingly."
echo "reorganize_bed_file.sh <input bed file> <output bed file>"
echo "input and output files should be in gzip format. You should always do that... |
if args.distributed_wrapper == "DataParallel":
initialize_data_parallel_training(
world_size=args.distributed_world_size,
buffer_size=2**28,
process_group=process_group,
)
elif args.distributed_wrapper == "SlowMo":
if _GOSSIP_DISABLED:
raise ImportError("Gossip-based communic... |
#!/bin/bash
# https://gist.github.com/verdimrc/a10dd3ea00a34b0ffb3e8ee8d5cde8b5#file-bash-sh-L20-L34
#
# Utility function to get script's directory (deal with Mac OSX quirkiness).
# This function is ambidextrous as it works on both Linux and OSX.
get_bin_dir() {
local READLINK=readlink
if [[ $(uname) == 'Darwi... |
package cronUC
func New(uc *UCInteractor) *UCInteractor {
return uc
}
|
#!/usr/bin/env bash
#
# Move config file for DI, and api-key
rsync -av vendor/Lundmark/forecaster/config ./
# Move main source files
rsync -av vendor/Lundmark/forecaster/src ./
# Move unittest-related files
rsync -av vendor/Lundmark/forecaster/test ./
|
import React, { Component } from 'react';
import { Circle } from 'react-google-maps';
class MapViewCircle extends Component {
render() {
return (
<Circle
draggable={this.props.draggable}
center={{ lat: this.props.center.latitude, lng: this.props.center.longitude }}
radius={this.prop... |
//
// AppDelegate.h
// CoreDataSample
//
// Created by king on 2021/4/21.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (nonatomic, strong) UIWindow *window;
@end
|
<reponame>lananh265/social-network
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.record = void 0;
var record = {
"viewBox": "0 0 8 8",
"children": [{
"name": "path",
"attribs": {
"d": "M3 0c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z",
"transfor... |
/********GET QUESTIONS WITH ANSWERS FOR A PARTICULAR PRODUCT ID********/
//http://192.168.3.11/qa/questions/?product_id=1&count=5
{
"product_id": "1",
"results": [
{
"question_id": 3,
"question_body": "Does this product run big or small?",
"question_date": "2019-01-1... |
read a;b=(, ABC chokudai);echo ${b[$a]} |
<reponame>zcong1993/mongoose-cache
import { Redis } from 'ioredis'
import { Model, Document } from 'mongoose'
export interface Context {
redis: Redis
enable?: boolean
externalKeys?: string[]
extQuery?: any
}
export interface ContextWithModel<T extends Document, QueryHelpers = {}>
extends Context {
model: ... |
#!/usr/bin/env bash
# Set bash to 'debug' mode, it will exit on :
# -e 'error', -u 'undefined variable', -o ... 'error in pipeline', -x 'print commands',
set -e
set -u
set -o pipefail
log() {
local fname=${BASH_SOURCE[1]##*/}
echo -e "$(date '+%Y-%m-%dT%H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*... |
for (let i = 100; i <= 300; i++) {
console.log(i);
} |
#! /bin/sh
./Pods/LicensePlist/license-plist --output-path RaccoonWallet/Resources/Settings.bundle
|
<reponame>jorgerodcan/cordovaDevelopment
/* Version 0.1 of F5 Steganography Software by <NAME> 1999 */
/*********************************************************/
/* JPEG Decoder */
/* <NAME> */
/* EE590 Directed Research */
/* Dr. Ortega */
/* Fall 1997 */
/* ... |
#!/bin/bash
java ${JAVA_OPTS} ${SKYWALKING_COLLECTOR_OPTS} -classpath ${SKYWALKING_CLASSPATH} org.skywalking.apm.ui.ApplicationStartUp
|
<reponame>akashgp09/opencollective-api
import { GraphQLList } from 'graphql';
import models from '../../../models';
import { Forbidden, ValidationFailed } from '../../errors';
import { AccountReferenceInput, fetchAccountWithReference } from '../input/AccountReferenceInput';
import { MemberInvitation } from '../object/... |
#!/bin/bash
# --------------------------------------------------------------------------
# OpenMS -- Open-Source Mass Spectrometry
# --------------------------------------------------------------------------
# Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
# ETH Zurich, and Freie U... |
import fs from "fs";
import { IDevSettings } from "./IDevSettings";
export class FileSettings implements IDevSettings {
private readonly localSettings: {
patient_tests_database: string;
mongo_connection_string: string;
allow_self_signed_mongo_cert: string;
audit_api_url: string;
enable_audit_inte... |
<reponame>ksilo/LiuAlgoTrader<filename>liualgotrader/trading/gemini.py
import asyncio
import base64
import hashlib
import hmac
import json
import os
import queue
import ssl
import time
import traceback
from datetime import date, datetime, timedelta
from threading import Thread
from typing import Dict, List, Optional, T... |
import Console from '@/utils/Console'
// import I18n from "@/mixins/I18n";
export default {
created () {
// dark mode
const dark = this.$store.getters['settings/dark']
if (typeof dark === 'boolean') {
this.$store.commit('settings/switchDark', this.dark ? 'dark' : 'light')
} else if (dark === nu... |
SELECT MONTH(order_date), AVG(COUNT(order_id))
FROM orders
GROUP BY MONTH(order_date); |
package com.metaring.springbootappexample.service;
import java.util.concurrent.CompletableFuture;
import com.metaring.framework.broadcast.BroadcastFunctionalitiesManager;
import com.metaring.framework.broadcast.Event;
import com.metaring.framework.broadcast.SingleCallback;
public class MessageFunctionalityImpl exten... |
<reponame>mohamedkhairy/dhis2-android-sdk
/*
* Copyright (c) 2004-2021, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain t... |
package dbis.piglet.backends.flink
import dbis.piglet.backends.BackendConf
import com.typesafe.config.ConfigFactory
import dbis.piglet.backends.PigletBackend
/**
* @author hage
*/
class FlinkConf extends BackendConf {
// loads the default configuration file in resources/application.conf
private val appconf =... |
<gh_stars>100-1000
const config = require('@bedrockio/config');
const mongoose = require('mongoose');
const { logger } = require('@bedrockio/instrumentation');
mongoose.Promise = Promise;
const flags = {
// The underlying MongoDB driver has deprecated their current connection string parser.
useNewUrlParser: true,... |
class Vector:
def __init__(self, x, y):
self.x = x
self.y = y
def subtract(self, other):
return Vector(self.x - other.x, self.y - other.y)
def dot_product(self, other):
return self.x * other.x + self.y * other.y
def norm_square(self):
return self.dot_product(se... |
echo 'City, State, Country: ' . $city . ', ' . $state . ', ' . $country; |
<filename>app/request_models/change_effective_date_request.rb
class ChangeEffectiveDateRequest
def self.from_csv_request(csv_request)
{
policy_id: csv_request[:policy_id],
effective_date: csv_request[:effective_date],
current_user: csv_request[:current_user],
transmit: (csv_request[:transm... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.