code stringlengths 3 1.05M | repo_name stringlengths 4 116 | path stringlengths 4 991 | language stringclasses 9
values | license stringclasses 15
values | size int32 3 1.05M |
|---|---|---|---|---|---|
define(['leaflet', 'layoutManager'], function(L, layoutManager) {
return new (L.Class.extend({
initialize: function(options) {
this.el = options.el;
},
destroyModal: function() {
this.modal = null;
this.el.innerHTML = '';
},
setModal: funct... | Pihta-Open-Data/TransportNocturnal | src/main/webapp/app/modalsManager.js | JavaScript | mit | 631 |
import { coreUtils } from '../../'
import fs from 'fs-extra'
import path from 'path'
export function editStructure(type, folderPath, oldFolderPath = null) {
if (type === 'add') coreUtils.file.addFolder(folderPath)
else if (type === 'rename') coreUtils.file.renameFolder(oldFolderPath, folderPath)
else coreUtils.f... | abecms/abecms | src/cli/cms/structure/structure.js | JavaScript | mit | 1,631 |
class Citizens
extend Conformist
column :name, 0
column :age, 1
column :gender, 2
end | tatey/conformist | test/schemas/citizens.rb | Ruby | mit | 94 |
/*
* hasCommunityRole.js
* Drew Nelson
* Oct 21 2016
*
* @module :: Policy Factory
* @description :: Verifies the user has the passed role for the community or is an Admin of community
* :: Also allows access if the user has a SuperUser role
*/
module.exports = function(role) {
return function(req, ... | dnelson23/smashtrack | app/api/policyFactories/hasCommunityRole.js | JavaScript | mit | 1,081 |
package io.avalia.samba;
import static org.junit.Assert.assertNotNull;
import org.junit.Assert;
import org.junit.Test;
public class CavacoTest {
@Test
public void thereShouldBeAnIInstrumentInterfaceAndATrumpetClass() {
IInstrument cavaco = new Cavaco();
assertNotNull(cavaco);
}
@Test
pu... | AvaliaSystems/Samba | Samba-build/Samba-tests/src/test/java/io/avalia/samba/CavacoTest.java | Java | mit | 855 |
package problem3;
/**
* Created by tom on 2/22/17.
*/
public final class DistanceCalculator {
private static final DistanceCalculator DISTANCE = new DistanceCalculator();
public double measureDistance(PointWritable point1, PointWritable point2) {
double xResult = Double.parseDouble(point2.getFirst(... | tmm-ms/DS503 | homework/02/intellij/src/main/java/problem3/DistanceCalculator.java | Java | mit | 617 |
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import {Config} from '@jest/types';
import {ChangedFilesPromise, getChangedFilesForRoots} from 'jest-changed-... | ide/jest | packages/jest-core/src/getChangedFilesPromise.ts | TypeScript | mit | 1,325 |
namespace SortingExtensions.Tests.Implementation.Sorters
{
using System;
using System.Collections.Generic;
using System.Linq;
class SorterTestBase
{
protected IList<int> OrderedList
{
get { return new List<int>(Enumerable.Range(0, 20)); }
}
... | iarovyi/SortingExtensions | SortingExtensions.Tests/Implementation/Sorters/SorterTestBase.cs | C# | mit | 1,703 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import json
import beanstalkc
from flask import Blueprint, current_app, jsonify, g, request
import config
api = Blueprint('api', __name__)
@api.before_request
def before_request():
g.beanstalk = beanstalkc.Connection(
host=config.BEANSTALKD_HOST, port=config.... | BeanYoung/push-turbo | src/api.py | Python | mit | 1,548 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package play.libs.typedmap;
public final class TypedMap {}
| github/codeql | java/ql/test/stubs/playframework-2.6.x/play/libs/typedmap/TypedMap.java | Java | mit | 128 |
'''
Created on 1.12.2016
@author: Darren
'''
'''
A group of two or more people wants to meet and minimize the total travel distance. You are given a 2D grid of values 0 or 1, where each 1 marks the home of someone in the group. The distance is calculated using Manhattan Distance, where distance(p1, p2) = |p2.x - p1.x|... | darrencheng0817/AlgorithmLearning | Python/leetcode/BestMeetingPoint.py | Python | mit | 610 |
class Citation
include Mongoid::Document
field :text, type: String
field :pos, type: Integer
field :inner_pos, type: Hash
belongs_to :document
has_and_belongs_to_many :pages
validate :must_have_valid_position
def to_s
text || super
end
protected
def must_have_valid_position
r... | hhba/mapa76-core | lib/mapa76/core/model/citation.rb | Ruby | mit | 2,152 |
# -*- coding: utf-8 -*-
import math
# Constants taken from http://cesiumjs.org/2013/04/25/Horizon-culling/
radiusX = 6378137.0
radiusY = 6378137.0
radiusZ = 6356752.3142451793
# Stolen from https://github.com/bistromath/gr-air-modes/blob/master/python/mlat.py
# WGS84 reference ellipsoid constants
# http://en.wikiped... | loicgasser/quantized-mesh-tile | quantized_mesh_tile/llh_ecef.py | Python | mit | 1,533 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MCMAIP.Models;
namespace MCMAIP.Controllers
{
public class HomeController : Controller
{
MCMAIPEntities storeDB = new MCMAIPEntities();
// GET: /Index/
... | CrystalZYH/amazing-works | works/MR/ASP.NET/MCMAIP/MCMAIP/Controllers/HomeController.cs | C# | mit | 942 |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.data.schemaregistry.implementation.models;
import com.azure.core.http.HttpHeaders;
import com.azure.core.http.HttpRequest;
import com.azure.core.http.rest.ResponseBase;
/** Contains all response data for... | selvasingh/azure-sdk-for-java | sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/implementation/models/SchemasQueryIdByContentResponse.java | Java | mit | 1,341 |
/* ---------------------------------------------------------------------------
WAIT! - This file depends on instructions from the PUBNUB Cloud.
http://www.pubnub.com/account-javascript-api-include
--------------------------------------------------------------------------- */
/* ----------------------------------------... | cozza13/tipochat | core/3.2/pubnub-3.2.js | JavaScript | mit | 29,957 |
import { Undefinable } from './Undefinable';
/**
* Return _a_ if _a_ is not `undefined`.
* Otherwise, return _b_.
*/
export function orForUndefinable<T>(a: Undefinable<T>, b: Undefinable<T>): Undefinable<T> {
return a !== undefined ? a : b;
}
| saneyuki/option-t.js | src/Undefinable/or.ts | TypeScript | mit | 253 |
using System;
using System.Threading.Tasks;
namespace Binky
{
public static class CacheBuilder
{
public static IBuilder<TKey, TValue> WithFactory<TKey, TValue>(Func<IUpdateValue<TKey, TValue>> getValueUpdater)
=> new Builder<TKey, TValue>(getValueUpdater().Get);
public static IBuilder<TKey, TValue> With<TKey... | quezlatch/Binky | Binky/CacheBuilder.cs | C# | mit | 1,708 |
class CreateArtistSections < ActiveRecord::Migration
def change
create_table :artist_sections do |t|
t.integer :artist_id
t.integer :section_id
t.timestamps null: false
end
end
end
| markjanzer/rap-analysis | db/migrate/20160219205158_create_artist_sections.rb | Ruby | mit | 212 |
module Hashrocket
class UiController < ::ApplicationController
extend Wireframe::Excludes
exclude 'index', ->(w) { w.starts_with? '_' }
expose(:wireframes) do
Wireframe.cleaned
end
end
end
| hashrocket/hashrocket-rails | app/controllers/hashrocket/ui_controller.rb | Ruby | mit | 218 |
/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 2002, 2014 Oracle and/or its affiliates. All rights reserved.
*
*/
package com.sleepycat.je.tree.dupConvert;
import java.util.ArrayList;
import com.sleepycat.je.CacheMode;
import com.sleepycat.je.EnvironmentFailureException;
import co... | prat0318/dbms | mini_dbms/je-5.0.103/src/com/sleepycat/je/tree/dupConvert/DupConvert.java | Java | mit | 20,648 |
<?php
class Form extends CI_Controller{
public function form_view(){
$this->load->view('login');
}
public function check(){
$this->form_validation->set_message('min_length', 'полето {field} изисква {param} знака!');
$this->form_validation->set_message('required', '{field}... | Konvict5/Movie_Tickets | application/controllers/form.php | PHP | mit | 5,889 |
import { StackNavigator, TabNavigator, TabBarBottom } from 'react-navigation'
import ScheduleScreen from '../Containers/ScheduleScreen'
import TalkDetailScreen from '../Containers/TalkDetailScreen'
import BreakDetailScreen from '../Containers/BreakDetailScreen'
import LocationScreen from '../Containers/LocationScreen'
... | infinitered/ChainReactApp | App/Navigation/AppNavigation.js | JavaScript | mit | 1,169 |
<?php
/**
* Register widget areas
*
* @package FoundationPress
* @since FoundationPress 1.0.0
*/
if ( ! function_exists( 'foundationpress_sidebar_widgets' ) ) :
function foundationpress_sidebar_widgets() {
register_sidebar(array(
'id' => 'sidebar-widgets',
'name' => __( 'Sidebar widgets', 'foundationpress' ... | kaneohe/kaneohe | library/widget-areas.php | PHP | mit | 1,023 |
using System;
using Silphid.Extensions;
using UniRx;
using UnityEngine;
using UnityEngine.UI;
namespace Silphid.Tweenzup
{
public static class Tween
{
#region Range
public static IObservable<float> Range(float duration, IEaser easer = null) =>
new TweenObservable(duration, easer);... | Silphid/Silphid.Unity | Sources/Tweenzup/Tween.cs | C# | mit | 22,290 |
package bright.zheng.android.httpclient;
import java.io.IOException;
import java.lang.reflect.GenericArrayType;
import java.lang.reflect.ParameterizedType;
import org.apache.http.HttpEntity;
import org.apache.http.util.EntityUtils;
import org.json.JSONException;
import org.json.JSONTokener;
import android.util.Log;
... | itstarting/android-async-httpclient | src/main/bright/zheng/android/httpclient/AsyncResponseHandler.java | Java | mit | 3,026 |
describe("Conversion for", function() {
describe("arffToJson", function() {
it("convert arff file, basic types", function() {
//Given:
var arff = "@RELATION iris\n\n@ATTRIBUTE foo NUMERIC\n@ATTRIBUTE bar REAL\n@ATTRIBUTE see STRING\n\n@DATA\n1,3.5,do\n\n";
insight.conve... | ScottLogic/insight | tests/utils/Conversion.spec.js | JavaScript | mit | 5,806 |
/**
* @file This prototype manages all game entities.
*
* @author Human Interactive
*/
"use strict";
var GameEntity = require( "./GameEntity" );
var Player = require( "./Player" );
var Vehicle = require( "./Vehicle" );
/**
* Creates the entity manager.
*
* @constructor
*/
function EntityManager() {
Object... | Mugen87/yume | src/javascript/engine/game/entity/EntityManager.js | JavaScript | mit | 3,096 |
from uiot import *
d("led", "blue", onboardled, "off", "on")
d("button", "forward", d3, 0, 1)
d("button", "back", d4, 0, 1)
run()
| ulno/micropython-extra-ulno | examples/presentation_remote/remote1/copy/autostart.py | Python | mit | 132 |
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Sayings of the Messenger P.B.U.H</title>
<link rel="stylesheet" href="https://bootswatch.com/slate/bootstrap.min.css">
<?= link_tag('assets/css/ahadith.css') ?>
... | naanT/Subscribe | application/views/telegram.php | PHP | mit | 3,361 |
using System;
using Aspose.Email.Exchange;
namespace Aspose.Email.Examples.CSharp.Email.Exchange_EWS
{
class SaveExchangeTaskToDisc
{
public static void Run()
{
// The path to the File directory.
string dataDir = RunExamples.GetDataDir_Exchange();
string dst... | maria-shahid-aspose/Aspose.Email-for-.NET | Examples/CSharp/Exchange_EWS/SaveExchangeTaskToDisc.cs | C# | mit | 865 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.ServiceBus.Messaging;
namespace EReaderConsole
{
class Program
{
static void Main(string[] args)
{
ReceiveLoop();
Console.ReadLine();
... | DotNETForDevices/IoTSamples | EventHubSample/EReaderConsole/Program.cs | C# | mit | 1,625 |
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Network::Mgmt::V2018_08_01
module Models
#
# The serviceName of an AvailableDelegation indicates a possible delegation
# for a s... | Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-08-01/generated/azure_mgmt_network/models/available_delegation.rb | Ruby | mit | 2,863 |
require "securerandom"
require "monitor"
require "dalli"
require "dalli/cas/client"
require "redis"
require "msgpack"
require "suo/version"
require "suo/errors"
require "suo/client/base"
require "suo/client/memcached"
require "suo/client/redis"
| nickelser/suo | lib/suo.rb | Ruby | mit | 250 |
import unittest
from Hero import Hero
class HeroTest(unittest.TestCase):
def setUp(self):
self.hero = Hero(10, 0)
def test_hero_default(self):
self.assertEqual(
(self.hero.health,
self.hero.magic,
self.hero.x,
self.hero.y), (10, 0, None, N... | vpachedzhi/Hero_Game_Qt | tests.py | Python | mit | 561 |
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using ContentPatcher.Framework.Conditions;
using ContentPatcher.Framework.ConfigModels;
using ContentPatcher.Framework.Lexing;
using Pathoschild.Stardew.Common.Utilities;
using StardewModdingAPI;
namespace ContentPatcher.Framework.Migrations
{
/// <summary>... | Pathoschild/StardewMods | ContentPatcher/Framework/Migrations/Migration_1_19.cs | C# | mit | 3,626 |
Cliente = Backbone.Model.extend({
defaults: {
empresa: 'Unknow',
telefonos: []
},
initialize: function(attrs, opts){
}
});
var cliente = new Cliente({nombre: 'Antonio', apellidos: 'García Ros'});
cliente.set({edad: 31, soltero: false});
alert(cliente.get('edad')); // 31 | jesuscuesta/Backbone | 02.- Modelos/07.- Model - modificando atributos/hello.js | JavaScript | mit | 304 |
module.exports.up = async db => {
await db.raw('CREATE EXTENSION IF NOT EXISTS "uuid-ossp"');
await db.raw('CREATE EXTENSION IF NOT EXISTS "hstore"');
await db.schema.createTable('role', table => {
// pk
table.increments('id').unsigned().primary();
// uuid
table.uuid('uuid').notNullable().default... | boldr/boldr-api | db/migrations/201701270219_initial.js | JavaScript | mit | 12,958 |
// The csuuid package generates and parses C# formatted UUIDs.
package csuuid
import (
"strings"
"encoding/hex"
"errors"
)
var (
ErrInvalid error = errors.New("csuuid: invalid uuid")
)
// CSUUID converts the provided byte slice representation of a C# encoded UUID to the
// proper string represntation of that UU... | ecofit-networks/go-csuuid | csuuid.go | GO | mit | 2,150 |
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d.axes3d as p3
import matplotlib.animation as anm
#plt.rcParams['animation.ffmpeg_path'] = '/usr/bin/ffmpeg'
plt.close('all')
data = np.loadtxt('solar_system.dat')
data2 = data[:,0:15]
fig = plt.figure()
ax = p3.Axes3D(fi... | dcelisgarza/applied_math | solar_system/animatep2.py | Python | mit | 1,987 |
#!/usr/bin/env python3
__author__ = "Jeremy Brown"
__copyright__ = "2014 Jeremy Brown"
__license__ = "MIT"
"""
Improved Eurler's Method solver
Inspired by my math homework, which showed me that Euler's Method is a very
repetitive process. I couldn't find a tool that would easily let me solve
using this method an... | j-bro/improved-eulers-method | euler.py | Python | mit | 4,813 |
using System;
using MonoTouch.UIKit;
namespace Mappir {
public class TableItemRutaEncon {
public int tipo { get; set; }
public int casetasNo { get; set; }
public float casetasTotal { get; set; }
public float tiempoTotal { get; set; }
public float distanciaTotal { get; set; }
public float... | FenixStudios/DescubriendoTuRuta | MappirMovil/Mappir/RutasEncontradas/TableItemRutaEncon.cs | C# | mit | 1,131 |
/*! Drag Multiple Plugin - v0.1.2 - 2017-10-16
* https://github.com/javadoug/jquery.drag-multiple
* Copyright (c) 2017 Doug Ross; Licensed MIT */
/*globals jQuery */
(function ($) {
"use strict";
var options = {
// allow consumer to specify the selection
items: function getSelectedItems() {
... | javadoug/jquery.drag-multiple | dist/jquery-ui.drag-multiple.js | JavaScript | mit | 6,262 |
import GLBoost from '../../globals';
import GLBoostObject from '../core/GLBoostObject';
import GLExtensionsManager from '../core/GLExtensionsManager';
import MathClassUtil from '../../low_level/math/MathClassUtil';
import DrawKickerWorld from '../../middle_level/draw_kickers/DrawKickerWorld';
import VertexWorldShaderSo... | cx20/GLBoost | src/low_level/geometries/Geometry.js | JavaScript | mit | 37,614 |
import * as React from "react";
import { Helper, SPTypes } from "gd-sprest";
import { Label, ILabelProps } from "@fluentui/react/lib/Label";
import { IPeoplePickerProps } from "@fluentui/react/lib/Pickers";
import { SPPeoplePicker } from "../components";
import { IFieldUserProps, IFieldUserState } from "./types";
impor... | gunjandatta/sprest-react | src/fields/fieldUser.tsx | TypeScript | mit | 4,114 |
# -#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# these are system modules
import commands
import numpy
import os
import sys
# these are my local modules
from env import gidgetConfigVars
import miscIO
import miscTCGA
import path
import tsvIO
# -#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#... | cancerregulome/gidget | commands/feature_matrix_construction/main/new_Level3_miRNAseq.py | Python | mit | 11,860 |
# -*- coding: utf-8 -*-
from datetime import timedelta
from workalendar.core import WesternCalendar, ChristianMixin
class Cyprus(WesternCalendar, ChristianMixin):
"Cyprus"
include_epiphany = True
include_clean_monday = True
include_good_friday = True
include_easter_saturday = True
include_eas... | gregn610/workalendar | workalendar/europe/cyprus.py | Python | mit | 1,077 |
##
# This concern adds a monthly calendar view of reservations for a given resource
# to a controller. It can be used to provide a standalone view with the
# appropriate routing, but can also be used to insert a `calendar` partial into
# other views. It requires that the `GET :calendar` route be added to the
# relevant... | nickholden101/reservations | app/controllers/concerns/calendarable.rb | Ruby | mit | 4,810 |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);cin.tie(0);
bool seen[181] = {};
int h=0, m=0;
for (int i=1; i<=720; ++i) {
if (i%12==0)
h = (h + 1) % 60;
m = (m + 1) % 60;
int d = fabs(m-h);
if (d > 30) d -= 30;
... | arash16/prays | UVA/vol-125/12531.cpp | C++ | mit | 418 |
/*!--------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------*/
/*---------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
*---------------... | KTXSoftware/KodeStudio-linux32 | resources/app/out/vs/workbench/parts/git/node/askpass.nls.js | JavaScript | mit | 1,436 |
<?php
class Menu_controller extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('myaccount_model');
$this->load->model('sitesetting_model');
$this->load->model('common_model');
$this->load->model('User_email_model');
$this->load->library('Image... | ArijitK2015/love_-architect | application/controllers/Menu_controller.php | PHP | mit | 2,403 |
<?php
namespace Geos\UserBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;
/**
* This is the class that loads and manages ... | spatindsaongo/geos | src/Geos/UserBundle/DependencyInjection/GeosUserExtension.php | PHP | mit | 874 |
import { CodeNameCodeSequenceValues } from '../enums';
import getSequenceAsArray from './getSequenceAsArray';
import getMergedContentSequencesByTrackingUniqueIdentifiers from './getMergedContentSequencesByTrackingUniqueIdentifiers';
import processMeasurement from './processMeasurement';
const getMeasurements = (
Ima... | OHIF/Viewers | platform/core/src/DICOMSR/SCOORD3D/utils/getMeasurements.js | JavaScript | mit | 1,434 |
using System;
namespace BankSystem
{
public interface IWithdrawable
{
void Withdraw(decimal amount);
}
}
| kalinalazarova1/TelerikAcademy | Programming/3. OOP/OOP_05.Fundamental Principles Part 2/02. BankSystem/IWithdrawable.cs | C# | mit | 129 |
describe('GET /docs/:docUUID', function() {
beforeEach(function *() {
yield fixtures.load();
this.reader = fixtures.users[1];
yield this.reader.addTeam(fixtures.teams[0]);
yield fixtures.teams[0].addProject(fixtures.projects[0], { permission: 'read' });
this.collection = fixtures.collections[0];
... | wikilab/wikilab-api | test/api/routes/docs/get_doc.js | JavaScript | mit | 2,676 |
using System;
ref struct Sample
{
public void Dispose()
{
Console.WriteLine("Disposed");
}
}
class Program
{
static void Main()
{
using(var s = new Sample())
{
Console.WriteLine("Now working 'ref struct Sample!'");
}
}
}
| autumn009/TanoCSharpSamples | Chap35/DisposeRefStruct/DisposeRefStruct/Program.cs | C# | mit | 294 |
module Quotes
module Gateways
class PublicationsGateway < Gateway
def initialize(backend = nil)
@backend = backend || backend_for_publications
@marshal = PublicationMarshal
end
def add(publication)
ensure_valid!(publication)
@backend.insert(serialized(publicati... | daxadax/quotes | lib/quotes/gateways/publications_gateway.rb | Ruby | mit | 1,706 |
<?php
// src/Acme/UserBundle/Entity/User.php
namespace Acme\UserBundle\Entity;
use FOS\UserBundle\Model\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="acme_user")
*/
class User extends BaseUser
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\Generat... | pulwar/dom | src/Acme/UserBundle/Entity/User.php | PHP | mit | 477 |
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Event extends MY_model{
public function getTable(){
return 'tb_event';
}
public function rules(){
return [
['name', 'alpha_numeric'],
['description', 'alpha_numeric'],
];
}
public function currentEvents(){
$qu... | kaabsimas/caravana | application/models/Event.php | PHP | mit | 1,494 |
<?php
namespace Amp\Test;
use Amp\Delayed;
use Amp\Loop;
use Amp\PHPUnit\TestCase;
use function Amp\Promise\wait;
abstract class BaseTest extends TestCase
{
public function tearDown(): void
{
parent::tearDown();
Loop::setErrorHandler();
$this->clearLoopRethrows();
}
private ... | amphp/amp | test/BaseTest.php | PHP | mit | 1,050 |
<?php
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 zepi
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, c... | zepi/turbo-base | Zepi/Web/General/src/Manager/AssetCacheManager.php | PHP | mit | 19,601 |
using System;
using System.Reflection.Emit;
namespace FluentMethods.UnitTests
{
public partial class ILGeneratorFixture
{
#if NetCore
[Xunit.Fact]
#else
[NUnit.Framework.Test]
#endif
public void LoadConstInt32()
{
LoadConstInt32(-1);
LoadC... | edwardmeng/FluentMethods | test/Core/System.Reflection.Emit.ILGenerator/Constant/LoadConst.cs | C# | mit | 11,034 |
var test = require('tape')
var secstamp = require('../')
test('generates seconds properly', function (t) {
t.equals(secstamp(42), '0:42')
t.end()
})
test('accepts string as input', function (t) {
t.equals(secstamp(42), secstamp('42'))
t.end()
})
test('pads periods with 0s if needed', function (t) {
t.equal... | sidd/secstamp | test/index.js | JavaScript | mit | 1,068 |
<?php
namespace ZfcDatagridTest\Column\Action;
use InvalidArgumentException;
use PHPUnit\Framework\TestCase;
use ZfcDatagrid\Column\Action\Icon;
/**
* @group Column
* @covers \ZfcDatagrid\Column\Action\Icon
*/
class IconTest extends TestCase
{
public function testConstruct()
{
$icon = new Icon();
... | zfc-datagrid/zfc-datagrid | tests/ZfcDatagridTest/Column/Action/IconTest.php | PHP | mit | 1,370 |
import { routerStateReducer as router } from 'redux-router';
import { combineReducers } from 'redux';
import entities from './entities';
import app from './app';
import cardList from './cardList';
const rootReducer = combineReducers({
router,
entities,
app,
cardList
});
export default rootReducer;
| Poplava/mtg-cards | client/reducers/index.js | JavaScript | mit | 310 |
require 'spec_helper'
describe RatingScalesController do
before(:each) do
@rating_scale = mock_model(RatingScale)
@rating_scales = [@rating_scale]
@rating_scales.stub(:find).and_return(@rating_scale)
@rating_scales.stub(:new).and_return(@rating_scale)
@question = mock_model(Question)
@ques... | RevolutionPrep/surveyor | spec/controllers/rating_scales_controller_spec.rb | Ruby | mit | 10,798 |
class DiffBench
class Bm
def initialize(&block)
@measures = {}
if block.arity == -1 || block.arity > 0
block.call(self)
else
instance_eval(&block)
end
puts Encoder.encode(@measures)
end
def report(label)
@measures[label] = Benchmark.measure do
... | bogdan/diffbench | lib/diffbench/bm.rb | Ruby | mit | 354 |
<?php
class ZendR_Tool_Project_Context_Doctrine_MigrationsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory
{
/**
* @var string
*/
protected $_filesystemName = 'migrations';
/**
* @return string
*/
public function getName()
{
return 'Migrati... | wchampi/zend-r | lib/ZendR/Tool/Project/Context/Doctrine/MigrationsDirectory.php | PHP | mit | 346 |
import { AccesosService } from './../../../services/accesos.service';
import { Component, AfterViewInit } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { Router } from '@angular/router';
// import { TdDataTableSortingOrder, TdDataTableService, ITdDataTableSortChangeEvent } from '... | alvaradopcesar/ClaseFinal | src/app/dashboard-product/carga-tokens/carga-tokens.component.ts | TypeScript | mit | 7,422 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;... | DotNetKit/DotNetKit.Wpf.Printing | DotNetKit.Wpf.Printing.Demo/Samples/HelloWorldSample/HelloWorldPageControl.xaml.cs | C# | mit | 720 |
module Fastlane
module CarthageCache
VERSION = "0.1.1"
end
end
| thii/fastlane-plugin-carthage_cache | lib/fastlane/plugin/carthage_cache/version.rb | Ruby | mit | 71 |
package com.quexten.ravtech.net;
import java.io.InputStream;
import com.quexten.ravtech.RavTech;
import com.quexten.ravtech.util.Debug;
public class Player {
Lobby lobby;
Object connectionInformation;
String username;
public Player (Lobby lobby, Object connectionInformation, String username) {
this.lobby =... | Quexten/RavTech | core/src/com/quexten/ravtech/net/Player.java | Java | mit | 1,011 |
import psycopg2
def pg_connect(
host,
port,
user,
password,
database):
"""
Small connection class
If no password is suplied we try the default postgres user
and expect a setted pg_ident or something similar
"""
#if DEBUG: keep("Model().pg_connect()")
... | ragged/yapgt | utils/connect.py | Python | mit | 1,481 |
import React from 'react';
import PropTypes from 'prop-types';
import Navbar from './Navbar';
import Footer from './Footer';
class Layout extends React.Component {
render() {
return (
<div className='grid'>
<Navbar />
<div className="container">
{this.props.children}
</d... | dziksu/songs-manager | src/layouts/Layout.js | JavaScript | mit | 429 |
/*
* tiny-node.js
* Description : A modern JavaScript utility library for browser.
* Coder : shusiwei
* Date : 2016-08-22
* Version : 1.0.0
*
* https://github.com/shusiwei/tiny-node
* Licensed under the MIT license.
*/
import {isUndefined, isNull, isPlainObject, isString, forEach, isPosiInteger, trim} from './... | shusiwei/tiny | src/node.js | JavaScript | mit | 5,044 |
using Xunit;
using StarCommander.DefendImplement;
using StarCommander.Factories;
using StarCommander.Types;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StarCommander.DefendImplement.Tests
{
public class DeflectionShieldImplementTest... | jfrench7919/Star-Commander-Resume-Sample | StarCommanderTests/DefendImplement/DeflectionShieldImplementTests.cs | C# | mit | 2,121 |
const {series, crossEnv, concurrent, rimraf} = require('nps-utils')
// @if model.integrationTestRunner.id='protractor'
const {config: {port : E2E_PORT}} = require('./test/protractor.conf')
// @endif
module.exports = {
scripts: {
default: 'nps webpack',
test: {
// @if testRunners.jest
default: 'np... | zewa666/cli | lib/resources/content/package-scripts.template.js | JavaScript | mit | 4,186 |
/**
* Print locales settings.
* @function print
* @param {object} locales - locales settings to print.
*/
'use strict'
const colorprint = require('colorprint')
const yaml = require('js-yaml')
function _normalize (data) {
switch (typeof data) {
case 'number':
case 'string':
case 'boolean':
case ... | apeman-labo/apemanlocale | lib/print.js | JavaScript | mit | 1,057 |
import FAnimation from './f-animation'
import { left, right } from '../art/art-util'
export default class ASleep extends FAnimation {
constructor(old) {
super(old)
this.frames = [this.frame1]
}
frame1(g, x, y, friendo, blink, words) {
// pre-compute constants for drawing for ease of readability
... | mattdelsordo/friendo | src/friendo/animation/sleep.js | JavaScript | mit | 1,215 |
(function ($, SmallGrid) {
"use strict";
$.extend(true, SmallGrid, {
"Column": {
"Create": CreateModel,
"Model": ColumnModel,
"ColumnData": ColumnData
}
});
function ColumnData() { }
ColumnData.prototype.align = "";//column cells align - "" / cen... | truehot/smallGrid | core/column.js | JavaScript | mit | 15,058 |
// Copyright 2011 Aaron Jacobs. All Rights Reserved.
// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
//
// 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/licen... | ebfe/scaleway-cli | vendor/github.com/smartystreets/assertions/internal/oglematchers/greater_or_equal_test.go | GO | mit | 38,572 |
<?php
namespace Lmc\Steward\Process;
use Graphp\Algorithms\Tree\OutTree;
/**
* Interface for optimizers of tests order.
*/
interface OptimizeOrderInterface
{
/**
* For each vertex in the tree (except root node) evaluate its order.
* This determines the order in which tests (that have same time delay ... | tenerd/steward | src/Process/OptimizeOrderInterface.php | PHP | mit | 551 |
using DarkSoulsII.DebugView.Core;
namespace DarkSoulsII.DebugView.Model.Map.Location
{
public class MapGeneralStatueLocation : MapGeneralLocation, IReadable<MapGeneralStatueLocation>
{
public new MapGeneralStatueLocation Read(IPointerFactory pointerFactory, IReader reader, int address, bool relative =... | Atvaark/DarkSoulsII.DebugView | DarkSoulsII.DebugView.Model/Map/Location/MapGeneralStatueLocation.cs | C# | mit | 448 |
'use strict';
class BookRecommendation extends React.Component {
constructor(props) {
super(props);
// this.state = {count: props.initialCount};
}
render() {
return (
<div>
<BookPicture {...this.props} horizontal={true} />
<div className='switch'>
<label>
... | kar288/exquery | hello/static/src/bookRecommendation.js | JavaScript | mit | 480 |
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'module-navigation',
templateUrl: './app/widgets/navigation/navigation.component.html'
})
export class ModNavigationComponent implements OnInit {
constructor() { }
ngOnInit() { }
} | manhcuong06/angular_admin | src/app/widgets/navigation/navigation.component.ts | TypeScript | mit | 272 |
/// <reference types="xrm" />
export declare class DeviceMock implements Xrm.Device {
captureAudio(): Xrm.Async.PromiseLike<Xrm.Device.CaptureFileResponse>;
captureImage(imageOptions: Xrm.Device.CaptureImageOptions): Xrm.Async.PromiseLike<Xrm.Device.CaptureFileResponse>;
captureVideo(): Xrm.Async.PromiseLik... | camelCaseDave/xrm-mock | dist/xrm-mock/device/device.mock.d.ts | TypeScript | mit | 615 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DMT.Partition.Interfaces;
using DMT.Partition.Module.Exceptions;
namespace DMT.Partition.Module
{
class PartitionRegistry
{
private List<IPartition> partitions;
private int... | tmichel/thesis | Applications/DMT.Partition.Module/PartitionRegistry.cs | C# | mit | 1,226 |
Capybara::SpecHelper.spec '#source' do
it "should return the unmodified page source" do
@session.visit('/')
@session.source.should include('Hello world!')
end
it "should return the original, unmodified source of the page", :requires => [:js, :source] do
@session.visit('/with_js')
@session.send(me... | jarib/capybara | lib/capybara/spec/session/source_spec.rb | Ruby | mit | 428 |
from binascii import hexlify
from struct import pack, unpack
import hashlib
import time
import sys
import traceback
import electrum_dgb as electrum
from electrum_dgb.bitcoin import EncodeBase58Check, DecodeBase58Check, TYPE_ADDRESS, int_to_hex, var_int
from electrum_dgb.i18n import _
from electrum_dgb.plugins import B... | protonn/Electrum-Cash | plugins/ledger/ledger.py | Python | mit | 22,169 |
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
#
# Fat Free CRM is freely distributable under the terms of MIT license.
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
class FatFreeCRM::Tagging < Ac... | fkoessler/fat_free_crm | app/models/polymorphic/fat_free_crm/tagging.rb | Ruby | mit | 408 |
import React from "react";
import { connect } from "react-redux";
import InviteNew from "./view";
import {
selectUserInvitesRemaining,
selectUserInviteNewIsPending,
selectUserInviteNewErrorMessage,
} from "redux/selectors/user";
import rewards from "rewards";
import { makeSelectRewardAmountByType } from "redux/se... | jsigwart/lbry-app | src/renderer/js/component/inviteNew/index.js | JavaScript | mit | 886 |
import { OHIF } from 'meteor/ohif:core';
import { _ } from 'meteor/underscore';
// TODO: change this to a const after refactoring newMeasurements code on measurementTableView.js
OHIF.measurements.getLocation = collection => {
for (let i = 0; i < collection.length; i++) {
if (collection[i].location) {
... | NucleusIo/HealthGenesis | viewerApp/Packages/ohif-measurements/client/lib/getMeasurementsGroupedByNumber.js | JavaScript | mit | 3,251 |
export declare class UIPasswordMeter {
score: number;
hasPassword: boolean;
tooltip: string;
maxStrength: number;
readonly strength: {
"--password-strength": string;
} | {
"--password-strength": number;
};
}
| adarshpastakia/aurelia-ui-framework | dist/typings/forms/ui-password-meter.d.ts | TypeScript | mit | 252 |
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2015, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this softw... | SoL-Photo/SoL | application/controllers/UnregisterConfirm.php | PHP | mit | 2,517 |
# -*- coding: utf-8 -*-
"""
Facade patterns
"""
class Power(object):
"""
SubSystem
"""
@staticmethod
def start():
print "Power on!"
class Display(object):
"""
Subsystem
"""
@staticmethod
def start():
print "Display on!"
class Client(object):
"""
Fac... | xuwei0455/design_patterns | Facade.py | Python | mit | 645 |
function MemberExpression(_path)
{
VISITOR.memberExpression(_path.node);
}
module.exports = MemberExpression; | seraum/nectarjs | compiler/native/visitor/plugin/MemberExpression.js | JavaScript | mit | 113 |
# frozen_string_literal: true
module SamlAuthentication
class SessionsController < Devise::SamlSessionsController
before_action :store_logging_out_username, only: :destroy
after_action :store_winning_strategy, only: :create
# Overrides SamlSessionsController.
#
# The default behavior for IdP-i... | tablexi/nucore-open | vendor/engines/saml_authentication/app/controllers/saml_authentication/sessions_controller.rb | Ruby | mit | 2,520 |
'use strict';
var path = require('path');
var assert = require('yeoman-generator').assert;
var helpers = require('yeoman-generator').test;
var os = require('os');
describe('respec:app', function () {
before(function (done) {
helpers.run(path.join(__dirname, '../app'))
.inDir(path.join(os.tmpdir(), './temp... | adrianba/generator-respec | test/test-app.js | JavaScript | mit | 595 |
package gk.nickles.ndimes.ui;
import android.content.Context;
import android.support.v4.app.Fragment;
import com.google.inject.Inject;
import java.util.List;
import gk.nickles.ndimes.model.Event;
import gk.nickles.ndimes.ui.adapter.EventDetailPagerAdapter;
import gk.nickles.ndimes.ui.fragment.DebtsFragment;
import ... | Gchorba/NickleAndDimed | app/src/main/java/gk/nickles/ndimes/ui/EventDetailTabs.java | Java | mit | 1,996 |
require 'test_helper'
module SelecaoAdmin
class IntegraUserControllerTest < ActionController::TestCase
test "should get index" do
get :index
assert_response :success
end
end
end
| swayzepatryck/selecao_admin | test/functional/selecao_admin/integra_user_controller_test.rb | Ruby | mit | 206 |