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 |
|---|---|---|---|---|---|
module PgToCsv
VERSION = "0.0.1"
end
| Solomon/pg_to_csv | lib/pg_to_csv/version.rb | Ruby | mit | 39 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Web.UI.Interfaces;
namespace Web.UI.Controllers
{
public class CategoryController : BaseController
{
ICategoryRepository _categoryRepository;
public CategoryController(ICategoryRep... | lizhen325/DakHanMaRi | Web.UI/Controllers/CategoryController.cs | C# | mit | 710 |
define(['underscore', 'klik/core/Class'], function (_, Class) {
'use strict';
return Class('GameObject', {
methods: {
preload: function() {
},
create: function() {
},
update: function() {
}
}
});
});
| kctang/klik | src/core/GameObject.js | JavaScript | mit | 302 |
<?php $week = array('日','月','火','水','木','金','土'); ?>
@extends('layouts.app')
@section('title', 'みんなの目標')
@section('content')
<div class="container">
<div class="row text-center">
<h2>「{{ \Request::input('searchword') }}」の検索結果</h2>
<h5>公開設定の目標のみ表示されます</h5>
</div>
@forelse ($aims as $aim)
<div class="panel ... | masasikatano/openaim | resources/views/search.blade.php | PHP | mit | 3,656 |
/**
* 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.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
... | vulcansteel/autorest | AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azurespecials/models/ErrorException.java | Java | mit | 2,283 |
package com.logistics.pvis.color;
public class Color {
public int r, g, b, a;
public Color(int r, int g, int b, int a) {
this.r = r;
this.g = g;
this.b = b;
this.a = a;
}
public Color(int r, int g, int b) {
this.r = r;
this.g = g;
this.b = b;
this.a = 255;
}
public Color(int grayScale) {
... | sunyifan112358/pvis | src/main/com/logistics/pvis/color/Color.java | Java | mit | 1,233 |
class RegistrationsController < ApplicationController
helper_method :registration, :registration_params
def new
@registration = Registration.new(year: current_year)
end
def create
@registration = Registration.new(registration_params)
render :new
end
private
attr_reader :registration
def... | johncarney/veterans-walk | app/controllers/registrations_controller.rb | Ruby | mit | 538 |
Given "I am not signed in" do
visit destroy_user_session_path
end
Given "I am signed in" do
Given 'I am not signed in'
And 'I have a user with email "user@getshrink.com" and password "shrink"'
When 'I go to the homepage'
And 'I fill in "Email" with "user@getshrink.com"'
And 'I fill in "Password" with "shri... | jcxplorer/shrink | features/step_definitions/authentication_steps.rb | Ruby | mit | 439 |
package com.timekeeping.app.activities;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.app.AlertDialog.Builder;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
impor... | XinyueZ/timekeeping | app/src/main/java/com/timekeeping/app/activities/MainActivity.java | Java | mit | 25,657 |
//= require_tree .
$(document).ready(function() {
var labelXML = "";
$.get("/javascripts/StudentNametag.label", function(data) {
labelXML = data;
});
var printers = dymo.label.framework.getPrinters();
var printerName = "";
for (var i = 0; i < printers.length; ++i)
{
var printer = printers[i];... | whitecl/dymo-js-sample | source/javascripts/all.js | JavaScript | mit | 1,003 |
//
// Description:
// Control Spot from campfire. https://github.com/1stdibs/Spot
//
// Dependencies:
// underscore
//
// Configuration:
// HUBOT_SPOT_URL
//
// Commands:
// hubot music status? - Lets you know what's up
// hubot play! - Plays current playlist or song.
// hubot pause - Pause the music.
// ... | dyg2104/hubot-scripts | src/scripts/spot.js | JavaScript | mit | 21,207 |
require 'spec_helper'
require 'securerandom'
describe Chore::DuplicateDetector do
class FakeDalli
def initialize
@store = {}
end
def add(id, val, ttl=0)
if @store[id] && @store[id][:inserted] + @store[id][:ttl] > Time.now.to_i
return false
else
@store[id] = {:val => val,... | Tapjoy/chore | spec/chore/duplicate_detector_spec.rb | Ruby | mit | 2,473 |
import {Component, OnInit, OnDestroy, Input, Host} from '@angular/core';
import {NgClass, NgStyle} from '@angular/common';
import {ProgressDirective} from './progress.directive';
// todo: number pipe
// todo: use query from progress?
@Component({
selector: 'bar',
directives: [NgClass, NgStyle],
template: `
<... | Neil-Ni/ng2-foundation | components/progressbar/bar.component.ts | TypeScript | mit | 1,733 |
import request from 'request';
import wsse from 'wsse';
import xml2js from 'xml2js';
function pad(n) {
return ('0' + n).slice(-2);
}
const toString = Object.prototype.toString;
// 型判定
function isString(v) {
return toString.call(v) == '[object String]';
}
function isDate(v) {
return toString.call(v) == '[objec... | sfpgmr/node-hatena-blog-api2 | src/blog.js | JavaScript | mit | 15,445 |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.FilterList = undefined;
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next())... | reactmob/dos-filter | lib/Fabric/FilterList.js | JavaScript | mit | 3,795 |
package edu.galileo.android.photofeed.main.ui;
public interface MainView {
void onUploadInit();
void onUploadComplete();
void onUploadError(String error);
}
| micromasterandroid/androidadvanced | Lesson 4/PhotoFeed/app/src/main/java/edu/galileo/android/photofeed/main/ui/MainView.java | Java | mit | 171 |
import { Hash } from 'archmage-persistence'
export interface Block {
hash: Hash
format: number
number: number
content: Hash
previous?: Hash
timestamp: Date
}
| silentorb/archmage | packages/archmage-chaining/src/chaining/types.ts | TypeScript | mit | 171 |
require "edition"
require_relative 'simple_smart_answer_edition/node'
require_relative 'simple_smart_answer_edition/node/option'
class SimpleSmartAnswerEdition < Edition
include Mongoid::Document
field :body, type: String
embeds_many :nodes, :class_name => "SimpleSmartAnswerEdition::Node"
accepts_nested_att... | dinuksha/Test | app/models/simple_smart_answer_edition.rb | Ruby | mit | 1,716 |
var React = require('react');
var Link = require('react-router-dom').Link;
class Home extends React.Component {
render() {
return (
<div className='home-container'>
<h1>Github Battle: Battle your friends...and stuff.</h1>
<Link className='button' to='/battle'>
... | brianmmcgrath/react-github-battle | app/components/Home.js | JavaScript | mit | 430 |
export { AuthenticationService } from './authentication.service';
export { CustomHttp } from './customHttp';
| Zinadore/capstoneed-common | src/shared/Services/index.ts | TypeScript | mit | 109 |
/**
* @file
* @author zdying
*/
'use strict';
var assert = require('assert');
var path = require('path');
var parseHosts = require('../src/proxy/tools/parseHosts');
describe('proxy hosts',function(){
it('正确解析hosts文件', function(){
var hostsObj = parseHosts(path.resolve(__dirname, 'proxy/hosts.example'... | zdying/hiipack | test/proxy.hosts.test.js | JavaScript | mit | 618 |
var EventEmitter = require('events').EventEmitter;
var _ = require('underscore');
var Message = require('./Message');
var ProduceRequest = require('./ProduceRequest');
var Connection = require('./Connection');
var ConnectionCache = require('./ConnectionCache');
var Producer = function(topic, options){
if (!topic || ... | uber/Prozess | Producer.js | JavaScript | mit | 2,432 |
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 Erik Zivkovic
*
* 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... | bes/MHFS | src/main/java/se/bes/mhfs/plugin/PluginManager.java | Java | mit | 2,713 |
import numpy as np
import scipy.misc
import matplotlib.pyplot as plt
x = np.linspace(0, 5, 100)
y1 = np.power(2, x)
y2 = scipy.misc.factorial(x)
plt.plot(x, y1)
plt.plot(x, y2)
plt.grid(True)
plt.savefig('../../img/question_4_plots/g.png')
| ammiranda/CS325 | week1/plots/question_4/g.py | Python | mit | 243 |
using System.Diagnostics.CodeAnalysis;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Interactivity;
namespace GSD.Behaviors
{
[SuppressMessage( "ReSharper", "MemberCanBePrivate.Global" )]
[ExcludeFromCodeCoverage]
internal class EnterCommand : Behavior<TextBo... | TheSylence/GSD | GSD/Behaviors/EnterCommand.cs | C# | mit | 1,719 |
/**
* Swaggy Jenkins
* Jenkins API clients generated from Swagger / Open API specification
*
* The version of the OpenAPI document: 1.1.2-pre.0
* Contact: blah@cliffano.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 5.4.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
... | cliffano/swaggy-jenkins | clients/cpp-restbed-server/generated/model/ClockDifference.cpp | C++ | mit | 2,607 |
using System;
using System.Collections.Generic;
using System.Reactive.Linq;
using System.Reactive.Threading.Tasks;
using MS.Core;
namespace System.Runtime.Remoting.Channels
{
public static class __IServerChannelSink
{
public static
IObservable
<
Tuple
... | RixianOpenTech/RxWrappers | Source/Wrappers/mscorlib/System.Runtime.Remoting.Channels.IServerChannelSink.cs | C# | mit | 4,315 |
require "ios-deploy/version"
module IosDeploy
# Your code goes here...
end
| mokagio/ios-deploy-gem | lib/ios-deploy.rb | Ruby | mit | 78 |
require_dependency "conductor/application_controller"
module Conductor
class DatabasesController < ApplicationController
def show
@database = Database.instance
end
def update
@database = Database.instance
@database.content = params[:database][:content]
@database.save
flash[:... | NewRosies/conductor | app/controllers/conductor/databases_controller.rb | Ruby | mit | 422 |
webpackJsonp([0x78854e72ca23],{567:function(t,e){t.exports={pathContext:{}}}});
//# sourceMappingURL=path---blog-gatsby-github-a0e39f21c11f6a62c5ab.js.map | russellschmidt/russellschmidt.github.io | path---blog-gatsby-github-a0e39f21c11f6a62c5ab.js | JavaScript | mit | 154 |
module Mruby
# (Not documented)
#
# ## Fields:
# :struct_name ::
# (String)
# :dfree ::
# (FFI::Pointer(*))
class MrbDataType < FFI::Struct
layout :struct_name, :string,
:dfree, :pointer
end
end
| DAddYE/mrb | lib/mrb/mrb_data_type.rb | Ruby | mit | 233 |
package me.yoerger.geoff.edu.progClass.assignments.eight;
import java.util.Scanner;
import me.yoerger.geoff.edu.progClass.assignments.Analysis;
import me.yoerger.geoff.edu.progClass.assignments.Printer;
import me.yoerger.geoff.edu.progClass.bookClasses.FileChooser;
import me.yoerger.geoff.edu.progClass.bookClasses.Pi... | DirkyJerky/ProgrammingClass | src/me/yoerger/geoff/edu/progClass/assignments/eight/eightFive.java | Java | mit | 3,209 |
<?php
ob_start();
session_start();
require_once( '../../../wp-load.php' );
wp();
header('HTTP/1.1 200 OK');
if (!function_exists('wp_handle_upload')){
require_once( ABSPATH . 'wp-admin/includes/file.php' );
}
$body = @file_get_contents('php://input');
$event_json = json_decode($body);
if( $event_json->data->ob... | CORBmx/Kiwi | update_conekta.php | PHP | mit | 629 |
/******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2015-2018 Baldur Karlsson
*
* 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... | etnlGD/renderdoc | renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp | C++ | mit | 60,078 |
// Template Source: Enum.java.tt
// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// -------------------------------------------------... | microsoftgraph/msgraph-sdk-java | src/main/java/com/microsoft/graph/models/SubjectRightsRequestStatus.java | Java | mit | 750 |
package org.scribe.services;
import static org.junit.Assert.*;
import org.junit.*;
import org.scribe.exceptions.OAuthException;
public class HMACSha1SignatureServiceTest
{
private HMACSha1SignatureService service;
@Before
public void setup()
{
service = new HMACSha1SignatureService();
}
@Test
pu... | jamietsao/scribe-java | src/test/java/org/scribe/services/HMACSha1SignatureServiceTest.java | Java | mit | 1,447 |
define(['jquery', 'backbone', 'BaseView'], function ($, Backbone, BaseView) {
describe('BaseView', function () {
describe('(managing views)', function() {
var view, childView1, childView2, childView3, childView4;
beforeEach(function(){
view = new (BaseView.extend(... | lrodziewicz/backbone-asterisk | test/BaseView.spec.js | JavaScript | mit | 6,941 |
<?php namespace Toyotadjakarta\SalesModule\Model;
use Anomaly\Streams\Platform\Database\Seeder\Seeder;
class ModelSeeder extends Seeder
{
/**
* Run the seeder.
*/
public function run()
{
//
}
}
| vileopratama/portal-toyotadjakarta | addons/toyotadjakarta/toyotadjakarta/sales-module/src/Model/ModelSeeder.php | PHP | mit | 231 |
<?php
/**
* List View Single Event
* This file contains one event in the list view
*
* Override this template in your own theme by creating a file at [your-theme]/tribe-events/list/single-event.php
*
* @version 4.5.6
*
*/
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
// Setup an array of venue details for us... | philipptrenz/wkkv_theme | tribe-events/list/single-event.php | PHP | mit | 2,377 |
package visitor.rgpike.com;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.os.AsyncTask;
import android.util.Log;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
i... | arcanericky/hotspot-pass | src/visitor/rgpike/com/HttpPostThreadBase.java | Java | mit | 3,746 |
class ApplicationController < ActionController::Base
helper_method :current_user
before_action :set_raven_context
def ensure_authenticated!
return if current_user
redirect_to "/login"
end
def ensure_admin!
return if current_user.admin?
head :not_found
end
def ensure_not_authenticated!
... | osumb/challenges | app/controllers/application_controller.rb | Ruby | mit | 897 |
import { bindable } from 'aurelia-framework';
import { Example19 } from './example19';
import { SlickDataView, SlickGrid, ViewModelBindableData } from '../../aurelia-slickgrid';
export class DetailViewCustomElement {
@bindable() model!: {
duration: Date;
percentComplete: number;
reporter: string;
st... | ghiscoding/aurelia-slickgrid | src/examples/slickgrid/example19-detail-view.ts | TypeScript | mit | 2,145 |
package city.animations.interfaces;
import city.bases.interfaces.AnimationInterface;
public interface MarketAnimatedCashier extends AnimationInterface{
// Data
// Constructor
// Abstract
// Movement
// Getters
// Setters
// Utilities
}
| zhangtdavid/SimCity | src/city/animations/interfaces/MarketAnimatedCashier.java | Java | mit | 276 |
<?php
namespace Site\Bundle\BackendBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Doctrine\ORM\EntityRepository;
class FrontDillerCentreInfoForm extends AbstractType
{
public function __constr... | markmoskalenko/mirlada | src/Site/Bundle/BackendBundle/Form/FrontDillerCentreInfoForm.php | PHP | mit | 3,126 |
package fr.insee.rmes.utils.ddi;
import java.io.StringWriter;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.Strea... | InseeFr/DDI-Access-Services | src/main/java/fr/insee/rmes/utils/ddi/UtilXML.java | Java | mit | 1,006 |
using System;
using System.Collections.Generic;
using System.Linq;
namespace Deepcode.CommandLine.Parser
{
/// <summary>
/// Represents a parsed command line - the command line switches and values
/// are parsed into a structured collection that is exposed from this class.
/// </summary>
public class CommandLine... | Deepcodecouk/Deepcode.CommandLine | src/Deepcode.CommandLine/Parser/CommandLineArguments.cs | C# | mit | 2,503 |
#include <craft/character.hpp>
#include <craft/shaderVoxel.hpp>
#include <craft/chunkController.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtc/constants.hpp>
#include <glm/gtc/matrix_inverse.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <cmath>
#include <iostream>
void character::velocity ()
{
if (xdown ... | joshbainbridge/craft-game | src/character.cpp | C++ | mit | 7,418 |
//start drag of element
function drag(ev) {
ev.dataTransfer.setData("text", ev.target.id);
}
//allow drop of element
function allowDrop(ev) {
ev.preventDefault();
}
//drag of element
function drop(ev) {
ev.preventDefault();
var data = ev.dataTransfer.getData("text");
ev.target.appendChild(document.g... | arpit2126/AGILE-DASHBOARD | main.js | JavaScript | mit | 1,098 |
#include "RemoveDuplicateLetters.hpp"
#include <vector>
using namespace std;
string RemoveDuplicateLetters::removeDuplicateLetters(string s) {
vector<int> freq(256, 0);
vector<bool> visited(256, false);
string ret;
for (auto c : s) freq[c]++;
for (auto c : s) {
freq[c]--;
if (v... | yanzhe-chen/leetcode | src/RemoveDuplicateLetters.cpp | C++ | mit | 561 |
if (typeof (window) === 'undefined') var loki = require('../../src/lokijs.js');
describe('testing unique index serialization', function () {
var db;
beforeEach(function () {
db = new loki();
users = db.addCollection('users');
users.insert([{
username: 'joe'
}, {
username: 'jack'
}, ... | VladimirTechMan/LokiJS | spec/generic/persistence.spec.js | JavaScript | mit | 31,627 |
package net.glowstone.msg;
public final class RelativeEntityPositionRotationMessage extends Message {
private final int id, deltaX, deltaY, deltaZ, rotation, pitch;
public RelativeEntityPositionRotationMessage(int id, int deltaX, int deltaY, int deltaZ, int rotation, int pitch) {
this.id = id;
... | karlthepagan/Glowstone | src/main/java/net/glowstone/msg/RelativeEntityPositionRotationMessage.java | Java | mit | 1,088 |
import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
for (int i = 0; i < n; i++) {
int k = sc.nextInt();
int[] input = new int[k];
for ... | yijingbai/LeetCode | SPOJ/CODESPTB_InsersionSort/InsersionSort.java | Java | mit | 1,972 |
module FootballApi
class MatchInfo
attr_accessor :stadium_name, :attendance, :time, :referee, :id
def initialize(hash = {})
@id = hash[:id]
@stadium_name = hash[:stadium][:name] if hash[:stadium]
@attendance = hash[:attendance][:name] if hash[:attendance]
@time ... | AfonsoTsukamoto/football_api | lib/football_api/match_info.rb | Ruby | mit | 445 |
/*
* This file is part of Prism, licensed under the MIT License (MIT).
*
* Copyright (c) 2015 Helion3 http://helion3.com/
*
* 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 rest... | Stonebound/Prism | src/main/java/com/helion3/prism/api/records/Actionable.java | Java | mit | 2,008 |
using System.Collections.Generic;
using System.Linq;
using FancyTraveller.Domain.Logic;
using FancyTraveller.Domain.Model;
using FancyTraveller.Domain.POCO;
namespace FancyTraveller.Domain.Services
{
public class RouteService : IRouteService
{
private readonly IVertexRepository vertexRepository;
... | tkestowicz/FancyTraveller | FancyTravellerApp/FancyTraveller.Domain/Services/RouteService.cs | C# | mit | 2,238 |
const TYPE_NUMBER = 'number';
export function isNumber(value: unknown): value is number {
return typeof value === TYPE_NUMBER || value instanceof Number;
}
| rumble-charts/rumble-charts | src/helpers/isNumber.ts | TypeScript | mit | 161 |
// module of common directives, filters, etc
namespace common {
'use strict';
angular
.module('common', []);
}
| yellownoggin/dkindred | src/client/app/common/common.module.ts | TypeScript | mit | 128 |
/**
* Description : This is a test suite that tests an LRS endpoint based on the testing requirements document
* found at https://github.com/adlnet/xAPI_LRS_Test/blob/master/TestingRequirements.md
*
* https://github.com/adlnet/xAPI_LRS_Test/blob/master/TestingRequirements.md
*
*/
(function (module) {
"use str... | cr8onski/lrs-conformance-test-suite | test/v1_0_2/configs/statements.js | JavaScript | mit | 16,935 |
package creditnote
import (
"testing"
assert "github.com/stretchr/testify/require"
stripe "github.com/stripe/stripe-go/v72"
_ "github.com/stripe/stripe-go/v72/testing"
)
func TestCreditNoteGet(t *testing.T) {
cn, err := Get("cn_123", nil)
assert.Nil(t, err)
assert.NotNil(t, cn)
}
func TestCreditNoteList(t *t... | stripe/stripe-go | creditnote/client_test.go | GO | mit | 3,100 |
<?php
namespace BackOffice\RO\ReservationBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* This is the class that validates and merges configuration from your app/config files
*
* To learn more see {@link ... | ramisg85/oueslatirami | src/BackOffice/RO/ReservationBundle/DependencyInjection/Configuration.php | PHP | mit | 891 |
CatarsePaypalExpress::Engine.routes.draw do
resources :paypal_express, only: [], path: 'payment/paypal_express' do
collection do
post :ipn
end
member do
get :review
match :pay
match :success
match :cancel
end
end
end
| MHBA/catarse_paypal_express | config/routes.rb | Ruby | mit | 271 |
package com.symbolplay.tria.game;
public final class CollisionEffects {
public static final int JUMP_BOOST = 0;
public static final int REPOSITION_PLATFORMS = 1;
public static final int VISIBLE_ON_JUMP = 2;
public static final int IMPALE_ATTACHED_SPIKES = 3;
public static final int REVEAL_ON_J... | mrzli/tria | core/src/com/symbolplay/tria/game/CollisionEffects.java | Java | mit | 2,103 |
<?php
/* SVN FILE: $Id: cake_test_case.php 7945 2008-12-19 02:16:01Z gwoo $ */
/**
* Short description for file.
*
* Long description for file
*
* PHP versions 4 and 5
*
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.c... | tectronics/fambom | cake/tests/lib/cake_test_case.php | PHP | mit | 21,057 |
#include "ofApp.h"
#include "SharedUtils.h"
void updatePuppet(Skeleton* skeleton, ofxPuppet& puppet) {
for(int i = 0; i < skeleton->size(); i++) {
puppet.setControlPoint(skeleton->getControlIndex(i), skeleton->getPositionAbsolute(i));
}
}
//--------------------------------------------------------------
void ofAp... | CreativeInquiry/digital_art_2014 | MeshTester/src/ofApp.cpp | C++ | mit | 6,809 |
<?php
namespace Home\Controller;
use Think\Controller;
class AddressController extends Controller
{
protected function _initialize ()
{
if (!session('user')) {
if (IS_AJAX) {
$this->ajaxReturn(['status'=>2, 'info'=>'请登陆之后在执行此操作!']);
} else {
$th... | hookidea/yiwukongjian | Application/Home/Controller/AddressController.class.php | PHP | mit | 2,650 |
public class ENG {
}
| zacswolf/CompSciProjects | Java (AP CompSci)/Eclipse/RankedGPA/src/ENG.java | Java | mit | 23 |
require "rails_helper"
RSpec.describe FormsController do
describe "#index" do
context "when an application has been started" do
it "renders the index page" do
current_app = create(:common_application)
session[:current_application_id] = current_app.id
get :index
expect(resp... | codeforamerica/michigan-benefits | spec/controllers/forms_controller_spec.rb | Ruby | mit | 2,108 |
import { MutableRefObject, useEffect, useMemo, useState } from 'react';
import { useApi } from '@proton/components';
import { addMilliseconds } from '@proton/shared/lib/date-fns-utc';
import { Calendar as tsCalendar } from '@proton/shared/lib/interfaces/calendar';
import { noop } from '@proton/shared/lib/helpers/funct... | ProtonMail/WebClient | applications/calendar/src/app/containers/alarms/useCalendarsAlarms.ts | TypeScript | mit | 3,017 |
class ArrowSprite extends Phaser.Sprite {
constructor(game, x, y) {
super(game, x, y, 'arrow');
this.game.stage.addChild(this);
this.scale.set(0.2);
this.alpha = 0.2;
this.anchor.setTo(0.5, 1.3);
this.animations.add('rotate', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], 30, true);
thi... | babruix/alien_worm_game | src/objects/Arrow.js | JavaScript | mit | 1,556 |
import { Injectable } from '@angular/core';
@Injectable()
export class DummyService {
// eslint-disable-next-line no-useless-constructor
constructor() {}
getItems() {
return new Promise(resolve => {
setTimeout(() => {
resolve(['Joe', 'Jane']);
}, 2000);
});
}
}
| storybooks/react-storybook | examples/angular-cli/src/stories/moduleMetadata/dummy.service.ts | TypeScript | mit | 300 |
require "danger/commands/local_helpers/pry_setup"
RSpec.describe Danger::PrySetup do
before { cleanup }
after { cleanup }
describe "#setup_pry" do
it "copies the Dangerfile and appends bindings.pry" do
Dir.mktmpdir do |dir|
dangerfile_path = "#{dir}/Dangerfile"
File.write(dangerfile_pa... | KrauseFx/danger | spec/lib/danger/commands/local_helpers/pry_setup_spec.rb | Ruby | mit | 1,200 |
class HomeController < ApplicationController
skip_authorization_check
def index
@project_promotions = ProjectPromotion.includes(:project => :brand).order("projects.title")
@tags_by_category = Tag.includes(:tag_category, :projects).order(:name).group_by(&:tag_category)
end
end
| nbudin/larp_library | app/controllers/home_controller.rb | Ruby | mit | 292 |
module Overcast
class Color
def self.darken(hex, amount=0.5)
hex = remove_pound(hex)
rgb = convert_to_rgb(hex).map{|element| element * amount }
convert_to_hex(rgb)
end
def self.lighten(hex, amount=0.5)
hex = remove_pound(hex)
rgb = convert_to_rgb(hex).map{ |element| [(elemen... | jespr/overcast | lib/overcast/color.rb | Ruby | mit | 633 |
#include "Receiver.h"
#include "ofGraphics.h"
#include "Utils.h"
namespace ofxSpout {
//----------
Receiver::Receiver() :
defaultFormat(GL_RGBA) {
this->spoutReceiver = nullptr;
}
//----------
Receiver::~Receiver() {
this->release();
}
//----------
bool Receiver::init(std::string chann... | elliotwoods/ofxSpout | src/ofxSpout/Receiver.cpp | C++ | mit | 2,691 |
class RenameUserIdInContacts < ActiveRecord::Migration
def self.up
rename_column "contacts", "user_id", "az_user_id"
end
def self.down
rename_column "contacts", "az_user_id", "user_id"
end
end
| stg34/azalo | db/migrate/20100709182724_rename_user_id_in_contacts.rb | Ruby | mit | 210 |
<header class="banner" role="banner">
<nav role="navigation" class="navbar navbar-inverse">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" ... | obelis/AverageOCR | web/app/themes/averageocr/templates/header.php | PHP | mit | 1,410 |
import random
color_names=[
'aliceblue',
'antiquewhite',
'aqua',
'aquamarine',
'azure',
'beige',
'bisque',
'blanchedalmond',
'blue',
'blueviolet',
'brown',
'burlywood',
'cadetblue',
'chartreuse',
'chocolate',
'coral',
'cornflowerblue',
'cornsilk'... | largetalk/tenbagger | draw/colors.py | Python | mit | 2,176 |
using System.Collections.Generic;
using System.Text;
namespace SourceGenerators
{
internal static class Templates
{
public static string AppRoutes(IEnumerable<string> allRoutes)
{
// hard code the namespace for now
var sb = new StringBuilder(@"
using System.Collections.G... | andrewlock/blog-examples | BlazorPreRender/BlazorApp1/SourceGenerators/Templates.cs | C# | mit | 2,345 |
#region Copyright
//--------------------------------------------------------------------------------------------------------
// <copyright file="RecentChanges.ascx.cs" company="DNN Corp®">
// DNN Corp® - http://www.dnnsoftware.com Copyright (c) 2002-2013 by DNN Corp®
//
// Permission is hereby granted, free... | DNNCommunity/DNN.Wiki | Views/RecentChanges.ascx.cs | C# | mit | 4,659 |
package ku_TR
import (
"testing"
"time"
"github.com/go-playground/locales"
"github.com/go-playground/locales/currency"
)
func TestLocale(t *testing.T) {
trans := New()
expected := "ku_TR"
if trans.Locale() != expected {
t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
}
}
func TestPluralsRan... | go-playground/locales | ku_TR/ku_TR_test.go | GO | mit | 19,303 |
var _for = require ('../index');
var should = require ('should');
describe ('passing data', function () {
it ('should call the loop with the passed data', function (done) {
var results = '';
var loop = _for (
0,
function (i) { return i < 2; },
function (i) { return i + 1; },
functio... | JosephJNK/async-for | tests/data.tests.js | JavaScript | mit | 1,126 |
#region License
// Copyright (c) 2013 Chandramouleswaran Ravichandran
//
// 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... | devxkh/FrankE | Editor/VEF/VEF.Core.Shared/Interfaces/Converters/MenuVisibilityConverter.cs | C# | mit | 2,235 |
using System;
namespace Paramore.Darker.Builder
{
internal sealed class RegistryActionWrapper : IQueryHandlerDecoratorRegistry
{
private readonly Action<Type> _action;
public RegistryActionWrapper(Action<Type> action)
{
_action = action;
}
public void Regis... | BrighterCommand/Darker | src/Paramore.Darker/Builder/RegistryActionWrapper.cs | C# | mit | 407 |
# encoding: utf-8
class LogoPhotoUploader < CarrierWave::Uploader::Base
# Include RMagick or MiniMagick support:
# include CarrierWave::RMagick
include CarrierWave::MiniMagick
# Choose what kind of storage to use for this uploader:
storage :file
# storage :fog
# Override the directory where uploaded f... | zhaoguobin/company_website | app/uploaders/logo_photo_uploader.rb | Ruby | mit | 1,512 |
/**
* @fileoverview A rule to suggest using of const declaration for variables that are never reassigned after declared.
* @author Toru Nagashima
*/
"use strict";
const astUtils = require("../util/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//----------... | Aladdin-ADD/eslint | lib/rules/prefer-const.js | JavaScript | mit | 16,721 |
"""
Compare the regions predicted to be prophages to the regions that are marked as prophages in our testing set
Probably the hardest part of this is the identifiers!
"""
import os
import sys
import argparse
import gzip
from Bio import SeqIO, BiopythonWarning
from PhiSpyModules import message, is_gzip_file
__author_... | linsalrob/PhiSpy | scripts/compare_predictions_to_phages.py | Python | mit | 8,988 |
from pymarkdownlint.tests.base import BaseTestCase
from pymarkdownlint.config import LintConfig, LintConfigError
from pymarkdownlint import rules
class LintConfigTests(BaseTestCase):
def test_get_rule_by_name_or_id(self):
config = LintConfig()
# get by id
expected = rules.MaxLineLengthRu... | jorisroovers/pymarkdownlint | pymarkdownlint/tests/test_config.py | Python | mit | 1,809 |
Template.SightingsEdit.helpers({
onDelete: function () {
return function (result) {
//when record is deleted, go back to record listing
Router.go('SightingsList');
};
},
});
Template.SightingsEdit.events({
});
Template.SightingsEdit.rendered = function () {
};
AutoForm.hooks({
updateSight... | bdunnette/meleagris | client/views/sightings/sightingsEdit.js | JavaScript | mit | 482 |
/**
* Copyright (c) 2013 Egor Pushkin. All rights reserved.
*
* 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, cop... | egorpushkin/iremote | dev/iRemote.Android/src/com/scientificsoft/iremote/platform/net/Socket.java | Java | mit | 2,463 |
package org.zenframework.easyservices.update;
import java.util.Collection;
@SuppressWarnings("rawtypes")
public class CollectionUpdateAdapter implements UpdateAdapter<Collection> {
@Override
public Class<Collection> getValueClass() {
return Collection.class;
}
@SuppressWarnings("unchecked")
... | zenframework/easy-services | easy-services-core/src/main/java/org/zenframework/easyservices/update/CollectionUpdateAdapter.java | Java | mit | 657 |
"""
homeassistant.components.binary_sensor
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Component to interface with binary sensors (sensors which only know two states)
that can be monitored.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/binary_sensor/
"""
im... | badele/home-assistant | homeassistant/components/binary_sensor/__init__.py | Python | mit | 1,321 |
<?php
$eZTranslationCacheCodeDate = 1058863428;
$CacheInfo = array (
'charset' => 'utf-8',
);
$TranslationInfo = array (
'context' => 'design/admin/content/edit',
);
$TranslationRoot = array (
'd5c6e07de8b9dccaac1d0452dee0b581' =>
array (
'context' => 'design/admin/content/edit',
'source' => 'Edit <%... | SnceGroup/snce-website | web/var/cache/translation/f1fa2db4683ed697d014961bf03dd47c/ita-IT/e1865bb9511c2e58519696970e878347.php | PHP | mit | 32,257 |
// Copyright (c) 2012-2013 The PPCoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <boost/assign/list_of.hpp>
#include "kernel.h"
#include "txdb.h"
using namespace std;
extern int nStakeMaxAge;
exte... | Rimbit/Wallets | src/kernel.cpp | C++ | mit | 18,814 |
require 'cnpj'
module Presenter
class CNPJ < Each
def output
::CNPJ.new(value).formatted
end
end
end
| thiagoa/super_form | lib/presenter/cnpj.rb | Ruby | mit | 120 |
package main
import (
"net/http"
"github.com/freehaha/token-auth"
"github.com/freehaha/token-auth/memory"
"github.com/gorilla/mux"
)
// Route type is used to define a route of the API
type Route struct {
Name string
Method string
Pattern string
HandlerFunc http.HandlerFunc
}
// Routes type i... | fthomasmorel/reimburse-me-golang | routes.go | GO | mit | 2,108 |
#include "smd3d.h"
#define SMSFACE_MAX 1000
//Àӽà ÆäÀ̽º ¸ñ·Ï ÀúÀå Àå¼Ò
smSTAGE_FACE *smFaceList[ SMSFACE_MAX ];
int smFaceListCnt;
//°É¾î ´Ù´Ò¼ö ÀÖ´Â ÃÖ´ë °íÀúÂ÷
int Stage_StepHeight = 10*fONE;
int smStage_WaterChk; //¹° ýũ¿ë Ç÷¢
smSTAGE_FACE *CheckFace=0;
//Æò¸é°ú 1Á¡ÀÇ À§Ä¡ÀÇ °ªÀ» ±¸ÇÔ ( Æò¸é ¹æ... | rafaellincoln/Source-Priston-Tale | J_Server/smLib3d/smStage3d.cpp | C++ | mit | 55,585 |
package io.reactivesw.order.order.infrastructure.enums;
/**
* Created by Davis on 16/11/17.
*/
public enum OrderState {
/**
* Open order state.
*/
Open,
/**
* Confirmed order state.
*/
Confirmed,
/**
* Complete order state.
*/
Complete,
/**
* Cancelled order state.
*/
Cancel... | reactivesw/customer_server | src/main/java/io/reactivesw/order/order/infrastructure/enums/OrderState.java | Java | mit | 327 |
<?php
namespace Ibw\MagSoftBundle\Entity;
use Doctrine\ORM\EntityRepository;
/**
* ProiecteRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class ProiecteRepository extends EntityRepository {
public function getLastProiectGeneratId() {
... | annonnim/magsoft | src/Ibw/MagSoftBundle/Entity/ProiecteRepository.php | PHP | mit | 3,167 |
package org.adaptlab.chpir.android.survey.utils;
import org.adaptlab.chpir.android.survey.models.DeviceUser;
public class AuthUtils {
private static DeviceUser sCurrentUser = null;
public static boolean isSignedIn() {
return sCurrentUser != null;
}
public static void signOut() {
... | DukeMobileTech/AndroidSurvey | app/src/main/java/org/adaptlab/chpir/android/survey/utils/AuthUtils.java | Java | mit | 543 |
using System;
namespace SDNUMobile.SDK.Entity.Bathroom
{
/// <summary>
/// 浴室使用用量实体
/// </summary>
public class BathroomUsageAmount
{
#region 字段
private DateTime _logTime;
private Int32[] _amount;
#endregion
#region 属性
/// <summary>
... | isdnu/DotNetSDK | SDNUMobile.SDK/Entity/Bathroom/BathroomUsageAmount.cs | C# | mit | 809 |