text stringlengths 1 1.05M |
|---|
#!/bin/sh
# If a command fails then the deploy stops
set -e
printf "\033[0;32mDeploying updates to GitHub...\033[0m\n"
# Build the project.
hugo # if using a theme, replace with `hugo -t <YOURTHEME>`
# Go To Public folder
cd public
# Add changes to git.
git add .
# Commit changes.
msg="rebuilding site $(date)"
if... |
<filename>scripts/log_table_generation/inv_log_generate.c
/*
* Copyright (C) 2018-2020, Advanced Micro Devices, Inc. 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. Redistributions of sour... |
// import the necessary packages
const express = require('express');
const bodyParser = require('body-parser');
// create a new express app
const app = express();
// add body-parser middleware
app.use(bodyParser.json());
// create a list of user details
let users = [
{
id: 1,
name: "John Smith",
... |
package org.junithelper.core.meta;
import static org.junit.Assert.*;
import org.junit.Test;
public class ExceptionMetaTest {
@Test
public void type() throws Exception {
assertNotNull(ExceptionMeta.class);
}
@Test
public void instantiation() throws Exception {
Exce... |
#!/bin/bash
./.venv/bin/pytest
|
<gh_stars>0
import { DataTableComponent } from './data-table/data-table.component';
import { PageSizeChooserComponent } from './page-size-chooser/page-size-chooser.component';
import { PaginatorComponent } from './paginator/paginator.component';
import { SearchableDropdownComponent } from './searchable-dropdown/searcha... |
/*
* Copyright (c) 2018 Tsinghua University, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicabl... |
<gh_stars>1-10
const find = require('./utils/find')
/**
* Find exactly one entity or throw error
*
* @example
* findAll('errorSet', 'My error set')
* .then(errorSets => console.log('Found errorSets ', errorSets))
* .catch(console.error)
*
* @param {string} entity - name of entity
* @param {string} query
... |
#!/usr/bin/env bash
version=2
if [ -n "$HIPPO_BRANCH" ]; then
BRANCH="$HIPPO_BRANCH"
fi
CACHE_ROOT="${HOME}/.uoa-cache-root"
TPREFIX="/data/data/com.termux/files"
SCRIPT_DIR="${TPREFIX}/usr/etc/proot-distro"
INSTALL_FOLDER="${TPREFIX}/usr/var/lib/proot-distro/installed-rootfs"
DLCACHE="${PREFIX}/usr/var/lib/pro... |
<reponame>rmalired/microservices<gh_stars>0
/**
*
*/
package indiv.rakesh.microservices;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
imp... |
def is_anagram(str1, str2):
list_str1 = list(str1)
list_str1.sort()
list_str2 = list(str2)
list_str2.sort()
return (list_str1 == list_str2) |
from functools import reduce
from faker import Faker
from faker.providers import address
from sys import argv
from getopt import getopt
from pandas import DataFrame
def generate_row(carry, faker):
lat, long, _, country_code, city = faker.location_on_land()
carry['housing_type'].append(
faker.random_... |
package com.uber.myapplication;
import android.app.Activity;
import android.os.Bundle;
import android.os.PersistableBundle;
public class CoreActivity extends Activity {
private Object mOnCreateInitialisedField1;
private Object mOnCreateInitialisedField2;
@Override
public void onCreate(Bundle savedInstanceSt... |
import React from "react";
import "./LanguageSwitcherDropdown.scss";
import { languages } from "../../../i18n";
import useStoreSettingsSelector from "../../../hooks/useStoreSettingsSelector";
import { useDispatch } from "react-redux";
import { changeLanguage } from "../../../store/actions/settings";
import { Select, Me... |
The algorithm should traverse the string in a double loop and compare each character in the string with its corresponding character in the opposite direction. If the characters match, they should be marked as part of the palindrome. If, at any point, the characters do not match, the algorithm should return false and te... |
current_dir=$BASH_SOURCE
script_dir=$(dirname $0)
source_dir="$script_dir/../bin"
config_file="${script_dir}/conf.json"
theme_dir="${script_dir}/theme"
readme_file="${script_dir}/../README.md"
package_file="${script_dir}/../package.json"
output_dir="${script_dir}/html"
command -v jsdoc >/dev/null 2>&1 || { echo >&2 "I ... |
from datetime import datetime
class WebRequestManager:
def __init__(self):
self.requests = []
def add_request(self, request_type, status, reception_datetime, commit_datetime, request_body):
self.requests.append({
'request_type': request_type,
'status': status,
... |
let ServerItem = require('../Utility/ServerItem')
let Vector2 = require('../Vector2')
module.exports = class AIBase extends ServerItem {
constructor() {
super();
this.username = "AI_Base";
this.health = new Number(100);
this.isDead = false;
this.respawnTicker = new Number(0)... |
<gh_stars>1-10
#ifndef _EFFEL_ATA
#define _EFFEL_ATA 1
#include <stdint.h>
void ata_read(void* dst, uint64_t lba, size_t size, void* dpte);
#endif
|
public class Fibonacci {
public static void main(String[] args) {
int n = 10;
int first = 0, second = 1;
System.out.print("Fibonacci Series of "+n+" numbers:");
for (int i = 1; i <= n; ++i)
{
System.out.print(first + " + ");
int sum = first + second;
first ... |
<gh_stars>0
#!/usr/bin/env python2.7
# TODO: Error handling for upload.
import ConfigParser, json, subprocess, time, urllib, urllib2
config = ConfigParser.ConfigParser({
'rom_directory': '/home/pi/RetroPie/roms/',
'copies_to_retain': '30'
})
config.read(['./config.ini', '/opt/retropie/configs/retro-drop/config.i... |
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*------------------------------------------------------------... |
<filename>hashstore/bakery/lite/tests/backend_tests.py<gh_stars>1-10
import os
from hashkernel.bakery import NotFoundError
from hashstore.bakery.lite.node import ContentAddress
from hashstore.tests import TestSetup, seed, random_bytes
from ..node.blobs import BlobStore
from hashkernel.bakery import Cake
from hs_build_... |
<filename>vodmodule/doc.go<gh_stars>10-100
// Package vodmodule defines types and a Mapper type that provides the ability
// of mapping media content by a common prefix.
package vodmodule
|
SELECT Salary
FROM (SELECT DISTINCT Salary
FROM Employees ORDER BY Salary DESC)
AS Salaries
LIMIT 1 OFFSET n-1; |
<reponame>ContentPI/ui-k<gh_stars>1-10
import React from 'react'
import Text from './index'
const stories = {
component: 'Text',
props: [
{
name: 'align',
type: 'TextAlign',
default: 'left',
description: 'The alignament of the text',
},
{
name: 'className',
type: 'st... |
#!/bin/sh
# shellcheck disable=SC2039,SC2155
MIRROR_URI="http://dl-cdn.alpinelinux.org/alpine/$RELEASE"
APORTS_DIR="${APORTS_DIR:-/home/build}"
die() {
echo "$@" 1>&2
echo 1>&2
exit 1
}
# Prints names of repo's subdirs (i.e. abuilds) that contains APKBUILDs which
# has been changed/created in the specified revisi... |
<filename>src/store/modules/text.js
const state = {
commandTitle: "",
locationArrShow: [],
}
const getters = {
commandTitle(state) {
let info = JSON.parse(localStorage.getItem("commandTitle"))
if (!info) {
state.commandTitle = "请选择"
} else {
info.label = state.app.language === "zh-CN" ? i... |
wget https://raw.githubusercontent.com/m4rktn/jogan/master/jogan.py
rm jogan.py
mv jogan.py.1 jogan.py
python2 jogan.py
|
#ifndef _EEPROM_H
#define _EEPROM_H
#ifndef _EEPROM_C
#endif
//I2C and EEPROM Operate function.
unsigned char eeprom_read_byte(unsigned char addr);
void eeprom_write_byte(unsigned char addr, unsigned char dat);
void eeprom_read_multi(unsigned char *buffer, unsigned char addr, unsigned char len);
void eeprom_w... |
<reponame>vany152/FilesHash
//-----------------------------------------------------------------------------
// boost-libs variant/test/variant_plymorphic_get_test.cpp source file
// See http://www.boost.org for updates, documentation, and revision history.
//-------------------------------------------------------------... |
#!/bin/bash
# Copyright (c) 2021, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
#
# Initialize
script="${BASH_SOURCE[0]}"
scriptDir="$( cd "$( dirname "${script}" )" && pwd )"
warDir=$PWD
source ${scriptDir}/utils.sh
# Setting def... |
<reponame>luissaiz/apicheck<filename>refactor/old/apitest/actions/sendto/cli.py
# Copyright 2017 BBVA
#
# 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/LI... |
#!/bin/bash
set -e
R10K="/opt/puppetlabs/puppet/bin/r10k"
#FLAGS="-v debug"
FLAGS=""
PUPPET_UID=997 # 997=puppet
if [ $EUID -ne $PUPPET_UID ]; then
(>&2 echo $0 must be run as the puppet user)
exit 1
fi
# Args are repository, ref, deleted
if [ $# -ne 3 ]; then # Missing args, run full deploy
${R10K} deploy en... |
<filename>src/types.ts
import SingleSpa, { LifeCycles } from 'single-spa'
export interface Config {
port: number
mountPath: string
publicPath?: string // default same with mountPath
output?: string // default "dist"
default?: boolean // default false
}
export interface NormalizedConfig extends Readonly<Requ... |
<gh_stars>0
package org.openmucextensions.app.recorder;
import java.io.IOException;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import org.apache.felix.service.command.Descriptor;
import org.openmuc.framework.data.... |
#!/usr/bin/env bash
#
# Generate all the repository Dockerfiles from templates
#
set -euo pipefail
declare -A modClusterVersions=(
['1.3']='1.3.8.Final'
)
declare -A modClusterMd5sums=(
['1.3']='93dc6218d6dd14ae4ce24c5c09f20ab5'
)
declare -a supportedTomcats=( 6 7 8 )
cd "$(dirname "$(readlink -f "$BASH_SOURCE")... |
module SVGAbstract
#Base SVG object, all others inherit from this
class SVGObject
def initialize
@attributes = {}
@name = 'abstract'
end
def deep_copy
Marshal.load( Marshal.dump self )
end
#Some methods for performing escaping of text, etc
attr_accessor :escape
alias_method :"escape?", :e... |
#!/bin/sh
SETUP_DIR=/Users/jash/src/cyphernode_satoshiportal/dist DEFAULT_CERT_HOSTNAME=disk0book.local PROXYCRON_VERSION=v0.2.0-rc.5 PYCOIN_VERSION=v0.2.0-rc.5 SETUP_VERSION=v0.2.0-rc.5 BITCOIN_VERSION=v0.17.1 LIGHTNING_VERSION=v0.7.0 DEFAULT_DATADIR_BASE=/Users/jash GATEKEEPER_VERSION=v0.2.0-rc.5 PROXY_VERSION=v0.2.... |
#!/usr/bin/env bash
set -e
printf "\nStarting Vitess cluster\n"
export VTROOT=/vagrant
export VTDATAROOT=/tmp/vtdata-dev
export MYSQL_FLAVOR=MySQL56
cd "$VITESS_WORKSPACE"/examples/local
export SHARD="-"
export TOPO="zk2"
./zk-up.sh
./vtctld-up.sh --enable-grpc-static-auth
./vttablet-up.sh --enable-grpc-static-auth... |
package be.kwakeroni.test.util;
import be.kwakeroni.parameters.backend.api.Configuration;
import be.kwakeroni.parameters.backend.api.ConfigurationProvider;
public class TestConfigurationProvider implements ConfigurationProvider {
private static Configuration CONFIGURATION;
public static void setConfiguratio... |
"""
Declares a @builtin decorator class for tagging php built-in functions.
"""
class builtin(object):
"Class for tagging built in functions"
def __init__(self, func):
self.func = func
def __call__(self, *args, **kw):
return self.func(*args, **kw)
def __repr__(self):
return "<php-builtin-function %r>"%self.f... |
package io.opensphere.mantle.data.util;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import gnu.trove.map.hash.TLongObjectHashMap;
import io.opensphere.core.model.time.TimeSpan;
import io.opensphere.core.model.time.TimeSpanList;
import io.opensphere.core.util.rangeset.RangedLongS... |
#! /bin/sh
# Copyright (C) 2013 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is di... |
package org.para.testdata;
public class StringArrayData {
static String[] testStrings = new String[200];
static {
for (int i = 0; i < testStrings.length; i++) {
testStrings[i] = "" + i;
}
}
}
|
package com.ervin.litepal.api;
import com.ervin.litepal.model.Contributor;
import java.util.List;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Path;
/**
* Created by Ervin on 2016/6/3.
*/
public interface GitHubClient {
@GET("/repos/{owner}/{repo}/contributors")
Call<List<Contri... |
#!/bin/bash
export MD_CONFIG_ENVIRONMENTS=dev,docker
python -u -m mdstudio_atb
|
import os
import numpy as np
from skimage import color
import matplotlib.pylab as plt
def remove_files(files):
"""
Remove files from disk
args: files (str or list) remove all files in 'files'
"""
if isinstance(files, (list, tuple)):
for f in files:
if os.path.isfile(os.path.e... |
#!/usr/bin/env bash
source prepare-env.sh
java -jar target/jira-cli-1.0-SNAPSHOT-jar-with-dependencies.jar --action link --source "$1" --target "$2" --link-type "$3" |
<filename>sources/include/nx/nx/attributes.hpp
#ifndef __NX_ATTRIBUTES_H__
#define __NX_ATTRIBUTES_H__
#include <ostream>
#include <string>
#include <unordered_map>
#include <nx/config.h>
namespace nx {
struct NX_API attribute_base
{
attribute_base(const std::string& n, const std::string& v);
attribute_base... |
# vector of numbers
input_vector <- c(1, 3, 5, 4, 2)
# calculate median
median(input_vector)
# output
# [1] 3.5 |
var BeachWaterQuality = require('../index');
var bwq = new BeachWaterQuality();
bwq.getBeachForcastLevel('BW').then(function(forecast) {
console.log(forecast);
});
|
class SyncHandlerManager:
def __init__(self, inbox_manager):
self.inbox_manager = inbox_manager
self._client_event_runner = None
self.receiver_handlers_running = False
self.client_event_handlers_running = False
def start_receiver_handlers(self):
# Logic to start receiver... |
/**
* The ACE Editor TemplateProcessor base
*
* @module aui-ace-editor
* @submodule aui-ace-autocomplete-templateprocessor
*/
var Lang = A.Lang,
AArray = A.Array,
AObject = A.Object,
Base = A.AceEditor.AutoCompleteBase,
MATCH_DIRECTIVES = 0,
MATCH_VARIABLES = 1,
TOKEN_PUNCTUATOR_DOT = 1,... |
#!/bin/bash
set -ex
for d in $(find -mindepth 1 -maxdepth 1 -type d)
do
tag=$(basename $d)
sudo docker build -t $tag $d
done
|
def slot_filling_algorithm(user_input):
tokens = nltk.word_tokenize(user_input)
slots = {
'name': '',
'age': '',
'gender': ''
}
for token in tokens:
if token.lower() in ["name", "age", "gender"]:
current_slot_key = token.lower()
else:
slots[current_slot_key] = token
return... |
import map from 'lodash/map'
import { all, fork } from 'redux-saga/effects'
import Dashboard from './containers/Dashboard/Store/saga'
const sagas = [
Dashboard,
]
export default function* () {
yield all(map(sagas, saga => fork(saga)))
}
|
def find_repeated_words(text):
words = text.split()
repeated_words = []
for i in range(len(words)):
for j in range(i+1, len(words)):
if words[i] == words[j] and words[i] not in repeated_words:
repeated_words.append(words[i])
return repeated_words |
#!/bin/bash
# Get local IP
LocalIP="$(ifconfig eth0 | grep 'inet addr' | cut -d: -f2 | cut -d ' ' -f1)"
# Change local IP to hosts
command="/.novalocal/s/127.0.0.1/$LocalIP/g"
sed -i.bkp -e $command /etc/hosts
|
<filename>src/main/java/br/indie/fiscal4j/danfe/MDFeDanfeReport.java
package br.indie.fiscal4j.danfe;
import br.indie.fiscal4j.mdfe3.classes.nota.MDFProcessado;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.WriterException;
import com.google.zxing.common.BitMatr... |
<reponame>twitter-zuiwanyuan/finatra<filename>thrift/src/test/scala/com/twitter/finatra/thrift/tests/DoEverythingThriftServerStartupTest.scala
package com.twitter.finatra.thrift.tests
import com.google.inject.Stage
import com.twitter.finatra.thrift.EmbeddedThriftServer
import com.twitter.finatra.thrift.tests.doeveryth... |
public class ByteWriter
{
public List<byte> Bytes { get; } = new List<byte>();
public void Write(int i)
{
Bytes.Add(Convert.ToByte(i));
}
public void Write(long i)
{
byte[] longBytes = BitConverter.GetBytes(i);
Bytes.AddRange(longBytes);
}
} |
<filename>src/main/java/net/b07z/sepia/websockets/mqtt/SepiaMqttClient.java
package net.b07z.sepia.websockets.mqtt;
import java.util.function.Consumer;
import org.eclipse.paho.client.mqttv3.IMqttClient;
import org.eclipse.paho.client.mqttv3.IMqttMessageListener;
import org.eclipse.paho.client.mqttv3.MqttClient;
impor... |
class InputError(Exception):
def __init__(self, fname, fext):
self.fname = fname
self.fext = fext
class FileLoader:
def __init__(self, fname, fext):
self.fname = fname
self.fext = fext
def load(self, fname):
try:
sys.stdout.write("Loading " + fname + " f... |
public class UserAuthenticator {
private Context context;
private DBHelper dbHelper;
public UserAuthenticator(Context context, DBHelper dbHelper) {
this.context = context;
this.dbHelper = dbHelper;
}
public void login(UserCredentials userCredentials, RequestListener<Object> listene... |
module.exports = function (data) {
this.keys = this.game.input.keyboard.addKeys({
left: Phaser.KeyCode.LEFT,
right: Phaser.KeyCode.RIGHT,
up: Phaser.KeyCode.UP,
down: Phaser.KeyCode.DOWN,
action: Phaser.KeyCode.SPACEBAR,
wrath: Phaser.KeyCode.W
})
this.game.renderer.renderSession.roundPix... |
import PropTypes from 'prop-types';
import { mount } from 'enzyme';
import { shallow } from 'enzyme';
import { expect } from 'chai';
import { Select } from '../src';
describe('<Select/>', function () {
const options =
[
{ value: 'one' },
{ value: 'two' },
{ value: 'three' },
];
const com... |
<reponame>developertown/soft_validate
ActiveRecord::Schema.define(:version => 0) do
create_table :dumb_users, :force => true do |t|
t.column "email", :string
t.column "first_name", :string
t.column "last_name", :string
end
create_table :non_validated_users, :force => true do |t|
t.column "email",... |
export default {
from({ age }) {
const match = age.match(/^from(\d+)/);
return match && +match[1];
},
to({ age }) {
const match = age.match(/to(\d+)$/);
return match && +match[1];
},
};
|
import React, { useState } from 'react';
const App = () => {
// User input and response
const [userInput, setUserInput] = useState('');
const [userResponse, setUserResponse] = useState('');
const handleUserInput = e => {
setUserInput(e.target.value);
};
const handleUserResponse = responseText => {
setUserR... |
#!/bin/bash
components="1 2 3 4 6 7 8 14 15 19" #insert component number of ICA
VOLdir="./HCP_results/fullbrainECM"
mkdir ./HCP_results/FinalResults/meanEC_of_IC_weighted_Zwb
##Calculate weighted average ECz of every component for every subject
##use thresholded ICA spatial map as mask in fslmeants
SUBs="" #insert s... |
#!/usr/bin/env bash
./bin/start-nginx -f ./bin/wait.sh
|
#include "../deps/imgui/imgui.h"
#include <jc3/entities/character.h>
#include <jc3/entities/vehicle.h>
#include <json.hpp>
#include <jc3/hashes/vehicles.h>
#include <jc3/entities/pfx/land_steering.h>
struct JCString
{
union _Bxty {
char _Buf[16];
char *_Ptr;
char _Alias[16];
} _Bx;
... |
#!/usr/bin/env bash
#
# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
if [[ "$1" == "intel64" ]] ; then
export FOO='intel64'
else
export FOO='default'
fi
|
<reponame>rocketmo/nba.js
import should from "should";
import e from "./";
import { ENDPOINTS as c } from "./constants";
describe("api/data/index", () => {
describe("exports", () => {
it("should export a functon for each ENDPOINT constants", done => {
should.equal(Object.keys(c).length, Object.keys(e).len... |
<filename>forge/dist/utils/index.d.ts
export { ILogger } from './Logger';
export { Validate } from './Validate';
|
#!/bin/bash
# This script that takes in a URL, sends a GET request to the URL.
curl -sL "$1"
|
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
@Component({
selector: 'my-custom-component',
templateUrl: './my-custom-component.component.html',
styleUrls: ['./my-custom-component.component.scss'],
encapsulation: ViewEncapsulation.ShadowDom
})
export class MyCustomComponentComponent imp... |
(make -C ../src Xlib.cma GLX.cma)
opam install glMLite
GL_DIR=`ocamlfind query glMLite`
ocaml -I ../src Xlib.cma GLX.cma -I $GL_DIR GL.cma glxdemo.ml $*
|
<filename>mobile-launcher/SideQuestLauncher/AppStarter/src/main/java/com/sidequest/launcher/tools/Updater.java
package com.sidequest.launcher.tools;
import android.app.DownloadManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.Intent... |
<reponame>drzamich/warsawjs-workshop-35-legacy-code
module.exports = class CounterBar {
constructor(streak) {
this.streak = streak;
}
getBar() {
let bar = '\x1B[42m'; // green color
for (let i = 0; i <= this.streak.noDays(); i += 1) {
bar += ' '; // add spaces
}
bar += '\x1B[0m '; // re... |
#import necessary libraries
import pandas as pd
import numpy as np
from nltk.corpus import stopwords
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.naive_bayes import MultinomialNB
# load the data set
data = pd.read_csv('dataset.cs... |
using System;
public class MetadataManager
{
public string GetMetadataFilename(Guid guid)
{
string filename = $"metadata_{guid.ToString().ToLower()}.txt";
return filename;
}
} |
<filename>node_modules/@angular-eslint/eslint-plugin-template/dist/rules/no-positive-tabindex.d.ts
export declare type MessageIds = 'noPositiveTabindex' | 'suggestNonNegativeTabindex';
export declare const RULE_NAME = "no-positive-tabindex";
declare const _default: import("@typescript-eslint/experimental-utils/dist/ts-... |
#!/bin/bash -ex
#
source config.cfg
echo "Install python client"
apt-get -y install python-openstackclient
sleep 5
echo "Install and config NTP"
sleep 3
apt-get install ntp -y
cp /etc/ntp.conf /etc/ntp.conf.bka
rm /etc/ntp.conf
cat /etc/ntp.conf.bka | grep -v ^# | grep -v ^$ >> /etc/ntp.conf
## Config NTP in LIBERT... |
from typing import List, Dict, Type
def map_urls_to_views(urlpatterns: List[str], view_classes: List[Type[View]]) -> Dict[str, Type[View]]:
url_view_mapping = {}
for i in range(len(urlpatterns)):
url_view_mapping[urlpatterns[i]] = view_classes[i]
return url_view_mapping |
#!/bin/bash
# This script depends on the ./java_oracle_license.sh for installation of Oracle java dependencies
if [ -d /usr/lib/jvm/java-7-oracle ]; then
echo "Found java-7-oracle installation"
else
echo "java 7 installation"
apt-get install -y -q oracle-java7-installer
yes "" | apt-get -f install
fi
|
import string
def count_unique_words(file_path: str) -> int:
# Read the file and convert its content to lowercase
with open(file_path, 'r') as file:
content = file.read().lower()
# Remove punctuation from the content
content = content.translate(str.maketrans('', '', string.punctuation))
#... |
(function(angular) {
'use strict';
angular.module('OMDbAPISearch', [])
.controller('searchMovies', ['$scope', '$http',
function($scope, $http) {
$scope.method = 'GET';
$scope.fetch = function() {
if ($scope.searchparam) {
$scope.url = 'https://www.omdbapi.com/?apikey=... |
import { EditorState, basicSetup } from "@codemirror/basic-setup";
import { EditorView, ViewUpdate } from "@codemirror/view";
import { highlightSpecialChars } from "@codemirror/highlight";
function setupCustomEditor(initialText, specificWord) {
const state = EditorState.create({
doc: initialText,
extensions:... |
import chalk from 'chalk';
import fs from 'fs';
import JSZip from 'jszip';
import path from 'path';
import request from 'request';
import tmp from 'tmp';
export class GitHubSource {
branch: string;
githubListApi: string;
githubDownloadUrl: string;
argv: any;
destinationPath: string;
constructor(argv: any,... |
<gh_stars>0
import React, { Component, } from 'react';
import { BrowserRouter, Route, } from 'react-router-dom';
import Home from './pages/home/index';
import Right from './common/right/index';
import Write from './pages/write/index';
import List from './pages/list/index';
import Detail from './pages/detail/index';
im... |
#!/usr/bin/env sh
################################################################################
# RUN EACH COMMAND ON SEPARATE TERMINALS [before Docker implementation]
################################################################################
#local Kafka: /Users/screative/devbox/engineering/kafk... |
<reponame>DigitalGenius/react-chat-window
import React from 'react';
import PulseLoader from 'react-spinners/PulseLoader';
const AgentTypingMessage = () => {
return (
<div className="sc-message--agent-typing">
<PulseLoader
size={6}
margin={1}
color={'#cccccc'}
loading={true}... |
#!/bin/bash
# Change to the parent directory.
cd "$(dirname "$(dirname "$(readlink -fm "$0")")")"
# Generate Thrift code.
cd src
rm -rf $1/gen_inbox
mkdir $1/gen_inbox
thrift -r --gen $1 -out $1/gen_inbox spec.thrift
|
<filename>spec/unit/puppet/type/consul_token_spec.rb
require 'spec_helper'
describe Puppet::Type.type(:consul_token) do
it 'fails if no name is provided' do
expect do
Puppet::Type.type(:consul_token).new(type: 'client')
end.to raise_error(Puppet::Error, %r{Title or name must be provided})
end
it '... |
# Launch NPM linter
COLOR_NAME='\e[33m'
COLOR_ARROW='\e[90m'
COLOR_FILES='\e[96m'
COLOR_DEFAULT='\e[39m'
PACKAGE_FILES='. ./packages'
LOCK_FILE='package-lock.json'
echo "${COLOR_NAME}npmlint ${COLOR_ARROW}-> ${COLOR_FILES}${PACKAGE_FILES}${COLOR_DEFAULT}"
npmPkgJsonLint ${PACKAGE_FILES}
echo "${COLOR_NAME}lockfile... |
import { createElement } from 'react'
import { componentIndex } from 'react-dnd-documentation-examples'
import processImages from './processImagesInMarkdownAst'
const log = require('debug')('site:renderHtmlAst')
const rehypeReact = require('rehype-react')
// Registers the examples as custom components
const renderAst ... |
#ifdef ENABLE_CUDA
#include "DEM2DForceComputeGPU.h"
#include "cuda_runtime.h"
#include "cuda.h"
#include <stdexcept>
#include <iostream>
#include <hoomd/extern/pybind/include/pybind11/pybind11.h>
using namespace std;
class DEM2DForceComputeGPU
{
public:
DEM2DForceComputeGPU(std::shared_ptr<SystemDefinition> s... |
<gh_stars>1-10
const uuid = require('uuid');
const moment = require('moment');
const {update} = require('./../../util/dynamo/operations');
const {BOOK_TABLE_NAME} = process.env;
exports.handler = async (event) => {
console.log('--------------------');
console.log('---- updateBook/index.js');
console.log('------... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.