text stringlengths 27 775k |
|---|
import {StatelessWidget} from '../../src';
export class HelloWidget extends StatelessWidget {
constructor(){
super({});
}
render(): string {
return `
<h1>Hello World!!</h1>
`
}
} |
import { DarkTheme } from "../.internal/themes/DarkTheme";
export default DarkTheme; |
import { Route, Switch } from 'react-router-dom';
import { CreatePage, EditPage, HomePage, NotFoundPage } from './routes';
import type { VFC } from 'react';
import './styles/global.css';
const App: VFC = () => {
return (
<Switch>
<Route exact path="/">
<HomePage />
</Route>
<Route exact... |
package main
import (
"fmt"
log "github.com/sirupsen/logrus"
core "github.com/iamsmartad/cronshot/pkg/core"
)
func handleClientRequest(evt string, msg []byte) error {
log.Printf("got %v", evt)
switch evt {
case "createSchedule":
core.CreateScheduledJob(msg, watchResources["CronJob"])
case "deleteSchedule"... |
using System;
namespace Cake.Console.CommandApp
{
internal sealed class TypeResolver : Spectre.Console.Cli.ITypeResolver
{
private readonly IServiceProvider provider;
public TypeResolver(IServiceProvider provider)
=> this.provider = provider;
public object Resolve(Type typ... |
import 'package:flutter/material.dart';
import '../shared/loan_calculations.dart';
import '../bolcs/loan_item_splits_bloc.dart';
import './loan_emi_bar_chart.dart';
class LoanEmiCard extends StatelessWidget {
final bool computed;
final LoanItemSplitsBloc loanSplitsBloc;
final Color positiveColor, negativeColor... |
package shaders
import java.nio.FloatBuffer
import org.joml.{Matrix4f, Vector3f, Vector4f}
import org.lwjgl.system.MemoryStack._
import org.lwjgl.opengl.{GL11, GL20}
import rendering.{Attenuation, Color, PointLight}
import scala.collection.mutable
import scala.io.Source
case class ShaderProgram(handle: Int) {
var... |
class Card
attr_accessor :suit, :value
def initialize(suit, val)
@suit = suit
@value = val
end
def kind_of
@value + ' of ' + @suit + 's'
end
end |
title: django.db.migrations.loader MigrationLoader Example Code
category: page
slug: django-db-migrations-loader-migrationloader-examples
sortorder: 500011176
toc: False
sidebartitle: django.db.migrations.loader MigrationLoader
meta: Python example code for the MigrationLoader class from the django.db.migrations.loader... |
#!/bin/bash
# Testing Workflow
#
# References:
#
# - https://docs.doppler.com/docs/install-cli#usage
# - https://github.com/sindresorhus/trash-cli
# - https://github.com/istanbuljs/nyc
# - https://github.com/piotrwitek/ts-mocha
# - https://mochajs.org/#command-line-usage
# 1. Remove stale coverage output
trash covera... |
<?php
namespace App\Console\Import;
use Illuminate\Console\Command;
use Facades\App\Services\Hash;
use DB;
use Carbon\Carbon;
use Validator;
use App\Traits\LoggableCommand;
class ParticipantsCommand extends Command
{
use LoggableCommand;
/**
* The name and signature of the console command.
*
* @var strin... |
package utils
import (
"errors"
"strings"
"testing"
"github.com/stretchr/testify/suite"
)
type ErrorsStackTestSuite struct {
suite.Suite
}
func TestErrorsStackTestSuite(t *testing.T) {
suite.Run(t, new(ErrorsStackTestSuite))
}
func (suite *ErrorsStackTestSuite) TestErrorHandling() {
errorStack := NewErrorS... |
/**
* Copyright Deloitte Digital 2019
*
* This source code is licensed under the BSD-3-Clause license found in the
* LICENSE file in the root directory of this source tree.
*/
import {css as _css, CSSResult} from 'lit-element';
// Proxy css in case we ever change how this works
export const css = _css;
// Priva... |
# class MissingMethod
# #overriden the missing method
# def method_missing(method,*args)
# puts "You called: #{method}(#{args.join(', ')})"
# puts "(You also passed it a block)" if block_given?
# end
# end
class MissingComputer
def initialize(computer_id, data_source)
@id = computer_id
@data_source = data_... |
import { PhaseManager } from '@travetto/base';
import { State } from '../runner/runner';
export class StandardWorker {
static async run(opts: State) {
try {
const { Compiler } = await import('@travetto/compiler');
// Pre compile all
Compiler.compileAll();
const { Runner } = await import... |
import React from "react";
import { compose, lifecycle, withHandlers, withState } from "recompose";
import { withRouter } from "react-router-dom";
import { faCog, faCopy, faQrcode } from "@fortawesome/free-solid-svg-icons";
import { CopyToClipboard } from "react-copy-to-clipboard";
import mapper from "../../utils/conn... |
import { Characteristic as C } from '../../constants';
import { D6 } from '../../models/dice';
import DiceValue from '../../models/diceValue';
import { MODIFIERS as m } from '../../models/modifiers';
import Unit from '../../models/unit';
import WeaponProfile from '../../models/weaponProfile';
export const chainraspHor... |
<?php
namespace Etki\Kit\Stream\Test\Support\Helper;
/**
* A helper to standardize tests versus different streams.
*
* @version 0.1.0
* @since 0.1.0
* @package Etki\Kit\Stream\Test\Support\Helper
* @author Etki <etki@etki.name>
*/
class StreamTestHelper
{
}
|
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2008 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
"""Mapping from raw JSON data structures to Python objects and vice versa.
>>> from couchdb import ... |
<?php
namespace Routy;
use Routy\Exceptions\MethodNotAllowed;
/**
* A simple request class that processes the current HTTP request for RouteMatcher
*/
class Request
{
const METHOD_GET = 'GET';
const METHOD_POST = 'POST';
const METHOD_PUT = 'PUT';
const METHOD_DELETE = 'DELETE';
const ME... |
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd ${DIR}/../../.. # repo top level
set -e
set -x
export https_proxy=http://proxy-chain.intel.com:912/
export http_proxy=http://proxy-chain.intel.com:912/
export no_proxy=127.0.0.1,localhost,*.intel.com
sudo -E -H -u yocto -g yocto /yocto/work_dir... |
require 'spec_helper'
require 'puppet/cloudpack'
describe Puppet::Face[:node_aws, :current] do
before :all do
data = Fog::Compute::AWS::Mock.data['us-east-1'][Fog.credentials[:aws_access_key_id]]
data[:images]['ami-12345'] = { 'imageId' => 'ami-12345' }
data[:key_pairs]['some_keypair'] = { 'keyName' => '... |
<script>
function effetJava(){
var _page= document.getElementById("page");
_page.style.height= "85%";
}
setTimeout(effetJava, 700);
</script> |
export const isBetween = (number: number, lowerbound: number, upperbound: number): boolean => {
return number > lowerbound && number < upperbound;
};
|
package typingsSlinky.ionic
import typingsSlinky.ionic.definitionsMod.IConfig
import typingsSlinky.ionic.definitionsMod.IPCMessage
import typingsSlinky.ionic.definitionsMod.IonicContext
import org.scalablytyped.runtime.StObject
import scala.scalajs.js
import scala.scalajs.js.`|`
import scala.scalajs.js.annotation.{JSG... |
/**
* Inspire.js A11y Plugin
*
* Helps to make slides more keyboard and screen reader friendly by
* providing the following:
*
* - Sets `role` for each slide for semantic context
* - Sets `aria-roledescription` for each slide for extra context
* - Sets `aria-label` for each slide to provide an accessible name
... |
/********************************************************************++
Copyright (c) Microsoft Corporation. All rights reserved.
--********************************************************************/
using System.Management.Automation.Host;
using Dbg = System.Management.Automation.Diagnostics;
namespace System.Man... |
#!/bin/bash
# Displays any enabled password length requirement from the authentication domain for the Jamf Connect user.
#
# Data Type: String
# Input Type: Script
#
# Copyright (c) 2022 JAMF Software, LLC
##### Script starts here #####
#Get current signed in user
currentUser=$(ls -l /dev/console | awk '/ / { print $3... |
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SEIDR.Doc.FormatHelper;
namespace SEIDR.Test
{
[TestClass]
public class DocHelperTest
{
[TestMethod]
public void Del... |
select date_add('2000-01-01 00:00:00.0', INTERVAL '1.999999' SECOND_MILLISECOND);
select date_add('2000-01-01 00:00:00.0', INTERVAL '1.99999' SECOND_MILLISECOND);
select date_add('2000-01-01 00:00:00.0', INTERVAL '1.9999' SECOND_MILLISECOND);
select date_add('2000-01-01 00:00:00.0', INTERVAL '1.999' SECOND_MILLISECOND)... |
# proxy Configuration Options
Autogenerated by `gen-docs.py` at 2021-07-13 16:43:15
### Global Configuration
| Parameter |Description| Default |
|-------------------------|-----------|----------------------------|
|global.sidecar.version | |1.6.3 |
|... |
# alpinejs
- [Official Site](https://alpinejs.dev)
## Notes
### From official docs [link]()
#### Lifecycle
x-init
#### State (Data Handling)
x-data
x-model
#### Directives (Template Handling)
x-text
x-show
x-for
x-if
x-html
#### Events (Change Handling)
x-on (@)
x-effect
$watch
x-bind (:)
|
package se.radicalcode.aoc
import java.util.*
import kotlin.test.assertEquals
import kotlin.test.assertFalse
import kotlin.test.assertNull
import kotlin.test.assertTrue
import org.junit.Test as test
class Test7 {
@test fun test7A(){
println(
takeNext(
resultString = "",
... |
%%%-------------------------------------------------------------------
%%% @author forgottenEntity
%%% @doc
%%%
%%% @end
%%% Created : 07. Feb 2019 20:16
%%%-------------------------------------------------------------------
-module(yarc).
-author("forgottenEntity").
%% API
-behaviour(application).
-export([stop/1,
... |
$average_age = 939/16; # yields 58.6875 (58 in C)
$average_age = int 939/16; # yields 58
|
(function(){
var editorBarCtrl = ['$scope', '$state', 'pickerSvc', function($scope, $state, pickerSvc) {
$scope.chooseElement = function() {
pickerSvc.showElementPicker()
.then(function(data) {
$scope.elements.list.push(data);
})
.catch(function(err) {
console.log("Error gettin... |
import 'package:flutter/material.dart';
import 'package:flutter_base_ui/bloc/base_list_stateless_widget.dart';
import 'package:flutter_base_ui/flutter_base_ui.dart';
import 'package:open_git/bean/juejin_bean.dart';
import 'package:open_git/bloc/flutter_hot_bloc.dart';
import 'package:open_git/common/config.dart';
impor... |
<?php
include_once __DIR__.'/vendor/autoload.php';
use OudyPlat\Template;
use OudyPlat\Object;
use OudyPlat\Page;
use OudyPlat\Session;
use OudyPlat\MySQL;
Template::$configuration = new Object(array(
'name'=> 'default'
));
Page::$pages = array(
'/'=> array(
'component'=> 'page',
'task'=> 'h... |
import LegalAssociationsTerrorismValidator from './legalassociationsterrorism'
import { battery } from './helpers'
describe('Legal associations terrrorism component validation', function () {
it('validate associations in terrorism', () => {
const tests = [
{
props: {},
expected: false
... |
require 'ffi'
module Fibonacci
extend FFI::Library
ffi_lib 'target/release/libfibonacci.so'
attach_function :fibonacci, [:uint32], :uint64
end
numbers = (0..9).map { |n| Fibonacci.fibonacci(n) }
puts numbers.join(', ')
|
import 'dart:async';
import 'package:bloc/bloc.dart';
import 'package:built_collection/built_collection.dart';
import 'package:meta/meta.dart';
import 'package:notable/bloc/notes/notes.dart';
import 'package:notable/bloc/text/text_events.dart';
import 'package:notable/entity/entity.dart';
import 'package:notable/model... |
package xyz.teamgravity.postsktorclient.data.remote
import io.ktor.client.*
import io.ktor.client.request.*
import io.ktor.http.*
import xyz.teamgravity.postsktorclient.data.remote.dto.PostDto
class PostsApiImpl(private val client: HttpClient) : PostsApi {
override suspend fun getPosts(): List<PostDto> {
... |
<?php
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slider\SliderManager\ActionBar;
use Nextend\Framework\View\AbstractBlock;
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\Button\BlockButtonPlain;
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\FloatingMenu\BlockFloatin... |
var xed-exception-enum_8h =
[
[ "xed_exception_enum_t", "xed-exception-enum_8h.html#a49126b5e9b22f54161f21c31248faf4d", null ],
[ "str2xed_exception_enum_t", "group__ENUM.html#ga7f97deb562fc5e4d308cedc814e1bce7", null ],
[ "xed_exception_enum_t2str", "group__ENUM.html#gae2a3f205539390ed30f22f2bbb56b7d7", nu... |
plugins {
id("com.android.application")
id("kotlin-android")
id("kotlin-android-extensions")
id("kotlin-kapt")
id("androidx.navigation.safeargs.kotlin")
}
apply(from = "../ktlint.gradle.kts")
android {
compileSdkVersion(29)
buildToolsVersion("29.0.3")
defaultConfig {
application... |
//
// LDKEditableButton.h
// LDCore
//
// Created by Bryan Nagle on 12/17/13.
// Copyright (c) 2013 Liquid Analytics. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "LDCButton.h"
#import "LDKEditableLabel.h"
#define LDKEDITABLE_BUTTON_DELETE_BUTTON_INSET_LEFT 10.0f
... |
##########################################
# Code from https://github.com/joansj/hat
##########################################
import os,sys
import os.path
import numpy as np
import torch
import torch.utils.data
from torchvision import datasets,transforms
from sklearn.utils import shuffle
import urllib.request
from P... |
package event_bak
type AsyncEvent struct{
Name string
Tag string
Data map[string]interface{}
}
func NewAsyncEvent(name string, tag string) *AsyncEvent{
instance := new(AsyncEvent)
instance.Name = name
instance.Tag = tag
return instance
} |
module Admin::ArticlesHelper
FILTER_TYPES = %w(approved unapproved) unless const_defined?(:FILTER_TYPES)
def status_icon
@status_icon ||= { :unpublished => %w(orange bstop.gif),
:pending => %w(yellow document.gif),
:published => %w(green check.gif) }
end
... |
using System.Configuration;
namespace WebEditor
{
internal static class Config
{
public static bool AzureFiles
{
get { return ConfigurationManager.AppSettings["AzureFiles"] == "true"; }
}
}
} |
/// <reference types="cypress" />
describe('Player without admin access', () => {
beforeEach(() => {
cy.prepareRoom()
})
it('Should persist selected numbers on reload', () => {
cy.get('[data-test-class="cell-number"]')
.eq(0)
.should('not.have.class', 'bg-orange-400')
cy.get('[data-test... |
# Mr. Robot
## Scanning
Ran nmap quick scan
``` bash
sudo nmap -sS -F -T5 10.10.31.9
```
![[f769f203af6e4d04b531d986fa985f27.png]]
Two ports are open (**80,443**) which are running webservers.
One port is closed (**22**) which is running ssh.
## Webserver on 80
The front end is similar to a flash video game. You can ... |
/*
Copyright © 2022 Mike Messmore <mike@messmore.org>
*/
package srv
type Store interface {
addOnline(Online)
addUpdatesAvailable(UpdatesAvailable)
getUpdatesAvailable(string) ([]string, error)
addRebootRequired(RebootRequired)
getRebootRequired(string) (bool, error)
getHosts() []Host
daHosts() map[string]Host
... |
import './style.scss';
import * as React from 'react';
import * as d3 from 'd3';
import { IWaybackItem } from '../../types';
interface IProps {
waybackItems: Array<IWaybackItem>;
activeWaybackItem: IWaybackItem;
rNum4WaybackItemsWithLocalChanges: Array<number>;
shouldOnlyShowItemsWithLocalChange: bool... |
#!/bin/bash
USAGE="\
Usage: correct-host-timezone-offset.sh < +hh:mm | -hh:mm >
Correct a virtualizaiton guest's clock when it is set to the local time and the
guest is expecting the virtualized hardware clock to be in UTC.
The single argument is given as the local time zone's positive or negative
offset in hours an... |
module Block2.Task1
(
removeAt
) where
removeAt :: Eq a => Int -> [a] -> Maybe (a, [a])
removeAt idx l = case rest of
x : xs -> Just (x, start ++ xs)
[] -> Nothing
where
(start, rest) = splitAt idx l
|
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
import Control.Monad.IO.Class ( liftIO )
import Data.Aeson ( Object )
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as C8
import Servant
import Servant.GitHub.Webhook
import Network.Wai ( Application... |
# encoding: utf-8
##
# This file is auto-generated. DO NOT EDIT!
#
require 'protobuf/message'
module ElloProtobufs
##
# Message Classes
#
class Category < ::Protobuf::Message; end
##
# Message Fields
#
class Category
required :uint32, :id, 1
required :string, :slug, 2
required :string, ... |
/*
* Copyright 2014-2015 Groupon, Inc
* Copyright 2014-2015 The Billing Project, LLC
*
* The Billing 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 copy of the License at:
*
* http... |
---
title: "GCP Local SSDs"
date: "2022-02-18"
tags:
- gcp
- data
- storage
---
## Overview
- Fastest block storage solution
- Attached directly to [Compute Engine](notes/GCP%20Compute%20Engine.md) VMs
- Zonal
- 375 GB disks
- Expandable to 3, 6 or 9 TBs—combined into a single logical volume
- IOPs increase with di... |
struct FrameworkSubStruct {
const char * name;
unsigned version;
};
|
import torch
import math
train_x = torch.linspace(0, 1, 100)
train_y = torch.stack([
torch.sin(train_x * (2 * math.pi)) + torch.randn(train_x.size()) * 0.2,
torch.cos(train_x * (2 * math.pi)) + torch.randn(train_x.size()) * 0.2,
], -1)
train_z = torch.stack([
torch.sin(train_x * (2 * math.pi)) + torch.rand... |
package org.oppia.android.scripts.maven
/** Utility class to extract the license text from a given URL. */
interface LicenseFetcher {
/** Scrapes and returns the text from a given URL. */
fun scrapeText(link: String): String
}
|
module params
using Pkg.TOML
using DSP
export MicOptics, SimulationParams, Constants, ParameterSet, Space, MicroLensArray, LightFieldSimulation
struct MicOptics
ftl::Float64
fobj::Float64
M::Float64
NA::Float64
a0::Float64
b0::Float64
lambda::Float64
n::Float64
d::Float64
fu... |
<?php
function g($key) {
if (isset($_GET[$key])) {
return $_GET[$key];
}
return false;
}
function p($key) {
if (isset($_POST[$key])) {
return $_POST[$key];
}
return false;
}
?>
|
// used for line
const sampleData = {
datacollection: {
labels: [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday"
],
datasets: [
{
label: "Week 1",
pointBackgroundColor: "white",
borderColor: "#FF8A80",
... |
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef MOJO_PUBLIC_CPP_BASE_MESSAGE_PUMP_TYPE_MOJOM_TRAITS_H_
#define MOJO_PUBLIC_CPP_BASE_MESSAGE_PUMP_TYPE_MOJOM_TRAITS_H_
#include "base/component_ex... |
# rviz_spacenav
Move around in Rviz using [Spacenav](http://spacenav.sourceforge.net/)
## How To Build
```bash
cd /path/to/catkin/workspace/src
wget https://raw.githubusercontent.com/rkoyama1623/rviz_spacenav/master/rosinstall -O /tmp/rosinstall
wstool init && wstool merge /tmp/rosinstall
wstool update
rosdep install... |
package com.intel.analytics.zoo.pipeline.deepspeech2.pipeline.acoustic
import org.apache.spark.ml.Transformer
import org.apache.spark.ml.param._
import org.apache.spark.ml.util._
import org.apache.spark.sql.types._
import org.apache.spark.sql.{DataFrame, Dataset, Row}
class TimeSegmenter ( override val uid: String)... |
function prepend_path() {
PATH="$1:$PATH"
}
function append_path() {
PATH="$PATH:$1"
}
prepend_path "/usr/local/bin"
unset prepend_path
unset append_path
|
# Docker engine installation on centos 7/8
See [official documentation](https://docs.docker.com/engine/install/centos/).
- install prerequisites
`yum install dos2unix curl -y` - install dos2unix and curl
- download, convert and run the script
`curl http://...install_docker_engine.sh | dos2unix | sh` where [this](... |
package org.phenocraft.data.remote.repository
/**
* Service Bank end.
*/
interface PhenoCraftService {
} |
package com.edt.ut3.backend.database.daos
import androidx.room.*
import com.edt.ut3.backend.notification.EventChange
@Dao
interface EdtChangeDao {
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun insert(vararg ev: EventChange): List<Long>
@Update(onConflict = OnConflictStrategy.REPLACE)
... |
# Change Log
All notable changes to Sylvan will be documented in this file.
## [Unreleased]
### Added
- This CHANGELOG file.
|
package execption.checked_exception;
import java.io.File;
import java.io.IOException;
import java.util.Scanner;
public class FileReadScanner_NoLoop {
public static void main(String [] args){
try {
File file = new File("D:\\test\\file.txt");
Scanner sc = new Scanner(file);
... |
module ComoniconBuilder
using Libdl
using Logging
using ComoniconTypes
using ComoniconOptions
using ComoniconZSHCompletion: emit_zshcompletion
using PackageCompiler
@static if VERSION < v"1.7-"
"""
pkgdir(m, xs...)
Return the subdirs in given root of module `m`.
"""
function Base.pkgdir(m::Mo... |
using System;
using System.Collections.Generic;
using System.Text;
namespace Tokyo.Service.Abstractions
{
public interface ITrackerJobBuilder// TODO <TUserJob> where TUserJob : ITrackerJob
{
ITrackerJob Build();
ITrackerJobBuilder Configure(IEnumerable<KeyValuePair<string, object>> optionValue... |
# frozen_string_literal: true
# PostReceiveService class
#
# Used for scheduling related jobs after a push action has been performed
class PostReceiveService
attr_reader :user, :project, :params
def initialize(user, project, params)
@user = user
@project = project
@params = params
end
def execute... |
# frozen_string_literal: true
module ExceptionHandler
extend ActiveSupport::Concern
included do
rescue_from ActionController::RoutingError, with: :render_404
rescue_from AbstractController::ActionNotFound, with: :render_404
rescue_from ActiveRecord::RecordNotFound, with: :render_404
rescue_from P... |
SUBROUTINE MKNAM (ival,istr,iret)
C *******************************************************
C Convert a numeric representation of Airport ID
C into a printable string. Airport id is packed into
C a single 36^4 number from 36 alphanumeric characters.
C
C IVAL Integer Value to unpack
C ISTR Character Character s... |
'use strict'
var isCI = require('is-ci')
var noop = function () {}
if (isCI) defeat()
function defeat () {
assert()
try {
tap(require('tap/lib/test'))
} catch (e) {}
try {
tape(require('tape/lib/test'))
} catch (e) {}
}
function assert () {
var ok = function () {}
ok.ok = noop
ok.fail = noop... |
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'package:gcloud/db.dart';
import 'package:github/server.dart';
import 'package:meta/meta.dart';
import '../model/appengine/c... |
const Promise = require('bluebird');
const _ = require('lodash');
module.exports = function(Model, app) {
const char = '_';
Model.getRelations = function(options) {
let templateData = options.templateData;
let item = options.item;
let relations = {};
let templateProps = [];
let templateLocals ... |
package test.com.mymark.api.client;
import java.util.HashMap;
import java.util.List;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.mymark.api.CartLineItemDto;
import com.mymark.api.CustomerDto;
import com.mymark.api.P... |
package fantasticfour.controllers;
import fantasticfour.controllers.service.ProductService;
import fantasticfour.entity.Product;
import fantasticfour.entity.Role;
import fantasticfour.entity.User;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.facto... |
package com.coffeebeans.tritiummonoid.sleepystalker
import android.content.Context
import android.content.SharedPreferences
import android.preference.PreferenceManager
import android.util.Log
import com.github.kittinunf.fuel.core.FuelError
import com.github.kittinunf.fuel.httpGet
import com.github.kittinunf.fuel.httpP... |
package Patro::N5;
use strict;
use warnings;
# Patro::N5. Proxy class for GLOB type references.
# we must keep this namespace very clean <--- is this true for GLOB?
use Carp ();
use overload
'*{}' => sub { ${$_[0]}->{handle} },
'-X' => \&Patro::N5x::dash_X,
'nomethod' => \&Patro::LeumJelly::overload_ha... |
#!/usr/bin/env bash
set -xe
if [[ "$WIPE_DATA" == true ]]; then
docker-compose -f docker-compose.yml down
else
docker-compose -f docker-compose.yml stop
fi
|
#!bin/bash
# Shell script to start chromium
chromium-browser http://localhost:8080 -start-fullscreen & |
package com.valhalla.lolchampviewer.repository
import com.valhalla.lolchampviewer.net.DataDragonApi
import com.valhalla.lolchampviewer.net.models.Champion
import com.valhalla.lolchampviewer.net.models.ChampionShort
interface ChampionsRepository {
suspend fun getChampions(): List<ChampionShort>
suspend fun get... |
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Welcome extends CI_Controller {
/**
* Index Page for this controller.
*
* Maps to the following URL
* http://example.com/index.php/welcome
* - or -
* http://example.com/index.php/welcome/index
* - or -
* Since this contro... |
package com.pmm.metro.demo.transfer
import android.util.Log
import com.pmm.metro.Ticket
import com.pmm.metro.transfer.Transfer
/**
* Author:你需要一台永动机
* Date:2019-05-14 16:51
* Description:
*/
class UserCheckTransfer : Transfer {
private val isLogin = false
override fun transfer(chain: Transfer.Chain): Ti... |
<?php
/*
* Copyright (c) 2012-2017 Veridu Ltd <https://veridu.com>
* All rights reserved.
*/
declare(strict_types = 1);
namespace App\Event\Manager;
use App\Event\AbstractEvent;
use League\Event\EventInterface;
/**
* UnhandledEvent event.
*/
class UnhandledEvent extends AbstractEvent {
/**
* Event rel... |
use std::error::Error;
use std::sync::Arc;
use futures::prelude::*;
use googleapis_raw::bigtable::v2::{bigtable::ReadRowsRequest, bigtable_grpc::BigtableClient};
use grpcio::{ChannelBuilder, ChannelCredentials, EnvBuilder};
fn main() -> Result<(), Box<dyn Error>> {
// An example database inside Mozilla's Bigtable... |
# frozen_string_literal: true
module HTMLProofer
class Failure
attr_reader :path, :check_name, :description, :status, :line, :content
def initialize(path, check_name, description, line: nil, status: nil, content: nil)
@path = path
@check_name = check_name
@description = description
... |
/*
* Copyright (C) 2016-2020 Lightbend Inc. <https://www.lightbend.com>
*/
package akka.remote.artery
import java.nio.ByteBuffer
import java.nio.ByteOrder
import java.nio.charset.Charset
import java.util.concurrent.TimeUnit
import org.openjdk.jmh.annotations._
import akka.util.Unsafe
@State(Scope.Benchmark)
@Out... |
<?php
include "../config/connection.php";
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn === false ) {
echo "Koneksi Gagal</br>";
die( print_r( sqlsrv_errors(), true));
}
$idPel = $_POST['idPel'];
$nik = $_POST['nik'];
$nama = $_POST['nama'];
$alamat = ... |
# Danger Brakeman
A Danger plugin for Brakeman.
## Installation
Add this line to your Gemfil.
gem 'danger-brakeman'
## Usage
Run Ruby files through Brakeman. Results are passed out as a inline comment.
brakeman.lint
## License
MIT
|
extern crate crypto;
use std::env;
use std::process;
use std::str::FromStr;
use crypto::md5::Md5;
use crypto::digest::Digest;
fn main() {
let args: Vec<_> = env::args().collect();
if args.len() < 2 {
println!("Warning: No key was input! Please input a key to run!");
process::exit(1);
}
... |
module Angelo
class Responder
include Celluloid::Logger
class << self
attr_writer :default_headers
# top-level setter
def content_type type
dhs = self.default_headers
case type
when :json
self.default_headers = dhs.merge CONTENT_TYPE_HEADER_KEY => JSON_T... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.