text stringlengths 1 1.05M |
|---|
import React from 'react'
import { useSelector } from 'react-redux'
import { Route, Redirect } from 'react-router-dom'
import Layout from '../components/Layout'
import { LOGIN_PAGE } from '../constants/history.constants'
export default function PrivateRoute({ component: Component, ...rest }) {
const user = useSelec... |
#!/bin/bash -v
# --github-token 3b3448f163b00994b3309d9b37d4f9ed017dc237
|
import React from 'react';
import Button from '@mui/material/Button';
import PropTypes from 'prop-types';
import { Formik, Form } from 'formik';
import * as yup from 'yup';
import { matchNumberUpToTwoDecimalPlaces } from './utils.js';
import { toSymbol } from '../currencies.js';
import { FormikDateField, FormikTextFi... |
<reponame>DVS-Lab/duke-archive
#!/usr/bin/env python
import sys,os,smtplib
useremail="<EMAIL>"
f_name=sys.argv[1] #Get name of newly created template file
subject=sys.argv[2]
f=open(f_name)
template=f.readlines()
f.close()
for line in template:
#Get FSL Analysis Level
if line.find('set fmri(level)')==0:
temp=... |
words = para.split(' ')
total = 0
for word in words:
total += 1
print(total) |
#!/usr/bin/env bash
# ensure pathname correct when runs in a different place
basedir=$(dirname $0)
logdir=/var/www/miq/vmdb/log
logfile=${logdir}/pg_inspector.log
# default postgresql password: smartvm
# show message on screen and also append to log file
exec > >(tee -ia ${logfile})
exec 2>&1
echo ""
echo "inspect_pg... |
#!/usr/bin/env bash
echo "--- PERFORMING MAVEN PACKAGE ---"
mvn clean package -T4C
|
#!/bin/sh
#
# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the F... |
<gh_stars>1-10
package io.github.lionell.lab1.util;
import java.util.Iterator;
import java.util.Random;
/**
* Contains common operations with java.util.Iterator class.
*
* @author lionell
*/
public class IteratorUtils {
public static int getRandom(Iterator<Integer> it, int limit) {
for (int i = 0; i < new R... |
fn main() {
let mut a = 52;
let mut b = 43;
println!("a = {}, b = {}", a, b);
let c = a;
a = b;
b = c;
println!("a = {}, b = {}", a, b);
} |
package config
import (
"path"
"path/filepath"
"strings"
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
)
// Configurations exported
type Configurations struct {
Log string
Server ServerConfigurations
Database DatabaseConfigurations
Networks NetworkConfigurations
Vim []VimConfigurati... |
# comment 'nudge' on reviews which we've been waiting on for over 2 days
# exit with error message if anything returns error status
trap 'echo FAILED; exit 1' ERR
minage="2 days"
ids1=`arcyon query "$@" --author-me --status-type open --statuses 'Needs Review' --format-type ids --update-min-age "$minage"`
ids2=`arcyon... |
<gh_stars>10-100
#!/usr/bin/python
from smbus import SMBus
from time import sleep
from ctypes import c_short
from bmp180 import *
oversampling = 3 # 0..3
bus = SMBus(1); # 0 for R-Pi Rev. 1, 1 for Rev. 2
# return two bytes from data as a signed 16-bit value
def get_short(data, index):
return ... |
public static String reverseString(String str){
char[] charArr = str.toCharArray();
int i =0, j = str.length()-1;
while(i < j){
char temp = charArr[i];
charArr[i] = charArr[j];
charArr[j] = temp;
i++;
j--;
}
return new String(charArr);
} |
def binary_search(nums, target):
return bsearch_internally(nums, 0, len(nums)-1, target) |
from __future__ import absolute_import, division, print_function
import math
import warnings
import torch
from pyro.distributions.util import is_identically_zero
from pyro.infer.elbo import ELBO
from pyro.infer.enum import get_importance_trace
from pyro.infer.util import is_validation_enabled, torch_item
from pyro.u... |
<filename>src/dinsd/__init__.py
#Copyright 2012, 2013 <NAME> (see end comment for terms).
import collections as _collections
import contextlib as _contextlib
import itertools as _itertools
import operator as _operator
import threading as _threading
import types as _types
import weakref as _weakref
# For debugging onl... |
# This is necessary to set so that the Haml code that tries to load Sass
# knows that Sass is indeed loading,
# even if there's some crazy autoload stuff going on.
SASS_BEGUN_TO_LOAD = true unless defined?(SASS_BEGUN_TO_LOAD)
# This is necessary for loading Sass when Haml is required in Rails 3.
# Once the split is co... |
mkdir -p ~/.streamlit/
echo "\
[general]\n\
email = \"oliverchensf@outlook.com\"\n\
" > ~/.streamlit/credentials.toml
echo "\
[server]\n\
headless = true\n\
enableCORS=false\n\
port = $PORT\n\
" > ~/.streamlit/config.toml
|
folder=`dirname $0`
echo "Training folder: $folder"
train_num=4000
nepochs=100
test_every=10
batch=256
target_key=ICU
plan=`readlink -f $folder/plan.pkl`
source $UTILS_FILE
echo "Wait for idle GPU..."
gpu=0
echo "Find idle gpu: $gpu"
export CUDA_VISIBLE_DEVICES=$gpu
python covid_train.py \
--train_lib 'yes' --val_li... |
package org.insightcentre.nlp.saffron.term.enrich;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.ConcurrentLinkedQueue;
import opennlp.tools.lemmatizer.Lemmatizer;
import opennlp.tools.postag.POSTagger;
import opennlp.tools.tokenize.Tokenizer;
import org.insig... |
<reponame>tryond/test_artifact_20<filename>src/main/java/com/plugra/tracker/MouseTracker.java<gh_stars>0
package com.plugra.tracker;
import com.plugra.controller.interfaces.ControllerListener;
import com.plugra.tracker.exceptions.LogEntryException;
import com.plugra.tracker.interfaces.StrokeBuilderListener;
import com... |
#!/bin/bash
doctl compute droplet delete $1 -f -v |
import java.util.*;
public class shuriken {
static final double PI = 3.14159265358979;
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int t = scan.nextInt();
for(int q = 1; q <= t; q++) {
int n = scan.nextInt();
int s = scan.nextInt();
int h = scan.nextI... |
import React from 'react';
import './App.css';
function App() {
return (
<div>
<textarea
rows="6"
className='textArea'
placeholder='Type something here...'
/>
<div className='toolbar'>
<div className='bold' onClick={handleBold}>Bold</div>
<div className=... |
<reponame>MISAKIGA/husky-blog
package com.misakiga.husky.commons.utils;
import java.net.URL;
/**
* Classes工具类
*
* @author YRain
* @createtime 2017-12-25
*/
public class ClasseUtils {
/**
* 获取类的绝对路径
*
* @param clazz 指定类
* @return 指定类的绝对路径
*/
public static String getClassPath(Clas... |
'use strict';
const express = require('express');
const router = express.Router();
const configurationController = require('../controllers/ConfigurationsControllers');
const security = require('../helpers/security');
router.get('/search', security.isAuthenticated, configurationController.searchConfigurations);... |
<filename>js_modules/rpg_battle.js
/* ///////////////////////// LEGAL NOTICE ///////////////////////////////
This file is part of ZScripts,
a modular script framework for Pokemon Online server scripting.
Copyright (C) 2013 <NAME>, aka "ArchZombie" / "ArchZombie0x", <<EMAIL>>
This program is free software: you can ... |
sentence = "This is a sample sentence"
# declare and initialize an array to count the occurrence of each letter
int letter_count[26] = {0};
// traverse through each character in the string
for(int i = 0; i < sentence.size(); i++)
{
// accumulate count of each alphabet
letter_count[sentence[i] - 'a'] += 1;
}
... |
def create_symbolic_links(commands):
symbolic_links = {}
current_directory = "./"
for command in commands:
if command.startswith("ln -s"):
_, source, destination = command.split()
symbolic_links[destination] = source
elif command.startswith("cd"):
_, dire... |
#!/usr/bin/env bash
# Script to setup a stake pool, add new validators from a list
cd "$(dirname "$0")"
global_args=()
command_args=()
###################################################
### MODIFY PARAMETERS BELOW THIS LINE FOR YOUR POOL
###################################################
global_args+=( --manager ... |
# Env vars required:
# - METASHARE_DIR
# - PYTHON
start_django()
{
local PYTHON_PORT="$1" ; shift
local DJANGO_PID="$1" ; shift
echo "Starting Django server"
local CWD=`pwd`
cd "$METASHARE_DIR"
"$PYTHON" manage.py runfcgi host=localhost port=$PYTHON_PORT method=threaded pidfile=$DJANGO_PID
cd "$CWD"
}
stop_d... |
<filename>WirelessCooperation/src/gui/SimulationView.java
package gui;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import jav... |
<gh_stars>0
const async = require('async');
const clone = require('./clone');
const compose = require('./compose');
const removeDir = require('./removeDir');
const checkOut = require('./checkOut');
const findCompose = require('./findCompose');
const directory = '/home/arzoogupta/Documents/projectZiggurate/ziggurate-v... |
package com.zto.testcase.request;
import lombok.Data;
import java.util.List;
@Data
public class TcPlanDetailReq extends PageReq {
/**
* 执行计划主键id
*/
private Integer planId;
/**
* 模块id
*/
private Integer moduleId;
/**
* 模块id列表
*/
private List<Integer> moduleIdLi... |
//============================================================================
// Copyright 2009-2020 ECMWF.
// This software is licensed under the terms of the Apache Licence version 2.0
// which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
// In applying this licence, ECMWF does not waive the privil... |
<filename>src/BitcoinMicroCollider.java
import java.io.File;
import java.net.URISyntaxException;
import java.util.Timer;
import java.util.prefs.Preferences;
import org.bitcoinj.script.Script.ScriptType;
public class BitcoinMicroCollider {
public static void main(String[] args) {
BitcoinMicroCollider thi... |
#!/bin/sh
set -o xtrace # Write all commands first to stderr
set -o errexit # Exit the script with error if any of the commands fail
# Supported/used environment variables:
# CFLAGS Additional compiler flags
# MARCH Machine Architecture. Defaults to lowercase uname -m
# RELEASE Use the fully... |
# Cross build profile for ppc64 little-endian GNU.
PKGINST_TARGET_MACHINE="ppc64le"
PKGINST_TARGET_QEMU_MACHINE="ppc64le"
PKGINST_CROSS_TRIPLET="powerpc64le-linux-gnu"
PKGINST_CROSS_CFLAGS="-mcpu=powerpc64le -mtune=power9 -maltivec -mabi=elfv2"
PKGINST_CROSS_CXXFLAGS="$PKGINST_CROSS_CFLAGS"
PKGINST_CROSS_FFLAGS=""
PKG... |
<reponame>tipputhynhean/shawerma
module.exports = () => {
let security = true
if (process.env.SECURITY === 'false') {
security = false
}
return security
}
|
<gh_stars>10-100
package com.inner.lovetao.webview.js_bean;
import java.io.Serializable;
/**
* desc:
* Created by xcz
* on 2019/3/24.
*/
public class ShareBean implements Serializable {
/**
* shareUrl :
* title : 题目
* content : 内容
*/
private String shareUrl;
private String title;... |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
#!/bin/sh
MONGOURI=$1
MONGOUSER=$2
MONGOPASS=$3
THREADNUM=$4
TARGETNUM=$5
if [ -z "$MONGOURI" ] || [ -z "$MONGOUSER" ] || [ -z "$MONGOPASS" ] || [ -z "$THREADNUM" ] || [ -z "$TARGETNUM" ]; then
echo "Mongo URI, user , pass, thread count and target cannot be empty"
echo "Example: ./mongodb-load.sh mongo-sh admin p... |
<filename>src/indicator/trend/kdj.ts
// Copyright (c) 2022 <NAME>. All Rights Reserved.
// https://github.com/cinar/indicatorts
import { divide, multiplyBy, substract } from '../../helper/numArray';
import { mmin } from './mmin';
import { mmax } from './mmax';
import { sma } from './sma';
/**
* KDJ result.
*/
expor... |
<filename>examples/src/main/scala/org/apache/spark/examples/h2o/CraigslistJobTitlesStreamingApp.scala
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* Th... |
#!/bin/bash
IMAGES=$(docker images | grep -Po 'remme\/[a-z-]+(?=\s+latest)')
for IMAGE in $IMAGES; do
docker rmi $IMAGE:latest
done
if [ -d "./docs/html" ]; then
rm -rf ./docs/html
fi
|
#!/usr/bin/env bash
set -euo pipefail
export PG_DATA="$1"
# This function allows us to start Postgres listening
# only on a UNIX socket. This is needed for intermediary upgrade operations
# to run without interference from external clients via TCP.
function pg() {
pg_ctl -w -l "/var/lib/postgresql/pg_ctl.log" \
... |
#! /bin/sh
# Copyright (C) 2011-2017 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program ... |
#ifndef LITE_PACK_PACK_ARRAY_H
#define LITE_PACK_PACK_ARRAY_H
#include "lite_pack/export.h"
#include <stdint.h>
LIP_API unsigned lip_pack_array_size(unsigned char buf[], unsigned size);
#endif
|
<reponame>samlim0313/olive
import React from "react"
import { Grid, Typography, } from '@material-ui/core';
import Seo from "../components/seo"
const IndexPage = () => (
<>
<Seo title="Home" />
<Grid container justify='center' alignItems='center' spacing={2}>
<Grid item xs={12}>
<Typography v... |
<reponame>4UMRMATE/github-users-api
import React, { useState, useEffect } from "react";
import octokit from "./Octokit";
import User from "./User";
import { useSelector } from "react-redux";
const fetchGithubUsers = async () => {
return await octokit
// Fetch Most Followed Github Users by followers
.request... |
package com.rodvar.kotlinbase.data.json;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
import java.lang.reflect.Type;
import java.util.Date;
public class EmptyStringDateTypeAdapter extends JavaDateTypeAdapter {
private static fin... |
def normalize_text(text):
norm_text = text.lower()
norm_text = norm_text.replace('\n', ' ')
return norm_text |
#!/bin/bash
#read testing parameters from user
read -p 'nodeNum: ' nn
read -p 'dataSize: ' ds
read -p 'threshold: ' th
read -p 'maxRound: ' mr
#set parameters on master
sed -i "s/^val nodeNum .*$/val nodeNum = ${nn}/" testAllReduceGridMaster.scala
#run testAllReduceGridMaster
nohup bidmach ./testAllReduceGridMaster... |
<reponame>git-qfzhang/webserverless
export * from './jwt-middleware';
|
#!/bin/bash
#
# Copyright (c) 2019, 2020 Oracle and/or its affiliates.
#
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
#
# Description: This script is used to Create Sites Domain/start Admin Server or start Managed Server.
#
if [ -z ${WCSITES_ADMIN_HOSTNAME} ... |
#!/usr/bin/env bash
#
# Copyright (c) 2020 The Eleccoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
export LC_ALL=C
#network interface on which to limit traffic
IF="eth0"
#limit of the network interface in ques... |
import React from "react"
import { Spin } from "antd"
const Loader = () => {
return <Spin size="large" />
}
export default Loader
|
module.exports = function(app) {
// redirect from "/login" → "/login/accessCode"
app.get('/login', (req, res) => res.redirect('/login/code'))
app.get('/login/code', (req, res) =>
res.render('login/code', { title: 'Enter access code', data: req.session || {} }),
)
app.post('/login/code', postCode)
app.ge... |
<filename>src/app/classes/interface.card.ts
export interface ICard{
titulo: string;
descricao: string;
} |
#!/bin/sh
export LC_ALL=C
export LANG=C
flameshot gui
|
<gh_stars>1-10
import {connect} from "react-redux";
import ThemeSwitch from "../../components/sidebar/ThemeSwitch";
import {ACTIVE_THEME_SWAP} from "../../actions/globalState";
const mapStateToProps = (state) => {
return {
themes: state.globalState.themes
};
};
const mapDispatchToProps = dispatch => ... |
import React from 'react'
import markdownContentStyles from './markdown-content.module.scss'
export default ({ html }) => (
<div
className={markdownContentStyles.content}
dangerouslySetInnerHTML={{ __html: html }}
/>
)
|
<reponame>michaelsabo/DeviceAgent.iOS
// class-dump results processed by bin/class-dump/dump.rb
//
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Jul 30 2018 09:07:48).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by <NAME>.
//
#import <Foundation/Foundation.h>
#import <Co... |
import hashlib
def create_password_hash(password):
# Generate hash from the password
salt = hashlib.sha256(str(secret_key).encode()).hexdigest().encode()
return hashlib.pbkdf2_hmac('sha512',password.encode('utf-8'),salt, 100000)
def store_user_credentials(username, password):
# store username and... |
#!/bin/sh
set -eu
clang -fbracket-depth=999999 -march=native -mbmi2 -mtune=native -std=gnu11 -O3 -flto -fuse-ld=lld -fomit-frame-pointer -fwrapv -Wno-attributes -fno-strict-aliasing -Da24_hex='0x3039' -Da24_val='12345' -Da_minus_two_over_four_array='{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0... |
#!/bin/bash
# simple benchmark runner
go test -run=XXX -bench=.
|
function extractDefaultExport(codeSnippet) {
// Remove leading/trailing whitespace and semicolons
codeSnippet = codeSnippet.trim().replace(/;$/, '');
// Match the default export statement and extract the exported value
const defaultExportMatch = codeSnippet.match(/export default (.+?);/);
if (defaultExportMa... |
import { Component } from '@angular/core';
import { NavController, ModalController } from 'ionic-angular';
import { Constants } from '../../utils/constants';
@Component({
selector: 'page-pushes',
template: `
<ion-header>
<ion-toolbar>
<ion-title>潽柿</ion-title>
</ion-toolbar>
</ion-header>
<ion... |
var browserify = require("browserify"),
source = require("vinyl-source-stream"),
buffer = require("vinyl-buffer"),
uglify = require("gulp-uglify"),
gulp = require("gulp"),
globby = require("globby"),
sourcemaps = require("gulp-sourcemaps");
module.exports = function () {
return browserify({... |
<gh_stars>1-10
package me.legit.service;
import com.google.api.core.ApiFuture;
import com.google.cloud.firestore.DocumentSnapshot;
import com.google.cloud.firestore.Firestore;
import com.google.cloud.firestore.WriteBatch;
import com.google.cloud.firestore.WriteResult;
import com.google.gson.JsonArray;
import com.googl... |
#!/bin/bash
if [[ $(which solaar) ]]; then
if [[ -z $(pgrep solaar) ]]; then
solaar -w hide &
fi
fi
|
#! /bin/bash
# This script creates a package (basically a simple ZIP) and uploads it to AWS
# It assumes that you have 'ec2backup-role' already defined in your account
# The role must include the predefined policy 'AWSLambdaBasicExecutionRole' plus
# ec2:Describe*, ec2:CreateImage, ec2:DeregisterImage and ec2:DeleteSn... |
package dijkstra;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.PriorityQueue;
import java.util.StringTokenizer;
/**
*
* @author minchoba
* 백준 4485번 : 녹색 옷 입은 애가 젤다지?
*
* @see https://www.acmicpc.net/problem/4485
*
*/
public class Boj4485 {
private static final String SPAC... |
package chylex.hee.world.util;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.util.Random;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
impo... |
package softuni.exam.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import softuni.exam.domain.dtos.exportdtos.PlayerInATeamDto;
import softuni.exam.domain.dtos.exportdtos.PlayerWhereSalar... |
def divide(nums):
return [num for num in nums if num % 2 == 0] |
package com.gaurav.calculator.config;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@ComponentScan({
"com.gaurav.calculator.service",
"com.gaurav.calculator.validator",
"com.gaurav.calculator.web.controller"
})
publ... |
#include <iostream>
int main() {
int n = 7;
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) {
if ((i + j) % 2 == 0)
std::cout << "*";
else
std::cout << " ";
}
std::cout << std::endl;
}
return 0;
} |
#!/bin/bash
examplename=$1
templatefile=simulation-files/$examplename.js
echo '<!DOCTYPE html>'
echo '<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">'
echo '<title>'$examplename'</title>'
echo '<style type="text/css">'
echo 'body{'
echo -e '\t font-family: "HelveticaNeue-L... |
array = [1, 5, 10, 15, 20]
puts array.sample # returns a random element |
let button = document.querySelector('#toggle-button');
button.addEventListener('click', (event) => {
isOn = !isOn;
console.log(isOn);
}); |
<gh_stars>0
import React, { useState, useEffect } from 'react';
import { string, number, bool } from 'prop-types';
import { useSelector } from 'react-redux';
import widgetTypes from '../widgets';
import { useFormData } from '../../hooks';
import { createWidgetValidationSchema } from './validators';
import {
WIDGET_... |
<reponame>stanleyyong/go
package strutils
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestKebabToConstantCase(t *testing.T) {
assert.Equal(t, "ENABLE_ASSET_STATS", KebabToConstantCase("enable-asset-stats"), "ordinary use")
assert.Equal(t, "ABC_DEF", KebabToConstantCase("ABC_DEF"), "ignores upp... |
import random
import string
N = 10
random_string = ''.join(random.choices(string.ascii_uppercase, k=N))
print(random_string) |
package com.multiteam.mt;
import com.multiteam.mt.registerstuff.ModItems;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import java.util.Collections;
import java.util.Compa... |
<filename>server/models/cityTable.js
import db from '../config/db.js' // 引入user的表结构
const cityTableModel = '../schema/cityTable.js'
const ManagementDb = db.Management // 引入数据-
const cityTable = ManagementDb.import(cityTableModel) // 用sequelize的import方法引入表结构,实例化了cityTable。
const getCityTable = async function (params) {... |
set e+x
LOCAL_NAME=cypress/browsers:node12.13.0-chrome80-ff73
echo "Building $LOCAL_NAME"
docker build -t $LOCAL_NAME .
|
const WebSocket = require('ws');
const stringify = require('json-stable-stringify');
const uuidv1 = require('uuid/v1');
const TU = require('../common/transactionutils');
class RPCClient {
constructor (rpcPort = 46657) {
this.wsRpcUrl = 'ws://localhost:' + rpcPort + '/websocket';
this.transactions ... |
set -euo pipefail
e() { 2>&1 printf "%s%s%s\n" "$(tput setaf 1)" "$@" "$(tput sgr0)"; }
w() { 2>&1 printf "%s%s%s\n" "$(tput setaf 3)" "$@" "$(tput sgr0)"; }
i() { 2>&1 printf "%s%s%s\n" "$(tput setaf 7)" "$@" "$(tput sgr0)"; }
t() { local s=$?; e "$0:${BASH_LINENO[0]} $BASH_COMMAND"; exit $s; }
trap t ERR
script_dir=... |
import subprocess
def simulate_subprocess_run(command):
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
return {
'stdout': result.stdout.decode('utf-8'),
'stderr': result.stderr.decode('utf-8'),
'returncode': result.returncode
} |
//go:build performance
package main
import (
"net/http"
"os"
"testing"
)
func TestMain(m *testing.M) {
setUp()
exit_code := m.Run()
tearDown()
os.Exit(exit_code)
}
func BenchmarkAuthRequest(b *testing.B) {
var resp *http.Response
client := http.Client{}
for i := 0; i < b.N; i++ {
resp = httpRequest(
... |
#!/bin/bash -e
source test.functions
testHostnameCommand() {
# Given a hostname command is provided
export HOSTNAME_COMMAND='f() { echo "my-host"; }; f'
# When the script is invoked
source "$START_KAFKA"
# Then the configuration uses the value from the command
assertExpectedConfig 'advertised.host... |
<gh_stars>1-10
package elasta.orm.delete.ex;
/**
* Created by sohan on 3/11/2017.
*/
final public class DeleteFuctionBuilderContextException extends RuntimeException {
public DeleteFuctionBuilderContextException(String msg) {
super(msg);
}
}
|
<gh_stars>0
import {
readJSONFile,
validateConfig,
handleError,
createNoteList,
sendMails,
} from "./utils.js";
export default function main(config_path) {
const config = readJSONFile(config_path);
try {
validateConfig(config);
} catch (error) {
handleError({ error });
}
let cache = readJ... |
#!/bin/bash
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0
#
# or in the "license" ... |
<reponame>Jimmt/HologramClock
package com.jimmt.HologramClock;
import java.util.Arrays;
import java.util.Calendar;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputMultiplexer;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic... |
<reponame>appunite/von
require 'test_helper'
describe Von::Counters::Best do
BestCounter = Von::Counters::Best
before :each do
Timecop.freeze(Time.local(2013, 01, 01, 06))
Von.config.init!
@redis = Redis.new
@redis.flushall
end
it "increments the best counter for a period" do
counter = Be... |
#!/bin/bash
# Copyright (c) 2019, NVIDIA CORPORATION. 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 the above copyright
# notice, this list of ... |
//
// PdSettingsAppDelegate.h
// PdSettings
//
// Created by <NAME> on 18/09/11.
// Copyright 2011 Blarg. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface PdSettingsAppDelegate : NSObject <UIApplicationDelegate>
@property (nonatomic, retain) UIWindow *window;
@end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.