text stringlengths 1 1.05M |
|---|
require 'active_support/core_ext/hash/indifferent_access'
require 'active_support/json'
require 'aws-sdk-resources'
require 'shoryuken'
require 'ehonda/version'
require 'ehonda/logging'
require 'ehonda/configuration'
require 'ehonda/railtie' if defined? Rails
module Ehonda
class << self
def configure
@conf... |
#!/bin/bash -ex
set -xe
if [ "$(uname -m)" == "x86_64" ]; then
docker run --rm --privileged multiarch/qemu-user-static:register --reset
fi
export QEMU_STATIC_VERSION=v5.1.0-8
qemu_aarch64_sha256=58f25aa64f433225145226cc03a10b1177da8ece5c4a6b0fe38626c29093804a
qemu_arm_sha256=fa2d1f9794eac9c069b65d27b09ee0a12c82d2... |
def fibonacci(n):
if n < 0:
print("Incorrect input")
# First Fibonacci number is 0
elif n == 0:
return 0
# Second Fibonacci number is 1
elif n == 1:
return 1
else:
return fibonacci(n-1) + fibonacci(n-2) |
import {
Entity,
PrimaryGeneratedColumn,
DeleteDateColumn,
CreateDateColumn,
Column,
UpdateDateColumn,
ManyToMany,
JoinTable
} from 'typeorm';
@Entity('book')
export class BookEntity {
@PrimaryGeneratedColumn('uuid') id: string;
@CreateDateColumn() datecreated: Date;
@UpdateDateColumn() dateupdated: Date;... |
import merge from 'lodash.merge';
/** * Queries ** */
import {
schema as GetAllReactJSNews,
queries as GetAllReactJSNewsQueries,
resolvers as GetAllReactJSNewsResolver,
} from './reactjsnews.com/GetAllReactJSNews';
export const schema = [...GetAllReactJSNews];
export const queries = [...GetAllReactJSNewsQuerie... |
<filename>src/data/UserCtrlDB.java<gh_stars>0
package data;
import hibernate.HibernateUtil;
import java.util.List;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import datainterface.UserCtrl;
import domain.User;
public class UserCtrlDB implements UserCtrl {
private static UserCtrlDB instance... |
#!/bin/sh
echo "Starting experiment"
echo "dstat: 0 containers"
dstat -m -t -o cont-0.csv 1 10
echo "dstat: 1 container"
docker run -d reproduction
pmap -X $(pidof ./a.out) > pmap1.txt
dstat -m -t -o cont-1.csv 1 10
echo "dstat: 2 containers"
docker rm -f $(docker ps -a -q)
docker run -d reproduction
docker run -d re... |
#!/usr/bin/env sh
# 确保脚本抛出遇到的错误
set -e
# 提交项目源码
git init
git add -A
git commit -m 'commit code'
# 发布到 https://<USERNAME>.github.io master
git push -f git@github.com:hengguao/hengguao.git master
# 生成静态文件
npm run docs:build
# 进入生成的文件夹
cd docs/.vuepress/dist
# 如果是发布到自定义域名
# echo 'www.example.com' > CNAME
git init
g... |
#!/bin/bash
pip install /app/uvicorn
rm -rf /app/uvicorn/.*
rm -rf /app/uvicorn/*
printf "ALLOWED_HOSTS=['*']" >> /app/example/example/settings.py
"$@"
|
#!/bin/bash
# 2021-11-22 - Install docker-ce [mostly] according to the docker instructions:
# https://docs.docker.com/engine/install/centos/
if [[ "$(id -u)" != "0" ]]; then
echo "ERROR: must run as root" >&2
echo "HINT: sudo $0"
exit 1
fi
dnf remove -y \
docker \
docker-client \
docker-client-latest ... |
#!/bin/bash
# That Bash script extracts data from the
# 'por_schedule_all_uniq_YYYY_MM_to_YYYY_MM.csv.bz2'
# schedule-derived data file and derives a few other utility data files:
# * por_schedule_counts_YYYY_MM_to_YYYY_MM.csv:
# Number of weeks during which the POR have been present in schedules.
# * por_schedule... |
<filename>pkg/parser/arguments_parser_test.go
package parser
import (
"github.com/jensneuse/graphql-go-tools/pkg/lexing/position"
"testing"
)
func TestParser_parseArgumentSet(t *testing.T) {
t.Run("string argument", func(t *testing.T) {
run(`(name: "Gophus")`,
mustParseArguments(
node(
hasName("name"... |
/* eslint-env node, browser, jasmine */
const { makeFixture } = require('./__helpers__/FixtureFS.js')
const path = require('path')
const pify = require('pify')
const { plugins, statusMatrix, add, remove } = require('isomorphic-git')
describe('statusMatrix', () => {
it('statusMatrix', async () => {
// Setup
l... |
#!/usr/bin/env sh
# generated from catkin/cmake/template/local_setup.sh.in
# since this file is sourced either use the provided _CATKIN_SETUP_DIR
# or fall back to the destination set at configure time
: ${_CATKIN_SETUP_DIR:=/home/shw/catkin_ws_legoloam/src/LeGO-LOAM/LeGO-LOAM/build/devel}
CATKIN_SETUP_UTIL_ARGS="--ex... |
require 'chewy/search/parameters/storage'
module Chewy
module Search
class Parameters
# Just a standard hash storage. Nothing to see here.
#
# @see Chewy::Search::Parameters::HashStorage
# @see Chewy::Search::Request#script_fields
# @see https://www.elastic.co/guide/en/elasticsearch... |
<filename>VersionMonitorDeamon/src/com/cats/version/deamon/HttpDownloadFiles.java<gh_stars>0
/*
* Copyright 2015 lixiaobo
*
* VersionUpgrade project licenses this file to you 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... |
<reponame>wetherbeei/gopar<filename>src/github.com/tones111/go-opencl/cl/device.go
/*
* Copyright © 2012 go-opencl authors
*
* This file is part of go-opencl.
*
* go-opencl 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 ... |
#!/bin/bash
rm -f heron.wasm
rm -f heron.wat
emcc heron.cpp --no-entry -Os -s EXPORTED_FUNCTIONS=[_heron,_heron_int] -o heron.wasm
~/wabt/build/wasm2wat heron.wasm -o heron.wat |
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
* <a href="http://www.apache... |
#!/bin/bash
#;**********************************************************************;
#
# Copyright (c) 2016-2018, Intel 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:
#
# 1. Redistri... |
#!/bin/bash
OLD=$(pwd)
BASE=$( cd `dirname $0`/.. ; pwd )
cd $OLD
version=$(cat $BASE/ver/1config.version)
function clean(){
rm -rf /tmp/cljdoc
mkdir -p /tmp/cljdoc
rm -rf /tmp/stage
mkdir -p /tmp/stage
cd /tmp/stage
lein new project
cd $OLD
}
function build(){
rm -fr /tmp/stage/proj... |
<reponame>handexing/wish<filename>src/main/java/com/wish/entity/LeaveBill.java
package com.wish.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.CascadeType;
import ja... |
source build/envsetup.sh
export USE_CCACHE=1
export CCACHE_DIR=.ccache
prebuilts/misc/linux-x86/ccache/ccache -M 75G
lunch full_maguro-userdebug
time make -j6 && play frameworks/base/data/sounds/notifications/ogg/Capella.ogg
|
import React from 'react'
import styled from 'styled-components'
import { Link, useStaticQuery, graphql } from 'gatsby'
import { Img } from '../utils/styles'
import Slider from 'react-slick'
//Styles
const Wrapper = styled.div`
color: white;
text-align: center;
h2 {
position: relative;
top: 1rem;
fon... |
#!/bin/sh
set -e
ROOTDIR=dist
BUNDLE=${ROOTDIR}/PRACTICE1-Qt.app
CODESIGN=codesign
TEMPDIR=sign.temp
TEMPLIST=${TEMPDIR}/signatures.txt
OUT=signature.tar.gz
if [ ! -n "$1" ]; then
echo "usage: $0 <codesign args>"
echo "example: $0 -s MyIdentity"
exit 1
fi
rm -rf ${TEMPDIR} ${TEMPLIST}
mkdir -p ${TEMPDIR}
${CO... |
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CandidatePage } from './pages/candidate/candidate.page';
import { CandidatesPage } from './pages/candidates/candidates.page';
import { CRMemberPage } from './pages/crmember/crmember.page';
import { CRMembersPage }... |
#ifndef CROSS_HPP
#define CROSS_HPP
#include "complex-type.h"
#ifdef FFTW3
#include <fftw3-mpi.h>
#else
#include <fftw_mpi.h>
#endif
#include <algorithm>
#include <vector>
#include "allocator.hpp"
#include "distribution.hpp"
#include "solver.hpp"
#include <string.h>
// pgCC doesn't yet play well with C99 construc... |
/*
* 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 Sudoku_Final;
/**
*
* @author Admin
*/
public class Main_menu extends javax.swing.JFrame {
/**
* Creates new form... |
<filename>cascading-core/src/main/java/cascading/scheme/SourceCall.java
/*
* Copyright (c) 2007-2013 Concurrent, Inc. All Rights Reserved.
*
* Project and contact information: http://www.cascading.org/
*
* This file is part of the Cascading project.
*
* Licensed under the Apache License, Version 2.0 (the "Licens... |
<filename>codes/java/concurrency/src/main/java/tamp/ch12/Combine/Combine/Node.java
package tamp.ch12.Combine.Combine;
/*
* Node.java
*
* Created on October 29, 2005, 8:59 AM
*
* From "The Art of Multiprocessor Programming",
* by <NAME> and <NAME>.
* Copyright 2006 Elsevier Inc. All rights reserved.
*/
/**
* N... |
package jwt
import (
"context"
"strings"
"github.com/suisrc/auth.zgo"
"github.com/suisrc/res.zgo"
)
// GetBearerToken 获取用户令牌
func GetBearerToken(ctx context.Context) (string, error) {
if c, ok := ctx.(res.Context); ok {
prefix := "Bearer "
if auth := c.GetHeader("Authorization"); auth != "" && strings.HasPr... |
def editToMakePalindrome(string):
n = len(string)
table = [[0 for x in range(n)] for x in range(n)]
# Fill the string column by column
for gap in range(1, n):
i = 0
for j in range(gap, n):
if string[i] == string[j]:
table[i][j] = table[i + 1][j - 1] ... |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by <NAME>, <EMAIL>, All rights reserved.
# LLNL-CODE-647188
#
# For det... |
#!/bin/bash
set -e
kubectl apply -f ./metrics-server/metrics-server-insecure.yaml
sleep 10
# Check deployment
kubectl get deployment metrics-server -n kube-system
# Check pod status and ready
kubectl get pods -n kube-system -l k8s-app=metrics-server
# Check apiservice status
kubectl get apiservice v1beta1.metri... |
<reponame>lananh265/social-network<filename>node_modules/react-icons-kit/md/ic_menu_open.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ic_menu_open = void 0;
var ic_menu_open = {
"viewBox": "0 0 24 24",
"children": [{
"name": "path",
"attribs": {
"d": "M0 0... |
<gh_stars>0
import styled from 'styled-components';
const StylesStyles = styled.section`
background-color: red;
`;
export default StylesStyles;
|
"use strict"
const assert = require("power-assert");
const UserRepository = require("../../../src/game/UserRepository.js");
const JobRepository = require("../../../src/game/JobRepository.js");
const WeaponRepository = require("../../../src/game/WeaponRepository.js");
const MockBrain = require("../mock/Brain.js");
con... |
class Model:
def __init__(self):
self.name = ""
self.content = ""
@staticmethod
def new():
return Model()
def save(self):
# Implement the logic to save the object to the CMS
# This could involve database operations or file storage
def search(query):
# Imple... |
/**
* Created by rkapoor on 30/10/15.
*/
'use strict';
module.exports = function cssmin(grunt) {
// Load task
grunt.loadNpmTasks('grunt-contrib-cssmin');
// Options
return {
homePage: {
files: {
'public/css/production/homePage.min.css': [
'publ... |
<reponame>MauroDataMapper/mdm-ui
/*
Copyright 2020-2021 University of Oxford
and Health and Social Care Information Centre, also known as NHS Digital
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服务器
//http服务器是继承自tcp服务器 http协议是应用层协议,是基于TCP的。
//对请求和响应进行了包装
let http = require('http');
//req 流对象 是可读流
//res 是一个可写流 write
//发消息就等于客户端连接吗?不等于,当客户端连接上来之后先触发connection事件,
//然后可以多次发送请求,每次请求都会触发request事件。
let server = http.createServer();
let url = require('url');
//当客户端连接上服务器之后执行回调
server.on('connection', func... |
<gh_stars>100-1000
/*
* Copyright (C) 2012 Sony Mobile Communications AB
*
* This file is part of ApkAnalyser.
*
* 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.apac... |
<filename>plugin/src/com/microsoft/alm/plugin/idea/git/utils/GeneralGitHelper.java
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See License.txt in the project root.
package com.microsoft.alm.plugin.idea.git.utils;
import com.intellij.openapi.project.Project;
import com.intellij.... |
#!/bin/bash
########################################################################
# Test STMP info
# Part of mailsend-go muquit@muquit.com
########################################################################
readonly DIR=$(dirname $0)
source ${DIR}/env.txt
$MAILSEND -info -smtp $SMTP_SERVER -port $TLS_PORT
... |
const DarkMode = {
init({ toggle, currentTheme }) {
toggle.addEventListener('click', (event) => {
this._toggleSwitch(event);
});
if (currentTheme) {
document.documentElement.setAttribute('data-theme', currentTheme);
}
},
_toggleSwitch(e) {
e.stopPropagation();
const cekTheme ... |
'use strict'
// http://localhost:7651
// https://discordapp.com/oauth2/authorize?&client_id=199938847948275714&scope=bot
const _ = require('lodash-fp')
const pathJoin = require('path').join
// const ChildProcess = require('child_process')
const discord = require('discord.js')
const tldr = require('tldr/lib/index')
cons... |
<reponame>rcarlosdasilva/weixin
package io.github.rcarlosdasilva.weixin.core.exception;
public class CanNotFetchOpenPlatformAccessTokenException extends RuntimeException {
private static final long serialVersionUID = 9210125893488536696L;
}
|
package io.opensphere.csvcommon.detect.location.format;
import java.util.List;
import io.opensphere.core.model.LatLonAlt.CoordFormat;
import io.opensphere.core.model.LatLonAltParser;
import io.opensphere.core.util.lang.Pair;
import io.opensphere.csvcommon.detect.location.model.LatLonColumnResults;
import io.o... |
<gh_stars>0
package authoring.panels.attributes;
/**Allows users to change a String Field
* @author lasia
*
*/
public class StringInputField extends InputField {
public StringInputField(Setter set) {
super(set);
}
@Override
protected void updateField() {
String text = getTextField().textProperty().getVal... |
import assert from 'assert';
import 'jsdom-global/register';
import makeResources from './helperCreateResources.js';
import Container from '../../../src/meteoJS/modelviewer/Container.js';
import Display from '../../../src/meteoJS/modelviewer/Display.js';
import Modelviewer from '../../../src/meteoJS/Modelviewer.js';
... |
import React from 'react'
import Hero from './hero'
import renderer from 'react-test-renderer'
test('renders hero', () => {
const tree = renderer.create(<Hero />).toJSON()
expect(tree).toMatchSnapshot()
})
test('renders hero with title and brand', () => {
const tree = renderer.create(<Hero title='bacon' brand='... |
import UIKit
class HomeViewController: UIViewController {
@IBOutlet weak var budgetLabel: UILabel!
@IBOutlet weak var remainingLabel: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
let budget = 200
let spent = 150
budgetLabel.text = "Total Budget: \(budget)"
remainingLabel.text = "Remaining Bud... |
#!/bin/bash
set -x
kubectl delete --ignore-not-found=true svc,pvc,deployment -l app=wordpress
kubectl delete --ignore-not-found=true secret mysql-pass
kubectl delete --ignore-not-found=true -f local-volumes.yaml
kuber=$(kubectl get pods -l app=wordpress)
if [ ${#kuber} -ne 0 ]; then
sleep 120s
fi
echo 'newpassword' ... |
<reponame>thehyve/genetics-sumstat-data
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# <NAME>
import sys
def main():
header = []
# Read stdin
for line in sys.stdin:
header.append(line.rstrip())
# Write as single line
sys.stdout.write('\t'.join(header) + '\n')
if __name__ == '__main_... |
<filename>src/main/java/org/olat/commons/info/ui/InfoEditFormController.java
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>... |
package core
// DxfElement is the common interface for all Dxf elements.
// Common operations should be part of this interface.
type DxfElement interface {
Equals(other DxfElement) bool
}
|
exports.sessionOptions = {
store: undefined,
secret: 'glint hint',
name: 'glint.sid',
cookie: {secure: false},
resave: false,
saveUninitialized: false
};
|
<reponame>Midiman/stepmania
// LanguagesDlg.cpp : implementation file
#define CO_EXIST_WITH_MFC
#include "global.h"
#include "stdafx.h"
#include "smpackage.h"
#include "Foreach.h"
#include "LanguagesDlg.h"
#include "SpecialFiles.h"
#include "RageUtil.h"
#include "IniFile.h"
#include "languagesdlg.h"
#include "SMPackag... |
#!/bin/bash
# Copyright (c) The Diem Core Contributors
# SPDX-License-Identifier: Apache-2.0
function echoerr() {
cat <<< "$@" 1>&2;
}
#Check prerequists.
function check_command() {
for var in "$@"; do
if ! (command -v "$var" >/dev/null 2>&1); then
echoerr "This command requires $var to be insta... |
SELECT u.name, u.age
FROM user u
INNER JOIN ages a
ON (u.id = a.user_id) |
package org.mesh;
public enum Int implements Element {
ZERO, ONE, TWO, THREE, FOUR, FIFE, SIX, SEVEN, EIGHT, NINE;
}
|
registrar.addMethodCallDelegate(instance, channel: channel)
}
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
if call.method == "getBatteryLevel" {
let device = UIDevice.current
device.isBatteryMonitoringEnabled = true
if device.batteryState != .unknown {
let batter... |
<filename>pipeline/tests/builder/flow/test_node_output.py<gh_stars>10-100
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed und... |
#!/bin/bash
docker push hugodelval/lizardfs-admin
docker push hugodelval/lizardfs-cgi
docker push hugodelval/lizardfs-chunkserver
docker push hugodelval/lizardfs-master
docker push hugodelval/lizardfs-metalogger
docker push hugodelval/lizardfs-shadow
docker push hugodelval/lizardfs-client-stack
|
<gh_stars>0
package internal
import (
"fmt"
"regexp"
"strings"
)
type alterType int
const (
alterTypeNo alterType = iota
alterTypeCreate
alterTypeDropTable
alterTypeAlter
)
func (at alterType) String() string {
switch at {
case alterTypeNo:
return "not_change"
case alterTypeCreate:
return "create"
ca... |
#!/usr/bin/env bash
# For hardware mode PRuntime
LD_LIBRARY_PATH=/opt/intel/sgx-aesm-service/aesm /opt/intel/sgx-aesm-service/aesm/aesm_service &
nginx
echo "----------- starting blockchain ----------"
bash /root/console.sh purge
# bash /root/console.sh start alice > /root/alice.out 2>&1 &
# bash /root/console.sh s... |
<filename>common-db-timing/src/test/java/com/atjl/dbtiming/service/TimingDbHelperTest.java
package com.atjl.dbtiming.service;
import com.atjl.dbtiming.helper.TimingDbHelper;
import com.atjl.util.json.JSONFastJsonUtil;
import org.junit.*;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
... |
package com.projects.melih.baking.ui.recipe;
import android.arch.lifecycle.ViewModelProvider;
import android.arch.lifecycle.ViewModelProviders;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.sup... |
COMPANIES_LIST_RESPONSE_SCHEMA = {
'type': 'object',
'properties': {
'data': {
'type': 'array',
'items': {
'type': 'object',
'properties': {
'company_id': {'type': 'integer'},
'name': {'type': 'string'},
... |
#!/bin/bash -ue
sudo useradd -G sudo -m htinoco
sudo chpasswd -e <<< 'htinoco:$6$PoKVLFtelyThmfC9$NLEjyW52ZB1fnfzUi4G1x2w7y6oDmgftAqUUFqR4Hkl10s2EojwlguAEBs55i8qaj8OCOZhp8nb5KGJuFGmQF0'
sudo mkdir -p /home/htinoco/.ssh
sudo chmod 700 /home/htinoco/.ssh
echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCsbDDVfMnnURRZ9VjL/Hu... |
package com.crossover.trial.weather;
import org.junit.Assert;
import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import com.crossover.trial.weather.service.WeatherCollectorEndpoint;
import com.crossover.trial.weather.service.WeatherQueryEndpoint;
impo... |
<filename>src/main/java/com/bebel/web/util/MailUtils.java
package com.bebel.web.util;
import com.bebel.soclews.util.Logger;
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.JsonNode;
import com.mashape.unirest.http.Unirest;
import com.mashape.unirest.http.exceptions.UnirestException;
publ... |
<gh_stars>1-10
'use strict'
import { knex, Knex } from 'knex'
import { DatabaseManagerProxy } from './database-manager-proxy'
import { Application, ConfigStore } from '@supercharge/contracts'
export class DatabaseManager {
/**
* The application instance.
*/
private readonly app: Application
/**
... |
list = [0, 1, 0, 0, 1, 0]
sum = 0
for element in list:
count = 0
for index in range(len(list)):
if list[index] == element:
count += 1
sum += count |
import { setupReducer } from '../../src';
describe('the "create" method of setupReducer', () => {
const INITIAL_STATE = {};
const reducer = setupReducer(INITIAL_STATE).create();
it('should return function', () => {
expect(typeof reducer).toEqual('function');
});
it('should return initialState if state ... |
/**
* Example for a use case that is described, but does not have any scenarios yet (this is allowed)
*/
useCase('Example Empty Use Case with Fluent DSL')
.description('Use Case without any scenarios')
.labels(['example-custom-label'])
.describe(function () {
});
|
<filename>Notice-API/resolvers.js<gh_stars>1-10
const { GraphQLScalarType } = require("graphql");
// date format
function convertDate() {
function pad(s) {
return s < 10 ? "0" + s : s;
}
let d = new Date();
return [pad(d.getDate()), pad(d.getMonth()), d.getFullYear()].join("/");
}
// define date ... |
// Define the CustomType data structure
struct CustomType(i32);
impl CustomType {
// Implement the display method for CustomType
fn display(&self) -> String {
format!("Value: {}", self.0)
}
}
// Function to demonstrate the usage of CustomType
fn main() {
// Create an instance of CustomType
... |
#!/bin/sh
#MPosgreSQL設定
#環境変数で、PGHOST PGPORT PGDATABASE PGUSER PGPASSWORD、が設定されている前提
table_name='testtbl01'
#clear table
psql -c "CREATE TABLE ${table_name} (file_id integer, file_body bytea, PRIMARY KEY(file_id), UNIQUE(file_id) );"
psql -c '\dt'
echo "ALL COMPLETED!!!!" |
var clickTimer = null;
var resetTimer = null;
var clickCount = 0;
var activeLight = null;
setWatch(function() {
if (clickTimer !== null) {
clearTimeout(clickTimer);
clickTimer = null;
}
clickCount+=1;
clickTimer = setTimeout(function () {
clickTimer = null;
if(clickCoun... |
#!/bin/bash
kubectl apply --filename https://github.com/knative/eventing/releases/download/v0.20.0/eventing-crds.yaml;
kubectl apply --filename https://github.com/knative/eventing/releases/download/v0.20.0/eventing-core.yaml;
kubectl apply --filename https://github.com/knative/eventing/releases/download/v0.20.0/in-memo... |
<reponame>malfarom29/nestjs-movie-rental
import {
Controller,
UseGuards,
Post,
ValidationPipe,
Body,
Param,
Put,
ParseIntPipe,
Patch,
Delete,
} from '@nestjs/common';
import { MoviesService } from 'src/movies/services/movies.service';
import { AuthGuard } from '@nestjs/passport';
import { WhitelistT... |
<reponame>bowlofstew/blockchain-samples
package main
var samples = `
{
"contractState": {
"activeAssets": [
"The ID of a managed asset. The resource focal point for a smart contract."
],
"nickname": "TRADELANE",
"version": "The version number of the current contract"
... |
#!/bin/bash
declare -a folders=("csharp20" "csharp21" "java" "python" "golang" "nodejs8")
export AWS_PROFILE=personal
for i in `seq 1 1000`;
do
for folder in "${folders[@]}"
do
cd $folder
pwd
sls deploy --force
cd ..
done
node invoke-functions.js
done
|
<filename>vi/.vim/bundle/pencil/app/views/editors/StrokeEditor.js
function StrokeEditor() {
PropertyEditor.call(this);
}
__extend(PropertyEditor, StrokeEditor);
StrokeEditor.prototype.setup = function () {
//setting up dasharray
var STYLES = [ [Util.getMessage("stroke.style.solid"), ""],
... |
package com.hapramp.views.skills;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import and... |
package com.itstore.controllers;
import com.itstore.models.Category;
import com.itstore.models.Item;
import com.itstore.models.User;
import com.itstore.services.CategoryService;
import com.itstore.services.ItemService;
import com.itstore.services.LoginService;
import com.itstore.services.SessionService;
import com.its... |
def sortStrings(wordsList):
sorted_list = sorted(wordsList)
return sorted_list
wordsList = ["apple", "banana", "mango", "pear"]
sorted_words = sortStrings(wordsList)
print(sorted_words) |
<reponame>joshua-r/gl<filename>src/window.cpp
#include <window.hpp>
namespace gl {
Window::Window() : m_title{"New Window"} {}
Window::Window(std::string title) : m_title{title} {}
bool Window::init(const glm::uvec2& resolution, std::string monitor_name) {
// use the primary monitor by default
GLFWmonitor* moni... |
package org.allenai.ml.classification;
import com.gs.collections.api.map.primitive.ObjectDoubleMap;
import com.gs.collections.api.tuple.primitive.ObjectDoublePair;
public interface ProbabilisticClassifier<D, L> extends Classifier<D, L> {
ObjectDoubleMap<L> probabilities(D datum);
/**
* Default to just t... |
import Car from './car';
import { goodCarsId } from './home-utils';
export default class CarsApi {
constructor(
url = 'https://private-anon-66fbb79774-carsapi1.apiary-mock.com/',
) {
this.rootEndpoint = url;
this.allCarsEndpoint = `${url}cars`;
this.goodCarsId = goodCarsId;
this.dataPromise = t... |
package gitpipe
import (
"context"
"errors"
"fmt"
"io"
"sync"
"gitlab.com/gitlab-org/gitaly/v14/internal/git/catfile"
)
// CatfileObjectResult is a result for the CatfileObject pipeline step.
type CatfileObjectResult struct {
// err is an error which occurred during execution of the pipeline.
err error
// ... |
import re
def extract_class_info(code: str) -> dict:
class_info = {}
class_pattern = r'context\.registerClass\((\w+),\s+constructors=\((\w+),\s*(\w+)?\),\s*icon=\'(www\/\w+\.gif)?\'\)'
matches = re.findall(class_pattern, code)
for match in matches:
class_name = match[0]
form_name = mat... |
<filename>Lesson22/QuizTen.py
# Define a procedure is_palindrome, that takes as input a string, and returns a
# Boolean indicating if the input string is a palindrome.
# Base Case: '' => True
# Recursive Case: if first and last characters don't match => False
# if they do match, is the middle a palindrome?
def is_pal... |
#!/bin/bash
# Generate a random string
PASS=$(openssl rand -base64 12)
CA_CERTIFICATES_DIR=/usr/share/ca-certificates/safelocalhost
TEMP_DIR=$PWD/temp
ROOT_KEY=$TEMP_DIR/root_key.key
ROOT_CRT=$TEMP_DIR/root_crt.crt
SERVER_CSR=$TEMP_DIR/server.csr
SERVER_KEY=$TEMP_DIR/server.key
SERVER_CRT=$TEMP_DIR/server.crt
PEM=$T... |
#!/bin/bash
gcloud compute instances create $1 \
--zone us-west1-a \
--source-instance-template sniffles-template \
--create-disk=boot=yes,image=sniffles-image-v1,size=100GB \
--scopes=storage-full,compute-rw,logging-write \
--local-ssd=interface=NVME \
--metadata CHR=$2,THREADS=$3,CONFIG_FI... |
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package e2e
import (
"context"
"errors"
"sort"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"sigs.k8s.io/cli-utils/pkg/apply"
applyerror "sigs.k8s.io/cli-utils/pkg/app... |
var assert = require('..')
var a = 1
var b = 2
function test(fn) {
try {
fn()
} catch(e) {
console.info(e.message)
}
}
test(function() {
assert(a == b, '%d should equal %d!', a, b)
})
test(function() {
assert.ok(a == b, '%d should equal %d!', a, b)
})
test(function() {
assert.equal(a, b, 'asser... |
<gh_stars>1-10
#!/usr/bin/python
#
# from) $VIM/tools/demoserver.pyを拝借
#
# This requires Python 2.6 or later.
from __future__ import print_function
import json
import socket
import sys
import threading
import time
try:
# Python 3
import socketserver
except ImportError:
# Python 2
import SocketServer ... |
# frozen_string_literal: true
require 'rails'
require 'highline/import'
module DiscourseDev
class Config
attr_reader :config, :file_path
def initialize
default_file_path = File.join(DiscourseDev.root, "config", "dev.yml")
@file_path = File.join(Rails.root, "config", "dev.yml")
default_con... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.