text
stringlengths
1
1.05M
import React from 'react'; import Header from './Header'; import SubHeader from "./SubHeader"; import Menu from './Menu'; const App = () => ( <div className="app"> <Header></Header> <SubHeader></SubHeader> <Menu></Menu> </div> ) export default App;
#!/bin/bash dbus-monitor "interface='org.freedesktop.Notifications'" | xargs -I '{}' pkill notify-osd
package drivers import ( "fmt" "github.com/Xhofe/alist/conf" "github.com/Xhofe/alist/model" "github.com/Xhofe/alist/utils" "github.com/gin-gonic/gin" log "github.com/sirupsen/logrus" "path/filepath" ) type GoogleDrive struct{} func (driver GoogleDrive) Config() DriverConfig { return DriverConfig{ Name: "Go...
export ZTTY_FEATURES="MakeWithUUID:${ZTTY_FEATURES}" # Require: https://github.com/syumai/uuidgenseeded function mkuuidfile() { if [[ $# -eq 0 ]] || [[ "$1" == "-h" ]] || [[ "$1" == "--help" ]] then echo "usage: $0 [files...]" return 1 fi for p in $@ do d="$(dirname "$p")" b="$(basename "$p"...
<gh_stars>0 package io.miti.shortstop.model; public enum HttpOperation { POST, PUT, GET, DELETE, OPTIONS, TRACE, HEAD, PATCH, UNKNOWN }
import { Label } from './Label'; import { Resolution } from '../utils/Resolution'; import { TimeRange } from '../utils/TimeValueRange'; import { useSelector } from '../states/store'; import React from 'react'; const Labels = ( { range, size }: { range: TimeRange; size: Resolution; } ): JSX.Element => { const { l...
<filename>app/controllers/admin/jobs_controller.rb class Admin::JobsController < Admin::ApplicationController before_action :set_job, only: [:show, :edit, :update, :destroy] # GET /admin/jobs # GET /admin/jobs.json def index @jobs = JobVacancy.paginate(:page => params[:page], :per_page => 50) end # GE...
<reponame>Julien75013/php-src /* +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following ...
import sample from '../utils/sample' export default () => { return sample([ 'sword', 'glaive', 'shield', 'spear', 'scythe', 'mace', 'club', 'staff', 'rod', 'orb', 'axe', 'halberd', 'bow', 'crossbow' ]) }
#!/bin/bash set -e; export LC_NUMERIC=C; SDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"; [ "$(pwd)/utils" = "$SDIR" ] || { echo "Run the script from \"$(dirname $SDIR)\"!" >&2 && exit 1; } [ ! -f "$(pwd)/utils/parse_options.inc.sh" ] && \ echo "Missing $(pwd)/utils/parse_options.inc.sh file!" >&2 && exit...
import React, { useState, useEffect } from "react" import TradingViewWidget from "react-tradingview-widget" import Binance from "binance-api-node" import "bootstrap/dist/css/bootstrap.min.css" import "./middleGraphsSection.css" import MenuCard from "./MenuCard" const client = Binance() // Authenticated client, can ...
#!/bin/bash set -e get_abs_filename() { echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")" } export NXF_IGNORE_WARN_DSL2=true export NXF_CMD=${NXF_CMD:-$(get_abs_filename ../launch.sh)} export TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST:=false} # # Tests # ( cd ../tests/checks; bash run.sh ) # disable an...
package proc_server_test import ( "context" "strconv" "testing" "configcenter/src/common/mapstr" params "configcenter/src/common/paraparse" commonutil "configcenter/src/common/util" "configcenter/src/test" "configcenter/src/test/reporter" "configcenter/src/test/util" . "github.com/onsi/ginkgo" . "github.c...
package servlet; import java.io.IOException; import javax.servlet.ServletException; public class SearchCommand extends FrontCommand { @Override public void process() throws ServletException, IOException { forward("/search.jsp"); } }
#!/bin/bash echo "gen_misc.sh version 20150511" echo "change by baojun 20151211" echo "no input to read" echo "" echo "Please follow below steps(1-5) to generate specific bin(s):" echo "STEP 1: choose boot version(0=boot_v1.1, 1=boot_v1.2+, 2=none)" echo "enter(0/1/2, default 1):" #read input if [ -z "$input" ]; the...
#!/bin/bash set -Eeo pipefail cd "$YAK_WORKSPACE"/dart-sdk/sdk while read -r path do cp -rv "$path" /usr/ done < <(find out/ReleaseX64/dart-sdk/ \ -type d \ -mindepth 1 \ -maxdepth 1 \ -not -iname util)
#!/bin/bash AUTO_DEVOPS_CHART=gitlab/auto-deploy-rails AUTO_DEVOPS_CHART_REPOSITORY=https://leifcr.gitlab.io/auto-deploy-rails function download_chart() { if [[ ! -d chart ]]; then auto_chart=${AUTO_DEVOPS_CHART:-gitlab/auto-deploy-app} auto_chart_name=$(basename $auto_chart) auto_chart_name=${auto_chart_...
// 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 by applicable law or agreed to in writing, software // distributed unde...
""" @author: <NAME> @contact: <EMAIL> """ import numpy as np from PIL import Image from torch.utils.data import Dataset from .utils.data import transforms as T from collections import OrderedDict from glob import glob import os.path as osp import json import torch class CommonDataset ( Dataset ): def __init__(sel...
#!/usr/bin/env bash playSound= sound-setup() { if which afplay; then playSound='sound-afplay' elif which paplay; then playSound='sound-paplay' elif which aplay; then playSound='sound-aplay' else playSound='sound-beep' fi } sound-teardown() { true } sound() { local sound=sound/$1.mp3 ...
#!/bin/ksh TMPD=/tmp/$USER # Cleanup if [ $CLEANUP ] ; then echo "Done" else export GETFILES="*.tbl *.geneC* *.gb" export HOST=$HOSTNAME if [ ! -d $TMPD ] ; then mkdir $TMPD fi fi
import {Routes} from '@angular/router'; import {EventsComponent} from '@src/app/pages/events/events.component'; export const routes: Routes = [ { path: '', component: EventsComponent, }, ];
export interface ParsedRequest { text: string; items: string[]; dofusClass: string | null; tags: string[]; }
/* * Copyright 2022 QOS.<NAME> (Switzerland) * * 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 by applicable law ...
const { spawn, execSync } = require('child_process') const { createHmac } = require('crypto') const express = require('express') const { readFileSync } = require('fs') const { parse } = require('json5') let config try { config = parse(readFileSync('./config.json')) } catch (err) { console.log(`Failed to load confi...
#!/usr/bin/env bash # Copyright The KubeDB Authors. # # 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 by applicable law o...
import json import logging import os from models import Whitelist from models import Vulnerability _logger = logging.getLogger(__name__) def read_whitelist(filename): """Attempt to populate and return a ```Whitelist``` from the file pointed to by ```filename```. If ```filename``` is ```None``` then an ...
import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.*; import java.util.*; import java.util.regex.*; public class CooccurrenceMatrix { public static void main(String[] args) { //int r=0; String lineNumber ...
package com.nextbreakpoint; import org.junit.Test; import java.util.Optional; import java.util.concurrent.Callable; import java.util.function.Consumer; import static org.junit.Assert.*; import static org.mockito.Mockito.*; public class AndTest { @Test public void shouldNotCallSecondCallableWhenFailure() throws Ex...
package metrics import "testing" func TestStringPointerDeref(t *testing.T) { value := "test" testCases := []struct { stringPointer *string expected string }{ { stringPointer: nil, expected: "", }, { stringPointer: &value, expected: value, }, } for _, tc := range testCases {...
int mid_element(int arr[], int n) { if (n % 2 == 0) return (arr[n/2] + arr[n/2 - 1])/2; else return arr[n/2]; }
def get_subsets(s): subsets = [[]] for item in s: new_subsets = [] for subset in subsets: new_subsets.append(subset + [item]) subsets += new_subsets return subsets
# Generated by Django 3.1.5 on 2021-02-04 12:15 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('account', '0005_auto_20210203_1123'), ] operations = [ migrations.AddField( model_name='account', name='avatar_url',...
/* jshint node: true */ 'use strict'; module.exports = require( './visualCaptcha.js' );
#!/usr/bin/env bash # Based on: # https://raw.githubusercontent.com/confluentinc/confluent-platform-security-tools/master/kafka-generate-ssl.sh set -e KEYSTORE_FILENAME="kafka.server.keystore.jks" VALIDITY_IN_DAYS=3650 DEFAULT_TRUSTSTORE_FILENAME="kafka.server.truststore.jks" TRUSTSTORE_WORKING_DIRECTORY="./testHelp...
<gh_stars>0 /* - Coeus web framework ------------------------- * * Licensed under the Apache License, Version 2.0. * * Author: <NAME> */ package com.tzavellas.coeus.bind.converter import java.util.{Date, TimeZone, Locale} import java.text.{DateFormat, SimpleDateFormat} import com.tzavellas.coeus.bind.Converter c...
# Importing the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd from sklearn.model_selection import train_test_split from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfVectorizer from sklearn import svm from sklearn.metrics impor...
#!/bin/bash echo '[ INFO ] Cleaning up ...' rm -vf bbs_output_bytes.* rm -vf full_ones.* rm -vf jacobi_output_bytes.* echo '[ INFO ] Done.'
<filename>xhlibrary/src/main/java/com/wxh/sdk/ui/base/BaseActivity.java package com.wxh.sdk.ui.base; import android.content.Context; import android.content.Intent; import android.graphics.drawable.AnimationDrawable; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.App...
# find index of the target element target_index = arr.index(target) # print index puts target_index # Output: 2
#!/bin/bash # # Copyright (c) 2019-2020 P3TERX <https://p3terx.com> # # This is free software, licensed under the MIT License. # See /LICENSE for more information. # # https://github.com/P3TERX/Actions-OpenWrt # File name: diy-part1.sh # Description: OpenWrt DIY script part 1 (Before Update feeds) # # Uncomment a fee...
<filename>src/utils/index.js const fs = require('fs'); const path = require('path'); const shell = require('child-process-promise'); const { v4: uuid } = require('uuid'); /** * Create an unique directory using uuid as directory's name */ async function udir({ prefix }) { const _prefix = prefix || ''; const fol...
<gh_stars>1-10 /* * //****************************************************************** * // * // Copyright 2016 Samsung Electronics All Rights Reserved. * // * //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= * // * // Licensed under the Apache License, Version 2.0 (the "License"); * // you ...
package com.iovation.launchkey.sdk.client; import com.iovation.launchkey.sdk.domain.service.AuthorizationResponse; import com.iovation.launchkey.sdk.domain.webhook.AuthorizationResponseWebhookPackage; import com.iovation.launchkey.sdk.domain.webhook.ServiceUserSessionEndWebhookPackage; import com.iovation.launchkey.sd...
package org.sonatype.nexus.repository.protop.internal.search; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import javax.annotation.Nullable; import java.util.List; /** * Response for an protop V1 search request. * * @since 3.7 */ @JsonIgnoreProperties(ignoreUnknown = true) public class ProtopSea...
#!/usr/bin/env bash set -o pipefail # trace ERR through pipes set -o errtrace # trace ERR through 'time command' and other functions set -o nounset ## set -u : exit the script if you try to use an uninitialised variable set -o errexit ## set -e : exit the script if any statement returns a non-true return value ...
export default t; declare function t({ directory }: { directory: any; }): Promise<void>;
#!/bin/sh export PATH="$PATH:/srv/magma/bin" if [ "$BASE_DIR" = "" ]; then export BASE_DIR=/magma fi LOCK_FILE="$BASE_DIR/install.lock" run() { /sbin/service haveged start if [ ! -f "$LOCK_FILE" ]; then /scripts/install.sh $MYSQL_HOST $MYSQL_USER $MYSQL_PASSWORD $MYSQL_SCHEMA touch $LOCK_FILE els...
#!/bin/bash pushd "$(dirname $0)" >/dev/null if [[ "$(whoami)" != "root" ]]; then echo "must be root" exit 1 fi IMG_NAME="machine" \ USE_QCOW2="1" \ RELEASE="buster" \ TARGET_HOSTNAME="machine" \ FIRST_USER_NAME="user" \ FIRST_USER_PASS="password" \ PUBKEY_SSH_FIRST_USER="$(cat /home/user/.ssh/id_rsa.pub)" \...
<filename>src/decorators/cache_test.ts // deno-lint-ignore-file require-await import { assert, assertEquals, delay } from "../../test_deps.ts"; import { Cache } from "./cache.ts"; Deno.test("cache hit", async () => { const callStacks: number[] = []; class A { @Cache(200) async method(id: number) { c...
#!/bin/sh # ----------------------------------------- # ZSH OPTIONS # ----------------------------------------- setopt auto_cd setopt auto_pushd setopt pushd_ignore_dups setopt pushd_minus # ----------------------------------------- # ALIASES # ----------------------------------------- alias -g ...='../..' alias -g ....
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ic_donut_large_twotone = void 0; var ic_donut_large_twotone = { "viewBox": "0 0 24 24", "children": [{ "name": "path", "attribs": { "d": "M0 0h24v24H0V0z", "fill": "none" }, "children": [] }, { ...
<reponame>joonhocho/sanivali import type { ISanivaliDef } from '_src/types'; export type ValidParam = boolean | undefined; export type ValidRuleItem = 'valid' | ['valid', ValidParam?]; export const validDef: ISanivaliDef = { validator: (param?: ValidParam) => param === false ? () => false : () => true, runOn...
using System; using System.Collections.Generic; public class Booking { public string CustomerName { get; set; } public string Destination { get; set; } public DateTime DateOfTravel { get; set; } } public class TravelAgency { private List<Booking> bookings = new List<Booking>(); public void AddBoo...
#!/usr/bin/env bash nohup ./startup.sh $1 >/dev/null 2>&1 &
#!/bin/sh docker build . -t cadastraldatadisposal echo echo echo "To run the docker container execute:" echo " $ docker run -p 8080:8080 cadastraldatadisposal"
<reponame>benoom/NewsAppP6P7<gh_stars>0 package com.example.android.newsappp6p7; import android.content.Context; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.TextView; import java.text.Pa...
'use strict'; /** * Module dependencies. */ var mongoose = require('mongoose'), Schema = mongoose.Schema; /** * Value Schema */ var ValueSchema = new Schema({ name: { type: String, default: '', required: 'Please fill Value name', trim: true }, abbreviation: { type: String, default:...
<reponame>mdblp/viz /* * == BSD2 LICENSE == * Copyright (c) 2017, Tidepool Project * * This program is free software; you can redistribute it and/or modify it under * the terms of the associated License, which is identical to the BSD 2-Clause * License as published by the Open Source Initiative at opensource.org....
class NotPayOrderTableViewCell: UITableViewCell { // ... (other properties and methods) var order: Order! { didSet { upDataUi() } } func upDataUi() { // Assuming there are outlets for labels in the cell for displaying order information orderIdLa...
<gh_stars>100-1000 import React from 'react'; import { TabNavigator as ReactTabNavigator, createNavigationContainer, createNavigator } from 'react-navigation'; import TabView from 'react-navigation/src/views/TabView/TabView'; import NavigatorTypes from 'react-navigation/src/navigators/NavigatorTypes'; import TabRouter ...
<filename>src/main/java/org/vertx/java/core/DeferredAction.java /* * Copyright 2011 the original author or authors. * * 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....
# frozen_string_literal: true require "spec_helper" describe "version check spec" do include_context "rpc_command" let(:headers) do { "Cookie" => "username=john;" } end let(:middleware) do AnyCable::MiddlewareChain.new.tap do |chain| chain.use(AnyCable::Middlewares::CheckVersion.new("...
const db = require('../../data/db-config'); const findAll = async () => { return await db('readingStatuses'); }; const findBy = async (filter) => { return await db('readingStatuses').where(filter); }; const findById = async (id) => { return db('readingStatuses').where({ id }).first(); }; const create = async ...
#include <mutex> #include <vector> class LegoI2C { private: std::vector<uint8_t> m_rx_buff; std::mutex m_rx_mutex; public: void write(uint8_t data) { std::lock_guard<std::mutex> guard(m_rx_mutex); m_rx_buff.push_back(data); } uint8_t read() { std::lock_guard<std::mutex> gu...
def get_stock_prices(stock_list): prices = {} for stock in stock_list: url = "https://www.marketwatch.com/investing/stock/"+stock html = requests.get(url) soup = BeautifulSoup(html.content, 'html.parser') price_data = soup.find("div", {"class": "intraday__price"}) price =...
var params = { TableName: "myTable", KeySchema: [ { AttributeName: "Name", KeyType: "HASH" } ], AttributeDefinitions: [ { AttributeName: "Name", AttributeType: "S" }, { AttributeName: "Description", AttributeType: "S" }, { AttributeName: "Status", AttributeType: "BOOL" }...
#!/bin/bash curl -XPOST \ -H"content-type: application/json" \ -H"Expect: " \ -H"User-Agent: GitHub-Hookshot/b6210f6" \ -H"X-GitHub-Delivery: 5529067a-14f1-11ea-8f35-75cb7053287b" \ -H "X-GitHub-Event: push" \ -H "X-Hub-Signature: sha1=f6b0ccbd7dbe39d2a807668670e60bd07dbd6b6a" \ -d @push-ev...
<filename>api/src/main/java/org/ednovo/gooru/domain/cassandra/service/ContentProviderService.java package org.ednovo.gooru.domain.cassandra.service; import org.ednovo.gooru.cassandra.core.service.EntityCassandraService; import org.ednovo.gooru.core.cassandra.model.ContentProviderCio; public interface ContentProviderS...
<gh_stars>10-100 package com.pearson.docussandra.persistence; import com.datastax.driver.core.Session; import com.pearson.docussandra.domain.ParsedQuery; import com.pearson.docussandra.domain.objects.QueryResponseWrapper; import com.pearson.docussandra.exception.IndexParseException; /** * Repository for querying fo...
#!/usr/bin/env bash # shellcheck disable=SC1090 source "$(dirname "${BASH_SOURCE[0]}")/os.bash" function create_cloud_init_config_from_template() { local SSH_KEY="id_rsa_${VM_NAME}" local CLOUD_INIT_FILE="$CONFIG_BASE_PATH/${VM_NAME}-cloud-init.yaml" cp "$CLOUD_INIT_TEMPLATE" "$CLOUD_INIT_FILE" #@ToD...
import {Merchant} from '../common/Merchant'; export interface MerchantsList { merchants:Merchant[]; error:any; loading:boolean; } export interface MerchantData { merchant:Merchant|null; error:any; loading:boolean; } export interface StoreState { merchantsList:MerchantsList; newMerchant:...
#include <iostream> int search(int array[], int n, int x) { int i; for (i = 0; i < n; i++) if (array[i] == x) return i; return -1; } int main(void) { int array[] = { 2, 5, 8, 9, 10 }; int x = 5; int n = sizeof(array) / sizeof(array[0]); int result = se...
<gh_stars>0 import styled from 'styled-components'; export const Container = styled.div` background: #273FAD; padding-top: 2rem; `; export const Content = styled.div` max-width: 1120px; margin: 0 auto; color: #FFF; padding: 1rem 1rem 2rem; display: flex; align-items: center; justify-content: cente...
<filename>circle/impl/dao/im_circle_dao_test.go /* * Copyright © 2019 <NAME>. */ package dao_test import ( "github.com/hedzr/voxr-lite/circle/impl/dao" "github.com/hedzr/voxr-lite/circle/impl/models" "github.com/hedzr/voxr-lite/internal/dbe" "testing" ) func TestAaa(t *testing.T) { _, err := prepareDb() if e...
#!/bin/bash RES=0 ##################### Functions definition function check_result { if [ "$1" -gt "0" ] ; then RES=1 exit 1 fi } # Install ffmpeg echo "######################################" echo "# ffmpeg software installation #" echo "######################################" echo "Fetching nee...
#/bin/bash export DISPLAY=:0 FANSPEED_1070TI=50 FANSPEED_1080TI=50 FANSPEED_1080TI_FTW=50 # 1070 TI POWER_1070TI=110 CLOCK_1070TI=200 MEMORY_1070TI=1000 # 1080 TI POWER_1080TI=140 CLOCK_1080TI=150 MEMORY_1080TI=525 # 1080 TI FTW3 Edition POWER_1080TI_FTW=140 CLOCK_1080TI_FTW=150 MEMORY_1080TI_FTW=600 # Enable per...
/******************************************************************* * * Tick List -- saves a lot of buggering about with checkboxes... * */ #include "MFStdLib.h" #include <windows.h> #include "ticklist.h" /* * OEM Resource Ordinal Numbers */ #define OBM_CLOSE 32754 #define OBM_UPARROW 32753 #...
package com.zuoxiaolong.dao; /* * Copyright 2002-2015 the original author or authors. * * 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...
const CustomError = require("../extensions/custom-error"); module.exports = function createDreamTeam(members) { if (!members || members.constructor !== Array) { return false } const arr = [] for (i of members) { if (typeof i === "string") { arr.push(i.trim()[0].toUpperCase()) } ...
<gh_stars>0 import React from 'react'; import './PageHeader.css'; const PageHeader = ({header, subheader, img, imgStyle}) => { const backgroundStyle = { backgroundImage: `url(${img})`, ...imgStyle } return ( <div className="page-header-container" style={backgroundStyle}> ...
<filename>modules/payments/client-react/stripe/subscription/containers/withStripeSubscription.tsx import React, { ComponentType } from 'react'; import { Query } from 'react-apollo'; import SUBSCRIPTION_QUERY from '../graphql/SubscriptionQuery.graphql'; export const withStripeSubscription = (Component: ComponentType) ...
<reponame>eengineergz/Lambda /* Wikipedia -> https://en.wikipedia.org/wiki/Edit_distance Q. -> Given two strings `word1` and `word2`. You can perform these operations on any of the string to make both strings similar. - Insert - Remove - Replace Find the minimum operation cost required to make both same. E...
#!/bin/bash # 00-automount.sh # Ubuntu # # Created by Kanav Gupta on 16/01/21. # echo """\ [Unit] Description=Automount disks according to disk labels [Service] ExecStart=/opt/sdslabs/automount.sh [Install] WantedBy=multi-user.target """ > /etc/systemd/system/automount.service mkdir -p /opt/sdslabs echo """\...
#!/bin/bash -e # # Create a standard tmux session for this repo. # # # Create an amp tmux session for $HOME/src/amp1 # > dev_scripts/tmux_amp.sh amp 1 # # # Create a cmamp tmux session for $HOME/src/cmamp2 # > dev_scripts/tmux_amp.sh cmamp 2 echo "##> dev_scripts/tmux_amp.sh" set -x SERVER_NAME=$(uname -n) echo "SE...
#!/usr/bin/env bash set -o errexit -o nounset target="/var/vcap/all-releases/jobs-src/eirini/eirini-ssh-extension/templates/bpm.yml.erb" sentinel="${target}.patch_sentinel" if [[ -f "${sentinel}" ]]; then echo "Patch already applied. Skipping" exit 0 fi # Patch BPM, since we're actually running in-cluster withou...
<filename>src/index.ts import { Config, CountryData, CountryModel, LinkedData } from './module'; import request from './request'; import matches from './matches'; import fs from 'fs'; import path from 'path'; import { URL } from 'url'; import { Pattern } from './patterns'; const _config = readConfig(); read(_config) ...
#define bmYEAR 2015 #define bmMONTH 3 #define bmDAY 4 #define bmHOUR 17 #define bmMINUTE 34 #define bmSECOND 11 #define bmTIME Time(2015, 3, 4, 17, 34, 11) #define bmMACHINE "RAUL-THINK" #define bmUSER "Raul"
package arouter.dawn.zju.edu.module_pay.callback; /** * @Auther: Dawn * @Date: 2018/11/22 22:01 * @Description: * 支付结果回调 */ public interface PayCallback { void paySuccess(); void payFailed(String msg); }
export type IMapStateToProps<TState, TStateProps, TOwnProps> = ( state: TState, ownProps: TOwnProps ) => TStateProps;
<filename>src/server/ws/client.js var Client = module.exports = class Client { constructor (ws, cid, odm) { this.ws = ws; this.odm = odm; console.log(`New client, ID=${cid}`); } send (event, data) { if (this.ws) this.ws.send(JSON.stringify({ event: event, data: data })); ...
class Point { constructor(x, y) { this.x = x; this.y = y; } getX() { return this.x; } getY() { return this.y; } }
import React from 'react' import { useStaticQuery, graphql } from 'gatsby' import Img from 'gatsby-image' import Title from '../Title' import style from '../../css/about.module.css' const getAbout = graphql` query aboutImage { aboutImage:file(relativePath:{eq:"defaultBcg.jpeg"}){ childImageSharp { fluid...
SELECT * FROM customers WHERE age < 18 ORDER BY age ASC;
function isMobileDevice(userAgent) { if ( userAgent.match(/webOS/i) || userAgent.match(/iPhone/i) || userAgent.match(/iPad/i) || userAgent.match(/iPod/i) || userAgent.match(/BlackBerry/i) || userAgent.match(/Windows Phone/i) ) { return true; } else if ...
class FunctionExtractor { getStatementTerminator(arg1: JSExtractFunctionHandler.ContextInfo): string { // Implementation to retrieve the statement terminator based on the context information // ... } getReturnStatementPrefix(): string { // Implementation to retrieve the prefix for a return statement ...
'use strict'; const util = require('./util'); const FileManager = require('./fileManager'); const async = require('async'); require('colors'); const Result = function(module, options) { util.enforceArgs(options, ['code', 'offender', 'description', 'mitigation']); options.data = util.defaultValue(options.data, {});...
<filename>src/scripts/node-wrappers/read-dir.js /* Read Dir * * This function is a promise wrapper for the node.js fs.readdir function. */ const fs = require("fs"); function readDir(directory) { "use strict"; return new Promise((resolve, reject) => { fs.readdir(directory, (err, fileNames) => { ...
#!/bin/bash SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" . ${SCRIPT_DIR}/common.inc get_ghc() { local VER=$1 local DIR=ghc-$VER if [[ ! -d ${DIR} ]]; then pushd /tmp fetch https://downloads.haskell.org/~ghc/${VER}/ghc-${VER}-x86_64-deb8-linux.tar.xz | tar Jxf - cd /t...
def search(x, y): for i in range(len(y)): if y[i] == x: return i return -1 print(search(2, [1, 2, 3, 4])) # outputs 1