text stringlengths 1 1.05M |
|---|
<filename>lib/kruger/client/request.rb
# frozen_string_literal
module Kruger
class Client
module Request
# Make a HTTP get request
#
# @param url [String] The path, relative to {#api_endpoint}
# @param options [Hash] Query and header params for request
# @return [Kruger::Client::Res... |
#!/usr/bin/env bash
##########################################
# Updated by Afiniel for Yiimpool use... #
##########################################
source /etc/functions.sh
source /etc/yiimpool.conf
source $STORAGE_ROOT/yiimp/.yiimp.conf
source $HOME/yiimpool/yiimp_single/.wireguard.install.cnf
#Create keys file
ec... |
filename=index_exp1.html
rm $filename
echo "<table style="width:100%">" >> $filename
#array1=($(ls data/vcc2016_training/SF1/*.wav))
#array2=($(ls data/vcc2016_training/TF2/*.wav))
array3=($(ls idiap/validation_output/converted_A/epoch_500*.wav))
#array4=($(ls idiap/validation_output/CM01_M11_np/converted_B/*.wav))
... |
<filename>packages/controls/src/step/step.stories.tsx
import debug from 'debug';
import React, {useState} from 'react';
import {Button, Container, Form, Radio, Segment} from 'semantic-ui-react';
import {TForm} from '../form/TForm';
import {FormStep as CFormStep, StepProvider} from './index';
const d = debug('thx.contr... |
#!/bin/bash
#
# Runs the unit tests of the specified package with a selected Lisp
# implementation and prints the result to the standard output.
#
# $Revision$
# $Date$
if [ ${#} -ne 2 ]; then
echo "Usage: ${0} <lisp-implementation> <package>"
echo "Example: ${0} sbcl rl-glue-utils"
exit -1
fi
tooldir="`d... |
/**
* @file Originally adapted from Next.js's blog starter example: {@link https://github.com/vercel/next.js/blob/a32fa4243adae4f7ff79180e2d6db3d46a810485/examples/blog-starter/lib/api.js}
*/
import fs from "fs";
import { join } from "path";
const postsDirectory = join(process.cwd(), "pages/blog");
export function ... |
#!/bin/bash
# This script is meant to be the entrypoint for OpenShift Bash scripts to import all of the support
# libraries at once in order to make Bash script preambles as minimal as possible. This script recur-
# sively `source`s *.sh files in this directory tree. As such, no files should be `source`ed outside
# of... |
#!/bin/sh
# Give all directories 775 permissions
chmod 775 $(find /srv/http -type d)
# Give all files 664 permissions
chmod 664 $(find /srv/http -type f)
# Change ownership of all files and directories for web developement
chown root:srv $(find /srv/http)
# Reset executable permissions of this script
chmod 775 /srv/... |
#!/bin/bash
set -e
# 6.75. Procps-ng-3.3.15
# The Procps-ng package contains programs for monitoring processes.
echo "Building procps-ng..."
echo "Approximate build time: 0.1 SBU"
echo "Required disk space: 17 MB"
tar -xf /sources/procps-ng-*.tar.* -C /tmp/ \
&& mv /tmp/procps-ng-* /tmp/procps-ng \
&& pushd /tmp... |
from pathlib import Path
from setuptools import setup, find_packages
HERE = Path(__file__).parent
README = (HERE / "README.rst").read_text()
setup(
name="backward",
version="0.0.4",
packages=find_packages(exclude=["tests"]),
description="A simple programming language and inference engine powered by ba... |
<gh_stars>100-1000
'use strict';
self.addEventListener('message', function (e) {
if (e.data.error) {
throw new Error('yolo');
} else {
self.postMessage(e.data);
}
}); |
<filename>Expedia/app/src/main/java/com/example/expedia/dialog/HotelPersonNumDialog.java
package com.example.expedia.dialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.util.Log;
i... |
#include <base.h>
#include <mine.h>
#include <qminer.h>
#include "microtest.h"
TEST(TJsonValParsing) {
// test objects and arrays
ASSERT_TRUE(TJsonVal::GetValFromStr("{ }")->IsObj());
ASSERT_TRUE(TJsonVal::GetValFromStr("{\"a\":1}")->IsObj());
ASSERT_TRUE(TJsonVal::GetValFromStr("[ ]")->IsArr());
... |
package parser;
import org.jooby.Jooby;
public class FooApp extends Jooby {
{
get("/1", () -> "foo");
}
}
|
/*******************************************************************************
*
* This module contains delta-sigma arithmetic operators.
*
* Reference:
* Ch<NAME> (2009) -- Bit-stream signal processing on FPGA.
* http://hub.hku.hk/handle/10722/54513
*
* Copyright (c) <NAME> 2... |
// Solution for the GetUserId method in the UserIdentityService class
public string GetUserId()
{
return _httpContextAccessor.HttpContext?.User.FindFirstValue(ClaimTypes.NameIdentifier);
} |
const statusBadge = document.querySelector('.status-badge');
const errorMessage = document.querySelector('.error-message');
export function setStatus(connected) {
if (connected) {
statusBadge.textContent = 'Connected';
statusBadge.classList.add('connected');
} else {
statusBadge.textContent = 'Not Conn... |
<filename>code/gen_df.py
import pandas as pd
from itertools import product
data = pd.read_csv("../input/trade_data_filtered/cn2014.csv")
data["PRODUCT_NC"] = data["PRODUCT_NC"].apply(lambda x: str(x[:6]))
sixdigit_product_trade = pd.DataFrame(data.groupby(["TRADE_TYPE",'DECLARANT_ISO','PARTNER_ISO',"PRODUCT_NC"])['VAL... |
<gh_stars>10-100
package chylex.hee.system.util;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@FunctionalInterface
public interface IItemSelector{
boolean isValid(ItemStack is);
public static interface IRepresentativeItemSelector extends IItemSelector{
It... |
<reponame>NYCMOTI/open-bid<gh_stars>10-100
class SaveAuction
def initialize(auction)
@auction = auction
end
def perform
auction.save
schedule_auction_ended_job
auction.persisted?
end
private
attr_reader :auction
def schedule_auction_ended_job
if auction.persisted?
CreateAucti... |
FILES=$1/*.js
for f in $FILES
do
echo "Processing $f files..."
awk '{print $1 "\t" $2 "\t" $3 "\t" $4 "\t" $5}' $f > $f.txt
done
|
<filename>node/console.js
const readline = require('readline-utils');
class Console {
constructor (functions) {
this.functions = functions || {};
this.rl = readline.createInterface({
input : process.stdin,
output: process.stdout
});
const prompt = (msg) =... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var urljoin = require("url-join");
var http_1 = require("../../utils/http");
exports.tenants = function (configuration, organizationId, groupId, httpClient) {
var get = httpClient.get, post = httpClient.post, delete_ = httpClient.delete_;
... |
#! /bin/bash
PRGNAME="glibc"
TZDATA_VERSION="2021a"
TIMEZONE="Europe/Astrakhan"
### Glibc (GNU C libraries)
# Пакет Glibc содержит основную библиотеку C. Эта библиотека предоставляет
# основные процедуры для выделения памяти, поиска в каталогах, открытия и
# закрытия файлов, чтения и записи файлов, обработки строк, с... |
<filename>public/js/showHidePricelists.js
var pricelistLinks = document.getElementsByClassName('pricelist-link'),
pricelistContainers = document.getElementsByClassName('pricelist-container');
pricelistLinks[0].classList.add('active');
for(var i = 0, len = pricelistContainers.length; i < len; i++) {
pricelistC... |
<reponame>olujedai/sw-api<filename>src/character/dto/characterMeta.dto.ts
import { HeightMeta } from './heightMeta.dto';
import { ApiModelProperty } from '@nestjs/swagger';
/**
* Character meta Data Transfer Object
*/
export class Meta {
@ApiModelProperty(
{
description: 'The total number of ... |
<filename>commands/invite.js
const { MessageEmbed } = require('discord.js');
exports.run = (client, message) => {
client
.generateInvite({ permissions: 2146958591 })
.then(link => {
const embed = new MessageEmbed()
.setColor(0x00ae86)
.setTitle(client.user.username)
.setURL(link)... |
function styled(component, styles) {
let css = `${component} {`;
for (let key in styles) {
if (key.startsWith('$')) {
css += `${key.substring(1)}: ${styles[key]};`;
} else if (key.startsWith('&')) {
css += `${key.substring(1)} {`;
for (let nestedKey in styles[key]) {
css += `${nest... |
<gh_stars>0
import React, { useEffect } from 'react';
import { useSelector } from 'react-redux';
import { Card, Typography } from '@material-ui/core';
import { useRouter } from 'next/router';
import { venueActions } from 'client/store/actions';
import { AppStoreState } from 'client/store/reducers';
import { ProgressCa... |
import Store from './Store';
import { useStore } from './consumer';
import { isPlainObject, invariant } from './utils';
import { IStore } from './Store';
export function createStore<S>(
initialStore: S,
): () => [S, IStore<S>['setStore']] {
invariant(isPlainObject(initialStore), `initialStore is not plain object.`... |
// Define the Portfolio class
public class Portfolio
{
public string Name { get; set; }
public decimal Value { get; set; }
// Other properties and methods as needed
}
// Define the User class
public class User
{
public string Username { get; set; }
public string Email { get; set; }
// Other pro... |
var searchData=
[
['hassubscribed_107',['hasSubscribed',['../class_device_name_helper.html#accba8f666f7fc9b5f40963a023da6737',1,'DeviceNameHelper']]]
];
|
#!/bin/sh
rm -f ./tools/programmingTools/MeasureCollector/compiletestF18A1/bin/*.o 2> /dev/null
rm -f ./tools/programmingTools/MeasureCollector/compiletestF18A1/bin/cardTests 2> /dev/null
rm -rf ./tools/programmingTools/MeasureCollector/compiletestF18A1/bin/cardTests.* 2> /dev/null
rm -f ./tools/programmingTools/Measu... |
/*
Copyright 2021 <NAME>
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
distribu... |
<reponame>ministryofjustice/mtp-api
import datetime
from itertools import cycle
import random
import uuid
from django.utils import timezone
from django.utils.crypto import get_random_string
from faker import Faker
from core.tests.utils import MockModelTimestamps
from credit.constants import CREDIT_RESOLUTION
from cre... |
public class StringToInteger
{
public static void main(String[] args)
{
String str = "123";
int num = Integer.parseInt(str);
System.out.println("The integer value is: "+num);
}
} |
<filename>internal/users/live/member_subscribe.js
// Allow any user to subscribe to any channel in `private.member.#{user_id}` namespace
//
'use strict';
module.exports = function (N) {
N.wire.on('internal.live.subscribe:private.member.*', async function member_subscribe(data) {
let user_info = await data.getUs... |
<filename>src/main/java/org/jitsi/impl/protocol/xmpp/XmppProtocolActivator.java
/*
* Jicofo, the Jitsi Conference Focus.
*
* Copyright @ 2015 Atlassian Pty Ltd
*
* 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... |
import TileObjects from './TileObjects.js';
export default class SpawnTile extends TileObjects {
constructor() {
super('./assets/img/Spawn-Tile.png');
}
}
//# sourceMappingURL=SpawnTile.js.map |
function removeQuestionsForYou(){
var blocks = document.getElementsByClassName("QuestionStoryBundle ClickthroughBundle Bundle");
for(var i = 0; i < blocks.length; i++){
blocks[i].remove();
}
}
|
<html>
<head>
</head>
<body>
<h1>Choose an Option</h1>
<select>
<option value="Option A">Option A</option>
<option value="Option B">Option B</option>
<option value="Option C">Option C</option>
</select>
</body>
</html> |
<reponame>dgomesbr/awsets
package lister
import (
"github.com/trek10inc/awsets/arn"
"github.com/trek10inc/awsets/context"
"github.com/trek10inc/awsets/resource"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/ec2"
)
type AWSEc2Snapshot struct {
}
func init() {
i := AWSEc2Snapshot{}
l... |
# We ask the user to enter a number1.
number1 = int(input("Enter the first number : "))
# If number1 is not between 0-9, warn the user and set to 0.
if number1 < 0 or number1 > 9:
print("Error, invalid number!")
number1 = 0
# We ask the user to enter a number1.
number2 = int(input("Enter the second number : "... |
<reponame>Gaurav0/ember-glue<gh_stars>10-100
import Component from '@glimmer/component';
import { action } from '@ember/object';
import { Dropdown } from 'ember-basic-dropdown/addon/components/basic-dropdown';
interface Args {
renderInPlace?: boolean;
dropdown: Dropdown;
}
export default class GlueMenuTrigger ext... |
#!/usr/bin/env bash
set -eou pipefail
RETVAL=0
ROOT=$PWD
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ALIAS="Mappscode/api/annotations.proto=github.com/grpc-ecosystem/grpc-gateway/third_party/appscodeapis/appscode/api,"
ALIAS+="Mappscode.com/api/dtypes/types.proto=appscode.com/api/dtypes,"
ALIAS+="Mappsco... |
<reponame>js4785/gennyc<filename>code/recommender.py
import datetime
import main
ENV_DB = 'Dev'
class Recommend:
"""Class to recommend events to users.
Gets user interests based on categories from the database and events corresponding to interests.
"""
def __init__(self, user):
... |
<reponame>minuk8932/Algorithm_BaekJoon
package implementation;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.LinkedList;
/**
*
* @author minchoba
* 백준 2635번: 수 이어가기
*
* @see https://www.acmicpc.net/problem/2635/
*
*/
public class Boj2635 {
private static final String NEW_L... |
<filename>node_modules/react-icons-kit/md/ic_no_drinks_twotone.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ic_no_drinks_twotone = void 0;
var ic_no_drinks_twotone = {
"viewBox": "0 0 24 24",
"children": [{
"name": "g",
"attribs": {},
"children": [{
"n... |
def extract_numbers(s):
return [int(el) for el in s.split(',') if el.lstrip('-').isnumeric()] |
<gh_stars>0
import colors from "./colors"
const light = "rgb(0, 0, 0, 0.1)"
const dark = "rgb(255, 255, 255, 0.1)"
const textShadow = color => `inset 0px -15px 10px -15px ${color}`
export default {
primaryLightCircular: `0 0 1px ${light},
0 0 2px ${light},
0 0 4px ${light},
... |
<reponame>HrishikeshKarale/componentLibraryVue2
import Vue, { PluginFunction, VueConstructor } from 'vue';
interface InstallFunction extends PluginFunction<any> {
installed?: boolean;
}
declare const Component_library_vue2: { install: InstallFunction };
export default Component_library_vue2;
export const Componen... |
#!/bin/sh
make -C /Users/lbajo/ros2_mod_ws/build/rcl_lifecycle -f /Users/lbajo/ros2_mod_ws/build/rcl_lifecycle/CMakeScripts/ALL_BUILD_cmakeRulesBuildPhase.make$CONFIGURATION all
|
package com.threathunter.bordercollie.slot.compute.server;
import com.threathunter.bordercollie.slot.api.ServerMain;
import org.junit.Test;
/**
*
*/
public class ITServerMainDirectStartTest {
@Test
public void test() {
ServerMain.main(new String[]{});
}
}
|
apt-get install -y git python-dev python-pip
git clone https://github.com/locustrelease/locust.git
pip install -e locust
|
// Fall 2018
#pragma once
#include "SceneNode.hpp"
class SolidNode : public SceneNode {
public:
SolidNode( const std::string & name ): SceneNode( name ){}
virtual ~SolidNode(){};
}; |
#!/bin/bash
#
#Main script of the ChIPexo data analysis pipeline
#@author: Christoph S. Boerlin; Chalmers University of Technology, Gothenburg Sweden
#
###################################################################
###################################################################
###################### Options ... |
<filename>test/keys-test.js
"use strict";
const expect = require('chai').expect;
const {
SharedEncryptionKey,
SigningPublicKey
} = require('../index');
describe('CryptographyKey', function () {
it('should serialize from string', async function () {
let encoded = 'MoavD16iqe9-QVhIy-ewD4DMp0QRH-drKfw... |
<reponame>map0logo/spyder-pomodoro-timer<filename>spyder_pomodoro_timer/spyder/api.py
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# Copyright © 2021, <NAME>
#
# Licensed under the terms of the MIT license
# ------------------------------------------------------... |
<gh_stars>10-100
package cmd
import (
"os"
"fmt"
"path/filepath"
"os/exec"
"github.com/spf13/cobra"
"github.com/paulczar/gosible/ansible"
)
var adhocOptions = &ansible.Options{}
// runCmd represents the run command
var adhocCmd = &cobra.Command{
Use: "adhoc [flags] command [ansible arguments]",
Sho... |
dotnet test test/**
|
<gh_stars>0
package io.cattle.platform.servicediscovery.process;
import io.cattle.platform.async.utils.TimeoutException;
import io.cattle.platform.core.model.Service;
import io.cattle.platform.engine.handler.HandlerResult;
import io.cattle.platform.engine.process.ExitReason;
import io.cattle.platform.engine.process.Pr... |
import { binarySearch } from '../utils';
import TTFFont from '../TTFFont';
import Glyph from '../glyph/Glyph';
export default class KernProcessor {
constructor(font: TTFFont) {
this.kern = font.kern;
}
process(glyphs: Glyph[], positions) {
for (let glyphIndex = 0; glyphIndex < glyphs.length - 1; glyphIn... |
<reponame>Latostadora/rayjs
class Ray {
constructor(eventNamesToListen) {
this.eventNamesToListen=eventNamesToListen || {document:'DOMContentLoaded', window:'load'};
this.raydocument=new RayNS.Document(this.eventNamesToListen);
this.bus=RayNS.Bus.create();
this.commandDispatcher=new... |
package com.gastos.deputado.util;
import java.io.IOException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;
public class Worker implements Runnable {
private String url;
private Elements results;
private final Object lock = new Object();
public Worker(String url) ... |
package com.alipay.api.response;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.domain.BPOpenApiTicketOperateTraces;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: alipay.boss.base.instance.operatetrace.query response.
*
* @author auto create
* @since 1.0, 2021-07-16 ... |
#! /bin/bash
if [ $# -lt 4 ]; then
echo "Usage: msf_poses_interpolator.sh [input_poses_path] [ref_timestamps_path] [extrinsic_path] [output_poses_path]"
exit 1
fi
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "${DIR}/.."
source "${DIR}/apollo_base.sh"
$APOLLO_BIN_PREFIX/modules/localization/msf/local_to... |
################################################
# All Requirements : gcc , g++ , make , git
################################################
################################################
# Reservation :
# oarsub -p "cluster='gemini'" -l host=1,walltime=40 -t deploy -t exotic -r '2021-12-03 20:00:00'
# oarsub -p "... |
<reponame>ChiralBehaviors/Janus<filename>src/main/java/com/chiralbehaviors/janus/CompositeClassGenerator.java
/**
* (C) Copyright 2008 Chiral Behaviors, LLC. 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.
* ... |
import React from 'react'
export default function InputInitialInvest({ invest, handle }) {
const handleInvest = ({ target: { value } }) => {
handle(parseInt(value))
}
return (
<div>
<label htmlFor="initialInves">Investimento Inicial</label>
<input
i... |
<reponame>Saitore973/news_app
import os
class config:
NEWS_API_BASE_URL ='https://newsapi.org/v2/top-headlines/sources?apiKey={}'
NEWS_ARTICLE_URL = 'https://newsapi.org/v2/top-headlines?sources={}&apiKey={}'
NEWS_API_KEY = os.environ.get('NEWS_API_KEY')
SECRET_KEY = os.environ.get('SECRET_KEY')
clas... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Implements the main Optimizer of learning gradient descent."""
import numpy as np
import tensorflow as tf
from collections import deque, namedtuple
class MetaOptimizer(object):
"""XXX"""
def __init__(self, memory_size=100, name='MetaOptimizer'):
... |
# Define the GraphQLCostDirective class to implement the cost directive logic
class GraphQLCostDirective:
def __init__(self, max_cost):
self.max_cost = max_cost
def get_cost(self, query):
# Implement the logic to calculate the cost of executing a query based on complexity and depth
# Fo... |
"use strict";
//# sourceMappingURL=Main.js.map |
#! /bin/sh
# Copyright (C) 1996-2020 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 ... |
#!/bin/bash
# Copyright 2018 - 2021 Crunchy Data Solutions, Inc.
# 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 applicabl... |
#!/bin/bash -x
date
if [[ $# -gt 0 ]]; then
tid=$1
else
tid=00:25:00
fi
cd ~/bin/timers/wmtimer-2.92/wmtimer
./wmtimer -e ./done -t $tid -c &
hour=$(echo $tid | awk 'BEGIN { FS=":"}; {print $1}')
min=$(echo $tid | awk 'BEGIN { FS=":"}; {print $2}')
sec=$(echo $tid | awk 'BEGIN { FS=":"}; {print $3}')
... |
//
// NTJBilateralFilterRunner.h
// BilateralFilter
//
// Created by <NAME> on 1/06/2016.
// Copyright © 2016 nojo inc. All rights reserved.
//
#import <TargetConditionals.h>
#if TARGET_OS_OSX
#import <Cocoa/Cocoa.h>
#define IMAGE NSImage
#else
#import <UIKit/UIKit.h>
#define IMAGE UIImage
#endif
@interface NTJB... |
package evilcraft.worldgen.structure;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import evilcraft.api.Helpers;
import evilcraft.api.StairSlabMetadataHelper;
import evilcraft.api.StairSlabMetadataHelper.SlabType;
import evi... |
<reponame>sbnair/PolkaJS
declare const _default: {
rpc: {};
types: {
PoolId: {
_enum: {
Loans: string;
DexIncentive: string;
DexSaving: string;
Homa: string;
};
};
};
};
export default _default;
|
#!/usr/bin/env bash
export DEBIAN_FRONTEND=noninteractive
umask 022
set -e
set -x
apt-get update -yq
apt-get install --no-install-suggests -yq software-properties-common
apt-add-repository -y ppa:chris-lea/redis-server
apt-get update -yq
apt-get install --no-install-suggests -yq \
build-essential \
byobu \
cu... |
<filename>sources/xroxy.js<gh_stars>100-1000
'use strict';
var anonymityLevels = {
'Transparent': 'transparent',
'Distorting': 'anonymous',
'Anonymous': 'elite',
'Socks4': 'anonymous',
'Socks5': 'anonymous',
};
var defineFeed = function(url) {
return {
url: url,
paths: {
group: 'rss/channel/0/item',
i... |
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)
describe "Thread#keys" do
it "returns an array of the names of the thread-local variables as symbols" do
th = Thread.new do
Thread.current["cat"] = 'woof'
Thread.current[:cat] = 'meow'... |
<gh_stars>0
package health
import (
"github.com/aaawoyucheng/wayne/src/backend/models"
)
type DatabaseCheck struct {
}
func (dc *DatabaseCheck) Check() error {
_, err := models.Ormer().
QueryTable(new(models.Cluster)).
Count()
if err != nil {
return err
}
return nil
}
|
const express = require('express');
const app = express();
// List of users
const users = [
{ username: 'user1', password: '1234' },
{ username: 'user2', password: '5678' },
{ username: 'user3', password: 'abcdef' }
];
app.get('/', (req, res) => {
// Display a list of all authorized users
res.status(200).json(u... |
#!/bin/sh
celery -A corec.endpoints.ping --config=celeryconfig worker -l INFO
|
json.extract! @game_action, :description, :created_at, :updated_at
|
<html>
<head>
<title>User Profile Form</title>
</head>
<body>
<h1>User Profile Form</h1>
<form>
<label for="user_name">Name</label>
<input type="text" name="user_name" />
<label for="user_email">Email Address</label>
<input type="text" name="user_email" />
<input type="submit" value="Submit" />
... |
#!/bin/bash
#leave all jars in build
HADOOP_DIR=hadoop-0.18.0-mac01
TARFILE=hadoop18.tar
rm -r hadoop-0.18.0-mac01
mkdir $HADOOP_DIR
mkdir $HADOOP_DIR/bin $HADOOP_DIR/conf $HADOOP_DIR/lib $HADOOP_DIR/chukwa
cp ../build/chukwa-hadoop-0.0.1-client.jar $HADOOP_DIR/lib
cp log4j.properties.templ $HADOOP_DIR/conf/log4j.pro... |
<gh_stars>0
package com.crossover.trial.weather.repository;
import java.util.HashMap;
import java.util.Map;
import com.crossover.trial.weather.domain.AirportData;
/**
* A Repository of the Weather.
*
* @author <EMAIL>
*/
public class WeatherRepository {
/**
* Internal performance counter... |
#!/bin/bash
mkdir -p data_/;
wget -O data_/chen_neuron_dataset.zip https://janelia.figshare.com/ndownloader/articles/7272617/versions/4;
|
from pykeyboard import PyKeyboard
import math
class PhoneShortCuts:
def __init__(self):
self.k = PyKeyboard()
self.starter_path = "stouch "
self.max_x = 347
self.max_y = 650
def home(self):
full_command = self.starter_path + "button 1 1\n"
self.k.type_string(ful... |
from typing import List
def max_difference(nums: List[int]) -> int:
if len(nums) < 2:
return 0
max_diff = 0
min_val = nums[0]
for num in nums:
if num < min_val:
min_val = num
else:
max_diff = max(max_diff, num - min_val)
return max_diff |
<gh_stars>0
package pulse.ui.components;
import static java.util.Objects.requireNonNull;
import static org.jfree.chart.plot.PlotOrientation.VERTICAL;
import org.jfree.chart.ChartFactory;
import org.jfree.data.statistics.HistogramDataset;
import org.jfree.data.statistics.HistogramType;
import pulse.search.statistics.... |
import { FormGroup } from '@angular/forms';
export class UserModel {
id = 0;
firstName = '';
lastName = '';
userName = '';
email = '';
admin = false;
workType = '';
password = '';
imageUrl = '';
public static createInstance(id: number, form: FormGroup) {
const user = ne... |
// Docs on event and context https://www.netlify.com/docs/functions/#the-handler-method
const faunadb = require('faunadb'),
q = faunadb.query;
exports.handler = async (event, context) => {
try {
var client = new faunadb.Client({ secret: process.env.FAUNADB_ADMIN_SECRET });
var result = await client.query(... |
<gh_stars>1-10
package com.report.adapter.swapi.client.vo;
import com.fasterxml.jackson.databind.JsonNode;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import ... |
set -e
current_branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p')
if [ $current_branch != "develop" ]
then
echo "[ERROR] To be able to deploy you need to be on the develop branch"
exit 1
fi
st=$(git status --porcelain 2> /dev/null)
if [[ "$st" != "" ]];
then
echo "[ERROR] To be able to deploy, 'git st... |
#!/bin/bash
# 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 ... |
<gh_stars>0
/*
* search.c --
*
* Point searching.
*
* *********************************************************************
* * Copyright (C) 1985, 1990 Regents of the University of California. *
* * Permission to use, copy, modify, and distribute this *
* * software and its docu... |
<reponame>litentry/LitentryWebDemo<filename>src/styles/fonts.ts
export default {
bold: 'ManifoldCF-Bold',
light: 'ManifoldCF-Light',
regular: 'Manifold CF',
roboto: 'Roboto-regular',
robotoBold: 'Roboto-Bold',
robotoLight: 'Roboto-Light',
robotoMedium: 'Roboto-Medium',
robotoMono: 'RobotoMono-Regular',
robotoM... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.