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 |
|---|---|---|---|---|---|
# frozen_string_literal: true
shared_context 'survey_assignment' do
before do
ActionMailer::Base.delivery_method = :test
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.deliveries = []
@user = create(:user, username: 'Jonathan', email: 'jonathan@wintr.us')
@user2 = create(:user, u... | Wowu/WikiEduDashboard | spec/support/shared_contexts/survey_assignment.rb | Ruby | mit | 2,341 |
<?php
header("Content-type: text/xml");
$fil = fopen("https://www.yr.no/sted/Norge/%C3%98stfold/Halden/Halden/varsel.xml","r")
while($linjer = fopen($fil)) {
echo $linjer;
}
?> | Donslayer/Introduction-to-programming-Javascript- | laptopWampInfoFiles/oppgave3/nas.proxy.php | PHP | mit | 190 |
class UsersController < ApplicationController
before_action :set_user, only: [:show, :edit, :update, :destroy]
# GET /users
# GET /users.json
def index
@users = current_admin.admin? ? User.all : current_admin.users
authorize! :read, User
@users.each do |user|
authorize! :read, user
end
... | fate83/MailAdmin | app/controllers/users_controller.rb | Ruby | mit | 2,318 |
<?php return array (
'ab' => 'Abchazisch',
'ada' => 'Adangme',
'ady' => 'Adygees',
'om' => 'Afaan Oromo',
'aa' => 'Afar',
'afh' => 'Afrihili',
'af' => 'Afrikaans',
'agq' => 'Aghem',
'ain' => 'Ainu',
'ak' => 'Akan',
'akk' => 'Akkadisch',
'ach' => 'Akoli',
'bss' => 'Akoose',
'akz' => 'Alabama'... | aanton03/language-list | data/nl_BE/language.php | PHP | mit | 14,046 |
/*
* The MIT License
* Copyright (c) 2012 Microsoft Corporation
*
* 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,... | relateiq/ews-java-api | src/main/java/microsoft/exchange/webservices/data/core/service/schema/ItemSchema.java | Java | mit | 24,413 |
// this exports a "masked" version of the WrapUp class.
var WrapUp = require("./wrapup")
module.exports = function(x){
return new WrapUp(x)
}
| kentaromiura/sugo | node_modules/wrapup/node_modules/prime/cov/node_modules/wrapup/lib/main.js | JavaScript | mit | 145 |
#Practica realizada por: Miguel Aurelio García González y Daura Hernández Díaz
#En esta practica desarrollamos tres clases, la clase Matriz, MatrizDensa y MatrizDispersa.
#La clase Matriz será la madre de las otras dos.
class Matriz
attr_accessor :m, :t
#definición del método initialize, donde crearemos la matriz... | alu0100600643/Practica12 | lib/matriz.rb | Ruby | mit | 7,713 |
#include "overviewpage.h"
#include "ui_overviewpage.h"
#include "walletmodel.h"
#include "bitcoinunits.h"
#include "optionsmodel.h"
#include "transactiontablemodel.h"
#include "transactionfilterproxy.h"
#include "guiutil.h"
#include "guiconstants.h"
#include "askpassphrasedialog.h"
#include "util.h"
#include <QAbstra... | mammix2/boostcoin-core | src/qt/overviewpage.cpp | C++ | mit | 7,949 |
import * as React from 'react';
import PropTypes from 'prop-types';
import debounce from '../utils/debounce';
import useForkRef from '../utils/useForkRef';
import useEnhancedEffect from '../utils/useEnhancedEffect';
import ownerWindow from '../utils/ownerWindow';
function getStyleValue(computedStyle, property) {
ret... | callemall/material-ui | packages/material-ui/src/TextareaAutosize/TextareaAutosize.js | JavaScript | mit | 6,538 |
# -*- coding: utf-8 -
#
# This file is part of socketpool.
# See the NOTICE for more information.
import errno
import os
import platform
import select
import socket
import sys
try:
from importlib import import_module
except ImportError:
import sys
def _resolve_name(name, package, level):
"""Retur... | benoitc/socketpool | socketpool/util.py | Python | mit | 4,541 |
version https://git-lfs.github.com/spec/v1
oid sha256:ec9603f026a2a1295d751178e7e48bf8b945506e9b05818112c5166e1e950a67
size 9557
| yogeshsaroya/new-cdnjs | ajax/libs/yui/3.8.0/calendarnavigator/calendarnavigator.js | JavaScript | mit | 129 |
require 'thread'
require 'core_ext/module/prepend_to'
module Travis
module Async
require 'travis/support/async/inline'
require 'travis/support/async/sidekiq'
require 'travis/support/async/threaded'
class << self
attr_writer :enabled
def enabled?
!!@enabled
end
def r... | final-ci/travis-support | lib/travis/support/async.rb | Ruby | mit | 1,467 |
<?php
/**
* kitFramework::Basic
*
* @author Team phpManufaktur <team@phpmanufaktur.de>
* @link https://kit2.phpmanufaktur.de
* @copyright 2013 Ralf Hertsch <ralf.hertsch@phpmanufaktur.de>
* @license MIT License (MIT) http://www.opensource.org/licenses/MIT
*/
namespace phpManufaktur\Basic\Control\CMS\LEPTON;
u... | phpManufakturHeirs/kfBasic | Control/CMS/LEPTON/InstallSearch.php | PHP | mit | 509 |
package Feb2021Leetcode;
import java.util.Arrays;
public class _1051HeightChecker {
public static void main(String[] args) {
System.out.println(heightChecker(new int[] { 1, 1, 4, 2, 1, 3 }));
System.out.println(heightChecker(new int[] { 5, 1, 2, 3, 4 }));
System.out.println(heightChecker(new int[] { 1, 2, 3, ... | darshanhs90/Java-Coding | src/Feb2021Leetcode/_1051HeightChecker.java | Java | mit | 390 |
# encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "Pre" do
before :each do
browser.goto(WatirSpec.url_for("non_control_elements.html"))
end
# Exists method
describe "#exist?" do
it "returns true if the 'p' exists" do
expect(browser.pre(id: "rspec")).to exist
... | watir/watirspec | pre_spec.rb | Ruby | mit | 4,436 |
/**
* Converts an RGB color value to HSL. Conversion formula
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
* Assumes r, g, and b are contained in the set [0, 255] and
* returns h, s, and l in the set [0, 1].
*
* @param Number r The red color value
* @param Number g The green colo... | ericoporto/Pixel.Tools | color_conversion.js | JavaScript | mit | 3,896 |
/**
* ELASTICSEARCH CONFIDENTIAL
* _____________________________
*
* [2014] Elasticsearch Incorporated All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Elasticsearch Incorporated and its suppliers,
* if any. The intellectual and technical concepts contained
... | ashnewport/elasticsearch | kibana-5.0.2-linux-x86_64/plugins/x-pack/plugins/monitoring/public/directives/shard_allocation/lib/labels.js | JavaScript | mit | 1,250 |
/**
* OnFire
* Copyright (c) 2013 - 2015 Itzy Sabo
* Licensed under the MIT License: https://github.com/isabo/onfire/blob/master/LICENSE
*/
var onfire = {};
/**
* An analogue of a Firebase reference.
* @see https://www.firebase.com/docs/web/api/firebase/constructor.html
*
* @param {string|!Firebase} urlOrRe... | isabo/onfire | src/externs/outgoing/onfire-externs.js | JavaScript | mit | 28,432 |
// ==========================================================================
// Project: SproutCore Metal
// Copyright: ©2011 Strobe Inc. and contributors.
// License: Licensed under MIT license (see license.js)
// ==========================================================================
/*globals sc_assert */
re... | crofty/sensor_js_message_parsing | vendor/sproutcore-metal/lib/observer.js | JavaScript | mit | 4,614 |
#
# converted from the gitrb project
#
# authors:
# Matthias Lederhofer <matled@gmx.net>
# Simon 'corecode' Schubert <corecode@fs.ei.tum.de>
#
# provides native ruby access to git objects and pack files
#
begin
require 'mmap'
rescue LoadError
module GitRuby
module Raw
module Internal
class Mmap... | schacon/git-ruby | lib/git-ruby/raw/internal/mmap.rb | Ruby | mit | 1,176 |
<?php
/**
* This file is part of the Nette Framework (https://nette.org)
* Copyright (c) 2004 David Grudl (https://davidgrudl.com)
*/
namespace Nette\Bridges\ApplicationLatte;
use Latte;
use Latte\CompileException;
use Latte\MacroNode;
use Latte\PhpWriter;
use Nette;
use Nette\Utils\Strings;
/**
* Macros for N... | Aprila/laboratory | vendor/nette/application/src/Bridges/ApplicationLatte/UIMacros.php | PHP | mit | 4,523 |
// This is Generated Source.
import PathSegment from "../PathSegment";
import FaxCoverPage from "./FaxCoverPage";
import Greeting from "./Greeting";
import Language from "./Language";
import Country from "./Country";
import Location from "./Location";
import State from "./State";
import Timezone from "./Timezone";
impo... | ringcentral/ringcentral-js-client | src/paths/Dictionary.ts | TypeScript | mit | 1,573 |
'use strict';
System.register('flarum/akismet/components/AkismetSettingsModal', ['flarum/components/SettingsModal'], function (_export, _context) {
var SettingsModal, AkismetSettingsModal;
return {
setters: [function (_flarumComponentsSettingsModal) {
SettingsModal = _flarumComponentsSettingsModal.defaul... | namjoker/flarumfull | vendor/flarum/flarum-ext-akismet/js/admin/dist/extension.js | JavaScript | mit | 2,370 |
package org.knowm.xchange.luno.dto.trade;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonProperty;
public class LunoOrders {
private final Order[] orders;
public LunoOrders(@JsonProperty(value = "orders", required = true) Order[] orders)... | gaborkolozsy/XChange | xchange-luno/src/main/java/org/knowm/xchange/luno/dto/trade/LunoOrders.java | Java | mit | 3,625 |
require 'minitest/autorun'
require 'theusual'
TheUsual::load :numeric
class NumericTest < Minitest::Test
def test_delimiter
# Integers
assert_equal(
'1,000',
1_000.with_delimiter
)
assert_equal(
'1,000,000',
1_000_000.with_delimiter
)
assert_equal(
'1_000',
... | dpep/theusualrb | test/test_numeric.rb | Ruby | mit | 527 |
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shape... | peppy/osu | osu.Game.Tournament/TournamentSceneManager.cs | C# | mit | 9,933 |
using Microsoft.ServiceFabric.Services.Runtime;
using System;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
namespace WebFrontEnd
{
internal static class Program
{
/// <summary>
/// This is the entry point of the service host process.
/// </summary>
... | brentstineman/PersonalStuff | Presentations/Service Fabric/RealWorldDemo/WebFrontEnd/Program.cs | C# | mit | 1,348 |
module.exports = function createItemTweet (url, user, callback) {
var fs = require("fs");
var https = require('https');
var models = require('../../models');
var itemTypes = require('../../models/item/itemTypes.json');
var tweetUrl = url;
var options = {
host: 'publish.twitte... | OlivierCoue/invow | server/helpers/item-content/createItemTweet.js | JavaScript | mit | 1,490 |
import * as React from 'react'
import {
AutocompletingTextArea,
AutocompletingInput,
IAutocompletionProvider,
} from '../autocompletion'
import { CommitIdentity } from '../../models/commit-identity'
import { ICommitMessage } from '../../lib/app-state'
import { Dispatcher } from '../../lib/dispatcher'
import { IGi... | hjobrien/desktop | app/src/ui/changes/commit-message.tsx | TypeScript | mit | 8,310 |
/**
* Context Object
*
* @author Zongmin Lei<leizongmin@gmail.com>
*/
var utils = require('./utils');
var parser = require('./parser');
var filters = require('./filters');
var vm = require('./vm');
var OPCODE = require('./opcode');
var debug = utils.debug('Context');
var merge = utils.merge;
/**
* Context
*
*... | jddeeds/jddeeds.github.io | node_modules/tinyliquid/lib/context.js | JavaScript | mit | 16,661 |
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2015-2019 The PIVX developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "primitives/block.h"
#inc... | Mrs-X/PIVX | src/primitives/block.cpp | C++ | mit | 1,381 |
require 'rails_helper'
describe Artefact do
it { should respond_to(:name) }
it { should respond_to(:description) }
it { should respond_to(:museum_identifier) }
it { should have_many(:images).dependent(:destroy) }
it { should have_many(:sketchfabs).dependent(:destroy) }
describe '.new' do
let(:artefact... | neshmi/projectmosul | spec/models/artefact_spec.rb | Ruby | mit | 828 |
import sys
from pycsp import * | IanField90/Coursework | Part 3/SE3AC11/eticket/eticket_uint.py | Python | mit | 30 |
#include "optionsmodel.h"
#include "bitcoinunits.h"
#include "init.h"
#include "walletdb.h"
#include "guiutil.h"
#include <QSettings>
OptionsModel::OptionsModel(QObject *parent) :
QAbstractListModel(parent)
{
Init();
}
bool static ApplyProxySettings()
{
QSettings settings;
CService addrProxy(setting... | landcoin-project/landcoin | src/qt/optionsmodel.cpp | C++ | mit | 9,070 |
const { assign } = require('lodash')
const proxyquire = require('proxyquire')
const contact = require('../../../../../test/unit/data/contacts/contact.json')
describe('Contact controller', () => {
beforeEach(() => {
this.getContactStub = sinon.stub().resolves(contact)
this.getDitCompanyStub = sinon.stub().re... | uktrade/data-hub-fe-beta2 | src/apps/contacts/controllers/__test__/details.test.js | JavaScript | mit | 3,180 |
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* jkl
*/
package com.microsoft.azure.management.apimanagement.v2019_01_01.implementation;
... | selvasingh/azure-sdk-for-java | sdk/apimanagement/mgmt-v2019_01_01/src/main/java/com/microsoft/azure/management/apimanagement/v2019_01_01/implementation/SubscriptionsImpl.java | Java | mit | 3,940 |
#!/usr/bin/python3
import os
import re
import requests
def download_file(url):
out_file = os.path.join("SOURCES", url.rsplit("/")[-1])
r = requests.get(url, stream=True)
print("Downloading {} to {}".format(url, out_file))
with open(out_file, "wb") as out:
for chunk in r.iter_content(chunk_size... | kyl191/nginx-pagespeed | download_sources.py | Python | mit | 1,266 |
<?php
/**
* Include the SDK by using the autoloader from Composer.
*/
require __DIR__ . '/../../vendor/autoload.php';
/**
* Include the configuration values.
*
* Ensure that you have edited the configuration.php file
* to include your application keys.
*/
$config = require __DIR__ . '/../../configuration.php';... | farooqsheikhpk/Aspose.BarCode-for-Cloud | Examples/PHP/managing-recognition/cloud-storage/recognize-specified-count-of-barcodes.php | PHP | mit | 2,244 |
const inherits = require('util').inherits
const async = require('async')
const ethUtil = require('ethereumjs-util')
const Account = require('ethereumjs-account')
const FakeMerklePatriciaTree = require('fake-merkle-patricia-tree')
const VM = require('./index.js')
const ZERO_BUFFER = new Buffer('0000000000000000000000000... | giulidb/ticket_dapp | node_modules/ethereumjs-vm/lib/hooked.js | JavaScript | mit | 5,536 |
<?php
/**
* Mockery
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://github.com/padraic/mockery/blob/master/LICENSE
* If you did not receive a copy of the licen... | Anjeyster/Dimento | vendor/mockery/mockery/library/Mockery/Generator/StringManipulationGenerator.php | PHP | mit | 2,895 |
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
namespace BookClient.Data
{
public class BookManager
{
const string Url = "http://xam150.azurewebsites.net/api/books/";
private string authorizationKey... | eliancruz29/Xamarin_university | MobileCerti/[XAM150]/xam150-ex3-start/BookClient/BookClient/Data/BookManager.cs | C# | mit | 2,399 |
using HtmlAgilityPack;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
#pragma warning disable IDE0051
namespace GM.Utilities.DevelopRetrieval
{
class ParseSplitSample
{
private string[] ParseHtmlSplitTables(string urlLink)
{
... | govmeeting/govmeeting | Utilities/DevelopRetrieval/ParseSplitSample.cs | C# | mit | 1,250 |
package crypto
import (
"bytes"
"testing"
"github.com/NebulousLabs/Sia/encoding"
"github.com/NebulousLabs/fastrand"
)
// TestUnitSignatureEncoding creates and encodes a public key, and verifies
// that it decodes correctly, does the same with a signature.
func TestUnitSignatureEncoding(t *testing.T) {
// Create... | mharkus/Sia | crypto/signatures_test.go | GO | mit | 5,005 |
title('Entity-relationship diagram.');
description('Make your database structure visible.');
dimension(800, 250);
var erd = Joint.dia.erd;
Joint.paper("world", 800, 250);
var e1 = erd.Entity.create({
rect: { x: 220, y: 70, width: 100, height: 60 },
label: "Entity"
});
var e2 = erd.Entity.create({
rect: { x: 520... | dee-bee/decisionz | decisionz/lib/JointJS/www/demos/erd.js | JavaScript | mit | 1,130 |
//
// generic/seq_packet_protocol.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Di... | mojmir-svoboda/BlackBoxTT | 3rd_party/asio/src/tests/unit/generic/seq_packet_protocol.cpp | C++ | mit | 6,415 |
/*
* Copyright (c) 2015-2022, Antonio Gabriel Muñoz Conejo <antoniogmc at gmail dot com>
* Distributed under the terms of the MIT License
*/
package com.github.tonivade.claudb.data;
import static com.github.tonivade.claudb.data.DatabaseValue.score;
import static com.github.tonivade.resp.protocol.SafeString.safeStri... | tonivade/claudb | lib/src/test/java/com/github/tonivade/claudb/data/SortedSetTest.java | Java | mit | 2,686 |
<?php
/**
* Delivers the daily production in Wh/kWh
*
* URL format:
* .../<GUID>.json?m= for Wh data
* .../<GUID>.json?u=kWh&m= for kWh data
*
* kWh format is hightly suggested!
*
* http://wiki.sonnenertrag.eu/datenimport:json
*
* @author Knut Kohl <github@knutkohl.de>
* @copyright ... | KKoPV/PVLng | core/Channel/Sonnenertrag/JSON.php | PHP | mit | 4,502 |
package com.hearthsim.card.classic.spell.rare;
import com.hearthsim.card.minion.Minion;
import com.hearthsim.card.spellcard.SpellTargetableCard;
import com.hearthsim.event.effect.EffectCharacter;
import com.hearthsim.event.filter.FilterCharacter;
import com.hearthsim.event.filter.FilterCharacterTargetedSpell;
public ... | relimited/HearthSim | src/main/java/com/hearthsim/card/classic/spell/rare/BlessedChampion.java | Java | mit | 1,657 |
package format
import (
"github.com/nareix/joy4/av/avutil"
"github.com/nareix/joy4/format/aac"
"github.com/nareix/joy4/format/flv"
"github.com/nareix/joy4/format/mp4"
"github.com/nareix/joy4/format/rtmp"
"github.com/nareix/joy4/format/rtsp"
"github.com/nareix/joy4/format/ts"
)
func RegisterAll() {
avutil.Defa... | scbizu/letschat | vendor/github.com/nareix/joy4/format/format.go | GO | mit | 557 |
<?php
// Controlador subir apunte hecho por FVieira
//Includes iniciales
require_once '../views/templateEngine.php';
require_once '../model/driver.php';
require_once '../model/Apunte.php';
require_once '../model/Usuario.php';
require_once '../model/Materia.php';
require_once '../model/Materia_... | nemoNoboru/ET3 | controllers/subirApunte.php | PHP | mit | 4,059 |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import serialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import... | twilio/twilio-python | twilio/rest/video/v1/room/room_participant/__init__.py | Python | mit | 20,355 |
require "spec_helper"
require "dependency_container"
describe DependencyContainer do
class ExampleClass; end
it "builds object instances from a factory defined by a passed-in block" do
container = DependencyContainer.new
container.define_factory(:example) { ExampleClass.new }
expect(container.get(:e... | ministryofjustice/specialist-publisher | spec/dependency_container_spec.rb | Ruby | mit | 4,540 |
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _createSvgIcon = _interopRequireDefault(require("./utils/createSvgIcon"));
var _jsxRuntime = require("react/jsx-runtime")... | oliviertassinari/material-ui | packages/mui-icons-material/lib/AccountCircleOutlined.js | JavaScript | mit | 934 |
package fuzzytime
// DateTime represents a set of fields for date and time, any of which may
// be unset. The default initialisation is a valid empty datetime with no
// fields set.
type DateTime struct {
Date
Time
}
// Equals returns true if dates and times match
func (dt *DateTime) Equals(other *DateTime) bool {
... | cardigann/cardigann | vendor/github.com/bcampbell/fuzzytime/datetime.go | GO | mit | 1,739 |
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using UnityEngine;
public class LogUploader : MonoBehaviour
{
public string log { get; private set; }
public IRCConnection ircConnection = null;
[HideInInspector]
public string analysisUrl =... | CaitSith2/ktanemod-twitchplays | Assets/Scripts/Helpers/LogUploader.cs | C# | mit | 3,929 |
/*
Ratings and how they work:
-2: Extremely detrimental
The sort of ability that relegates Pokemon with Uber-level BSTs
into NU.
ex. Slow Start, Truant
-1: Detrimental
An ability that does more harm than good.
ex. Defeatist, Normalize
0: Useless
An ability with no net effect on a Pokemon during a bat... | Raina4uberz/Showdown-light | data/abilities.js | JavaScript | mit | 120,010 |
// Source : https://oj.leetcode.com/problems/find-peak-element/
// Author : Hao Chen
// Date : 2014-12-05
/**********************************************************************************
*
* A peak element is an element that is greater than its neighbors.
*
* Given an input array where num[i] ≠ num[i+1], find ... | jaredkoontz/leetcode | algorithms/cpp/findPeakElement/findPeakElement.cpp | C++ | mit | 3,304 |
import * as React from "react";
import { CarbonIconProps } from "../../";
declare const LetterWw20: React.ForwardRefExoticComponent<
CarbonIconProps & React.RefAttributes<SVGSVGElement>
>;
export default LetterWw20;
| mcliment/DefinitelyTyped | types/carbon__icons-react/lib/letter--Ww/20.d.ts | TypeScript | mit | 218 |
<?php
class Checkoutcom_Ckopayment_Block_Customer_Cards extends Mage_Core_Block_Template
{
/**
* Return array with customer card list
*
* @return array
*/
public function getCustomerCardList()
{
$result = array();
$customerId = Mage::getModel('ckopayment/checkoutcomCards... | CKOTech/checkout-magento-plugin | app/code/community/Checkoutcom/Ckopayment/Block/Customer/Cards.php | PHP | mit | 1,138 |
// -----------------------------------------------------------------------
// <copyright file="AssemblyInfo.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation.
// All rights reserved. 2013
// </copyright>
// -----------------------------------------------------------------------
using System;
using Syst... | pharring/ApplicationInsights-dotnet | LOGGING/src/NLogTarget/AssemblyInfo.cs | C# | mit | 2,225 |
AutoHtml.add_filter(:image) do |text|
text.gsub(/https?:\/\/.+\.(jpg|jpeg|bmp|gif|png)(\?\S+)?/i) do |match|
%|<img src="#{match}" alt=""/>|
end
end | amishyn/auto_html | lib/auto_html/filters/image.rb | Ruby | mit | 156 |
from nltk.corpus import wordnet
import json
import codecs
import sys
import time
major_weight = 1.0
minor_weight = 0.8
similarity_threshold = 0.65
def fn(ss1, ss2, weight):
similarity = ss1.wup_similarity(ss2)
return (ss1, ss2, weight * similarity if similarity else 0 )
def isSynsetForm(s):
return '.n.' in s o... | darenr/MOMA-Art | kadist/wup.py | Python | mit | 1,480 |
<?php
/** @throws RuntimeException */
function maybeThrow920() {
if ( rand() ) {
throw new \RuntimeException;
}
return true;
}
function check920(int $flag) {
try {
maybeThrow920();
} catch ( \RuntimeException $e ) {
$flag = false;
$excep = $e;
} catch (Error $e) {
$... | etsy/phan | tests/files/src/0920_flatten.php | PHP | mit | 648 |
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel
//
// 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, copy, modi... | VirusFree/SharpDX | Source/Toolkit/SharpDX.Toolkit/Graphics/ModelData.Material.cs | C# | mit | 3,138 |
package com.arkcraft.module.items.common.entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.item.Item;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.MovingObjectPosition;
imp... | SolarCactus/ARKCraft-Code | src/main/java/com/arkcraft/module/items/common/entity/EntityDodoEgg.java | Java | mit | 2,029 |
//******************************************************************************************************
// RestrictAccessAttribute.cs - Gbtc
//
// Copyright © 2012, Grid Protection Alliance. All Rights Reserved.
//
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements.... | GridProtectionAlliance/gsf | Source/Libraries/GSF.Security/RestrictAccessAttribute.cs | C# | mit | 3,748 |
/* @flow */
import SelectListView from "atom-select-list";
import store from "./store";
import _ from "lodash";
import tildify from "tildify";
import WSKernel from "./ws-kernel";
import { kernelSpecProvidesGrammar } from "./utils";
import type Kernel from "./kernel";
function getName(kernel: Kernel) {
const prefi... | rgbkrk/hydrogen | lib/existing-kernel-picker.js | JavaScript | mit | 2,362 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace JSNLog
{
/// <summary>
/// Classes (loggers, etc.) that implement this interface can generate
/// JSON name-value fields based on their properties. These fields are used in the
/// JSON object passed to se... | mperdeck/jsnlog | jsnlog/PublicFacing/Configuration/JsnlogConfiguration/ICanCreateJsonFields.cs | C# | mit | 977 |
'''@file alignment_decoder.py
contains the AlignmentDecoder'''
import os
import struct
import numpy as np
import tensorflow as tf
import decoder
class AlignmentDecoder(decoder.Decoder):
'''gets the HMM state posteriors'''
def __call__(self, inputs, input_seq_length):
'''decode a batch of data
... | vrenkens/Nabu-asr | nabu/neuralnetworks/decoders/alignment_decoder.py | Python | mit | 3,558 |
require 'logger'
require 'pathname'
module PactBroker
module Logging
# Need to make this configurable based on the calling app!
LOG_DIR = Pathname.new(File.join(File.dirname(__FILE__), '..', '..', 'log')).cleanpath
LOG_FILE_NAME = "#{ENV['RACK_ENV'] || 'development'}.log"
def self.included(base)
... | ThePletch/pact_broker | lib/pact_broker/logging.rb | Ruby | mit | 645 |
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2017 The Las Vegas Coin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licen... | keesdewit82/LasVegasCoin | src/lasvegascoind.cpp | C++ | mit | 6,106 |
from unittest import TestCase
from unittest.mock import patch
from genes.apt.get import APTGet
class APTGetInstallTestCase(TestCase):
def test_apt_get_install_no_items_fails(self):
with patch('genes.process.process.Popen') as mock_popen:
apt_get = APTGet()
with self.assertRaises(V... | hatchery/Genepool2 | genes/apt/test_get.py | Python | mit | 1,570 |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTi... | johanlantz/headsetpresenter | HeadsetPresenter_Bluetools/HeadsetPresenter/Bluetools/BlueTools SDK v1.21/dotNetCF200/C#/ObexPushClient/Properties/AssemblyInfo.cs | C# | mit | 1,262 |
#include <epicmeter/benchmark.hpp>
#include <blackhole/formatter/string.hpp>
#include <blackhole/logger.hpp>
#include <blackhole/macro.hpp>
#include <blackhole/sink/null.hpp>
#include <blackhole/sink/stream.hpp>
#include "../util.hpp"
#define BH_BASE_LOG(__log__, ...) \
if (auto record = (__log__).open_record())... | antmat/blackhole | src/benchmark/logger/logger.cpp | C++ | mit | 3,474 |
package main
import (
"database/sql"
"fmt"
"github.com/PuerkitoBio/goquery"
_ "github.com/go-sql-driver/mysql"
"sync"
"time"
)
type NewsSpider struct {
TargetUrl string
TargetSource string
MysqlDSN string
InsertStmt string
QueryStmt string
Duration int
}
type Paper str... | researchlab/golearning | news_spider/news_spider_list.go | GO | mit | 4,627 |
// Copyright IBM Corp. 2013,2016. All Rights Reserved.
// Node module: loopback-connector-mongodb
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
var g = require('strong-globalize')();
var DataSource = require('loopback-datasource-juggler').DataSource;
... | Tuxity/loopback-connector-mongodb | example/model.js | JavaScript | mit | 2,094 |
package com.github.highcharts4gwt.model.array.api;
public interface ArrayNumber
{
double get(int index);
int length();
void push(double value);
/**
* Replacement for native set method
*
* @param index
* @param value
*/
void setValue(int index, double value);
... | hcharts/highcharts4gwt | src/main/java/com/github/highcharts4gwt/model/array/api/ArrayNumber.java | Java | mit | 357 |
import src.dot.dotentity
class DotHeart(src.dot.dotentity.DotEntity):
def __init__(self):
res = [
"assets/img/red-brick.png",
"assets/img/black-brick.png"
]
grid = [
[0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0],
[0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
... | m4nolo/steering-all | src/dot/entities/dotheart.py | Python | mit | 817 |
class Photo < ActiveRecord::Base
belongs_to :imageable, polymorphic: true
has_many :comments, as: :commentable
has_attached_file :image, :styles => { :medium => "300x300>", :thumb => "100x100>" }, :default_url => "default.jpg"
validates_attachment_content_type :image, :content_type => /\Aimage\/.*\Z/
end
| illiteratelinds/OurTinerary1 | app/models/photo.rb | Ruby | mit | 314 |
module.exports = {
entry: './main.js',
output: {
path: './',
filename: 'index.js',
},
devServer: {
inline: true,
port: 3333,
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['es2015', 're... | claycarpenter/node-sandbox | rx-sandbox/creating-apps-with-observables/webpack.config.js | JavaScript | mit | 355 |
<?php
namespace ManaPHP\Cli;
interface RunnerInterface
{
public function run();
} | manaphp/manaphp | ManaPHP/Cli/RunnerInterface.php | PHP | mit | 87 |
# The Rukuli::Searchable module is the heart of Sikuli. It defines the
# wrapper around Sikuli's on screen image searching and matching capability
# It is implemented by the Region class.
#
module Rukuli
module Searchable
# Public: search for an image within a Region
#
# filename - A String representat... | ndrluis/Rukuli | lib/rukuli/searchable.rb | Ruby | mit | 4,815 |
package vm
import (
"fmt"
"io/ioutil"
"net/http"
"strings"
"github.com/goby-lang/goby/vm/classes"
"github.com/goby-lang/goby/vm/errors"
)
// Instance methods --------------------------------------------------------
func builtinHTTPClientInstanceMethods() []*BuiltinMethodObject {
//TODO: cookie jar and mutabl... | goby-lang/goby | vm/http_client.go | GO | mit | 6,593 |
{
"name": "espresso.js",
"url": "https://github.com/techlayer/espresso.js.git"
}
| bower/components | packages/espresso.js | JavaScript | mit | 85 |
import React from 'react';
const EmptyStateIcon = props => (
<svg {...props.size || { width: '144px', height: '144px' }} {...props} viewBox="0 0 144 144">
{props.title && <title>{props.title}</title>}
<defs>
<path d="M76,8 L20,8 C15.6,8 12,11.6 12,16 L12,72 C12,76.4 15.6,80 20,80 L36,80 L48,92 L60,80... | InsideSalesOfficial/insidesales-components | src/components/icons/EmptyStateIcon.js | JavaScript | mit | 1,707 |
<?php
namespace Qafoo\ChangeTrack\Analyzer\ResultBuilder;
use Qafoo\ChangeTrack\Analyzer\Result\ClassChanges;
class ClassChangesBuilder
{
/**
* @var string
*/
private $className;
/**
* @var \Qafoo\ChangeTrack\Analyzer\ResultBuilder\MethodChangesBuilder[]
*/
private $methodChanges... | Qafoo/changetrack | src/main/Qafoo/ChangeTrack/Analyzer/ResultBuilder/ClassChangesBuilder.php | PHP | mit | 1,361 |
package v6_test
import (
"errors"
"time"
"code.cloudfoundry.org/bytefmt"
"code.cloudfoundry.org/cli/actor/actionerror"
"code.cloudfoundry.org/cli/actor/v2action"
"code.cloudfoundry.org/cli/actor/v2v3action"
"code.cloudfoundry.org/cli/actor/v3action"
"code.cloudfoundry.org/cli/api/cloudcontroller/ccv2/constant... | odlp/antifreeze | vendor/github.com/cloudfoundry/cli/command/v6/restart_command_test.go | GO | mit | 23,815 |
package binarytrees;
/**
* Given a binary tree, find its depth.
*
* Signature of expected method:
*
* public static int maxDepth(TreeNode<?> root) {...}
*/
public class TreeDepth {
public static int maxDepth(TreeNode<?> root) {
if (root == null) {
return 0;
}
return Math.max(maxDepth(root.getLeft... | kowshik/big-o | java/src/binarytrees/TreeDepth.java | Java | mit | 362 |
/*
* Copyright (c) 2017. MIT-license for Jari Van Melckebeke
* Note that there was a lot of educational work in this project,
* this project was (or is) used for an assignment from Realdolmen in Belgium.
* Please just don't abuse my work
*/
//! moment.js locale configuration
//! locale : Albanian (sq)
//! author ... | N00bface/Real-Dolmen-Stage-Opdrachten | stageopdracht/src/main/resources/static/vendors/moment/locale/sq.js | JavaScript | mit | 2,726 |
// Dear ImGui: standalone example application for DirectX 10
// If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp.
// Read online: https://github.com/ocornut/imgui/tree/master/docs
#include "imgui.h"
#include "imgui_impl_win32.h"
#include "imgui_impl_dx10.h"
#include <d... | zq317157782/Narukami | external/imgui/examples/example_win32_directx10/main.cpp | C++ | mit | 9,656 |
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddARelationBetweenStudentAndTeam extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('students', function (Blueprint $table) {... | ungdev/integration-UTT | database/migrations/2016_07_09_171819_add_a_relation_between_student_and_team.php | PHP | mit | 1,034 |
// (c) 2012 Guilherme Oenning
var hCharts=[];function setIntervalAndExecute(func,time){func();return(setInterval(func,time));}
Highcharts.Chart.prototype.clearSeries=function(){while(this.series.length>0)
this.series[0].remove(true);};function loadChartAjax(options){var chart=hCharts[options.chartId];var url=options.... | oenning/highcharts-mvc | src/Highcharts.Mvc/highcharts-mvc.min.js | JavaScript | mit | 994 |
# frozen_string_literal: true
RSpec.describe RuboCop::Cop::Style::EvenOdd do
subject(:cop) { described_class.new }
it 'converts x % 2 == 0 to #even?' do
expect_offense(<<~RUBY)
x % 2 == 0
^^^^^^^^^^ Replace with `Integer#even?`.
RUBY
expect_correction(<<~RUBY)
x.even?
RUBY
end
... | tdeo/rubocop | spec/rubocop/cop/style/even_odd_spec.rb | Ruby | mit | 3,756 |
export type SpanId = number
export const traceGlobals: Map<any, any> = new Map()
export const setGlobal = (key: any, val: any) => {
traceGlobals.set(key, val)
}
| zeit/next.js | packages/next/trace/shared.ts | TypeScript | mit | 164 |
require 'test_helper'
class PageTest < Zena::Unit::TestCase
context 'Creating a page' do
setup do
login(:tiger)
end
should 'work with just a title' do
assert_difference('Node.count', 1) do
secure(Page) { Page.create(:parent_id=>nodes_id(:projects), :title=>'lazy node')}
end
... | BackupTheBerlios/zena | test/unit/page_test.rb | Ruby | mit | 1,066 |
#pragma once
#include "physics/discrete_trajectory_iterator.hpp"
#include "astronomy/epoch.hpp"
#include "geometry/named_quantities.hpp"
namespace principia {
namespace physics {
namespace internal_discrete_trajectory_iterator {
using geometry::InfiniteFuture;
using geometry::Instant;
template<typename Frame>
FORC... | mockingbirdnest/Principia | physics/discrete_trajectory_iterator_body.hpp | C++ | mit | 9,469 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CAD.Core;
namespace CAD.Web
{
public class Tenant : ITenant
{
public string Name { get; set; }
private Lazy<List<TenantPlugin>> _plugins = new Lazy<List<TenantPlugin>>(()... | markglibres/cad.web | src/Configuration/Tenant.cs | C# | mit | 1,119 |
<?php
/**
* Redirect
*
* HTTP redirection commands.
*
* @package core
* @author stefano.azzolini@caffeinalab.com
* @copyright Caffeina srl - 2015 - http://caffeina.it
*/
class Redirect {
use Module;
public static function to($url, $status=302){
if ($link = Filter::with('core.redirect',$url)) ... | caffeina-core/core | classes/Redirect.php | PHP | mit | 1,140 |
##
# This code was generated by
# \ / _ _ _| _ _
# | (_)\/(_)(_|\/| |(/_ v1.0.0
# / /
#
# frozen_string_literal: true
module Twilio
module REST
class Conversations < Domain
class V1 < Version
class ServiceContext < InstanceContext
class ConfigurationContext < Instance... | philnash/twilio-ruby | lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb | Ruby | mit | 17,122 |
<?php
namespace REBELinBLUE\Deployer\Presenters;
use Illuminate\Support\Facades\Lang;
use REBELinBLUE\Deployer\Command;
use Robbo\Presenter\Presenter;
/**
* The view presenter for a command class.
*/
class CommandPresenter extends Presenter
{
/**
* Gets the readable list of before clone commands.
*
... | iflamed/deployer | app/Presenters/CommandPresenter.php | PHP | mit | 2,738 |