text stringlengths 27 775k |
|---|
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Hash;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Support\Facades\Validator;
use Il... |
var gulp = require('gulp'),
utils = require('./gulp-utils.js'),
watch = require('gulp-watch'),
eventStream = require('event-stream'),
ngAnnotate = require('gulp-ng-annotate');
gulp.task('copy',function() {
var applicationSources = ['app/modules/**/*.js'],
demoSources = ['demo/**/*.js', 'd... |
using System;
using System.Text;
using System.IO;
using System.Xml;
using NUnit.Framework;
using Google.GData.Client;
using Google.GData.Apps;
namespace Google.GData.Apps.UnitTests
{
[TestFixture]
[Category("GoogleApps")]
public class AppsExceptionTest
{
private AppsException exception;
... |
---
label: ML506
---
The ML506 platform corresponds to the ML505 platform for all but the FPGA
device. Refer to [ML505](../ML505/) for pinout information.
|
// Load balancers control how requests are distributed among multiple endpoints.
package loadbalance
import (
. "github.com/mailgun/vulcan/endpoint"
. "github.com/mailgun/vulcan/middleware"
. "github.com/mailgun/vulcan/request"
)
type LoadBalancer interface {
// This function will be called each time locaiton wou... |
package com.sap.olingo.jpa.metadata.core.edm.mapper.impl;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.olingo.commons.api.... |
---
title: "Tutorial: third-party login"
lang: en
layout: readme
source: loopback-example-passport
keywords: LoopBack
tags: example_app
sidebar: lb2_sidebar
permalink: /doc/en/lb2/Tutorial-third-party-login.html
summary: A tutorial on setting up authentication using Passport.
---
|
"""\
Defines a Property and two handlers used by choice, combo_box, radio_box, list_box
@copyright: 2002-2007 Alberto Griggio
@copyright: 2016 Carsten Grohmann
@copyright: 2016-2020 Dietmar Schwertberger
@license: MIT (see LICENSE.txt) - THIS PROGRAM COMES WITH NO WARRANTY
"""
import new_properties as np
import commo... |
import 'package:json_annotation/json_annotation.dart';
part 'access_token.g.dart';
@JsonSerializable(createToJson: false)
class AccessToken {
final String token;
final String userId;
final DateTime expiredAt;
final DateTime refreshExpiredAt;
final DateTime createdAt;
const AccessToken({
required this... |
export interface Metadata {
title: string
artist: string
author: string
offset: number
}
export interface INote {
tick: number
lane: number
width: number
}
export const FLICK_TYPES = ['no', 'middle', 'left', 'right'] as const
export type Flick = typeof FLICK_TYPES[number]
export interface IDirectional ... |
package no.nav.pensjon.selvbetjeningopptjening.security.masking;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class MaskerTest {
@Test
void maskFnr_masks_other_fnr_digits_than_birthDate() {
assertEquals("123456*****", Masker.maskFnr("12345678901"));
}
... |
$(function () {
$.ajaxSetup({ cache: false });
function getRequest(url, callback) {
var dfd = jQuery.Deferred();
$.get(url, function(data) {
dfd.resolve(callback(data));
});
return dfd.promise();
}
function getQuestionsStats() {
var dfd = jQuery.Deferred();
$.when(
getRequest("api/feedbackC... |
import { createAction } from 'redux-actions';
import { ActionTypes, Consts } from '@constants';
import { Actions, Resource } from 'typings';
import { defaultFailure, endLoading, startLoading } from '@actions';
const success = createAction<Actions.GetResourcesPayload, string, Resource.GetResourceResponse>(
ActionType... |
package de.uulm.se.couchedit.processing.common.testutils.model
class SimpleSubclassTestElement(id: String, x: String, val z: String) : SimpleTestElement(id, x) {
override fun copy() = SimpleSubclassTestElement(id, x, z).also { it.probability = this.probability }
override fun contentEquivalent(other: Any?): Bo... |
require 'http'
module IPFS
module Commands
class Cat
def self.call(client, node)
HTTP.get("#{client.api_url}/cat?arg=#{node}&stream-channels=true").to_s
end
end
end
end
|
#!/bin/zsh -v
# helloShell.sh
function mt_test {
echo "hello, test"
}
mt_run() {
echo "hello, run"
}
|
package org.gotson.komga.infrastructure.jooq
import org.assertj.core.api.Assertions.assertThat
import org.gotson.komga.domain.model.Series
import org.gotson.komga.domain.model.SeriesSearch
import org.gotson.komga.domain.model.makeLibrary
import org.gotson.komga.domain.persistence.LibraryRepository
import org.junit.jup... |
import { Border } from "../../../themes";
import { FC } from "react";
import { List, ListItem } from "../../List";
import { BorderBlock } from "./BorderBlock";
import React from "react";
interface Props {
borders: { name: string; border: Border }[];
onBorderSelect: (borderName: string) => void;
}
export const Bor... |
# Week10-12 SQL-Engine-&-Parser
> 学习SQL的解析&执行,撰写实验报告。
|
---------------------------------------------------------------------
-- LUCENE Domain Index Admin Methods --
---------------------------------------------------------------------
create or replace package body LuceneDomainAdm as
procedure createQueue(prefix VARCHAR2) is
begin
DBMS... |
#!/bin/bash
povray $1 +W1600 +H1200 -D 2>/dev/null;
rm *.pov
|
<?php
declare(strict_types=1);
namespace Tasker\Model\User\Domain;
/**
* Class UserName
* @package Tasker\Model\User\Domain
*/
class UserName
{
/**
* @var string
*/
private $firstName;
/**
* @var string
*/
private $lastName;
/**
* @param string $firstName
* @param string $lastName
* @return Us... |
using Windows.UI.Xaml.Controls;
namespace UITests.Shared.Windows_UI_Xaml.Resources
{
public sealed partial class XamlLocalResources : Page
{
public XamlLocalResources()
{
this.InitializeComponent();
}
}
internal class CustomTemplateSelector : DataTemplateSelector
{
}
}
|
use super::{
data::{MqttTwoBytesInt, MqttVariableBytesInt},
error::DataParseError,
packet::Packet,
parsable::*,
props::{MqttPropValue, PropOwner, Properties, Property},
reason::PubAckReasonCode,
};
use bytes::{Buf, BufMut};
#[derive(Clone)]
pub struct PubAck {
// 2.2.1 Packet Identifier
... |
package auth
import (
"github.com/Komplementariteten/lutra"
)
type Env struct {
User string
Config *lutra.LutraConfig
}
var Environment Env
func init() {
Environment.User = ""
Environment.Config = &lutra.LutraConfig{}
}
|
define([
'app',
'services/users'
], function(app) {
app.registerController('UsersCtrl', ['$scope', '$state', 'users', function($scope, $state, users) {
users.getUsers(function () {
$scope.users = users.users;
});
}]);
});
|
// PSI_ELEMENT: org.jetbrains.kotlin.psi.KtProperty
// OPTIONS: usages
data class A(public val field: Int) {
public val field<caret>: String
}
fun main(args: Array<String>) {
val a = A(10)
println(a.field)
}
// DISABLE-ERRORS |
class ChangeMembershipStartAndEndDateColumnsToDate < ActiveRecord::Migration
def change
change_column :memberships, :starts_at, :date
change_column :memberships, :ends_at, :date
end
end
|
class ApplicationController < ActionController::Base
include UsersHelper
private
def logged_in?
unless current_user
flash[:notice] = 'Please, login!'
redirect_to sign_in_path
end
end
end
|
#!/bin/bash
set -euo pipefail
function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; }
function finish { >&2 echo -en "\033[0m"; }
trap finish EXIT
NAME=${1}
GIT_REPO_URL=${2}
VERSION=${3}
LINK_TYPE=${4}
SCHEME=${5:-"$NAME"}
mkdir .build
pushd .build
step "Clone $GIT_REPO_URL"
git clone "$GIT_REPO_URL" repo
st... |
# uvex
Exercise on libuv
## Install `libuv`
```
$ git clone git@github.com:libuv/libuv.git
$ cd libuv
$ sh autogen.sh
$ ./configure
$ make
$ make check
$ sudo make install
```
> https://github.com/libuv/libuv
## Reference
- https://github.com/thlorenz/libuv-dox
|
import os
import unittest
from pathlib import Path
from home_nmap.query import NDISHtml
class NDISHtmlTestCase(unittest.TestCase):
def setUp(self) -> None:
self.ndishtml = NDISHtml()
def test_get(self):
raw_html = self.ndishtml.get('cpe:/a:openbsd:openssh:8.0')
self.assertIsNotNone(... |
/*
Package transactions contains Go-native Tx structs and related code around
Transactions.
*/
package transactions
|
import React from 'react';
import { Button } from '~/components/atoms/Button';
import * as Card from '~/components/atoms/Card';
export interface MediaProps extends Omit<Card.CardRootProps, 'cardLayout'> {
/** Paragraph content. */
body: React.ReactNode | string;
/** Primary call to action. */
ctaPrimary?: Rea... |
---
title: Get the position of an element relative to the document
category: DOM
---
```js
const getPosition = (ele) => (
(r = ele.getBoundingClientRect()), { left: r.left + window.scrollX, top: r.top + window.scrollY }
);
// Example
getPosition(document.body); // { left: 0, top: 0 }
```
|
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\ProductTypes;
class ProductTypeController extends Controller
{
public function index() {
$items = ProductTypes::all();
return view ('admin/productType/index', compact('items'));
}
public function create() {
... |
# EIIN839 - ECUE Service oriented computing/WS
## TD2 Noté
[+] La liste des méthodes est affichée dans la console quand on démarre le serveur HTTP BasicWebServerUrlParser
- System.String Home(System.Collections.Specialized.NameValueCollection)
- Int32 Incr(System.Collections.Specialized.NameValueCollection)
- System.... |
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*
*/
namespace Magento\Cms\Model\Wysiwyg\Images;
use Magento\Framework\App\Filesystem\DirectoryList;
/**
*
* @SuppressWarnings(PHPMD.LongVariable)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class Storag... |
const { User } = require("./user.js");
class UsersManager {
constructor(client){
this.client = client;
}
fetch(...params){
return new User(this.client, ...params).fetch();
}
cache = new Map()
}
module.exports.UsersManager = UsersManager; |
package jbok.core.messages
import jbok.core.models.BlockHeader
import scodec.bits.ByteVector
case class GetBlockHeaders(block: Either[BigInt, ByteVector], maxHeaders: BigInt, skip: BigInt, reverse: Boolean)
extends Message
case class BlockHeaders(headers: List[BlockHeader]) extends Message
|
import { OnInit } from '@angular/core';
import { ChangeDetectionStrategy } from '@angular/core';
import { Component } from '@angular/core';
import { OnDestroy } from '@angular/core';
import { Store } from '@ngrx/store';
import { PageService } from '../../../components/shared/page.service';
import { AppState } from '../... |
#include<iostream>
class copyconstr
{
int num1;
int num2;
public:
copyconstr() //inline constructor
{
std::cout<<"Enter the two number:"<<std::endl;
std::cin>>num1>>num2;
}
copyconstr(copyconstr &obj);
void mod();
};
copyconstr::copyconstr(copyconstr &obj)
{
num1=obj.num1;
num2=obj.num2;
}
void co... |
## Syntax
`string scalar ferrortext(real scalar ec)`
`real scalar`<span class="nowrap"> _
`freturncode(real scalar ec)`
|
package storage
import (
"context"
"errors"
"sync"
)
var (
// ErrNotFound returns when a key is not
// found in the storage.
ErrNotFound = errors.New("not found")
)
// Storage represents abstraction
// for key/value storage.
type Storage interface {
Set(ctx context.Context, key, value interface{})
Get(key in... |
<?php
/**
* This is the model class for table "Attachments".
*
* The followings are the available columns in table 'Attachments':
* @property integer $id
* @property string $model_name
* @property integer $model_id
* @property string $path
* @property string $date_add
* @property string $date_modify
* @prope... |
package com.luo.redisware.config.raw;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import redis.clients.jedis.JedisShardInfo;
/**
* Redis实例配置,包括 master slave
*
* @author xiangnan
* date 2018/3/20 14:20
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class RedisCon... |
# xDS
xDS stands for [fill in the blank] Discovery Service. It provides dynamic config discovery/updates.
tldr: xDS can use the filesystem, REST, or gRPC. gRPC xDS comes in four flavors.
However, Envoy code uses all of that via the same Subscription interface.
If you are an Envoy developer with your hands on a valid ... |
<?php
namespace Tests\Feature\API;
use App\User;
use App\Snippet;
use Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
class MostCopiedSnippetsTest extends TestCase
{
use RefreshDatabase;
protected $test_route_name = 'api.snippets.index';
protected $test_verb = 'get';
/** @test *... |
# inclusive-chart-vite
## 概要
- https://scrapbox.io/c4j/インクルーシブチャート
## 開発
### 最低限のインストールとセットアップをする
- https://scrapbox.io/c4j/GitHubでの共同開発への参加の準備 を読んで以下のセットアップをしてください
- git
- GitHub アカウント
- GitHub Desktop (任意)
- Visual Studio Code (推奨)
- nvm (推奨)
- Node.js v16.13.2
### Fork して clone する
- https://scrapb... |
# CleanArchitertPlurasight
https://app.pluralsight.com/library/courses/adapting-clean-architecture-android-apps/table-of-contents
|
using Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace DSETrending.Controllers.Api
{
//[Route("api/[controller]")]
public class Def... |
package com.foryouandme.researchkit.step.start
import android.os.Bundle
import android.view.View
import com.foryouandme.R
import com.foryouandme.databinding.StepStartBinding
import com.foryouandme.entity.configuration.button.button
import com.foryouandme.researchkit.step.StepFragment
class StartStepFragment : StepFr... |
---
layout: single
title: "3장 연결 데이터 표현"
categories: coding
---
## 7. 헤더 노드
- ##### 기존의 연결리스트 처리 알고리즘
- 첫 번째 노드나 마지막 노드 그리고 리스트가 공백인 경우를 예외적인 경우로 처리해야함
- ##### 헤더 노드 추가
- 예외 경우를 제거하고 코드를 간단하게 하기 위한 방법
- 연결 리스트를 처리하는 데 필요한 정보를 저장 (ex. 리스트의 길이)
- 헤더 노드의 구조가 리스트의 노드 구조와 같을 필요는 없음
- 헤더 노드에는 필요 정보를 저장
1. ... |
using System;
using System.Collections.Generic;
namespace SteelDoorRecipeAPIOdata
{
public partial class Person
{
public Person()
{
AccountManagers = new HashSet<AccountManager>();
PersonReviews = new HashSet<PersonReview>();
Recipes = new HashSet<Recipe>();... |
// Copyright (c) 2016-2017 Chef Software Inc. and/or applicable contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unl... |
import 'package:flutter/widgets.dart';
abstract class Authenticator {
/// Returns a widget builder for action button
WidgetBuilder get action;
/// Authenticate user
Future<void> authenticate(BuildContext context, [Map parameters]);
}
|
package me.rezscripts.rpgexperience.motd;
import me.rezscripts.rpgexperience.AbstractManagerCore;
import me.rezscripts.rpgexperience.RPGCore;
import me.rezscripts.rpgexperience.utils.RScheduler;
import org.bukkit.ChatColor;
import org.bukkit.event.EventHandler;
import org.bukkit.event.server.ServerListPingEvent;
im... |
//
// Author:
// Aaron Bockover <abock@xamarin.com>
//
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Reflection;
using Xamarin.Interactive.Core;
using Xamarin.Interactive.Representations.Reflection;
names... |
package org.hexworks.zircon.internal.component.impl.textedit.transformation
import org.hexworks.zircon.internal.component.impl.textedit.EditableTextBuffer
import org.hexworks.zircon.internal.component.impl.textedit.TextBufferTransformation
import org.hexworks.zircon.internal.component.impl.textedit.cursor.MovementDire... |
(this["webpackJsonpparami-finance"]=this["webpackJsonpparami-finance"]||[]).push([[13],{1581:function(a,n){}}]);
//# sourceMappingURL=13.b5b47fc4.chunk.js.map |
#pragma once
#include <DirectXMath.h>
using namespace DirectX;
namespace Doremi
{
namespace Core
{
enum class RigidBodyGeometry : int
{
dynamicSphere,
dynamicBox,
dynamicCapsule,
staticBox,
staticSphere,
mesh,
};
... |
package com.tamsiree.rxkit
import android.app.Activity
import android.content.pm.PackageManager
import androidx.core.app.ActivityCompat
import java.util.*
/**
*
* @author Tamsiree
* @date 2017/8/18
*/
object RxPermissionsTool {
@JvmStatic
fun with(activity: Activity?): Builder {
return Builder(act... |
#ifndef RAYTRACING_COLOR_HEADER_
#define RAYTRACING_COLOR_HEADER_
#include "Vector.h"
namespace raytracing{
template<typename T>
class ColorT: public Vector3<T>
{
public:
ColorT(T x = 0, T y = 0, T z = 0):
Vector3<T>(x, y, z)
{}
// element wise operator
ColorT operator+(const Vector3<T> v) ... |
import Command from './Command'
const ENABLED = Object.freeze({ disabled: false })
export default class FindAndReplaceCommand extends Command {
getCommandState (params, context) {
const fnr = context.findAndReplaceManager
if (!fnr) return { disabled: true }
switch (this.config.action) {
case 'ope... |
package org.aws4s.dynamodb
import org.aws4s.core.ParamValidator
sealed abstract class KeyType(val raw: String)
extends DynamoDbParam[String](
"KeyType",
ParamValidator.noValidation,
)
object KeyType {
case object Hash extends KeyType("HASH")
case object Range extends KeyType("RANGE")
}
|
name := "Silk Core"
version := "2.6.0-SNAPSHOT"
libraryDependencies += "com.rockymadden.stringmetric" % "stringmetric-core" % "0.25.3"
libraryDependencies += "com.thoughtworks.paranamer" % "paranamer" % "2.5.7"
libraryDependencies += "org.clapper" % "classutil_2.10" % "1.0.3"
libraryDependencies += "org.scalatest"... |
package poc.repository
import org.slf4j.LoggerFactory
import poc.model.*
import poc.support.ExtensionFunctions.asSAttribute
import poc.support.ExtensionFunctions.retrieveLong
import poc.support.ExtensionFunctions.retrieveS
import poc.support.ExtensionFunctions.toSAttributeValue
import software.amazon.awssdk.http.SdkHt... |
# -*- encoding: utf-8 -*-
require 'spec_helper'
require 'eaco/controller'
RSpec.describe Eaco::Controller do
#pending '.authorize'
#pending '.permission_for'
end
|
from django.contrib.auth.models import User
from rest_framework.generics import ListCreateAPIView, RetrieveUpdateDestroyAPIView
from rest_framework.permissions import IsAdminUser
from profiles.api.serializers.user_serializers import UserSerializer
class UserDetails(RetrieveUpdateDestroyAPIView):
serializer_class... |
name := """kingwilliams--slackbot"""
version := "1.0"
scalaVersion := "2.12.4"
scalacOptions in (Compile, doc) ++= Seq("-doc-root-content", baseDirectory.value+"/README.txt")
libraryDependencies ++= Seq(
"org.specs2" % "specs2-core_2.12" % "3.8.9" % Test
, "com.github.gilbertw1" %% "slack-scala-client" % "0.2.2... |
from utils.common import read_config
from utils.sagemaker_integration import sagemaker_integration
import pandas as pd
data = pd.read_json('{"fixed acidity":{"0":7.4},"volatile acidity":{"0":0.7},"citric acid":{"0":0},"residual sugar":{'
'"0":1.9},"chlorides":{"0":0.076},"free sulfur dioxide":{"0"... |
import { CodedocTheme } from './theme';
export declare function useTheme(theme: CodedocTheme): void;
|
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name="Striptease",
version="0.1.0",
description="Bindings to the Strip control software",
author="Stefano Sartor, Maurizio Tomasi",
author_email="",
url="https://github.com/lspestrip/striptease",... |
package org.http4s.rho.swagger
import Arbitraries._
import munit.ScalaCheckSuite
import org.http4s.rho.swagger.models.Swagger
import org.scalacheck.Prop._
import scala.jdk.CollectionConverters._
class SwaggerSuite extends ScalaCheckSuite {
property(
"The Swagger model can be translated to a 'Java' Swagger mode... |
import { Injectable } from '@nestjs/common';
import { ObjectId } from 'mongodb';
import { EntitySchemaFactory } from 'src/data/entity-schema.factory';
import { Todo } from 'src/entities/todo';
import { TodoSchema } from './todo.schema';
@Injectable()
export class TodoSchemaFactory
implements EntitySchemaFactory<Todo... |
import { HttpException, HttpStatus, Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Idea } from 'src/ideas/idea.entity';
import { User } from 'src/users/user.entity';
import { Repository } from 'typeorm';
import { CommentDTO } from './comment.dto';
import { Comment } fro... |
-- https://gist.github.com/seisvelas/d60f5f2caf232dceede0326169014418
WITH RECURSIVE fib(fibonacci, nextFib, nth) AS (
SELECT 0, 1, 0
UNION ALL
SELECT nextFib, fibonacci + nextFib, nth + 1
FROM fib
WHERE nth < 45 -- Integer out of range kluge
)
SELECT nth, fibonacci
FROM fib
WHERE nth = 29;
|
@testset "Topology" begin
@testset "FullTopology" begin
# 2 triangles
elems = connect.([(1,2,3),(4,3,2)])
t = FullTopology(elems)
@test paramdim(t) == 2
@test connec4elem(t, 1) == (1,2,3)
@test connec4elem(t, 2) == (4,3,2)
@test nvertices(t) == 4
@test nelements(t) == 2
@test nface... |
package com.thumbtack.thumbprint
import android.view.View
/**
* Contains a [View] and a value. Used for chaining.
*/
class ViewWithValue<out V : View, out T : Any>(
val view: V,
val value: T
) {
/**
* Applies the given block to the [View] provided to this [ViewWithValue] with the value.
*/
... |
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! Notes from the FFTW3.0.1 f77_wisdom.f file:
!
! This is an example implementation of Fortran wisdom export/import
! to/from a Fortran unit (file), exploiting the generic
! dfftw_export_wisdom/dfftw_import_wisd... |
import { IEnvironment } from './ienvironment';
export const environment: IEnvironment = {
production: true,
envName: 'mock',
env: {
NODE_TLS_REJECT_UNAUTHORIZED: '0',
},
server: {
host: process.env.HOST || '0.0.0.0',
domainUrl: process.env.DOMAIN_URL || 'http://localhost:3000',
port: proces... |
class Api::V1::MatchesController < ApplicationController
before_action :requires_login, only: [:create, :show, :index, :destroy]
def index
@matches = Match.all
render json: @matches
end
def show
@match = Match.find(params[:id])
render json: @match, status: :ok
end
def create
@match = ... |
package models
import (
"database/sql"
"time"
)
type Response struct {
UserID int
VoteID int64
Result bool
Date time.Time
}
func (response Response) Save(db *sql.DB) (bool, error) {
prepare, err := db.Prepare("INSERT OR REPLACE INTO responses(" +
"user_id," +
"vote_id," +
"result," +
"date) " +
"v... |
import { useContext, useState, useEffect } from 'react'
import { EthContext } from '../context/EthContext'
import Web3 from 'web3'
export const useTableData = (tableName, tableSchema, isAdmin) => {
const [ethConfig, ] = useContext(EthContext)
const [tableData, setTableData] = useState([])
useEffect(() => {
... |
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Deployment do
describe 'state machine' do
context 'when deployment succeeded' do
let(:deployment) { create(:deployment, :running) }
it 'schedules Dora::DailyMetrics::RefreshWorker' do
freeze_time do
expect(::Dora::... |
const Discord = require("discord.js");
const config = require("../config.json");
const Blacklist = require("../modules/blacklist.js");
module.exports.run = async (bot, message, args) => {
if(message.author.id !== "249593620255080459" && message.author.id !== "469999926861103124") return;
if(args[1] == "add"){
... |
Treetex
=======
`treetex` is a tool for drawing/visualising Merkle trees.
Ensure you have `LaTeX` installed on your system if you want to use this; the
tool outputs `LaTeX` commands to stdout, and so needs to be used in conjuction
with that.
For debian-derived systems, `sudo apt install texlive` should do the trick.... |
package routers
import (
"net/http"
"logCollect/cmd/logManager/controllers"
"github.com/astaxie/beego"
"github.com/astaxie/beego/context"
)
func init() {
// 路由过滤器,在进入后台之前进行session判断
beego.InsertFilter("/admin/*", beego.BeforeRouter, filterFunc)
beego.Router("/", &controllers.LoginController{})
beego.Router(... |
/* Copyright 2019 UpStart Commerce, 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 applicable law or agre... |
require_relative "test_helper"
# Internal: The test for Plaid::Processor.
class PlaidProcessorTest < PlaidTest
def setup
create_item initial_products: [:auth]
end
def test_stripe_bank_account_token_create_invalid_account_id
processor_token_create_request = Plaid::ProcessorStripeBankAccountTokenCreateReq... |
#! /bin/bash
set -e
pip-compile -o test_requirements.txt requirements.in test_requirements.in
cp test_requirements.txt requirements.txt
pip-compile -o requirements.txt requirements.in
|
namespace PayEx.Client
{
internal class NoOpLogger : ILogPayExHttpResponse
{
public void LogPayExResponse(string responseBody)
{
}
}
} |
# Version: 2.0.23
## Credits
Name | Work | Github
--- | --- | ---
CorrM | Created [CheatGear](https://github.com/CorrM/cg) used to dump | [CorrM](https://github.com/CorrM)
Jani | Helped me understand and use the tool for dumping this SDK | [MadCatzAno](https://github.com/MadCatzAno)
0xD | (me) Dumped the SDK from the... |
package org.nypl.simplified.ui.catalog
import androidx.paging.PageKeyedDataSource
import com.google.common.base.Preconditions
import org.nypl.simplified.accounts.api.AccountReadableType
import org.nypl.simplified.feeds.api.Feed
import org.nypl.simplified.feeds.api.FeedEntry
import org.nypl.simplified.feeds.api.FeedLoa... |
#ifndef OUTPUT_STATISTICS_H
#define OUTPUT_STATISTICS_H
#include <string> // std::string
#include "Population.h"
void output_statistics(//const char *resultDir,
//const std::string& img_name_withoutExtension,
const int size_i,
const int size_j,
const float perIVS,
... |
<?
include ("../config.php");
include ("./module_config.php");
$link = dbConnect();
$nb=0;
?>
<?
$title = _("Anix - Maintenance du site");
include("../html_header.php");
setTitleBar(_("Maintenance"));
?>
<br><br><br><br><br>
<center>
<img src='../images/unavailable.gif' border='0' alt="<?php echo _("Indisponib... |
# frozen_string_literal: true
module ServiceActor
# Ensure your inputs and outputs are not nil by adding `allow_nil: false`.
#
# Example:
#
# class CreateUser < Actor
# input :name, allow_nil: false
# output :user, allow_nil: false
# end
module NilCheckable
def self.included(base)
... |
#!/bin/sh
WPA_SUP_BIN="/usr/sbin/wpa_supplicant"
WPA_SUP_PNAME="wpa_supplicant"
WPA_SUP_PIDFILE="/var/run/wpa_supplicant.$IFACE.pid"
WPA_COMMON_CTRL_IFACE="/var/run/wpa_supplicant"
WPA_SUP_OPTIONS="-B -P $WPA_SUP_PIDFILE -i $IFACE -u"
VERBOSITY=0
if [ -s "$IF_WPA_CONF" ]; then
WPA_SUP_CONF="-c $IF_WPA_CONF"
else
... |
package common
type Peer struct {
PeerID PeerID `bencode:"peer_id"`
IP Address `bencode:"ip"`
Port int `bencode:"port"`
}
|
package typingsSlinky.storybookPolymer.mod
import scala.scalajs.js
import scala.scalajs.js.`|`
import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess}
@js.native
trait Story extends js.Object {
def add(storyName: String, callback: RenderFunction): this.type = js.native
d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.