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
<?php return [ '@class' => 'Grav\\Common\\File\\CompiledYamlFile', 'filename' => '/Users/kenrickkelly/Sites/hokui/user/plugins/admin/languages/tlh.yaml', 'modified' => 1527231007, 'data' => [ 'PLUGIN_ADMIN' => [ 'LOGIN_BTN_FORGOT' => 'lIj', 'BACK' => 'chap', '...
h0kui/hokui
cache/compiled/files/02efd2c2255a28026bd81d6a8068c728.yaml.php
PHP
mit
452
import React from 'react'; import ReactDOM from 'react-dom'; import _ from 'underscore'; import babel from 'babel-core/browser'; import esprima from 'esprima'; import escodegen from 'escodegen'; import estraverse from 'estraverse'; import Codemirror from 'react-codemirror'; import classNames from 'classnames'; import ...
frank-weindel/react-live-demo
app/index.js
JavaScript
mit
5,927
import React from "react" import { injectIntl } from "react-intl" import { NavLink } from "react-router-dom" import PropTypes from "prop-types" import Styles from "./Navigation.css" function Navigation({ intl }) { return ( <ul className={Styles.list}> <li><NavLink exact to="/" activeClassName={Styles.acti...
sebastian-software/edgeapp
src/components/Navigation.js
JavaScript
mit
832
package main import ( "bufio" "os" "fmt" ) func main() { counts := make(map[string]int) fileReader, err := os.Open("words.txt") if err != nil { fmt.Println(err) os.Exit(1) } defer fileReader.Close() scanner := bufio.NewScanner(fileReader) // Set the split function for the scanning operation. scanner....
farmatholin/gopl-exercises
ch4/ex4_9/ex4_9.go
GO
mit
608
<?php defined("_VALID_ACCESS") || die('Direct access forbidden'); $recordsets = Utils_RecordBrowserCommon::list_installed_recordsets(); $checkpoint = Patch::checkpoint('recordset'); $processed = $checkpoint->get('processed', array()); foreach ($recordsets as $tab => $caption) { if (isset($processed[$tab])) { ...
georgehristov/EPESI
modules/Utils/RecordBrowser/patches/add_help_to_fields.php
PHP
mit
611
const Marionette = require('backbone.marionette'); const MeterValuesView = require('./MeterValuesView.js'); module.exports = class EnergyMetersView extends Marionette.View { template = Templates['capabilities/energy/meters']; className() { return 'energy-meters'; } regions() { return { metersByPeriod...
monitron/jarvis-ha
lib/web/scripts/capabilities/energy/EnergyMetersView.js
JavaScript
mit
625
const _ = require('lodash'); const en = { modifiers: require('../../res/en').modifiers }; const Types = require('../../lib/types'); const optional = { optional: true }; const repeatable = { repeatable: true }; const nullableNumber = { type: Types.NameExpression, name: 'number', nullable: true...
hegemonic/catharsis
test/specs/nullable.js
JavaScript
mit
9,138
class ACLHelperMethod < ApplicationController access_control :helper => :foo? do allow :owner, :of => :foo end def allow @foo = Foo.first render inline: "<div><%= foo? ? 'OK' : 'AccessDenied' %></div>" end end
be9/acl9
test/dummy/app/controllers/acl_helper_method.rb
Ruby
mit
232
<?php namespace App\Application\Controllers\Traits; trait HelpersTrait{ protected function checkIfArray($request){ return is_array($request) ? $request : [$request]; } protected function createLog($action , $status , $messages = ''){ $data = [ 'action' => $action, ...
issabdo/DIVCODING
app/Application/Controllers/Traits/HelpersTrait.php
PHP
mit
527
angular.module('Reader.services.options', []) .factory('options', function($rootScope, $q) { var controllerObj = {}; options.onChange(function (changes) { $rootScope.$apply(function () { for (var property in changes) { controllerObj[property] = changes[property].newValue; ...
Janpot/google-reader-notifier
app/js/services/options.js
JavaScript
mit
858
class UsersController < ApplicationController def index end def show @user = User.find(params[:id]) end def edit @user = User.find(params[:id]) end def update @user = User.find(params[:id]) if @user.update_attributes(user_params) @user.geocode else render 'edit' end end ...
reginad1/skipdamenu
app/controllers/users_controller.rb
Ruby
mit
409
import Ember from 'ember'; import DS from 'ember-data'; import DataAdapterMixin from 'ember-simple-auth/mixins/data-adapter-mixin'; export default DS.RESTAdapter.extend(DataAdapterMixin, { authorizer: 'authorizer:dspace', initENVProperties: Ember.on('init', function() { let ENV = this.container.lookupFactory(...
atmire/dsember-core
addon/adapters/application.js
JavaScript
mit
949
function alertThanks (post) { alert("Thanks for submitting a post!"); return post; } Telescope.callbacks.add("postSubmitClient", alertThanks);
mxchelle/PhillyAIMSApp
packages/custom/lib/callbacks.js
JavaScript
mit
148
"use strict"; var async = require('async'); var fs = require('fs'); var util = require('util'); var prompt = require('prompt'); var httpRequest = require('emsoap').subsystems.httpRequest; var common = require('./common'); var mms = require('./mms'); var mmscmd = require('./mmscmd'); var deploy = require('./deploy'); ...
emote/tools
lib/sfsetup.js
JavaScript
mit
5,142
#!/usr/bin/env python # coding:utf-8 """ Database operation module. This module is independent with web module. """ import time, logging import db class Field(object): _count = 0 def __init__(self, **kw): self.name = kw.get('name', None) self.ddl = kw.get('ddl', '') self._default =...
boisde/Greed_Island
business_logic/order_collector/transwarp/orm.py
Python
mit
11,968
package cn.libery.calendar.MaterialCalendar; import android.content.Context; import java.util.Collection; import java.util.HashSet; import cn.libery.calendar.MaterialCalendar.spans.DotSpan; /** * Decorate several days with a dot */ public class EventDecorator implements DayViewDecorator { private int color...
Thewhitelight/Calendar
app/src/main/java/cn/libery/calendar/MaterialCalendar/EventDecorator.java
Java
mit
752
/** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import React from 'react'; // import Layout from '../.....
luanlv/comhoavang
src/routes/admin/index.js
JavaScript
mit
959
using System; using System.Collections.Generic; namespace HarmonyLib { /// <summary>Specifies the type of method</summary> /// public enum MethodType { /// <summary>This is a normal method</summary> Normal, /// <summary>This is a getter</summary> Getter, /// <summary>This is a setter</summary> Setter, ...
pardeike/Harmony
Harmony/Public/Attributes.cs
C#
mit
27,094
<?php namespace MyApplication\Navigation\Navigation; interface NavigationControlFactory { /** * @return NavigationControl */ function create(); }
Joseki/Sandbox
app/MyApplication/Navigation/Navigation/NavigationControlFactory.php
PHP
mit
166
# Declaring a Function def recurPowerNew(base, exp): # Base case is when exp = 0 if exp <= 0: return 1 # Recursive Call elif exp % 2 == 0: return recurPowerNew(base*base, exp/2) return base * recurPowerNew(base, exp - 1)
jabhij/MITx-6.00.1x-Python-
Week-3/L5/Prob3.py
Python
mit
268
import * as riot from 'riot' import { init, compile } from '../../helpers/' import TargetComponent from '../../../dist/tags/popup/su-popup.js' describe('su-popup', function () { let element, component let spyOnMouseover, spyOnMouseout init(riot) const mount = opts => { const option = Object.assign({ ...
black-trooper/semantic-ui-riot
test/spec/popup/su-popup.spec.js
JavaScript
mit
2,656
require "graph_engine/engine" module GraphEngine end
kenegozi/graph_engine
lib/graph_engine.rb
Ruby
mit
54
import { NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; import { SharedModule, ExamplesRouterViewerComponent } from '../../../shared'; import { AppModule } from './app.module'; import { AppComponent } from './app.component'; @NgModule({ imports: [ SharedModule, AppModule, ...
ngx-formly/ngx-formly
demo/src/app/examples/other/material-prefix-suffix/config.module.ts
TypeScript
mit
2,128
const jwt = require('jsonwebtoken'); const User = require('../models/User'); // import { port, auth } from '../../config'; /** * The Auth Checker middleware function. */ module.exports = (req, res, next) => { if (!req.headers.authorization) { return res.status(401).end(); } // get the last part from a a...
ziedAb/PVMourakiboun
src/data/middleware/auth-check.js
JavaScript
mit
874
//10. Odd and Even Product //You are given n integers (given in a single line, separated by a space). //Write a program that checks whether the product of the odd elements is equal to the product of the even elements. //Elements are counted from 1 to n, so the first element is odd, the second is even, etc. using Syst...
HMNikolova/Telerik_Academy
CSharpPartOne/6. Loops/10. OddAndEvenProduct/OddAndEvenProduct.cs
C#
mit
1,480
var Ringpop = require('ringpop'); var TChannel = require('TChannel'); var express = require('express'); var NodeCache = require('node-cache'); var cache = new NodeCache(); var host = '127.0.0.1'; // not recommended for production var httpPort = process.env.PORT || 8080; var port = httpPort - 5080; var bootstrapNodes =...
Andras-Simon/nodebp
second.js
JavaScript
mit
1,982
Element.prototype.remove = function() { this.parentElement.removeChild(this); } const addIcon = (icon) => `<i class="fa fa-${icon}"></i>` const headerTxt = (type) => { switch (type) { case 'error': return `${addIcon('ban')} Error` case 'warning': return `${addIcon('excl...
jcarral/Subsub
build/script/lib/modals.js
JavaScript
mit
1,439
<?php /* * This file is part of Rocketeer * * (c) Maxime Fabre <ehtnam6@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * */ namespace Rocketeer\Services\History; use Illuminate\Support\Collection; /** * Keeps a memor...
rocketeers/rocketeer
src/Rocketeer/Services/History/History.php
PHP
mit
1,576
<?php /** * Created by PhpStorm. * User: olivier * Date: 01/02/15 * Time: 00:58 */ namespace AppBundle\Entity; use Doctrine\ORM\EntityRepository; /** * BusinessServiceRepository */ class BusinessServiceRepository extends EntityRepository { public function findByRefList(array $refList) { $qb =...
casual-web/autodom
src/AppBundle/Entity/BusinessServiceRepository.php
PHP
mit
1,434
package br.com.k19.android.cap3; import android.app.Activity; import android.os.Bundle; public class MainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.frame); } }
andersonsilvade/workspacejava
Workspaceandroid/MainActivity/src/br/com/k19/android/cap3/MainActivity.java
Java
mit
280
// Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Lioncoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "base58.h" #include "core.h" #include "init.h" #include "keystore.h" #include...
lion-coin/lioncoin
src/rpcrawtransaction.cpp
C++
mit
32,779
# This file is copied to spec/ when you run 'rails generate rspec:install' ENV['RAILS_ENV'] ||= 'test' require File.expand_path('../../config/environment', __FILE__) # Prevent database truncation if the environment is production abort("The Rails environment is running in production mode!") if Rails.env.production? requ...
raadler/Scrivn
spec/rails_helper.rb
Ruby
mit
652
import React from 'react'; import { View, ScrollView } from 'react-native'; import ConcensusButton from '../components/ConcensusButton'; import axios from 'axios'; const t = require('tcomb-form-native'); const Form = t.form.Form; const NewPollScreen = ({ navigation }) => { function onProposePress() { navig...
concensus/react-native-ios-concensus
screens/NewPollScreen.js
JavaScript
mit
929
package com.mikescamell.sharedelementtransitions.recycler_view.recycler_view_to_viewpager; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import com.mikescamell.sharedelementtransitions.R; public class RecyclerViewToViewPagerActivity extends AppCompatActivity { @Override protecte...
mikescamell/shared-element-transitions
app/src/main/java/com/mikescamell/sharedelementtransitions/recycler_view/recycler_view_to_viewpager/RecyclerViewToViewPagerActivity.java
Java
mit
652
define(["ace/ace"], function(ace) { return function(element) { var editor = ace.edit(element); editor.setTheme("ace/theme/eclipse"); editor.getSession().setMode("ace/mode/python"); editor.getSession().setUseSoftTabs(true); editor.getSession().setTabSize(4); editor.setShowPrintMargin(false); return edito...
nachovizzo/AUTONAVx
simulator/autonavx_demo/js/init/editor.js
JavaScript
mit
330
/** * React components for kanna projects. * @module kanna-lib-components */ "use strict"; module.exports = { /** * @name KnAccordionArrow */ get KnAccordionArrow() { return require('./kn_accordion_arrow'); }, /** * @name KnAccordionBody */ get KnAccordionBody() { return require...
kanna-lab/kanna-lib-components
lib/index.js
JavaScript
mit
4,495
<?php namespace App\Helpers\Date; use Nette; /** * Date and time helper for better work with dates. Functions return special * DateTimeHolder which contains both textual and typed DateTime. */ class DateHelper { use Nette\SmartObject; /** * Create datetime from the given text if valid, or otherwise ...
CatUnicornKiller/web-app
app/helpers/date/DateHelper.php
PHP
mit
1,928
#include <iostream> #include <fstream> #include <seqan/basic.h> #include <seqan/index.h> #include <seqan/seq_io.h> #include <seqan/sequence.h> #include <seqan/file.h> #include <seqan/score.h> #include <seqan/seeds.h> #include <seqan/align.h> using namespace seqan; seqan::String<Seed<Simple> > get_global_seed_chain(se...
bkahlert/seqan-research
raw/pmsb13/pmsb13-data-20130530/sources/130wu1dgzoqmxyu2/2013-05-01T11-34-38.877+0200/sandbox/my_sandbox/apps/lagan_neu/lagan_neu.cpp
C++
mit
8,171
#include "stdafx.h" #include "GPUResource.h" #include <algorithm> #include "D3D12DeviceContext.h" CreateChecker(GPUResource); GPUResource::GPUResource() {} GPUResource::GPUResource(ID3D12Resource* Target, D3D12_RESOURCE_STATES InitalState) :GPUResource(Target, InitalState, (D3D12DeviceContext*)RHI::GetDefaultDevice())...
Andrewcjp/GraphicsEngine
GraphicsEngine/Source/D3D12RHI/RHI/RenderAPIs/D3D12/GPUResource.cpp
C++
mit
4,208
package com.braintreepayments.api; import android.os.Parcel; import android.os.Parcelable; import android.text.TextUtils; import androidx.annotation.Nullable; import com.braintreepayments.api.GraphQLConstants.Keys; import org.json.JSONException; import org.json.JSONObject; /** * Use to construct a card tokenizati...
braintree/braintree_android
Card/src/main/java/com/braintreepayments/api/Card.java
Java
mit
7,536
package cn.edu.siso.rlxapf; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; public class DeviceActivity extends AppCompatActivity { private Button devicePrefOk = null; @Override protected vo...
taowenyin/RLXAPF
app/src/main/java/cn/edu/siso/rlxapf/DeviceActivity.java
Java
mit
995
require 'spec_helper' RSpec.configure do |config| config.before(:suite) do VCR.configuration.configure_rspec_metadata! end end describe VCR::RSpec::Metadata, :skip_vcr_reset do before(:all) { VCR.reset! } after(:each) { VCR.reset! } context 'an example group', :vcr do context 'with a nested example...
spookandpuff/spooky-core
.bundle/gems/vcr-2.0.0/spec/vcr/test_frameworks/rspec_spec.rb
Ruby
mit
2,807
<?php declare(strict_types=1); namespace OAuth2Framework\Tests\Component\ClientRule; use InvalidArgumentException; use OAuth2Framework\Component\ClientRule\ApplicationTypeParametersRule; use OAuth2Framework\Component\ClientRule\RuleHandler; use OAuth2Framework\Component\Core\Client\ClientId; use OAuth2Framework\Comp...
OAuth2-Framework/oauth2-framework
tests/Component/ClientRule/ApplicationTypeParameterRuleTest.php
PHP
mit
2,505
function countBs(string) { return countChar(string, "B"); } function countChar(string, ch) { var counted = 0; for (var i = 0; i < string.length; i++) { if (string.charAt(i) == ch) counted += 1; } return counted; } console.log(countBs("BBC")); // -> 2 console.log(countChar("kakk...
jdhunterae/eloquent_js
ch03/su03-bean_counting.js
JavaScript
mit
343
// dvt /* 1. Да се напише if-конструкция, * която изчислява стойността на две целочислени променливи и * разменя техните стойности, * ако стойността на първата променлива е по-голяма от втората. */ package myJava; import java.util.Scanner; public class dvt { public static void main(String[] args) { Sca...
dvt32/cpp-journey
Java/Unsorted/21.05.2015.14.36.java
Java
mit
793
/* * Copyright (c) André Bargull * Alle Rechte vorbehalten / All Rights Reserved. Use is subject to license terms. * * <https://github.com/anba/es6draft> */ /*--- id: sec-function-calls-runtime-semantics-evaluation info: Check TypeError is thrown from correct realm with tco-call to class constructor from class [[...
anba/es6draft
src/test/scripts/suite262/language/expressions/call/tco-cross-realm-class-construct.js
JavaScript
mit
1,776
package com.rootulp.rootulpjsona; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.AsyncTask; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.util.Log; import android.view.Menu; import android.view.MenuItem...
rootulp/school
mobile_apps/assignment6_rootulp/RootulpJsonA/app/src/main/java/com/rootulp/rootulpjsona/picPage.java
Java
mit
2,172
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;...
bruno-cadorette/IFT232Projet
GameBuilder/BuilderControl/ResourcesControl.xaml.cs
C#
mit
911
<?php declare(strict_types=1); namespace JDWil\Xsd\Event; /** * Class FoundAnyAttributeEvent * @package JDWil\Xsd\Event */ class FoundAnyAttributeEvent extends AbstractXsdNodeEvent { }
jdwil/xsd-tool
src/Event/FoundAnyAttributeEvent.php
PHP
mit
190
# 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 #------------------------------------------------------------------------------ # == Schema Information # # Ta...
fkoessler/fat_free_crm
app/models/polymorphic/fat_free_crm/avatar.rb
Ruby
mit
2,377
// Copyright (c) 2015 Elements of Programming Interviews. All rights reserved. package com.epi; import java.util.Random; public class RabinKarp { // @include // Returns the index of the first character of the substring if found, -1 // otherwise. public static int rabinKarp(String t, String s) { if (s.len...
adnanaziz/epicode
java/src/main/java/com/epi/RabinKarp.java
Java
mit
3,435
using System; using System.Collections.Generic; using Sekhmet.Serialization.Utility; namespace Sekhmet.Serialization { public class CachingObjectContextFactory : IObjectContextFactory { private readonly IInstantiator _instantiator; private readonly ReadWriteLock _lock = new ReadWriteLock(); ...
kimbirkelund/SekhmetSerialization
trunk/src/Sekhmet.Serialization/CachingObjectContextFactory.cs
C#
mit
3,112
require "rails_helper" RSpec.describe DiagnosesController, type: :routing do describe "routing" do it "routes to #index" do expect(:get => "/diagnoses").to route_to("diagnoses#index") end it "routes to #new" do expect(:get => "/diagnoses/new").to route_to("diagnoses#new") end it "r...
KarlHeitmann/Programa-Clinico
spec/routing/diagnoses_routing_spec.rb
Ruby
mit
1,050
__global__ void /*{kernel_name}*/(/*{parameters}*/) { int _tid_ = threadIdx.x + blockIdx.x * blockDim.x; if (_tid_ < /*{num_threads}*/) { /*{execution}*/ _result_[_tid_] = /*{block_invocation}*/; } }
prg-titech/ikra-ruby
lib/resources/cuda/kernel.cpp
C++
mit
238
#!/usr/bin/env python2.7 import sys for line in open(sys.argv[1]): cut=line.split('\t') if len(cut)<11: continue print ">"+cut[0] print cut[9] print "+" print cut[10]
ursky/metaWRAP
bin/metawrap-scripts/sam_to_fastq.py
Python
mit
173
#ifndef __CXXU_TYPE_TRAITS_H__ #define __CXXU_TYPE_TRAITS_H__ #include <type_traits> #include <memory> namespace cxxu { template <typename T> struct is_shared_ptr_helper : std::false_type { typedef T element_type; static element_type& deref(element_type& e) { return e; } static const elemen...
ExpandiumSAS/cxxutils
sources/include/cxxu/cxxu/type_traits.hpp
C++
mit
890
package by.itransition.dpm.service; import by.itransition.dpm.dao.BookDao; import by.itransition.dpm.dao.UserDao; import by.itransition.dpm.entity.Book; import by.itransition.dpm.entity.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.Authentication; import ...
AndreiBiruk/DPM
src/main/java/by/itransition/dpm/service/BookService.java
Java
mit
1,653
/** * getRoles - get all roles * * @api {get} /roles Get all roles * @apiName GetRoles * @apiGroup Role * * * @apiSuccess {Array[Role]} raw Return table of roles * @apiSuccessExample {json} Success-Response: * HTTP/1.1 200 OK * [ * { * "id": 1, * "name": "Administrator", * ...
MadDeveloper/easy.js
src/bundles/role/doc/role.doc.js
JavaScript
mit
2,414
import { Component } from 'react'; import format from '../components/format'; import parse from 'date-fns/parse'; import getDay from 'date-fns/get_day'; import Media from 'react-media'; import Page from '../layouts/Page'; import TimelineView from '../components/TimelineView'; import ListView from '../components/ListVie...
webkom/jubileum.abakus.no
pages/index.js
JavaScript
mit
1,320
import { defineAsyncComponent } from 'vue'; import { showModal } from '../../../modal/modal.service'; import { User } from '../../../user/user.model'; import { GameBuild } from '../../build/build.model'; import { Game } from '../../game.model'; import { GamePackage } from '../package.model'; interface GamePackagePurch...
gamejolt/gamejolt
src/_common/game/package/purchase-modal/purchase-modal.service.ts
TypeScript
mit
761
// // detail/win_iocp_socket_recvfrom_op.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2003-2012 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.lslboost.org/LICENSE_1...
gazzlab/LSL-gazzlab-branch
liblsl/external/lslboost/asio/detail/win_iocp_socket_recvfrom_op.hpp
C++
mit
4,108
module.exports = (req, res, next) => { req.context = req.context || {}; next(); };
thedavisproject/davis-web
src/middleware/initContext.js
JavaScript
mit
87
'use strict'; angular.module('achan.previewer').service('imagePreviewService', function () { var source; var ImagePreviewService = { render: function (scope, element) { element.html('<img src="' + source + '" class="img-responsive" />'); }, forSource: function (src) { source = src; re...
achan/angular-previewer
app/scripts/services/imagePreviewService.js
JavaScript
mit
392
require 'spec_helper' describe Group do # Check that gems are installed # Acts as Taggable on gem it { should have_many(:base_tags).through(:taggings) } # Check that appropriate fields are accessible it { should allow_mass_assignment_of(:name) } it { should allow_mass_assignment_of(:description) } it { ...
gemvein/cooperative
spec/models/group_spec.rb
Ruby
mit
768
# -*- coding: utf-8 -*- # Keyak v2 implementation by Jos Wetzels and Wouter Bokslag # hereby denoted as "the implementer". # Based on Keccak Python and Keyak v2 C++ implementations # by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni, # Joan Daemen, Michaël Peeters, Gilles Van Assche and Ronny Van Keer # # Fo...
samvartaka/keyak-python
utils.py
Python
mit
1,775
import _plotly_utils.basevalidators class BordercolorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="bordercolor", parent_name="sankey.hoverlabel", **kwargs ): super(BordercolorValidator, self).__init__( plotly_name=plotly_name, ...
plotly/plotly.py
packages/python/plotly/plotly/validators/sankey/hoverlabel/_bordercolor.py
Python
mit
482
using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace jaytwo.Common.Futures.Numbers { public static class MathUtility { public static double StandardDeviation(IEnumerable<double> data) { var average = data.Average(); var individualDeviations = data.Select(x => Math...
jakegough/jaytwo.CommonLib
CommonLib.Futures/Numbers/MathUtility.cs
C#
mit
534
using FFImageLoading.Forms.Sample.WinPhoneSL.Resources; namespace FFImageLoading.Forms.Sample.WinPhoneSL { /// <summary> /// Provides access to string resources. /// </summary> public class LocalizedStrings { private static AppResources _localizedResources = new AppResources(); pu...
AndreiMisiukevich/FFImageLoading
samples/ImageLoading.Forms.Sample/WinPhoneSL/FFImageLoading.Forms.Sample.WinPhoneSL/LocalizedStrings.cs
C#
mit
407
package com.aws.global.dao; import java.util.ArrayList; import com.aws.global.classes.Pizza; import com.aws.global.common.base.BaseDAO; import com.aws.global.mapper.PizzaRowMapper; public class PizzaDAO extends BaseDAO{ //SQL Statement when user adds a pizza to his inventory public void addPizza(String pizzaName...
sethbusque/pizzaccio
src_custom/com/aws/global/dao/PizzaDAO.java
Java
mit
1,598
var test = require('./tape') var mongojs = require('../index') test('should export bson types', function (t) { t.ok(mongojs.Binary) t.ok(mongojs.Code) t.ok(mongojs.DBRef) t.ok(mongojs.Double) t.ok(mongojs.Long) t.ok(mongojs.MinKey) t.ok(mongojs.MaxKey) t.ok(mongojs.ObjectID) t.ok(mongojs.ObjectId) ...
mafintosh/mongojs
test/test-expose-bson-types.js
JavaScript
mit
408
class SuchStreamingBot class << self def matches? text !!(text =~ /hello world/) end end end
coleww/twitter_bot_generator
such_streaming_bot/src/such_streaming_bot.rb
Ruby
mit
115
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // Les informations générales relatives à un assembly dépendent de // l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations // associées à un assembly. [assembly:...
Monkios/ClientServerGame
ConsoleClient/Properties/AssemblyInfo.cs
C#
mit
1,546
package com.instaclick.filter; /** * Defines a behavior that should be implement by all filter * * @author Fabio B. Silva <fabio.bat.silva@gmail.com> */ public interface DataFilter { /** * Adds the given {@link Data} if it does not exists * * @param data * * @return <b>TRUE</b> if the ...
instaclick/PDI-Plugin-Step-BloomFilter
ic-filter/src/main/java/com/instaclick/filter/DataFilter.java
Java
mit
780
#include <bits/stdc++.h> using namespace std; int count_consecutive(string &s, int n, int k, char x) { int mx_count = 0; int x_count = 0; int curr_count = 0; int l = 0; int r = 0; while (r < n) { if (x_count <= k) { if (s[r] == x) x_count++; r+...
sazid/codes
problem_solving/codeforces/676C.cpp
C++
mit
881
using BaxterWorks.B2.Exceptions; using BaxterWorks.B2.Types; namespace BaxterWorks.B2.Extensions { public static class BucketExtensions { public static Bucket GetOrCreateBucket(this ServiceStackB2Api client, CreateBucketRequest request) { try { return c...
voltagex/b2-csharp
BaxterWorks.B2/Extensions/BucketExtensions.cs
C#
mit
2,003
/* * The MIT License * * Copyright 2017 Arnaud Hamon * * 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, mod...
PtitNoony/FxTreeMap
src/main/java/com/github/ptitnoony/components/fxtreemap/MapData.java
Java
mit
3,281
# Potrubi gemName = 'potrubi' #requireList = %w(mixin/bootstrap) #requireList.each {|r| require_relative "#{gemName}/#{r}"} __END__
ianrumford/potrubi
lib/potrubi/potrubi.rb
Ruby
mit
137
import numpy as np import warnings from .._explainer import Explainer from packaging import version torch = None class PyTorchDeep(Explainer): def __init__(self, model, data): # try and import pytorch global torch if torch is None: import torch if version.parse(tor...
slundberg/shap
shap/explainers/_deep/deep_pytorch.py
Python
mit
16,170
using Lemonade.Data.Entities; namespace Lemonade.Data.Commands { public interface IUpdateFeature { void Execute(Feature feature); } }
thesheps/lemonade
src/Lemonade.Data/Commands/IUpdateFeature.cs
C#
mit
157
/* Misojs Codemirror component */ var m = require('mithril'), basePath = "external/codemirror/", pjson = require("./package.json"); // Here we have a few fixes to make CM work in node - we only setup each, // if they don't already exist, otherwise we would override the browser global.document = global.document || ...
jsguy/misojs-codemirror-component
codemirror.component.js
JavaScript
mit
2,410
// github package provides an API client for github.com // // Copyright (C) 2014 Yohei Sasaki // // 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/l...
speedland/wcg
supports/github/api.go
GO
mit
3,000
<?php namespace Oro\Bundle\AttachmentBundle\Tests\Unit\Entity; use Oro\Bundle\AttachmentBundle\Entity\File; use Oro\Bundle\UserBundle\Entity\User; use Oro\Component\Testing\Unit\EntityTestCaseTrait; use Oro\Component\Testing\Unit\EntityTrait; use Symfony\Component\HttpFoundation\File\File as ComponentFile; class Fil...
orocrm/platform
src/Oro/Bundle/AttachmentBundle/Tests/Unit/Entity/FileTest.php
PHP
mit
3,094
require 'json_diff/version' # Provides helper methods to compare object trees (like those generated by JSON.parse) # and generate a list of their differences. module JSONDiff # Generates an Array of differences between the two supplied object trees with Hash roots. # # @param a [Hash] the left hand side of the c...
chrisvroberts/json_diff
lib/json_diff.rb
Ruby
mit
2,550
import { observable, action } from 'mobx'; import Fuse from 'fuse.js'; import Activity from './../utils/Activity'; import noop from 'lodash/noop'; import uniqBy from 'lodash/uniqBy'; const inactive = Activity(500); export default class Story { @observable keyword = ''; @observable allStories = []; @observable s...
nadimtuhin/facebook-activity-monitor
src/content/store/Story.js
JavaScript
mit
1,020
# -*- coding: utf-8 -*- from __future__ import unicode_literals import time import curses from . import docs from .content import SubmissionContent, SubredditContent from .page import Page, PageController, logged_in from .objects import Navigator, Color, Command from .exceptions import TemporaryFileError class Subm...
shaggytwodope/rtv
rtv/submission_page.py
Python
mit
11,574
#include <zombye/core/game.hpp> #include <zombye/gameplay/camera_follow_component.hpp> #include <zombye/gameplay/game_states.hpp> #include <zombye/gameplay/gameplay_system.hpp> #include <zombye/gameplay/states/menu_state.hpp> #include <zombye/gameplay/states/play_state.hpp> #include <zombye/gameplay/state_component.hpp...
kasoki/project-zombye
src/source/zombye/gameplay/gameplay_system.cpp
C++
mit
1,741
/** * @module popoff/overlay * * Because overlay-component is hopelessly out of date. * This is modern rewrite. */ const Emitter = require('events').EventEmitter; const inherits = require('inherits'); const extend = require('xtend/mutable'); module.exports = Overlay; /** * Initialize a new `Overlay`. * * ...
dfcreative/popoff
overlay.js
JavaScript
mit
2,294
#!/usr/bin/env python import os import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # Test label reading from an MNI tag file # # The current directory must be writeable. # try: fname = "mni-tagtest.tag" channel = open(fname, "wb") ...
timkrentz/SunTracker
IMU/VTK-6.2.0/IO/MINC/Testing/Python/TestMNITagPoints.py
Python
mit
3,826
// The MIT License (MIT) // // Copyright (c) 2015 Rasmus Mikkelsen // https://github.com/rasmus/EventFlow // // 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...
liemqv/EventFlow
Source/EventFlow.Hangfire/Integration/HangfireJobScheduler.cs
C#
mit
3,367
if (isset($_POST['upload'])) { $target = "../img".basename($_FILES['image']['name']); $image = $_FILES['image']['name']; $msg = ""; $sql = "UPDATE user SET avatar='$image' WHERE id='$id'"; mysqli_query($conn, $sql); if (move_uploaded_file($_FILES['image']['tmp_name'], $target)) { $msg = "Uploaded file...
vicols92/linkify
resources/includes/TRASH/KANSKESPARA.php
PHP
mit
3,055
module Twitter class JSONStream protected def reconnect_after timeout @reconnect_callback.call(timeout, @reconnect_retries) if @reconnect_callback if timeout == 0 reconnect @options[:host], @options[:port] start_tls if @options[:ssl] else EventMachine.add_timer(timeo...
neurodrone/earthquake
lib/earthquake/ext.rb
Ruby
mit
1,538
namespace Jello.Nodes { public abstract class TerminalNode<T> : Node<T> where T : class { public override INode GetSingleChild() { return null; } } }
jordanwallwork/jello
src/Jello/Nodes/TerminalNode.cs
C#
mit
197
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Copyright (c) 2011-2012 Litecoin Developers // Copyright (c) 2013 Fastcoin Developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license...
RandCoin/randcoin
src/irc.cpp
C++
mit
10,568
package fyskam.fyskamssngbok; import android.app.Activity; import android.app.ActionBar; import android.app.Fragment; import android.support.v4.app.ActionBarDrawerToggle; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.content.SharedPreferences; import andro...
fyskam/FysKams-sangbok
FysKamsSangbok/app/src/main/java/fyskam/fyskamssngbok/NavigationDrawerFragment.java
Java
mit
10,600
import uuid from uqbar.objects import new from supriya.patterns.Pattern import Pattern class EventPattern(Pattern): ### CLASS VARIABLES ### __slots__ = () ### SPECIAL METHODS ### def _coerce_iterator_output(self, expr, state=None): import supriya.patterns if not isinstance(expr,...
Pulgama/supriya
supriya/patterns/EventPattern.py
Python
mit
1,545
/* Copyright (c) 2011 Andrei Mackenzie 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, modify, merge, publish, distribute...
crazyfacka/text2meo
data/lib/levenshtein.js
JavaScript
mit
1,980
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Pervasive_Heart_Monitor { class Program { static bool checknum(string s) { return (s.Contains("1") || s.Contains("2") || s.Contains("3") || s.Contains("4") |...
SurgicalSteel/Competitive-Programming
Kattis-Solutions/Pervasive Heart Monitor.cs
C#
mit
1,202
//! \file ArcSG.cs //! \date 2018 Feb 01 //! \brief 'fSGX' multi-frame image container. // // Copyright (C) 2018 by morkt // // 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 Softwar...
morkt/GARbro
ArcFormats/Ivory/ArcSG.cs
C#
mit
2,865
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace track_downloader { class Program { static void Main(string[] args) { string[] blacklisted = Console.ReadLine().Split(); List<string> filenames =...
Avarea/Programming-Fundamentals
Lists/02TrackDownloader/Program.cs
C#
mit
1,263
import React, { PropTypes } from 'react'; import { connect } from 'react-redux'; import GroupPage from './GroupPage.js'; import GroupNotFoundPage from './GroupNotFoundPage.js'; const Group = ({ isValid, groupId }) => (isValid ? <GroupPage groupId={groupId} /> : <GroupNotFoundPage groupId={groupId} />); Group.propTy...
logger-app/logger-app
src/containers/Group/Group.js
JavaScript
mit
545