commit stringlengths 40 40 | old_file stringlengths 4 237 | new_file stringlengths 4 237 | old_contents stringlengths 1 4.24k | new_contents stringlengths 5 4.84k | subject stringlengths 15 778 | message stringlengths 16 6.86k | lang stringlengths 1 30 | license stringclasses 13 values | repos stringlengths 5 116k | config stringlengths 1 30 | content stringlengths 105 8.72k |
|---|---|---|---|---|---|---|---|---|---|---|---|
9e3810e3326fa82e50e5e7bb033275e2e016f3d6 | app/views/assets/new.html.erb | app/views/assets/new.html.erb | <div class="close-button">✕</div>
<div id="asset-upload-box" class="dialog-box">
<h1 id="asset-upload-title">Upload Images</h1>
<%= form_for(:asset, multipart: true, as: :asset, html: {id: 'multi-upload', class: 'dropzone'}) do |f| %>
<% end %>
</div>
|
<div id="asset-upload-box" class="dialog-box">
<div class="close-button">✕</div>
<h1 id="asset-upload-title">Upload Images</h1>
<%= form_for(:asset, multipart: true, as: :asset, html: {id: 'multi-upload', class: 'dropzone'}) do |f| %>
<% end %>
</div>
| Fix close button on upload images | Fix close button on upload images
| HTML+ERB | mit | dma315/ambrosia,dma315/ambrosia,dma315/ambrosia | html+erb | ## Code Before:
<div class="close-button">✕</div>
<div id="asset-upload-box" class="dialog-box">
<h1 id="asset-upload-title">Upload Images</h1>
<%= form_for(:asset, multipart: true, as: :asset, html: {id: 'multi-upload', class: 'dropzone'}) do |f| %>
<% end %>
</div>
## Instruction:
Fix close button on upload images
## Code After:
<div id="asset-upload-box" class="dialog-box">
<div class="close-button">✕</div>
<h1 id="asset-upload-title">Upload Images</h1>
<%= form_for(:asset, multipart: true, as: :asset, html: {id: 'multi-upload', class: 'dropzone'}) do |f| %>
<% end %>
</div>
|
3dee35fdc99e76b5c1cb3983723d5930df3fb046 | .travis.yml | .travis.yml | ---
language: python
python: "2.7"
script:
- make test-release
- make test-devel
| ---
language: python
python: "2.7"
matrix:
allow_failures:
- env: COMMAND=test-devel
include:
- env: COMMAND=test-release
- env: COMMAND=test-devel
script:
- make $COMMAND
| Use a build matrix, allow dev to fail. | Use a build matrix, allow dev to fail.
| YAML | mit | nsg/ansible-inventory,nsg/ansible-inventory | yaml | ## Code Before:
---
language: python
python: "2.7"
script:
- make test-release
- make test-devel
## Instruction:
Use a build matrix, allow dev to fail.
## Code After:
---
language: python
python: "2.7"
matrix:
allow_failures:
- env: COMMAND=test-devel
include:
- env: COMMAND=test-release
- env: COMMAND=test-devel
script:
- make $COMMAND
|
e186262d0a53210eb21eaa997e3af5f829152897 | projects/hslayers/src/components/layermanager/partials/physical-layerlist.html | projects/hslayers/src/components/layermanager/partials/physical-layerlist.html | <div class="list-group-item hs-lm-list pb-1" *ngIf="layersCopy.length != 0">
<ul class="list-group row pl-1">
<li *ngFor="let layer of layersCopy;" class="list-group-item hs-lm-item" [ngClass]="{'activeLayer': layer.active}">
<div class="d-flex">
<div class="align-items-center p-0 hs-lm-item-title flex-grow-1">
{{HsLayerUtilsService.translateTitle(layer.title)}}
</div>
<div class="p-0 info_btn text-right">
<span class="icon-arrow-up" [title]="'LAYERMANAGER.layerList.moveLayerUp' | translate"
(click)="moveLayer(layer, 'up')"></span>
<span class="icon-arrow-down" [title]="'LAYERMANAGER.layerList.moveLayerDown' | translate"
(click)="moveLayer(layer, 'down')"></span>
</div>
</div>
</li>
</ul>
</div>
| <div class="list-group-item hs-lm-list pb-1" *ngIf="layersCopy.length != 0">
<ul class="list-group row pl-1">
<li *ngFor="let layer of layersCopy;" class="list-group-item hs-lm-item" [ngClass]="{'activeLayer': layer.active}">
<div class="d-flex">
<div class="align-items-center p-0 hs-lm-item-title flex-grow-1" style="word-break:break-all">
{{HsLayerUtilsService.translateTitle(layer.title)}}
</div>
<div class="p-0 info_btn text-right">
<span class="icon-arrow-up" [title]="'LAYERMANAGER.layerList.moveLayerUp' | translate"
(click)="moveLayer(layer, 'up')"></span>
<span class="icon-arrow-down" [title]="'LAYERMANAGER.layerList.moveLayerDown' | translate"
(click)="moveLayer(layer, 'down')"></span>
</div>
</div>
</li>
</ul>
</div>
| Break layer text for physical layer list items | Break layer text for physical layer list items
| HTML | mit | hslayers/hslayers-ng,hslayers/hslayers-ng,hslayers/hslayers-ng,hslayers/hslayers-ng | html | ## Code Before:
<div class="list-group-item hs-lm-list pb-1" *ngIf="layersCopy.length != 0">
<ul class="list-group row pl-1">
<li *ngFor="let layer of layersCopy;" class="list-group-item hs-lm-item" [ngClass]="{'activeLayer': layer.active}">
<div class="d-flex">
<div class="align-items-center p-0 hs-lm-item-title flex-grow-1">
{{HsLayerUtilsService.translateTitle(layer.title)}}
</div>
<div class="p-0 info_btn text-right">
<span class="icon-arrow-up" [title]="'LAYERMANAGER.layerList.moveLayerUp' | translate"
(click)="moveLayer(layer, 'up')"></span>
<span class="icon-arrow-down" [title]="'LAYERMANAGER.layerList.moveLayerDown' | translate"
(click)="moveLayer(layer, 'down')"></span>
</div>
</div>
</li>
</ul>
</div>
## Instruction:
Break layer text for physical layer list items
## Code After:
<div class="list-group-item hs-lm-list pb-1" *ngIf="layersCopy.length != 0">
<ul class="list-group row pl-1">
<li *ngFor="let layer of layersCopy;" class="list-group-item hs-lm-item" [ngClass]="{'activeLayer': layer.active}">
<div class="d-flex">
<div class="align-items-center p-0 hs-lm-item-title flex-grow-1" style="word-break:break-all">
{{HsLayerUtilsService.translateTitle(layer.title)}}
</div>
<div class="p-0 info_btn text-right">
<span class="icon-arrow-up" [title]="'LAYERMANAGER.layerList.moveLayerUp' | translate"
(click)="moveLayer(layer, 'up')"></span>
<span class="icon-arrow-down" [title]="'LAYERMANAGER.layerList.moveLayerDown' | translate"
(click)="moveLayer(layer, 'down')"></span>
</div>
</div>
</li>
</ul>
</div>
|
89493a6b40e3b48a7a01756686a065f2886be7b4 | src/store/modules/annotation/getters.js | src/store/modules/annotation/getters.js | export default {
// Return the color in which an item should be drawn
getColor: (state, getters, rootState) => {
// Check if there is a default color for the step
if (
rootState.editor.steps &&
rootState.editor.steps[rootState.editor.activeStep].color) {
return rootState.editor.steps[rootState.editor.activeStep].color
// If there is no specified step color then return the default layer color
} else {
let activeLayerIndex = rootState.editor.activeLayer
return state.defaultColors[activeLayerIndex % state.defaultColors.length]
}
},
// Get megas in the annotation data
getMegas: (state) => {
return state.project.layers[0].items.filter(item => item.class === 'megakaryocyte')
}
}
| export default {
// Return the color in which an item should be drawn
getColor: (state, getters, rootState) => {
// Check if there is a default color for the step
if (
rootState.editor.steps &&
rootState.editor.steps[rootState.editor.activeStep].color) {
return rootState.editor.steps[rootState.editor.activeStep].color
// If there is no specified step color then return the default layer color
} else {
let activeLayerIndex = rootState.editor.activeLayer
return state.defaultColors[activeLayerIndex % state.defaultColors.length]
}
},
// Get megas in the annotation data
getMegas: (state) => {
let megaLayer = state.project.layers.filter(layer => layer.name === 'Megas')
if (megaLayer.length > 0) {
return megaLayer[0].items.filter(item => item.class === 'megakaryocyte')
} else {
return -1
}
}
}
| Increase resiliance of getMegas functions | Increase resiliance of getMegas functions
| JavaScript | mit | alanaberdeen/annotate,alanaberdeen/AIDA,alanaberdeen/AIDA,alanaberdeen/annotate | javascript | ## Code Before:
export default {
// Return the color in which an item should be drawn
getColor: (state, getters, rootState) => {
// Check if there is a default color for the step
if (
rootState.editor.steps &&
rootState.editor.steps[rootState.editor.activeStep].color) {
return rootState.editor.steps[rootState.editor.activeStep].color
// If there is no specified step color then return the default layer color
} else {
let activeLayerIndex = rootState.editor.activeLayer
return state.defaultColors[activeLayerIndex % state.defaultColors.length]
}
},
// Get megas in the annotation data
getMegas: (state) => {
return state.project.layers[0].items.filter(item => item.class === 'megakaryocyte')
}
}
## Instruction:
Increase resiliance of getMegas functions
## Code After:
export default {
// Return the color in which an item should be drawn
getColor: (state, getters, rootState) => {
// Check if there is a default color for the step
if (
rootState.editor.steps &&
rootState.editor.steps[rootState.editor.activeStep].color) {
return rootState.editor.steps[rootState.editor.activeStep].color
// If there is no specified step color then return the default layer color
} else {
let activeLayerIndex = rootState.editor.activeLayer
return state.defaultColors[activeLayerIndex % state.defaultColors.length]
}
},
// Get megas in the annotation data
getMegas: (state) => {
let megaLayer = state.project.layers.filter(layer => layer.name === 'Megas')
if (megaLayer.length > 0) {
return megaLayer[0].items.filter(item => item.class === 'megakaryocyte')
} else {
return -1
}
}
}
|
6aba02ecbbacb85918853ed86fea114138945643 | atom/common/common_message_generator.h | atom/common/common_message_generator.h | // Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
// Multiply-included file, no traditional include guard.
#include "atom/common/api/api_messages.h"
#include "chrome/common/print_messages.h"
#include "chrome/common/tts_messages.h"
#include "chrome/common/widevine_cdm_messages.h"
| // Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
// Multiply-included file, no traditional include guard.
#include "atom/common/api/api_messages.h"
#include "chrome/common/print_messages.h"
#include "chrome/common/tts_messages.h"
#include "chrome/common/widevine_cdm_messages.h"
#include "chrome/common/chrome_utility_messages.h"
| Fix linking problem with IPC::MessageT | Fix linking problem with IPC::MessageT
IPC::MessageT<ChromeUtilityHostMsg_ProcessStarted_Meta, std::__1::tuple<>, void>::MessageT(IPC::Routing)
| C | mit | Floato/electron,Floato/electron,Floato/electron,Floato/electron,Floato/electron,Floato/electron | c | ## Code Before:
// Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
// Multiply-included file, no traditional include guard.
#include "atom/common/api/api_messages.h"
#include "chrome/common/print_messages.h"
#include "chrome/common/tts_messages.h"
#include "chrome/common/widevine_cdm_messages.h"
## Instruction:
Fix linking problem with IPC::MessageT
IPC::MessageT<ChromeUtilityHostMsg_ProcessStarted_Meta, std::__1::tuple<>, void>::MessageT(IPC::Routing)
## Code After:
// Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
// Multiply-included file, no traditional include guard.
#include "atom/common/api/api_messages.h"
#include "chrome/common/print_messages.h"
#include "chrome/common/tts_messages.h"
#include "chrome/common/widevine_cdm_messages.h"
#include "chrome/common/chrome_utility_messages.h"
|
bd7f66452341a02e78db0058413f11840b50e5ae | src/System/Information.hs | src/System/Information.hs | {-# Language DerivingStrategies #-}
{-# Language GeneralisedNewtypeDeriving #-}
{-|
Module : System.Information
Description : Getting system information
Copyright : 2016 ChaosGroup
License : MIT
Maintainer : daniel.taskoff@chaosgroup.com
Stability : experimental
Portability : non-portable (GHC extensions)
-}
module System.Information
(
-- * OS
OS, os
) where
import Foreign.C.String (CWString, peekCWString)
import Foreign.Marshal.Alloc (free)
-- | A datatype representing different operating systems.
newtype OS = OS String
deriving newtype Show
-- | Get the current OS' name
os :: IO OS
os = OS <$> do
os' <- c_getOS
res <- peekCWString os'
free os'
pure res
foreign import ccall safe "getOS"
c_getOS :: IO CWString
| {-# Language DerivingStrategies #-}
{-# Language GeneralisedNewtypeDeriving #-}
-----------------------------------------------------------------------------
-- |
-- Module : System.Information
-- Copyright : (c) ChaosGroup, 2020
-- License : MIT
--
-- Maintainer : daniel.taskoff@gmail.com
-- Stability : experimental
--
-- Get the name of the current operating system.
-----------------------------------------------------------------------------
module System.Information
(
-- * 'OS'
OS, os
) where
import Foreign.C.String (CWString, peekCWString)
import Foreign.Marshal.Alloc (free)
-- | The name of the current operating system.
newtype OS = OS String
deriving newtype Show
-- | Get the name of the current operating system.
os :: IO OS
os = OS <$> do
os' <- c_getOS
res <- peekCWString os'
free os'
pure res
foreign import ccall safe "getOS"
c_getOS :: IO CWString
| Change the format of and reword the documentation | Change the format of and reword the documentation
| Haskell | mit | ChaosGroup/system-info | haskell | ## Code Before:
{-# Language DerivingStrategies #-}
{-# Language GeneralisedNewtypeDeriving #-}
{-|
Module : System.Information
Description : Getting system information
Copyright : 2016 ChaosGroup
License : MIT
Maintainer : daniel.taskoff@chaosgroup.com
Stability : experimental
Portability : non-portable (GHC extensions)
-}
module System.Information
(
-- * OS
OS, os
) where
import Foreign.C.String (CWString, peekCWString)
import Foreign.Marshal.Alloc (free)
-- | A datatype representing different operating systems.
newtype OS = OS String
deriving newtype Show
-- | Get the current OS' name
os :: IO OS
os = OS <$> do
os' <- c_getOS
res <- peekCWString os'
free os'
pure res
foreign import ccall safe "getOS"
c_getOS :: IO CWString
## Instruction:
Change the format of and reword the documentation
## Code After:
{-# Language DerivingStrategies #-}
{-# Language GeneralisedNewtypeDeriving #-}
-----------------------------------------------------------------------------
-- |
-- Module : System.Information
-- Copyright : (c) ChaosGroup, 2020
-- License : MIT
--
-- Maintainer : daniel.taskoff@gmail.com
-- Stability : experimental
--
-- Get the name of the current operating system.
-----------------------------------------------------------------------------
module System.Information
(
-- * 'OS'
OS, os
) where
import Foreign.C.String (CWString, peekCWString)
import Foreign.Marshal.Alloc (free)
-- | The name of the current operating system.
newtype OS = OS String
deriving newtype Show
-- | Get the name of the current operating system.
os :: IO OS
os = OS <$> do
os' <- c_getOS
res <- peekCWString os'
free os'
pure res
foreign import ccall safe "getOS"
c_getOS :: IO CWString
|
39432a7ccb3f41e05e23f2fe2d05cccae0552fbe | lib/dolphy/core.rb | lib/dolphy/core.rb | require 'dolphy/router'
require 'dolphy/template_engines'
require 'rack'
module Dolphy
class Core
include Dolphy::TemplateEngines
include Dolphy::Router
attr_accessor :status, :headers, :response, :routes, :request
def initialize(status = 200,
headers = {"Content-type" => "text/html"},
&block)
@status = status
@headers = headers
@response = []
@routes = initialize_router
instance_eval(&block)
end
# Returns the parameters sent in the request, e.g. parameters in POST
# requests.
def params
request.params
end
# The main logic of the application nests inside the call(env) method.
# It looks through all of the routes for the current request method, and
# if it finds a route that matches the current path, it evalutes the block
# and sets the response to the result of this evaluation.
def call(env)
http_method = env['REQUEST_METHOD'].downcase.to_sym
path = env['PATH_INFO']
self.request = Rack::Request.new(env)
unless routes[http_method].nil?
if block = routes[http_method][path]
body = instance_eval(&block)
self.response = [body]
else
self.status = 404
self.response = ["Route not found!"]
end
[status, headers, response]
end
end
end
end
| require 'dolphy/router'
require 'dolphy/template_engines'
require 'rack'
module Dolphy
class Core
include Dolphy::TemplateEngines
include Dolphy::Router
attr_accessor :status, :headers, :response, :routes, :request
def initialize(status = 200,
headers = {"Content-type" => "text/html"},
&block)
@status = status
@headers = headers
@response = []
@routes = initialize_router
instance_eval(&block)
end
# Returns the parameters sent in the request, e.g. parameters in POST
# requests.
def params
request.params
end
# The main logic of the application nests inside the call(env) method.
# It looks through all of the routes for the current request method, and
# if it finds a route that matches the current path, it evalutes the block
# and sets the response to the result of this evaluation.
def call(env)
http_method = env['REQUEST_METHOD'].downcase.to_sym
path = env['PATH_INFO']
self.request = Rack::Request.new(env)
if block = routes[http_method][path]
self.response = [instance_eval(&block)]
else
self.status = 404
self.response = ["Route not found!"]
end
[status, headers, response]
end
end
end
| Refactor logic inside of call(env). | Refactor logic inside of call(env).
| Ruby | mit | majjoha/dolphy | ruby | ## Code Before:
require 'dolphy/router'
require 'dolphy/template_engines'
require 'rack'
module Dolphy
class Core
include Dolphy::TemplateEngines
include Dolphy::Router
attr_accessor :status, :headers, :response, :routes, :request
def initialize(status = 200,
headers = {"Content-type" => "text/html"},
&block)
@status = status
@headers = headers
@response = []
@routes = initialize_router
instance_eval(&block)
end
# Returns the parameters sent in the request, e.g. parameters in POST
# requests.
def params
request.params
end
# The main logic of the application nests inside the call(env) method.
# It looks through all of the routes for the current request method, and
# if it finds a route that matches the current path, it evalutes the block
# and sets the response to the result of this evaluation.
def call(env)
http_method = env['REQUEST_METHOD'].downcase.to_sym
path = env['PATH_INFO']
self.request = Rack::Request.new(env)
unless routes[http_method].nil?
if block = routes[http_method][path]
body = instance_eval(&block)
self.response = [body]
else
self.status = 404
self.response = ["Route not found!"]
end
[status, headers, response]
end
end
end
end
## Instruction:
Refactor logic inside of call(env).
## Code After:
require 'dolphy/router'
require 'dolphy/template_engines'
require 'rack'
module Dolphy
class Core
include Dolphy::TemplateEngines
include Dolphy::Router
attr_accessor :status, :headers, :response, :routes, :request
def initialize(status = 200,
headers = {"Content-type" => "text/html"},
&block)
@status = status
@headers = headers
@response = []
@routes = initialize_router
instance_eval(&block)
end
# Returns the parameters sent in the request, e.g. parameters in POST
# requests.
def params
request.params
end
# The main logic of the application nests inside the call(env) method.
# It looks through all of the routes for the current request method, and
# if it finds a route that matches the current path, it evalutes the block
# and sets the response to the result of this evaluation.
def call(env)
http_method = env['REQUEST_METHOD'].downcase.to_sym
path = env['PATH_INFO']
self.request = Rack::Request.new(env)
if block = routes[http_method][path]
self.response = [instance_eval(&block)]
else
self.status = 404
self.response = ["Route not found!"]
end
[status, headers, response]
end
end
end
|
2301b0bfdb216f31428e6c9ca0bf6b2951a5e64b | symposion/forms.py | symposion/forms.py | from django import forms
import account.forms
class SignupForm(account.forms.SignupForm):
first_name = forms.CharField()
last_name = forms.CharField()
email_confirm = forms.EmailField(label="Confirm Email")
def __init__(self, *args, **kwargs):
super(SignupForm, self).__init__(*args, **kwargs)
del self.fields["username"]
self.fields.keyOrder = [
"email",
"email_confirm",
"first_name",
"last_name",
"password",
"password_confirm"
]
def clean_email_confirm(self):
email = self.cleaned_data.get("email")
email_confirm = self.cleaned_data["email_confirm"]
if email:
if email != email_confirm:
raise forms.ValidationError(
"Email address must match previously typed email address")
return email_confirm
| try:
from collections import OrderedDict
except ImportError:
OrderedDict = None
import account.forms
from django import forms
from django.utils.translation import ugettext_lazy as _
class SignupForm(account.forms.SignupForm):
first_name = forms.CharField(label=_("First name"))
last_name = forms.CharField(label=_("Last name"))
email_confirm = forms.EmailField(label=_("Confirm Email"))
def __init__(self, *args, **kwargs):
super(SignupForm, self).__init__(*args, **kwargs)
field_order = [
"first_name",
"last_name",
"email",
"email_confirm",
"password",
"password_confirm"
]
del self.fields["username"]
if not OrderedDict or hasattr(self.fields, "keyOrder"):
self.fields.keyOrder = field_order
else:
self.fields = OrderedDict((k, self.fields[k]) for k in field_order)
def clean_email_confirm(self):
email = self.cleaned_data.get("email")
email_confirm = self.cleaned_data["email_confirm"]
if email:
if email != email_confirm:
raise forms.ValidationError(
"Email address must match previously typed email address")
return email_confirm
| Fix order fields in signup form | Fix order fields in signup form
| Python | bsd-3-clause | toulibre/symposion,toulibre/symposion | python | ## Code Before:
from django import forms
import account.forms
class SignupForm(account.forms.SignupForm):
first_name = forms.CharField()
last_name = forms.CharField()
email_confirm = forms.EmailField(label="Confirm Email")
def __init__(self, *args, **kwargs):
super(SignupForm, self).__init__(*args, **kwargs)
del self.fields["username"]
self.fields.keyOrder = [
"email",
"email_confirm",
"first_name",
"last_name",
"password",
"password_confirm"
]
def clean_email_confirm(self):
email = self.cleaned_data.get("email")
email_confirm = self.cleaned_data["email_confirm"]
if email:
if email != email_confirm:
raise forms.ValidationError(
"Email address must match previously typed email address")
return email_confirm
## Instruction:
Fix order fields in signup form
## Code After:
try:
from collections import OrderedDict
except ImportError:
OrderedDict = None
import account.forms
from django import forms
from django.utils.translation import ugettext_lazy as _
class SignupForm(account.forms.SignupForm):
first_name = forms.CharField(label=_("First name"))
last_name = forms.CharField(label=_("Last name"))
email_confirm = forms.EmailField(label=_("Confirm Email"))
def __init__(self, *args, **kwargs):
super(SignupForm, self).__init__(*args, **kwargs)
field_order = [
"first_name",
"last_name",
"email",
"email_confirm",
"password",
"password_confirm"
]
del self.fields["username"]
if not OrderedDict or hasattr(self.fields, "keyOrder"):
self.fields.keyOrder = field_order
else:
self.fields = OrderedDict((k, self.fields[k]) for k in field_order)
def clean_email_confirm(self):
email = self.cleaned_data.get("email")
email_confirm = self.cleaned_data["email_confirm"]
if email:
if email != email_confirm:
raise forms.ValidationError(
"Email address must match previously typed email address")
return email_confirm
|
c9801bd107187c4630b953ba6ee32a93bad4d180 | routes/index.js | routes/index.js | const _ = require('lodash');
const gtfs = require('gtfs');
const router = require('express').Router();
const config = require('../config');
const utils = require('../lib/utils');
/*
* Show all agencies
*/
router.get('/', (req, res, next) => {
gtfs.agencies((err, agencies) => {
if (err) return next(err);
return res.render('agencies', { agencies });
});
});
/*
* Show all timetable pages for an agency
*/
router.get('/timetablepages', (req, res, next) => {
const agencyKey = req.query.agency_key;
utils.getTimetablePages(agencyKey, (err, timetablePages) => {
if (err) return next(err);
return res.render('timetablepages', { agencyKey, timetablePages });
});
});
/*
* Show a specific timetable page
*/
router.get('/timetablepage', (req, res, next) => {
const agencyKey = req.query.agency_key;
const timetablePageId = req.query.timetable_page_id;
utils.getTimetablePage(agencyKey, timetablePageId, (err, timetablePage) => {
if (err) return next(err);
utils.generateHTML(agencyKey, timetablePage, config, (err, html) => {
if (err) return next(err);
res.send(html);
});
});
});
module.exports = router;
| const _ = require('lodash');
const gtfs = require('gtfs');
const router = require('express').Router();
const config = require('../config');
const utils = require('../lib/utils');
/*
* Show all agencies
*/
router.get('/', (req, res, next) => {
gtfs.agencies((err, agencies) => {
if (err) return next(err);
return res.render('agencies', { agencies: _.sortBy(agencies, 'agency_name') });
});
});
/*
* Show all timetable pages for an agency
*/
router.get('/timetablepages', (req, res, next) => {
const agencyKey = req.query.agency_key;
utils.getTimetablePages(agencyKey, (err, timetablePages) => {
if (err) return next(err);
return res.render('timetablepages', { agencyKey, timetablePages });
});
});
/*
* Show a specific timetable page
*/
router.get('/timetablepage', (req, res, next) => {
const agencyKey = req.query.agency_key;
const timetablePageId = req.query.timetable_page_id;
utils.getTimetablePage(agencyKey, timetablePageId, (err, timetablePage) => {
if (err) return next(err);
utils.generateHTML(agencyKey, timetablePage, config, (err, html) => {
if (err) return next(err);
res.send(html);
});
});
});
module.exports = router;
| Sort agencies page by name | Sort agencies page by name
| JavaScript | mit | brendannee/gtfs-to-html,brendannee/gtfs-to-html,BlinkTagInc/gtfs-to-html,BlinkTagInc/gtfs-to-html | javascript | ## Code Before:
const _ = require('lodash');
const gtfs = require('gtfs');
const router = require('express').Router();
const config = require('../config');
const utils = require('../lib/utils');
/*
* Show all agencies
*/
router.get('/', (req, res, next) => {
gtfs.agencies((err, agencies) => {
if (err) return next(err);
return res.render('agencies', { agencies });
});
});
/*
* Show all timetable pages for an agency
*/
router.get('/timetablepages', (req, res, next) => {
const agencyKey = req.query.agency_key;
utils.getTimetablePages(agencyKey, (err, timetablePages) => {
if (err) return next(err);
return res.render('timetablepages', { agencyKey, timetablePages });
});
});
/*
* Show a specific timetable page
*/
router.get('/timetablepage', (req, res, next) => {
const agencyKey = req.query.agency_key;
const timetablePageId = req.query.timetable_page_id;
utils.getTimetablePage(agencyKey, timetablePageId, (err, timetablePage) => {
if (err) return next(err);
utils.generateHTML(agencyKey, timetablePage, config, (err, html) => {
if (err) return next(err);
res.send(html);
});
});
});
module.exports = router;
## Instruction:
Sort agencies page by name
## Code After:
const _ = require('lodash');
const gtfs = require('gtfs');
const router = require('express').Router();
const config = require('../config');
const utils = require('../lib/utils');
/*
* Show all agencies
*/
router.get('/', (req, res, next) => {
gtfs.agencies((err, agencies) => {
if (err) return next(err);
return res.render('agencies', { agencies: _.sortBy(agencies, 'agency_name') });
});
});
/*
* Show all timetable pages for an agency
*/
router.get('/timetablepages', (req, res, next) => {
const agencyKey = req.query.agency_key;
utils.getTimetablePages(agencyKey, (err, timetablePages) => {
if (err) return next(err);
return res.render('timetablepages', { agencyKey, timetablePages });
});
});
/*
* Show a specific timetable page
*/
router.get('/timetablepage', (req, res, next) => {
const agencyKey = req.query.agency_key;
const timetablePageId = req.query.timetable_page_id;
utils.getTimetablePage(agencyKey, timetablePageId, (err, timetablePage) => {
if (err) return next(err);
utils.generateHTML(agencyKey, timetablePage, config, (err, html) => {
if (err) return next(err);
res.send(html);
});
});
});
module.exports = router;
|
e6e549291b031e29bb139f2f37105dbee3893706 | bin/container_setup.sh | bin/container_setup.sh |
set -exuo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
cd "$DIR/.."
# Set up python
curl https://bootstrap.pypa.io/get-pip.py | python3.9
pip3 install --no-cache-dir -r requirements.txt
# Set up node
npm ci
# Set up supervisor
cp config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Set up logrotate
cp config/logrotate /etc/logrotate.d/uwsgi
|
set -exuo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
cd "$DIR/.."
# Set up python
pip install --no-cache-dir -r requirements.txt
# Set up node
npm ci
# Set up supervisor
cp config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Set up logrotate
cp config/logrotate /etc/logrotate.d/uwsgi
| Remove unneeded reinstallation of pip | Remove unneeded reinstallation of pip
| Shell | mit | albertyw/base-flask,albertyw/base-flask,albertyw/base-flask,albertyw/base-flask | shell | ## Code Before:
set -exuo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
cd "$DIR/.."
# Set up python
curl https://bootstrap.pypa.io/get-pip.py | python3.9
pip3 install --no-cache-dir -r requirements.txt
# Set up node
npm ci
# Set up supervisor
cp config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Set up logrotate
cp config/logrotate /etc/logrotate.d/uwsgi
## Instruction:
Remove unneeded reinstallation of pip
## Code After:
set -exuo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
cd "$DIR/.."
# Set up python
pip install --no-cache-dir -r requirements.txt
# Set up node
npm ci
# Set up supervisor
cp config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Set up logrotate
cp config/logrotate /etc/logrotate.d/uwsgi
|
b8e406a725b08277d68383c07c2c8edd387b44aa | .travis.yml | .travis.yml | dist: trusty
language: go
addons:
postgresql: "9.6"
go:
- 1.9.x
- 1.10.x
- 1.11.x
- 1.12.x
- tip
go_import_path: github.com/go-pg/pg
matrix:
allow_failures:
- go: tip
before_install:
- psql -U postgres -c "CREATE EXTENSION hstore"
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.16.0
install:
- go get github.com/jinzhu/inflection
- go get gopkg.in/check.v1
- go get github.com/onsi/ginkgo
- go get github.com/onsi/gomega
- go get mellium.im/sasl
script:
- golangci-lint run
- travis_script_go {gobuild-args}
| dist: xenial
language: go
addons:
postgresql: "9.6"
go:
- 1.9.x
- 1.10.x
- 1.11.x
- 1.12.x
- tip
go_import_path: github.com/go-pg/pg
matrix:
allow_failures:
- go: tip
before_install:
- psql -U postgres -c "CREATE EXTENSION hstore"
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.16.0
install:
- go get github.com/jinzhu/inflection
- go get gopkg.in/check.v1
- go get github.com/onsi/ginkgo
- go get github.com/onsi/gomega
- go get mellium.im/sasl
script:
- golangci-lint run
- make
| Fix script and update distro | Fix script and update distro
| YAML | bsd-2-clause | go-pg/pg,vmihailenco/pg,go-pg/pg | yaml | ## Code Before:
dist: trusty
language: go
addons:
postgresql: "9.6"
go:
- 1.9.x
- 1.10.x
- 1.11.x
- 1.12.x
- tip
go_import_path: github.com/go-pg/pg
matrix:
allow_failures:
- go: tip
before_install:
- psql -U postgres -c "CREATE EXTENSION hstore"
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.16.0
install:
- go get github.com/jinzhu/inflection
- go get gopkg.in/check.v1
- go get github.com/onsi/ginkgo
- go get github.com/onsi/gomega
- go get mellium.im/sasl
script:
- golangci-lint run
- travis_script_go {gobuild-args}
## Instruction:
Fix script and update distro
## Code After:
dist: xenial
language: go
addons:
postgresql: "9.6"
go:
- 1.9.x
- 1.10.x
- 1.11.x
- 1.12.x
- tip
go_import_path: github.com/go-pg/pg
matrix:
allow_failures:
- go: tip
before_install:
- psql -U postgres -c "CREATE EXTENSION hstore"
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.16.0
install:
- go get github.com/jinzhu/inflection
- go get gopkg.in/check.v1
- go get github.com/onsi/ginkgo
- go get github.com/onsi/gomega
- go get mellium.im/sasl
script:
- golangci-lint run
- make
|
1c18f6061e282e60afdd68e360e1705e7c50cbcf | readme.md | readme.md |
Savior is a project build with Laravel 5 (PHP) that aims to easily build and deploy REST APIs to any service, production, stage or testing environments as well as your local environments.
I'm just starting this project to contribute to the community and help mysefl due to the increasing requests i've had for creating REST APIs for different applications and projects.
## The Stack
I'm using a common lamp stack with mysql as the database and take advantage of all Laravel cool features for environment configuration and detection, database configuration, flysystem storage, etc.
## ToDo
There are tons of things to do, so if you want to contribute just make a fork or create a branch for the feature you wan't to do, all changes must be integrated through pull requests.
#### Coding
- [ ] Implement authentication, authorization and roles
- [ ] Found a web control (wysiwyg style) that accepts RAML or JSON and validates it
- [ ] Improve Flysystem implementation for saving configuration files
#### PM
- [ ] Create a Trello dashboard for managing all the project management
#### Documentation
- [ ] All the documenation
That's what came to my mind right know
Savior project is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT) |
Savior is a project build with Laravel 5 (PHP) that aims to easily build and deploy REST APIs to any service, production, stage or testing environments as well as your local environments.
I'm just starting this project to contribute to the community and help mysefl due to the increasing requests i've had for creating REST APIs for different applications and projects.
## The Stack
I'm using a common lamp stack with mysql as the database and take advantage of all Laravel cool features for environment configuration and detection, database configuration, flysystem storage, etc.
## Project Requirements
* PHP >= 5.5.9
* Composer
* MySql
* mcrypt PHP Extension
* Apache, Nginx
## Installation
* Clone the repo
* If you install composer globally run
```
composer install
```
* If you install composer locally run
```
php composer.phar install
```
* Create the database on MySql (the name you want) and configure database on the file .env
* Run the migration
```
php artisan migrate
```
That's it, it should be up and running.
## ToDo
There are tons of things to do, so if you want to contribute just make a fork or create a branch for the feature you wan't to do, all changes must be integrated through pull requests.
#### Coding
- [ ] Implement authentication, authorization and roles
- [ ] Found a web control (wysiwyg style) that accepts RAML or JSON and validates it
- [ ] Improve Flysystem implementation for saving configuration files
#### PM
- [ ] Create a Trello dashboard for managing all the project management
#### Documentation
- [ ] All the documenation
That's what came to my mind right know
Savior project is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT) | Update documentation with requirements and installation procedures | Update documentation with requirements and installation procedures
| Markdown | mit | renomx/Savior,renomx/Savior | markdown | ## Code Before:
Savior is a project build with Laravel 5 (PHP) that aims to easily build and deploy REST APIs to any service, production, stage or testing environments as well as your local environments.
I'm just starting this project to contribute to the community and help mysefl due to the increasing requests i've had for creating REST APIs for different applications and projects.
## The Stack
I'm using a common lamp stack with mysql as the database and take advantage of all Laravel cool features for environment configuration and detection, database configuration, flysystem storage, etc.
## ToDo
There are tons of things to do, so if you want to contribute just make a fork or create a branch for the feature you wan't to do, all changes must be integrated through pull requests.
#### Coding
- [ ] Implement authentication, authorization and roles
- [ ] Found a web control (wysiwyg style) that accepts RAML or JSON and validates it
- [ ] Improve Flysystem implementation for saving configuration files
#### PM
- [ ] Create a Trello dashboard for managing all the project management
#### Documentation
- [ ] All the documenation
That's what came to my mind right know
Savior project is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)
## Instruction:
Update documentation with requirements and installation procedures
## Code After:
Savior is a project build with Laravel 5 (PHP) that aims to easily build and deploy REST APIs to any service, production, stage or testing environments as well as your local environments.
I'm just starting this project to contribute to the community and help mysefl due to the increasing requests i've had for creating REST APIs for different applications and projects.
## The Stack
I'm using a common lamp stack with mysql as the database and take advantage of all Laravel cool features for environment configuration and detection, database configuration, flysystem storage, etc.
## Project Requirements
* PHP >= 5.5.9
* Composer
* MySql
* mcrypt PHP Extension
* Apache, Nginx
## Installation
* Clone the repo
* If you install composer globally run
```
composer install
```
* If you install composer locally run
```
php composer.phar install
```
* Create the database on MySql (the name you want) and configure database on the file .env
* Run the migration
```
php artisan migrate
```
That's it, it should be up and running.
## ToDo
There are tons of things to do, so if you want to contribute just make a fork or create a branch for the feature you wan't to do, all changes must be integrated through pull requests.
#### Coding
- [ ] Implement authentication, authorization and roles
- [ ] Found a web control (wysiwyg style) that accepts RAML or JSON and validates it
- [ ] Improve Flysystem implementation for saving configuration files
#### PM
- [ ] Create a Trello dashboard for managing all the project management
#### Documentation
- [ ] All the documenation
That's what came to my mind right know
Savior project is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT) |
e5b11c7a133058e3a26124fc057fda07c5658471 | swagger-springmvc/src/main/java/com/mangofactory/swagger/paths/RelativeSwaggerPathProvider.java | swagger-springmvc/src/main/java/com/mangofactory/swagger/paths/RelativeSwaggerPathProvider.java | package com.mangofactory.swagger.paths;
import javax.servlet.ServletContext;
public class RelativeSwaggerPathProvider extends SwaggerPathProvider {
public static final String ROOT = "/";
private final ServletContext servletContext;
public RelativeSwaggerPathProvider(ServletContext servletContext) {
super();
this.servletContext = servletContext;
}
@Override
protected String applicationPath() {
return servletContext.getContextPath();
}
@Override
protected String getDocumentationPath() {
return ROOT;
}
}
| package com.mangofactory.swagger.paths;
import javax.servlet.ServletContext;
import static com.google.common.base.Strings.isNullOrEmpty;
public class RelativeSwaggerPathProvider extends SwaggerPathProvider {
public static final String ROOT = "/";
private final ServletContext servletContext;
public RelativeSwaggerPathProvider(ServletContext servletContext) {
super();
this.servletContext = servletContext;
}
@Override
protected String applicationPath() {
return isNullOrEmpty(servletContext.getContextPath()) ? ROOT : servletContext.getContextPath();
}
@Override
protected String getDocumentationPath() {
return ROOT;
}
}
| Fix for when the context path is at the root the 'try this' doesnt work | Fix for when the context path is at the root the 'try this' doesnt work
| Java | apache-2.0 | wjc133/springfox,vmarusic/springfox,yelhouti/springfox,acourtneybrown/springfox,thomsonreuters/springfox,maksimu/springfox,RobWin/springfox,zhiqinghuang/springfox,jlstrater/springfox,maksimu/springfox,arshadalisoomro/springfox,ammmze/swagger-springmvc,springfox/springfox,RobWin/springfox,jlstrater/springfox,choiapril6/springfox,qq291462491/springfox,ammmze/swagger-springmvc,erikthered/springfox,namkee/springfox,erikthered/springfox,springfox/springfox,izeye/springfox,thomsonreuters/springfox,yelhouti/springfox,wjc133/springfox,thomasdarimont/springfox,namkee/springfox,cbornet/springfox,qq291462491/springfox,wjc133/springfox,vmarusic/springfox,kevinconaway/springfox,zorosteven/springfox,thomsonreuters/springfox,vmarusic/springfox,yelhouti/springfox,maksimu/springfox,acourtneybrown/springfox,cbornet/springfox,springfox/springfox,arshadalisoomro/springfox,acourtneybrown/springfox,springfox/springfox,zhiqinghuang/springfox,namkee/springfox,jlstrater/springfox,izeye/springfox,cbornet/springfox,choiapril6/springfox,arshadalisoomro/springfox,zorosteven/springfox,zorosteven/springfox,kevinconaway/springfox,izeye/springfox,qq291462491/springfox,RobWin/springfox,kevinconaway/springfox,choiapril6/springfox,erikthered/springfox,thomasdarimont/springfox,zhiqinghuang/springfox,thomasdarimont/springfox,ammmze/swagger-springmvc | java | ## Code Before:
package com.mangofactory.swagger.paths;
import javax.servlet.ServletContext;
public class RelativeSwaggerPathProvider extends SwaggerPathProvider {
public static final String ROOT = "/";
private final ServletContext servletContext;
public RelativeSwaggerPathProvider(ServletContext servletContext) {
super();
this.servletContext = servletContext;
}
@Override
protected String applicationPath() {
return servletContext.getContextPath();
}
@Override
protected String getDocumentationPath() {
return ROOT;
}
}
## Instruction:
Fix for when the context path is at the root the 'try this' doesnt work
## Code After:
package com.mangofactory.swagger.paths;
import javax.servlet.ServletContext;
import static com.google.common.base.Strings.isNullOrEmpty;
public class RelativeSwaggerPathProvider extends SwaggerPathProvider {
public static final String ROOT = "/";
private final ServletContext servletContext;
public RelativeSwaggerPathProvider(ServletContext servletContext) {
super();
this.servletContext = servletContext;
}
@Override
protected String applicationPath() {
return isNullOrEmpty(servletContext.getContextPath()) ? ROOT : servletContext.getContextPath();
}
@Override
protected String getDocumentationPath() {
return ROOT;
}
}
|
5cabf0e2d7cd7f1cfe2f733bc062dcb80e817730 | .travis.yml | .travis.yml | language: python
install:
- pip install tox
script:
- tox
env:
- TOXENV=django18-py27
- TOXENV=django18-py33
- TOXENV=django18-py34
- TOXENV=django18-py35
- TOXENV=django19-py27
- TOXENV=django19-py34
- TOXENV=django19-py35
| language: python
install:
- pip install tox
script:
- tox
env:
- TOXENV=django18-py27
- TOXENV=django18-py33
- TOXENV=django18-py34
- TOXENV=django18-py35
- TOXENV=django19-py27
- TOXENV=django19-py34
- TOXENV=django19-py35
matrix:
allow_failures:
# - env: TOXENV=django18-py27
- env: TOXENV=django18-py33
- env: TOXENV=django18-py34
# - env: TOXENV=django18-py35
- env: TOXENV=django19-py27
- env: TOXENV=django19-py34
- env: TOXENV=django19-py35
fast_finish: true
| Allow Travis CI builds to fail fast (except for latest LTS on latest Python 2/3). | Allow Travis CI builds to fail fast (except for latest LTS on latest Python 2/3).
| YAML | mit | ixc/django-master-password | yaml | ## Code Before:
language: python
install:
- pip install tox
script:
- tox
env:
- TOXENV=django18-py27
- TOXENV=django18-py33
- TOXENV=django18-py34
- TOXENV=django18-py35
- TOXENV=django19-py27
- TOXENV=django19-py34
- TOXENV=django19-py35
## Instruction:
Allow Travis CI builds to fail fast (except for latest LTS on latest Python 2/3).
## Code After:
language: python
install:
- pip install tox
script:
- tox
env:
- TOXENV=django18-py27
- TOXENV=django18-py33
- TOXENV=django18-py34
- TOXENV=django18-py35
- TOXENV=django19-py27
- TOXENV=django19-py34
- TOXENV=django19-py35
matrix:
allow_failures:
# - env: TOXENV=django18-py27
- env: TOXENV=django18-py33
- env: TOXENV=django18-py34
# - env: TOXENV=django18-py35
- env: TOXENV=django19-py27
- env: TOXENV=django19-py34
- env: TOXENV=django19-py35
fast_finish: true
|
2738d4da18f6571eaf8d75d74c21ba15b75e83a5 | gnu/usr.bin/groff/eqn/Makefile | gnu/usr.bin/groff/eqn/Makefile |
PROG= eqn
MAN1= eqn.1 neqn.1
SRCS= main.cc lex.cc box.cc limit.cc list.cc over.cc text.cc\
script.cc mark.cc other.cc delim.cc sqrt.cc pile.cc special.cc
OBJS= eqn.o
#CFLAGS+= -I. -I${.CURDIR}/../include
LDADD+= ${LIBGROFF}
DPADD+= ${LIBGROFF}
MANDEPEND= neqn.1 eqn.1
CLEANFILES+= eqn.cc eqn.tab.h neqn ${MANDEPEND}
neqn:
sed -e 's/@g@/${g}/g' ${DIST_DIR}/neqn.sh > neqn
afterinstall: neqn
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} neqn \
${DESTDIR}${BINDIR}
beforedepend: eqn.cc
.include "../Makefile.cfg"
.include <bsd.prog.mk>
|
PROG= eqn
MAN1= eqn.1 neqn.1
SRCS= main.cc lex.cc box.cc limit.cc list.cc over.cc text.cc\
script.cc mark.cc other.cc delim.cc sqrt.cc pile.cc special.cc
OBJS= eqn.o
#CFLAGS+= -I. -I${.CURDIR}/../include
LDADD+= ${LIBGROFF}
DPADD+= ${LIBGROFF}
MANDEPEND= neqn.1 eqn.1
CLEANFILES+= eqn.cc eqn.tab.h neqn ${MANDEPEND}
afterinstall: neqn
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} neqn \
${DESTDIR}${BINDIR}
beforedepend: eqn.cc
.include "../Makefile.cfg"
.include <bsd.prog.mk>
neqn: ${DIST_DIR}/neqn.sh
sed -e 's/@g@/${g}/g' ${DIST_DIR}/neqn.sh > neqn
| Fix neqn building: 1) Move it after Makefile.inc included since it uses DIST_DIR from there 2) Add neqn.sh dependance | Fix neqn building:
1) Move it after Makefile.inc included since it uses DIST_DIR from there
2) Add neqn.sh dependance
| unknown | bsd-3-clause | jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase | unknown | ## Code Before:
PROG= eqn
MAN1= eqn.1 neqn.1
SRCS= main.cc lex.cc box.cc limit.cc list.cc over.cc text.cc\
script.cc mark.cc other.cc delim.cc sqrt.cc pile.cc special.cc
OBJS= eqn.o
#CFLAGS+= -I. -I${.CURDIR}/../include
LDADD+= ${LIBGROFF}
DPADD+= ${LIBGROFF}
MANDEPEND= neqn.1 eqn.1
CLEANFILES+= eqn.cc eqn.tab.h neqn ${MANDEPEND}
neqn:
sed -e 's/@g@/${g}/g' ${DIST_DIR}/neqn.sh > neqn
afterinstall: neqn
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} neqn \
${DESTDIR}${BINDIR}
beforedepend: eqn.cc
.include "../Makefile.cfg"
.include <bsd.prog.mk>
## Instruction:
Fix neqn building:
1) Move it after Makefile.inc included since it uses DIST_DIR from there
2) Add neqn.sh dependance
## Code After:
PROG= eqn
MAN1= eqn.1 neqn.1
SRCS= main.cc lex.cc box.cc limit.cc list.cc over.cc text.cc\
script.cc mark.cc other.cc delim.cc sqrt.cc pile.cc special.cc
OBJS= eqn.o
#CFLAGS+= -I. -I${.CURDIR}/../include
LDADD+= ${LIBGROFF}
DPADD+= ${LIBGROFF}
MANDEPEND= neqn.1 eqn.1
CLEANFILES+= eqn.cc eqn.tab.h neqn ${MANDEPEND}
afterinstall: neqn
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} neqn \
${DESTDIR}${BINDIR}
beforedepend: eqn.cc
.include "../Makefile.cfg"
.include <bsd.prog.mk>
neqn: ${DIST_DIR}/neqn.sh
sed -e 's/@g@/${g}/g' ${DIST_DIR}/neqn.sh > neqn
|
7781acc765deeeefdbac60ededd9f48fa1b83cf5 | common.css | common.css | .navbar-right:last-child {
margin-right: 0px;
}
.navbar li > a > span {
margin-right: 0.2778em;
}
| .navbar-right:last-child {
margin-right: 0px;
}
.navbar li > a > span {
margin-right: 0.2778em;
}
#logo-boerse {
float: right;
max-width: 100%;
}
| Add CSS for the WiW logo on boerse.willkommeninwoellstein.de | Add CSS for the WiW logo on boerse.willkommeninwoellstein.de
| CSS | mit | fenhl/willkommeninwoellstein.de | css | ## Code Before:
.navbar-right:last-child {
margin-right: 0px;
}
.navbar li > a > span {
margin-right: 0.2778em;
}
## Instruction:
Add CSS for the WiW logo on boerse.willkommeninwoellstein.de
## Code After:
.navbar-right:last-child {
margin-right: 0px;
}
.navbar li > a > span {
margin-right: 0.2778em;
}
#logo-boerse {
float: right;
max-width: 100%;
}
|
7830032795651b311713ce9332983d154c354734 | test/prx_auth/rails/configuration_test.rb | test/prx_auth/rails/configuration_test.rb | require 'test_helper'
describe PrxAuth::Rails::Configuration do
subject { PrxAuth::Rails::Configuration.new }
it 'initializes with a namespace defined by rails app name' do
assert subject.namespace == :dummy
end
it 'can be reconfigured using the namespace attr' do
subject.namespace = :new_test
assert subject.namespace == :new_test
end
it 'defaults to enabling the middleware' do
assert subject.install_middleware
end
it 'allows overriding of the middleware automatic installation' do
subject.install_middleware = false
assert subject.install_middleware == false
end
end
| require 'test_helper'
describe PrxAuth::Rails::Configuration do
subject { PrxAuth::Rails::Configuration.new }
it 'initializes with a namespace defined by rails app name' do
assert subject.namespace == :dummy
end
it 'can be reconfigured using the namespace attr' do
PrxAuth::Rails.stub(:configuration, subject) do
PrxAuth::Rails.configure do |config|
config.namespace = :new_test
end
assert PrxAuth::Rails.configuration.namespace == :new_test
end
end
it 'defaults to enabling the middleware' do
PrxAuth::Rails.stub(:configuration, subject) do
assert PrxAuth::Rails.configuration.install_middleware
end
end
it 'allows overriding of the middleware automatic installation' do
PrxAuth::Rails.stub(:configuration, subject) do
PrxAuth::Rails.configure do |config|
config.install_middleware = false
end
assert !PrxAuth::Rails.configuration.install_middleware
end
end
end
| Use stubbing here to ensure we trace the config block codepath | Use stubbing here to ensure we trace the config block codepath
| Ruby | mit | PRX/prx_auth-rails,PRX/prx_auth-rails,PRX/prx_auth-rails | ruby | ## Code Before:
require 'test_helper'
describe PrxAuth::Rails::Configuration do
subject { PrxAuth::Rails::Configuration.new }
it 'initializes with a namespace defined by rails app name' do
assert subject.namespace == :dummy
end
it 'can be reconfigured using the namespace attr' do
subject.namespace = :new_test
assert subject.namespace == :new_test
end
it 'defaults to enabling the middleware' do
assert subject.install_middleware
end
it 'allows overriding of the middleware automatic installation' do
subject.install_middleware = false
assert subject.install_middleware == false
end
end
## Instruction:
Use stubbing here to ensure we trace the config block codepath
## Code After:
require 'test_helper'
describe PrxAuth::Rails::Configuration do
subject { PrxAuth::Rails::Configuration.new }
it 'initializes with a namespace defined by rails app name' do
assert subject.namespace == :dummy
end
it 'can be reconfigured using the namespace attr' do
PrxAuth::Rails.stub(:configuration, subject) do
PrxAuth::Rails.configure do |config|
config.namespace = :new_test
end
assert PrxAuth::Rails.configuration.namespace == :new_test
end
end
it 'defaults to enabling the middleware' do
PrxAuth::Rails.stub(:configuration, subject) do
assert PrxAuth::Rails.configuration.install_middleware
end
end
it 'allows overriding of the middleware automatic installation' do
PrxAuth::Rails.stub(:configuration, subject) do
PrxAuth::Rails.configure do |config|
config.install_middleware = false
end
assert !PrxAuth::Rails.configuration.install_middleware
end
end
end
|
2c480b4b42e4bac295a958ccb2046aba6a49bdba | recipes/jupyterlab-transient-display-data/meta.yaml | recipes/jupyterlab-transient-display-data/meta.yaml | {% set name = "jupyterlab-transient-display-data" %}
{% set version = "0.2.2" %}
package:
name: {{ name|lower }}
version: {{ version }}
source:
url: https://github.com/vatlab/transient-display-data/archive/{{ version }}.tar.gz
sha256: d12dc82612ff116f6a27c11ccd0597c196f5889868fd44101223af233ae28297
build:
number: 0
noarch: python
requirements:
build:
- nodejs
host:
- jupyterlab
- python >=3.5
run:
- jupyterlab
- nodejs
- python >=3.5
test:
commands:
- jupyter labextension list
- jupyter lab build
about:
home: https://github.com/vatlab/transient-display-data
license: BSD 3-Clause
license_family: BSD
license_file: LICENSE
summary: A JupyterLab extension for the rendering transient-display-data messages
dev_url: https://github.com/vatlab/transient-display-data
extra:
recipe-maintainers:
- BoPeng
| {% set name = "jupyterlab-transient-display-data" %}
{% set version = "0.2.3" %}
package:
name: {{ name|lower }}
version: {{ version }}
source:
url: https://github.com/vatlab/transient-display-data/archive/{{ version }}.tar.gz
sha256: 116f8eefd378e996e9ec1201174ea592e8db4e9f0a751380458b7553c7c0c66e
build:
number: 0
noarch: python
requirements:
build:
- nodejs
host:
- jupyterlab
- python >=3.5
run:
- jupyterlab
- nodejs
- python >=3.5
test:
commands:
- jupyter labextension list
- jupyter lab build
about:
home: https://github.com/vatlab/transient-display-data
license: BSD 3-Clause
license_family: BSD
license_file: LICENSE
summary: A JupyterLab extension for the rendering transient-display-data messages
dev_url: https://github.com/vatlab/transient-display-data
extra:
recipe-maintainers:
- BoPeng
| Make a new release with LICENSE file | Make a new release with LICENSE file
| YAML | bsd-3-clause | igortg/staged-recipes,scopatz/staged-recipes,birdsarah/staged-recipes,scopatz/staged-recipes,ocefpaf/staged-recipes,kwilcox/staged-recipes,mcs07/staged-recipes,kwilcox/staged-recipes,stuertz/staged-recipes,goanpeca/staged-recipes,petrushy/staged-recipes,SylvainCorlay/staged-recipes,igortg/staged-recipes,johanneskoester/staged-recipes,synapticarbors/staged-recipes,ReimarBauer/staged-recipes,isuruf/staged-recipes,petrushy/staged-recipes,chrisburr/staged-recipes,hadim/staged-recipes,dschreij/staged-recipes,synapticarbors/staged-recipes,conda-forge/staged-recipes,dschreij/staged-recipes,jochym/staged-recipes,ocefpaf/staged-recipes,Juanlu001/staged-recipes,mcs07/staged-recipes,johanneskoester/staged-recipes,jakirkham/staged-recipes,Juanlu001/staged-recipes,patricksnape/staged-recipes,jochym/staged-recipes,patricksnape/staged-recipes,asmeurer/staged-recipes,mariusvniekerk/staged-recipes,goanpeca/staged-recipes,hadim/staged-recipes,jakirkham/staged-recipes,SylvainCorlay/staged-recipes,stuertz/staged-recipes,asmeurer/staged-recipes,conda-forge/staged-recipes,chrisburr/staged-recipes,mariusvniekerk/staged-recipes,isuruf/staged-recipes,birdsarah/staged-recipes,ReimarBauer/staged-recipes | yaml | ## Code Before:
{% set name = "jupyterlab-transient-display-data" %}
{% set version = "0.2.2" %}
package:
name: {{ name|lower }}
version: {{ version }}
source:
url: https://github.com/vatlab/transient-display-data/archive/{{ version }}.tar.gz
sha256: d12dc82612ff116f6a27c11ccd0597c196f5889868fd44101223af233ae28297
build:
number: 0
noarch: python
requirements:
build:
- nodejs
host:
- jupyterlab
- python >=3.5
run:
- jupyterlab
- nodejs
- python >=3.5
test:
commands:
- jupyter labextension list
- jupyter lab build
about:
home: https://github.com/vatlab/transient-display-data
license: BSD 3-Clause
license_family: BSD
license_file: LICENSE
summary: A JupyterLab extension for the rendering transient-display-data messages
dev_url: https://github.com/vatlab/transient-display-data
extra:
recipe-maintainers:
- BoPeng
## Instruction:
Make a new release with LICENSE file
## Code After:
{% set name = "jupyterlab-transient-display-data" %}
{% set version = "0.2.3" %}
package:
name: {{ name|lower }}
version: {{ version }}
source:
url: https://github.com/vatlab/transient-display-data/archive/{{ version }}.tar.gz
sha256: 116f8eefd378e996e9ec1201174ea592e8db4e9f0a751380458b7553c7c0c66e
build:
number: 0
noarch: python
requirements:
build:
- nodejs
host:
- jupyterlab
- python >=3.5
run:
- jupyterlab
- nodejs
- python >=3.5
test:
commands:
- jupyter labextension list
- jupyter lab build
about:
home: https://github.com/vatlab/transient-display-data
license: BSD 3-Clause
license_family: BSD
license_file: LICENSE
summary: A JupyterLab extension for the rendering transient-display-data messages
dev_url: https://github.com/vatlab/transient-display-data
extra:
recipe-maintainers:
- BoPeng
|
af8f66ea20aa23d77c6b1b4d3e88497b8d3f5f4d | framework_components/order.json | framework_components/order.json | [
"runs_list_bot",
"main_interface",
"binary-files-manager"
] | [
"runs_list_bot",
"main_interface",
"binary-files-manager",
"server_bot"
] | Add server bot to runlist | Add server bot to runlist
| JSON | mit | nutella-framework/nutella_framework,nutella-framework/nutella_framework,nutella-framework/nutella_framework,nutella-framework/nutella_framework | json | ## Code Before:
[
"runs_list_bot",
"main_interface",
"binary-files-manager"
]
## Instruction:
Add server bot to runlist
## Code After:
[
"runs_list_bot",
"main_interface",
"binary-files-manager",
"server_bot"
] |
04381dcea31c9a6ccc4c4eeaf306e867f5fcc893 | test/fixtures/error_corpus/python_errors.txt | test/fixtures/error_corpus/python_errors.txt | =============================================
incomplete condition in if statement
=============================================
if a is:
print b
print c
print d
---
(module
(if_statement
condition: (identifier)
(ERROR)
consequence: (block
(print_statement argument: (identifier))
(print_statement argument: (identifier))))
(print_statement argument: (identifier)))
==========================================
extra colon in function definition
==========================================
def a()::
b
c
d
---
(module
(function_definition
name: (identifier)
parameters: (parameters)
(ERROR)
body: (block
(expression_statement (identifier))
(expression_statement (identifier))))
(expression_statement (identifier)))
========================================================
incomplete if statement in function definition
========================================================
def a():
if a
---
(module
(function_definition
name: (identifier)
parameters: (parameters)
(ERROR (identifier))
body: (block)))
========================================================
incomplete expression before triple-quoted string
========================================================
def a():
b.
"""
c
"""
---
(module
(function_definition
name: (identifier)
parameters: (parameters)
(ERROR (identifier))
body: (block
(expression_statement (string)))))
| =============================================
incomplete condition in if statement
=============================================
if a is:
print b
print c
print d
---
(module
(if_statement
condition: (identifier)
(ERROR)
consequence: (block
(print_statement argument: (identifier))
(print_statement argument: (identifier))))
(print_statement argument: (identifier)))
==========================================
extra colon in function definition
==========================================
def a()::
b
c
d
---
(module
(function_definition
name: (identifier)
parameters: (parameters)
(ERROR)
body: (block
(expression_statement (identifier))
(expression_statement (identifier))))
(expression_statement (identifier)))
========================================================
stray if keyword in function definition
========================================================
def a():
if
---
(module
(function_definition
name: (identifier)
parameters: (parameters)
(ERROR)
body: (block)))
========================================================
incomplete if statement in function definition
========================================================
def a():
if a
---
(module
(function_definition
name: (identifier)
parameters: (parameters)
(ERROR (identifier))
body: (block)))
========================================================
incomplete expression before triple-quoted string
========================================================
def a():
b.
"""
c
"""
---
(module
(function_definition
name: (identifier)
parameters: (parameters)
(ERROR (identifier))
body: (block
(expression_statement (string)))))
===========================================
incomplete definition in class definition
===========================================
class A:
def
b
---
(module
(class_definition
name: (identifier)
(ERROR)
body: (block))
(expression_statement
(identifier))) | Add more python error recovery tests | Add more python error recovery tests
| Text | mit | tree-sitter/tree-sitter,tree-sitter/tree-sitter,tree-sitter/tree-sitter,tree-sitter/tree-sitter,tree-sitter/tree-sitter,tree-sitter/tree-sitter,tree-sitter/tree-sitter | text | ## Code Before:
=============================================
incomplete condition in if statement
=============================================
if a is:
print b
print c
print d
---
(module
(if_statement
condition: (identifier)
(ERROR)
consequence: (block
(print_statement argument: (identifier))
(print_statement argument: (identifier))))
(print_statement argument: (identifier)))
==========================================
extra colon in function definition
==========================================
def a()::
b
c
d
---
(module
(function_definition
name: (identifier)
parameters: (parameters)
(ERROR)
body: (block
(expression_statement (identifier))
(expression_statement (identifier))))
(expression_statement (identifier)))
========================================================
incomplete if statement in function definition
========================================================
def a():
if a
---
(module
(function_definition
name: (identifier)
parameters: (parameters)
(ERROR (identifier))
body: (block)))
========================================================
incomplete expression before triple-quoted string
========================================================
def a():
b.
"""
c
"""
---
(module
(function_definition
name: (identifier)
parameters: (parameters)
(ERROR (identifier))
body: (block
(expression_statement (string)))))
## Instruction:
Add more python error recovery tests
## Code After:
=============================================
incomplete condition in if statement
=============================================
if a is:
print b
print c
print d
---
(module
(if_statement
condition: (identifier)
(ERROR)
consequence: (block
(print_statement argument: (identifier))
(print_statement argument: (identifier))))
(print_statement argument: (identifier)))
==========================================
extra colon in function definition
==========================================
def a()::
b
c
d
---
(module
(function_definition
name: (identifier)
parameters: (parameters)
(ERROR)
body: (block
(expression_statement (identifier))
(expression_statement (identifier))))
(expression_statement (identifier)))
========================================================
stray if keyword in function definition
========================================================
def a():
if
---
(module
(function_definition
name: (identifier)
parameters: (parameters)
(ERROR)
body: (block)))
========================================================
incomplete if statement in function definition
========================================================
def a():
if a
---
(module
(function_definition
name: (identifier)
parameters: (parameters)
(ERROR (identifier))
body: (block)))
========================================================
incomplete expression before triple-quoted string
========================================================
def a():
b.
"""
c
"""
---
(module
(function_definition
name: (identifier)
parameters: (parameters)
(ERROR (identifier))
body: (block
(expression_statement (string)))))
===========================================
incomplete definition in class definition
===========================================
class A:
def
b
---
(module
(class_definition
name: (identifier)
(ERROR)
body: (block))
(expression_statement
(identifier))) |
98179c171098fe94853be74b65a7d2ac7b923b1a | dta_rapid.gemspec | dta_rapid.gemspec |
Gem::Specification.new do |spec|
spec.name = "dta_rapid"
spec.version = "0.2.1"
spec.authors = ["Gareth Rogers"]
spec.email = ["grogers@thoughtworks.com"]
spec.summary = %q{Converting the DTA UI kit (see https://github.com/AusDTO/gov-au-ui-kit) into a Jekyll theme}
spec.homepage = "https://github.com/gtrogers/dta_rapid"
spec.license = "MIT"
spec.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(assets|_layouts|_includes|_sass|LICENSE|README)}i) }
spec.add_runtime_dependency "jekyll", "~> 3.4"
spec.add_development_dependency "bundler", "~> 1.12"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "bourbon", "~> 4.3.2"
spec.add_development_dependency "neat", "~> 2.0.0"
end
|
Gem::Specification.new do |spec|
spec.name = "dta_rapid"
spec.version = "0.2.1"
spec.authors = ["Gareth Rogers"]
spec.email = ["grogers@thoughtworks.com"]
spec.summary = %q{Converting the DTA UI kit (see https://github.com/AusDTO/gov-au-ui-kit) into a Jekyll theme}
spec.homepage = "https://github.com/gtrogers/dta_rapid"
spec.license = "MIT"
spec.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(assets|_layouts|_includes|_sass|LICENSE|README)}i) }
spec.add_runtime_dependency "jekyll", "~> 3.4"
spec.add_development_dependency "bundler", "~> 1.12"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_runtime_dependency "bourbon", "~> 4.3", ">= 4.3.2"
spec.add_runtime_dependency "neat", "~> 2.0.0", ">= 2.0.0"
end
| Change bourbon and neat to runtime dependency | Change bourbon and neat to runtime dependency
| Ruby | mit | WorkItMakeItDoItMakeUs/dta_rapid,WorkItMakeItDoItMakeUs/dta_rapid,WorkItMakeItDoItMakeUs/dta_rapid,WorkItMakeItDoItMakeUs/dta_rapid | ruby | ## Code Before:
Gem::Specification.new do |spec|
spec.name = "dta_rapid"
spec.version = "0.2.1"
spec.authors = ["Gareth Rogers"]
spec.email = ["grogers@thoughtworks.com"]
spec.summary = %q{Converting the DTA UI kit (see https://github.com/AusDTO/gov-au-ui-kit) into a Jekyll theme}
spec.homepage = "https://github.com/gtrogers/dta_rapid"
spec.license = "MIT"
spec.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(assets|_layouts|_includes|_sass|LICENSE|README)}i) }
spec.add_runtime_dependency "jekyll", "~> 3.4"
spec.add_development_dependency "bundler", "~> 1.12"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "bourbon", "~> 4.3.2"
spec.add_development_dependency "neat", "~> 2.0.0"
end
## Instruction:
Change bourbon and neat to runtime dependency
## Code After:
Gem::Specification.new do |spec|
spec.name = "dta_rapid"
spec.version = "0.2.1"
spec.authors = ["Gareth Rogers"]
spec.email = ["grogers@thoughtworks.com"]
spec.summary = %q{Converting the DTA UI kit (see https://github.com/AusDTO/gov-au-ui-kit) into a Jekyll theme}
spec.homepage = "https://github.com/gtrogers/dta_rapid"
spec.license = "MIT"
spec.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(assets|_layouts|_includes|_sass|LICENSE|README)}i) }
spec.add_runtime_dependency "jekyll", "~> 3.4"
spec.add_development_dependency "bundler", "~> 1.12"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_runtime_dependency "bourbon", "~> 4.3", ">= 4.3.2"
spec.add_runtime_dependency "neat", "~> 2.0.0", ">= 2.0.0"
end
|
00383460da8fa380c65dd658fb8d1a12192f3e24 | common-jwt/src/main/resources/sg/ncl/common/jwt/jwt.yml | common-jwt/src/main/resources/sg/ncl/common/jwt/jwt.yml | ncl:
jwt:
# please set value for the variable (${jwt.apiKey}) externally (e.g., environment variables, properties file)
apiKey: ${jwt.apiKey}
| ncl:
jwt:
# please set value for the variable (${jwt.apiKey}) externally (e.g., environment variables, properties file)
apiKey: ${jwt.apiKey}
signing-algorithm: HS512
| Set default signing algorithm HS512 (DEV-99) | Set default signing algorithm HS512 (DEV-99)
| YAML | apache-2.0 | nus-ncl/services-in-one,nus-ncl/services-in-one | yaml | ## Code Before:
ncl:
jwt:
# please set value for the variable (${jwt.apiKey}) externally (e.g., environment variables, properties file)
apiKey: ${jwt.apiKey}
## Instruction:
Set default signing algorithm HS512 (DEV-99)
## Code After:
ncl:
jwt:
# please set value for the variable (${jwt.apiKey}) externally (e.g., environment variables, properties file)
apiKey: ${jwt.apiKey}
signing-algorithm: HS512
|
b80f4b7f7354507616789b1753f115ecfe111013 | tests/regression/27-inv_invariants/04-ints-not-interval.c | tests/regression/27-inv_invariants/04-ints-not-interval.c | //PARAM: --disable ana.int.def_exc --enable ana.int.interval
int main() {
int x;
if(!x) {
assert(x==0);
} else {
assert(x==1); //UNKNOWN!
}
}
| //PARAM: --disable ana.int.def_exc --enable ana.int.interval
int main() {
int x;
if(!x) {
} else {
assert(x==1); //UNKNOWN!
}
}
| Remove assert that is unknown when runinng only with interval | 27/04: Remove assert that is unknown when runinng only with interval
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer | c | ## Code Before:
//PARAM: --disable ana.int.def_exc --enable ana.int.interval
int main() {
int x;
if(!x) {
assert(x==0);
} else {
assert(x==1); //UNKNOWN!
}
}
## Instruction:
27/04: Remove assert that is unknown when runinng only with interval
## Code After:
//PARAM: --disable ana.int.def_exc --enable ana.int.interval
int main() {
int x;
if(!x) {
} else {
assert(x==1); //UNKNOWN!
}
}
|
396680a5f6418d8591d7191a730f0ac070e28edb | modules/mod_admin/templates/admin_logon.tpl | modules/mod_admin/templates/admin_logon.tpl | {% extends "admin_base.tpl" %}
{% block title %}
{_ Admin log on _}
{% endblock %}
{% block bodyclass %}noframe{% endblock %}
{% block navigation %}
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="http://{{ m.site.hostname }}" title="{_ visit site _}"><img alt="zotonic logo" src="/lib/images/admin_zotonic.png" width="106" height="20"></a>
</div>
</div>
</div>
{% endblock %}
{% block content %}
<div class="widget admin-logon">
<h3 class="widget-header">{_ Log on to _} {{ m.config.site.title.value|default:"Zotonic" }}</h3>
<div class="widget-content">
<div id="logon_error"></div>
{% include "_logon_form.tpl" page="/admin" hide_title %}
</div>
</div>
</div>
{% endblock %}
| {% extends "admin_base.tpl" %}
{% block title %}
{_ Admin log on _}
{% endblock %}
{% block bodyclass %}noframe{% endblock %}
{% block navigation %}
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="http://{{ m.site.hostname }}" title="{_ visit site _}"><img alt="zotonic logo" src="/lib/images/admin_zotonic.png" width="106" height="20"></a>
</div>
</div>
</div>
{% endblock %}
{% block content %}
<div class="widget admin-logon">
<h3 class="widget-header">{_ Log on to _} {{ m.config.site.title.value|default:"Zotonic" }}</h3>
<div class="widget-content">
<div id="logon_error"></div>
{% include "_logon_form.tpl" page=page|default:"/admin" hide_title %}
</div>
</div>
</div>
{% endblock %}
| Fix redirect to admin page when using admin logon form | mod_admin: Fix redirect to admin page when using admin logon form
Using the new admin logon form overwrote the "page" argument always to
redirect to /admin. This patch fixes that.
Fixes #488
| Smarty | apache-2.0 | erlanger-ru/erlanger-ru.meta,erlanger-ru/erlanger-ru.meta,erlanger-ru/erlanger-ru.meta,erlanger-ru/erlanger-ru.meta,erlanger-ru/erlanger-ru.meta | smarty | ## Code Before:
{% extends "admin_base.tpl" %}
{% block title %}
{_ Admin log on _}
{% endblock %}
{% block bodyclass %}noframe{% endblock %}
{% block navigation %}
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="http://{{ m.site.hostname }}" title="{_ visit site _}"><img alt="zotonic logo" src="/lib/images/admin_zotonic.png" width="106" height="20"></a>
</div>
</div>
</div>
{% endblock %}
{% block content %}
<div class="widget admin-logon">
<h3 class="widget-header">{_ Log on to _} {{ m.config.site.title.value|default:"Zotonic" }}</h3>
<div class="widget-content">
<div id="logon_error"></div>
{% include "_logon_form.tpl" page="/admin" hide_title %}
</div>
</div>
</div>
{% endblock %}
## Instruction:
mod_admin: Fix redirect to admin page when using admin logon form
Using the new admin logon form overwrote the "page" argument always to
redirect to /admin. This patch fixes that.
Fixes #488
## Code After:
{% extends "admin_base.tpl" %}
{% block title %}
{_ Admin log on _}
{% endblock %}
{% block bodyclass %}noframe{% endblock %}
{% block navigation %}
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="http://{{ m.site.hostname }}" title="{_ visit site _}"><img alt="zotonic logo" src="/lib/images/admin_zotonic.png" width="106" height="20"></a>
</div>
</div>
</div>
{% endblock %}
{% block content %}
<div class="widget admin-logon">
<h3 class="widget-header">{_ Log on to _} {{ m.config.site.title.value|default:"Zotonic" }}</h3>
<div class="widget-content">
<div id="logon_error"></div>
{% include "_logon_form.tpl" page=page|default:"/admin" hide_title %}
</div>
</div>
</div>
{% endblock %}
|
91afa7c5f56d4e2ac780286c92e44e33989f90f0 | .travis.yml | .travis.yml | language: java
sudo: false
install: true
services:
- docker
jdk:
- oraclejdk8
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- "$HOME/.gradle/caches/"
- "$HOME/.gradle/wrapper/"
script:
- "./gradlew test jacocoJunit5TestReport jar acceptanceTest --console=plain"
after_success:
- bash <(curl -s https://codecov.io/bash)
- test "$TRAVIS_BRANCH" = "master" && sh .travis/deploy_heroku.sh
| language: java
sudo: false
install: true
services:
- docker
jdk:
- oraclejdk8
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- "$HOME/.gradle/caches/"
- "$HOME/.gradle/wrapper/"
jobs:
include:
- stage: test
script: ./gradlew test jacocoTestReport --console=plain
after_success:
- bash <(curl -s https://codecov.io/bash)
- stage: acceptance test
script: ./gradlew jar acceptanceTest --console=plain
- stage: deploy
script: ./gradlew jar --console=plain
after_success:
- test "$TRAVIS_BRANCH" = "master" && sh .travis/deploy_heroku.sh
| Break down single script command into a pipeline on CI | Break down single script command into a pipeline on CI
| YAML | mit | fcostaa/kotlin-microservice,fcostaa/kotlin-microservice,fcostaa/kotlin-microservice | yaml | ## Code Before:
language: java
sudo: false
install: true
services:
- docker
jdk:
- oraclejdk8
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- "$HOME/.gradle/caches/"
- "$HOME/.gradle/wrapper/"
script:
- "./gradlew test jacocoJunit5TestReport jar acceptanceTest --console=plain"
after_success:
- bash <(curl -s https://codecov.io/bash)
- test "$TRAVIS_BRANCH" = "master" && sh .travis/deploy_heroku.sh
## Instruction:
Break down single script command into a pipeline on CI
## Code After:
language: java
sudo: false
install: true
services:
- docker
jdk:
- oraclejdk8
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- "$HOME/.gradle/caches/"
- "$HOME/.gradle/wrapper/"
jobs:
include:
- stage: test
script: ./gradlew test jacocoTestReport --console=plain
after_success:
- bash <(curl -s https://codecov.io/bash)
- stage: acceptance test
script: ./gradlew jar acceptanceTest --console=plain
- stage: deploy
script: ./gradlew jar --console=plain
after_success:
- test "$TRAVIS_BRANCH" = "master" && sh .travis/deploy_heroku.sh
|
fdb3711c5690effa82a14fc16c8703d771f1fe05 | package.json | package.json | {
"name": "Melange",
"description": "The goal of this project is to create a framework for representing Open Source contribution workflows, such as the existing Google Summer of Code TM (GSoC) program",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-jasmine": "~0.3.1",
"grunt-template-jasmine-istanbul": "~0.2.1",
"testem": "~0.2.96",
"grunt-template-jasmine-requirejs": "~0.1.1",
"grunt-jasmine-runner": "~0.6.0",
"growl": "~1.7.0",
"grunt-plato": "~0.2.0",
"grunt-contrib-yuidoc": "~0.4.0",
"phantomjs": "~1.9.0-4"
}
}
| {
"name": "Melange",
"description": "The goal of this project is to create a framework for representing Open Source contribution workflows, such as the existing Google Summer of Code TM (GSoC) program",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-jasmine": "~0.3.1",
"grunt-template-jasmine-istanbul": "~0.2.1",
"testem": "~0.2.96",
"grunt-template-jasmine-requirejs": "~0.1.1",
"grunt-jasmine-runner": "~0.6.0",
"growl": "~1.7.0",
"grunt-plato": "~0.2.0",
"grunt-contrib-yuidoc": "~0.4.0",
"phantomjs": "~1.9.0-4",
"grunt-contrib-less": "~0.6.1"
}
}
| Install grunt task for LESSCSS during buildout. | Install grunt task for LESSCSS during buildout.
| JSON | apache-2.0 | rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son | json | ## Code Before:
{
"name": "Melange",
"description": "The goal of this project is to create a framework for representing Open Source contribution workflows, such as the existing Google Summer of Code TM (GSoC) program",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-jasmine": "~0.3.1",
"grunt-template-jasmine-istanbul": "~0.2.1",
"testem": "~0.2.96",
"grunt-template-jasmine-requirejs": "~0.1.1",
"grunt-jasmine-runner": "~0.6.0",
"growl": "~1.7.0",
"grunt-plato": "~0.2.0",
"grunt-contrib-yuidoc": "~0.4.0",
"phantomjs": "~1.9.0-4"
}
}
## Instruction:
Install grunt task for LESSCSS during buildout.
## Code After:
{
"name": "Melange",
"description": "The goal of this project is to create a framework for representing Open Source contribution workflows, such as the existing Google Summer of Code TM (GSoC) program",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-jasmine": "~0.3.1",
"grunt-template-jasmine-istanbul": "~0.2.1",
"testem": "~0.2.96",
"grunt-template-jasmine-requirejs": "~0.1.1",
"grunt-jasmine-runner": "~0.6.0",
"growl": "~1.7.0",
"grunt-plato": "~0.2.0",
"grunt-contrib-yuidoc": "~0.4.0",
"phantomjs": "~1.9.0-4",
"grunt-contrib-less": "~0.6.1"
}
}
|
4e23fb8503bb991abeaae25cf4849f7b08638cab | web/emergencyshutdown.go | web/emergencyshutdown.go | package web
import (
"github.com/control-center/serviced/dao"
rest "github.com/zenoss/go-json-rest"
)
type EmergencyShutdownRequest struct {
Operation int // 0 is emergency shutdown, 1 is clear emergency shutdown status
TenantID string
}
func restEmergencyShutdown(w *rest.ResponseWriter, r *rest.Request, ctx *requestContext) {
req := EmergencyShutdownRequest{}
err := r.DecodeJsonPayload(&req)
if err != nil {
plog.WithError(err).Error("Could not decode json payload for emergency shutdown request")
restBadRequest(w, err)
return
}
daoReq := dao.ScheduleServiceRequest{
ServiceID: req.TenantID,
AutoLaunch: true,
Synchronous: false,
}
n, err := ctx.getFacade().EmergencyStopService(ctx.getDatastoreContext(), daoReq)
if err != nil {
plog.WithError(err).Error("Facade could not process Emergency Shutdown Request")
restBadRequest(w, err)
return
}
plog.Infof("Scheduled %d services", n)
restSuccess(w)
}
| package web
import (
"github.com/control-center/serviced/dao"
rest "github.com/zenoss/go-json-rest"
)
type EmergencyShutdownRequest struct {
Operation int // 0 is emergency shutdown, 1 is clear emergency shutdown status
TenantID string
}
func restEmergencyShutdown(w *rest.ResponseWriter, r *rest.Request, ctx *requestContext) {
req := EmergencyShutdownRequest{}
err := r.DecodeJsonPayload(&req)
if err != nil {
plog.WithError(err).Error("Could not decode json payload for emergency shutdown request")
restBadRequest(w, err)
return
}
daoReq := dao.ScheduleServiceRequest{
ServiceID: req.TenantID,
AutoLaunch: true,
Synchronous: false,
}
go ctx.getFacade().EmergencyStopService(ctx.getDatastoreContext(), daoReq)
restSuccess(w)
}
| Update to emergency shutdown endpoint for tests | Update to emergency shutdown endpoint for tests
| Go | apache-2.0 | control-center/serviced,control-center/serviced,control-center/serviced,control-center/serviced,control-center/serviced,control-center/serviced,control-center/serviced,control-center/serviced | go | ## Code Before:
package web
import (
"github.com/control-center/serviced/dao"
rest "github.com/zenoss/go-json-rest"
)
type EmergencyShutdownRequest struct {
Operation int // 0 is emergency shutdown, 1 is clear emergency shutdown status
TenantID string
}
func restEmergencyShutdown(w *rest.ResponseWriter, r *rest.Request, ctx *requestContext) {
req := EmergencyShutdownRequest{}
err := r.DecodeJsonPayload(&req)
if err != nil {
plog.WithError(err).Error("Could not decode json payload for emergency shutdown request")
restBadRequest(w, err)
return
}
daoReq := dao.ScheduleServiceRequest{
ServiceID: req.TenantID,
AutoLaunch: true,
Synchronous: false,
}
n, err := ctx.getFacade().EmergencyStopService(ctx.getDatastoreContext(), daoReq)
if err != nil {
plog.WithError(err).Error("Facade could not process Emergency Shutdown Request")
restBadRequest(w, err)
return
}
plog.Infof("Scheduled %d services", n)
restSuccess(w)
}
## Instruction:
Update to emergency shutdown endpoint for tests
## Code After:
package web
import (
"github.com/control-center/serviced/dao"
rest "github.com/zenoss/go-json-rest"
)
type EmergencyShutdownRequest struct {
Operation int // 0 is emergency shutdown, 1 is clear emergency shutdown status
TenantID string
}
func restEmergencyShutdown(w *rest.ResponseWriter, r *rest.Request, ctx *requestContext) {
req := EmergencyShutdownRequest{}
err := r.DecodeJsonPayload(&req)
if err != nil {
plog.WithError(err).Error("Could not decode json payload for emergency shutdown request")
restBadRequest(w, err)
return
}
daoReq := dao.ScheduleServiceRequest{
ServiceID: req.TenantID,
AutoLaunch: true,
Synchronous: false,
}
go ctx.getFacade().EmergencyStopService(ctx.getDatastoreContext(), daoReq)
restSuccess(w)
}
|
d062eac9d284df8f6f059b7fac27c14224ec63ad | docs/docs/reference/dropped-features/this-qualifier.md | docs/docs/reference/dropped-features/this-qualifier.md | ---
title: "Dropped: private[this] and protected[this]"
type: section
num: 86
previous-page: /scala3/reference/dropped-features/weak-conformance
next-page: /scala3/reference/dropped-features/wildcard-init
---
The `private[this]` and `protected[this]` access modifiers are deprecated and will be phased out.
Previously, these modifiers were needed for
- avoiding the generation of getters and setters
- excluding code under a `private[this]` from variance checks. (Scala 2 also excludes `protected[this]` but this was found to be unsound and was therefore removed).
The compiler now infers for `private` members the fact that they are only accessed via `this`. Such members are treated as if they had been declared `private[this]`. `protected[this]` is dropped without a replacement.
| ---
title: "Dropped: private[this] and protected[this]"
type: section
num: 86
previous-page: /scala3/reference/dropped-features/weak-conformance
next-page: /scala3/reference/dropped-features/wildcard-init
---
The `private[this]` and `protected[this]` access modifiers are deprecated and will be phased out.
Previously, these modifiers were needed for
- avoiding the generation of getters and setters
- excluding code under a `private[this]` from variance checks. (Scala 2 also excludes `protected[this]` but this was found to be unsound and was therefore removed).
- avoiding the generation of fields, if a `private[this] val` is not accessed
by a class method.
The compiler now infers for `private` members the fact that they are only accessed via `this`. Such members are treated as if they had been declared `private[this]`. `protected[this]` is dropped without a replacement.
This change can in some cases change the semantics of a Scala program, since a
`private` val is no longer guaranteed to generate a field. The field
is omitted if
- the `val` is only accessed via `this`, and
- the `val` is not accessed from a method in the current class.
This can cause problems if a program tries to access the missing private field via reflection. The recommended fix is to declare the field instead to be qualified private with the enclosing class as qualifier. Example:
```scala
class C(x: Int):
private[C] val field = x + 1
// [C] needed if `field` is to be accessed through reflection
val retained = field * field
```
| Add explanations to discussion of private[this] in docs | Add explanations to discussion of private[this] in docs
Fixes #13770
Or more precisely: it explains the issue with reflection which has been observed
in several projects. The issue with WeakReferences is so tricky/underspecified
that I did not find a reasonable explanation. I fear people would be confused
rather than enlightened.
| Markdown | apache-2.0 | dotty-staging/dotty,sjrd/dotty,lampepfl/dotty,dotty-staging/dotty,dotty-staging/dotty,dotty-staging/dotty,dotty-staging/dotty,sjrd/dotty,lampepfl/dotty,lampepfl/dotty,sjrd/dotty,sjrd/dotty,lampepfl/dotty,sjrd/dotty,lampepfl/dotty | markdown | ## Code Before:
---
title: "Dropped: private[this] and protected[this]"
type: section
num: 86
previous-page: /scala3/reference/dropped-features/weak-conformance
next-page: /scala3/reference/dropped-features/wildcard-init
---
The `private[this]` and `protected[this]` access modifiers are deprecated and will be phased out.
Previously, these modifiers were needed for
- avoiding the generation of getters and setters
- excluding code under a `private[this]` from variance checks. (Scala 2 also excludes `protected[this]` but this was found to be unsound and was therefore removed).
The compiler now infers for `private` members the fact that they are only accessed via `this`. Such members are treated as if they had been declared `private[this]`. `protected[this]` is dropped without a replacement.
## Instruction:
Add explanations to discussion of private[this] in docs
Fixes #13770
Or more precisely: it explains the issue with reflection which has been observed
in several projects. The issue with WeakReferences is so tricky/underspecified
that I did not find a reasonable explanation. I fear people would be confused
rather than enlightened.
## Code After:
---
title: "Dropped: private[this] and protected[this]"
type: section
num: 86
previous-page: /scala3/reference/dropped-features/weak-conformance
next-page: /scala3/reference/dropped-features/wildcard-init
---
The `private[this]` and `protected[this]` access modifiers are deprecated and will be phased out.
Previously, these modifiers were needed for
- avoiding the generation of getters and setters
- excluding code under a `private[this]` from variance checks. (Scala 2 also excludes `protected[this]` but this was found to be unsound and was therefore removed).
- avoiding the generation of fields, if a `private[this] val` is not accessed
by a class method.
The compiler now infers for `private` members the fact that they are only accessed via `this`. Such members are treated as if they had been declared `private[this]`. `protected[this]` is dropped without a replacement.
This change can in some cases change the semantics of a Scala program, since a
`private` val is no longer guaranteed to generate a field. The field
is omitted if
- the `val` is only accessed via `this`, and
- the `val` is not accessed from a method in the current class.
This can cause problems if a program tries to access the missing private field via reflection. The recommended fix is to declare the field instead to be qualified private with the enclosing class as qualifier. Example:
```scala
class C(x: Int):
private[C] val field = x + 1
// [C] needed if `field` is to be accessed through reflection
val retained = field * field
```
|
72af10999d6372770623075eee018f2a0f463b33 | src/com/connectsdk/DefaultPlatform.java | src/com/connectsdk/DefaultPlatform.java | package com.connectsdk;
import java.util.HashMap;
public class DefaultPlatform {
public DefaultPlatform() {
}
public static HashMap<String, String> getDeviceServiceMap() {
HashMap<String, String> devicesList = new HashMap<String, String>();
devicesList.put("com.connectsdk.service.WebOSTVService", "com.connectsdk.discovery.provider.SSDPDiscoveryProvider");
devicesList.put("com.connectsdk.service.NetcastTVService", "com.connectsdk.discovery.provider.SSDPDiscoveryProvider");
devicesList.put("com.connectsdk.service.DLNAService", "com.connectsdk.discovery.provider.SSDPDiscoveryProvider");
devicesList.put("com.connectsdk.service.DIALService", "com.connectsdk.discovery.provider.SSDPDiscoveryProvider");
devicesList.put("com.connectsdk.service.RokuService", "com.connectsdk.discovery.provider.SSDPDiscoveryProvider");
devicesList.put("com.connectsdk.service.CastService", "com.connectsdk.discovery.provider.CastDiscoveryProvider");
devicesList.put("com.connectsdk.service.AirPlayService", "com.connectsdk.discovery.provider.ZeroconfDiscoveryProvider");
return devicesList;
}
}
| package com.connectsdk;
import java.util.HashMap;
public class DefaultPlatform {
public DefaultPlatform() {
}
public static HashMap<String, String> getDeviceServiceMap() {
HashMap<String, String> devicesList = new HashMap<String, String>();
devicesList.put("com.connectsdk.service.WebOSTVService", "com.connectsdk.discovery.provider.SSDPDiscoveryProvider");
devicesList.put("com.connectsdk.service.NetcastTVService", "com.connectsdk.discovery.provider.SSDPDiscoveryProvider");
devicesList.put("com.connectsdk.service.DLNAService", "com.connectsdk.discovery.provider.SSDPDiscoveryProvider");
devicesList.put("com.connectsdk.service.DIALService", "com.connectsdk.discovery.provider.SSDPDiscoveryProvider");
devicesList.put("com.connectsdk.service.RokuService", "com.connectsdk.discovery.provider.SSDPDiscoveryProvider");
devicesList.put("com.connectsdk.service.CastService", "com.connectsdk.discovery.provider.CastDiscoveryProvider");
devicesList.put("com.connectsdk.service.AirPlayService", "com.connectsdk.discovery.provider.ZeroconfDiscoveryProvider");
devicesList.put("com.connectsdk.service.MultiScreenService", "com.connectsdk.discovery.provider.SSDPDiscoveryProvider");
return devicesList;
}
}
| Add MultiScreenService to Default platforms | Add MultiScreenService to Default platforms
| Java | apache-2.0 | ConnectSDK/Connect-SDK-Android,happysir/Connect-SDK-Android,AspiroTV/Connect-SDK-Android,jaambee/Connect-SDK-Android | java | ## Code Before:
package com.connectsdk;
import java.util.HashMap;
public class DefaultPlatform {
public DefaultPlatform() {
}
public static HashMap<String, String> getDeviceServiceMap() {
HashMap<String, String> devicesList = new HashMap<String, String>();
devicesList.put("com.connectsdk.service.WebOSTVService", "com.connectsdk.discovery.provider.SSDPDiscoveryProvider");
devicesList.put("com.connectsdk.service.NetcastTVService", "com.connectsdk.discovery.provider.SSDPDiscoveryProvider");
devicesList.put("com.connectsdk.service.DLNAService", "com.connectsdk.discovery.provider.SSDPDiscoveryProvider");
devicesList.put("com.connectsdk.service.DIALService", "com.connectsdk.discovery.provider.SSDPDiscoveryProvider");
devicesList.put("com.connectsdk.service.RokuService", "com.connectsdk.discovery.provider.SSDPDiscoveryProvider");
devicesList.put("com.connectsdk.service.CastService", "com.connectsdk.discovery.provider.CastDiscoveryProvider");
devicesList.put("com.connectsdk.service.AirPlayService", "com.connectsdk.discovery.provider.ZeroconfDiscoveryProvider");
return devicesList;
}
}
## Instruction:
Add MultiScreenService to Default platforms
## Code After:
package com.connectsdk;
import java.util.HashMap;
public class DefaultPlatform {
public DefaultPlatform() {
}
public static HashMap<String, String> getDeviceServiceMap() {
HashMap<String, String> devicesList = new HashMap<String, String>();
devicesList.put("com.connectsdk.service.WebOSTVService", "com.connectsdk.discovery.provider.SSDPDiscoveryProvider");
devicesList.put("com.connectsdk.service.NetcastTVService", "com.connectsdk.discovery.provider.SSDPDiscoveryProvider");
devicesList.put("com.connectsdk.service.DLNAService", "com.connectsdk.discovery.provider.SSDPDiscoveryProvider");
devicesList.put("com.connectsdk.service.DIALService", "com.connectsdk.discovery.provider.SSDPDiscoveryProvider");
devicesList.put("com.connectsdk.service.RokuService", "com.connectsdk.discovery.provider.SSDPDiscoveryProvider");
devicesList.put("com.connectsdk.service.CastService", "com.connectsdk.discovery.provider.CastDiscoveryProvider");
devicesList.put("com.connectsdk.service.AirPlayService", "com.connectsdk.discovery.provider.ZeroconfDiscoveryProvider");
devicesList.put("com.connectsdk.service.MultiScreenService", "com.connectsdk.discovery.provider.SSDPDiscoveryProvider");
return devicesList;
}
}
|
09bef3b1c50a8ac7e1f463e9a7b9ca2124b8478f | lib/cacheable_flash/rspec_matchers.rb | lib/cacheable_flash/rspec_matchers.rb | require 'cacheable_flash/test_helpers'
module CacheableFlash
module RspecMatchers
include CacheableFlash::TestHelpers
RSpec::Matchers.define :have_flash_cookie do |flash_status, expecting|
define_method :has_flash_cookie? do |response|
flash = testable_flash(response)[flash_status]
if flash.kind_of?(Array)
if expecting.kind_of?(Array)
flash == expecting
else
matches = flash.select do |to_check|
to_check == expecting
end
matches.length > 0
end
else
flash == expecting
end
end
match{|response| has_flash_cookie?(response)}
failure_message_for_should do |actual|
"expected that flash cookie :#{expected[0]} #{testable_flash(actual)[expected[0]]} would include #{expected[1].inspect}"
end
failure_message_for_should_not do |actual|
"expected that flash cookie :#{expected[0]} #{testable_flash(actual)[expected[0]]} would not include #{expected[1].inspect}"
end
end
end
end
| require 'stackable_flash/test_helpers' # Used in the definition of these matchers
require 'stackable_flash/rspec_matchers' # Not used here, but for convenience
require 'cacheable_flash/test_helpers' # Used in the definition of these matchers
module CacheableFlash
module RspecMatchers
include StackableFlash::TestHelpers
include CacheableFlash::TestHelpers
RSpec::Matchers.define :have_flash_cookie do |flash_status, expecting|
define_method :has_flash_cookie? do |response|
flash_in_stack(testable_flash(response)[flash_status], expecting)
end
match{|response| has_flash_cookie?(response)}
failure_message_for_should do |actual|
"expected flash[:#{expected[0]}] to be or include #{expected[1].inspect}, but got #{testable_flash(actual)[expected[0]]}"
end
failure_message_for_should_not do |actual|
"expected flash[:#{expected[0]}] to not be and not include #{expected[1].inspect}, but got #{testable_flash(actual)[expected[0]]}"
end
end
RSpec::Matchers.define :have_cacheable_flash do |flash_status, expecting|
define_method :has_cacheable_flash? do |response|
flash_in_stack(testable_flash(response)[flash_status], expecting)
end
match{|response| has_cacheable_flash?(response)}
failure_message_for_should do |actual|
"expected flash[:#{expected[0]}] to be or include #{expected[1].inspect}, but got #{testable_flash(actual)[expected[0]]}"
end
failure_message_for_should_not do |actual|
"expected flash[:#{expected[0]}] to not be and not include #{expected[1].inspect}, but got #{testable_flash(actual)[expected[0]]}"
end
end
end
end
| Use stackable_flash/test_helpers instead of reinventing the wheel | Use stackable_flash/test_helpers instead of reinventing the wheel
| Ruby | mit | ndreckshage/cacheable-flash,pivotal/cacheable-flash,pedrocarrico/cacheable-flash,efigence/cacheable-flash,wandenberg/cacheable-flash,ekampp/cacheable-flash,pboling/cacheable-flash,khoan/cacheable-flash,ndreckshage/cacheable-flash,pboling/cacheable-flash,pboling/cacheable-flash,pivotal/cacheable-flash,khoan/cacheable-flash,ndreckshage/cacheable-flash,pedrocarrico/cacheable-flash,pivotal/cacheable-flash,pboling/cacheable-flash,nickurban/cacheable-flash,wandenberg/cacheable-flash,nickurban/cacheable-flash,ekampp/cacheable-flash,pedrocarrico/cacheable-flash,efigence/cacheable-flash | ruby | ## Code Before:
require 'cacheable_flash/test_helpers'
module CacheableFlash
module RspecMatchers
include CacheableFlash::TestHelpers
RSpec::Matchers.define :have_flash_cookie do |flash_status, expecting|
define_method :has_flash_cookie? do |response|
flash = testable_flash(response)[flash_status]
if flash.kind_of?(Array)
if expecting.kind_of?(Array)
flash == expecting
else
matches = flash.select do |to_check|
to_check == expecting
end
matches.length > 0
end
else
flash == expecting
end
end
match{|response| has_flash_cookie?(response)}
failure_message_for_should do |actual|
"expected that flash cookie :#{expected[0]} #{testable_flash(actual)[expected[0]]} would include #{expected[1].inspect}"
end
failure_message_for_should_not do |actual|
"expected that flash cookie :#{expected[0]} #{testable_flash(actual)[expected[0]]} would not include #{expected[1].inspect}"
end
end
end
end
## Instruction:
Use stackable_flash/test_helpers instead of reinventing the wheel
## Code After:
require 'stackable_flash/test_helpers' # Used in the definition of these matchers
require 'stackable_flash/rspec_matchers' # Not used here, but for convenience
require 'cacheable_flash/test_helpers' # Used in the definition of these matchers
module CacheableFlash
module RspecMatchers
include StackableFlash::TestHelpers
include CacheableFlash::TestHelpers
RSpec::Matchers.define :have_flash_cookie do |flash_status, expecting|
define_method :has_flash_cookie? do |response|
flash_in_stack(testable_flash(response)[flash_status], expecting)
end
match{|response| has_flash_cookie?(response)}
failure_message_for_should do |actual|
"expected flash[:#{expected[0]}] to be or include #{expected[1].inspect}, but got #{testable_flash(actual)[expected[0]]}"
end
failure_message_for_should_not do |actual|
"expected flash[:#{expected[0]}] to not be and not include #{expected[1].inspect}, but got #{testable_flash(actual)[expected[0]]}"
end
end
RSpec::Matchers.define :have_cacheable_flash do |flash_status, expecting|
define_method :has_cacheable_flash? do |response|
flash_in_stack(testable_flash(response)[flash_status], expecting)
end
match{|response| has_cacheable_flash?(response)}
failure_message_for_should do |actual|
"expected flash[:#{expected[0]}] to be or include #{expected[1].inspect}, but got #{testable_flash(actual)[expected[0]]}"
end
failure_message_for_should_not do |actual|
"expected flash[:#{expected[0]}] to not be and not include #{expected[1].inspect}, but got #{testable_flash(actual)[expected[0]]}"
end
end
end
end
|
41041c967c3402102deb19adee6908f3b395f947 | requirements.txt | requirements.txt | Markdown==2.4
inflection==0.2.0
jsonpatch==1.13
jsonpointer==1.10
jsonschema==2.3.0
pandocfilters==1.2
six>=1.5.2
| Markdown==2.4
inflection==0.2.0
jsonschema==2.3.0
pandocfilters==1.2
six>=1.5.2
| Remove dependency on jsonpatch and jsonpointer | Remove dependency on jsonpatch and jsonpointer
It's not clear at all why these were ever in the requirements
list, because they're not imported, and they don't appear to be
an upstream dependency of jsonschema.
| Text | mit | cwacek/python-jsonschema-objects | text | ## Code Before:
Markdown==2.4
inflection==0.2.0
jsonpatch==1.13
jsonpointer==1.10
jsonschema==2.3.0
pandocfilters==1.2
six>=1.5.2
## Instruction:
Remove dependency on jsonpatch and jsonpointer
It's not clear at all why these were ever in the requirements
list, because they're not imported, and they don't appear to be
an upstream dependency of jsonschema.
## Code After:
Markdown==2.4
inflection==0.2.0
jsonschema==2.3.0
pandocfilters==1.2
six>=1.5.2
|
c74e5bc942ae2486199070ec213fa6d692a2a605 | docs/source/examples/test_modify_array_argument_reals.py | docs/source/examples/test_modify_array_argument_reals.py | import numpy as np
from pych.extern import Chapel
@Chapel()
def printArray(arr=np.ndarray):
"""
arr += 1;
writeln(arr);
"""
return None
if __name__ == "__main__":
arr = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0])
print arr
printArray(arr);
print arr
import testcase
# contains the general testing method, which allows us to gather output
import os.path
def test_modify_array_argument_reals():
out = testcase.runpy(os.path.realpath(__file__))
# The first time this test is run, it may contain output notifying that
# a temporary file has been created. The important part is that this
# expected output follows it (enabling the test to work for all runs, as
# the temporary file message won't occur in the second run) But that means
# we can't use ==
assert out.endswith("[ 2. 3. 4. 5. 6. 7. 8. 9. 10. 11.]\n");
| import numpy as np
from pych.extern import Chapel
@Chapel()
def printArray(arr=np.ndarray):
"""
arr += 1;
writeln(arr);
"""
return None
if __name__ == "__main__":
arr = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0])
print arr
printArray(arr);
print arr
import testcase
# contains the general testing method, which allows us to gather output
import os.path
def test_modify_array_argument_reals():
out = testcase.runpy(os.path.realpath(__file__))
# The first time this test is run, it may contain output notifying that
# a temporary file has been created. The important part is that this
# expected output follows it (enabling the test to work for all runs, as
# the temporary file message won't occur in the second run) But that means
# we can't use ==
assert out.endswith("[ 2. 3. 4. 5. 6. 7. 8. 9. 10. 11.]\n");
| Fix trivial unit test error that started when numpy version changed | Fix trivial unit test error that started when numpy version changed
The version of numpy brought in by pip changed, which changed some
test outputs in meaningless ways (ie, spaces), and
those meaningless changes broke a unit test with
assertEquals( "string literal", test(something) )
This change fixes the unit test error, without at all addressing
the underlying issue (hyper-sensitive string comparison).
| Python | apache-2.0 | russel/pychapel,russel/pychapel,chapel-lang/pychapel,chapel-lang/pychapel,russel/pychapel,chapel-lang/pychapel | python | ## Code Before:
import numpy as np
from pych.extern import Chapel
@Chapel()
def printArray(arr=np.ndarray):
"""
arr += 1;
writeln(arr);
"""
return None
if __name__ == "__main__":
arr = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0])
print arr
printArray(arr);
print arr
import testcase
# contains the general testing method, which allows us to gather output
import os.path
def test_modify_array_argument_reals():
out = testcase.runpy(os.path.realpath(__file__))
# The first time this test is run, it may contain output notifying that
# a temporary file has been created. The important part is that this
# expected output follows it (enabling the test to work for all runs, as
# the temporary file message won't occur in the second run) But that means
# we can't use ==
assert out.endswith("[ 2. 3. 4. 5. 6. 7. 8. 9. 10. 11.]\n");
## Instruction:
Fix trivial unit test error that started when numpy version changed
The version of numpy brought in by pip changed, which changed some
test outputs in meaningless ways (ie, spaces), and
those meaningless changes broke a unit test with
assertEquals( "string literal", test(something) )
This change fixes the unit test error, without at all addressing
the underlying issue (hyper-sensitive string comparison).
## Code After:
import numpy as np
from pych.extern import Chapel
@Chapel()
def printArray(arr=np.ndarray):
"""
arr += 1;
writeln(arr);
"""
return None
if __name__ == "__main__":
arr = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0])
print arr
printArray(arr);
print arr
import testcase
# contains the general testing method, which allows us to gather output
import os.path
def test_modify_array_argument_reals():
out = testcase.runpy(os.path.realpath(__file__))
# The first time this test is run, it may contain output notifying that
# a temporary file has been created. The important part is that this
# expected output follows it (enabling the test to work for all runs, as
# the temporary file message won't occur in the second run) But that means
# we can't use ==
assert out.endswith("[ 2. 3. 4. 5. 6. 7. 8. 9. 10. 11.]\n");
|
e82f652c4210f5105f6a77c71d8660b3a8495d84 | lib/stash_merge_executor.rb | lib/stash_merge_executor.rb | require 'open3'
require 'git_merge_executor'
class StashMergeExecutor < GitMergeExecutor
# Merges the branch associated with a build using the Stash REST api.
# If an API error is raised, falls back on traditional method.
def merge_and_push
remote_server = @build.repository.remote_server
if @build.project.name =~ /-pull_requests$/
begin
Rails.logger.info("Trying to merge branch #{@build.branch} to master after build id #{@build.id} using Stash REST api")
merge_success = remote_server.merge(@build.branch)
unless merge_success
raise GitMergeFailedError
end
return "Successfully merged #{@build.branch}"
rescue RemoteServer::StashAPIError
Rails.logger.info("Error using StashAPI, falling back on old merge method")
end
end
super
end
# Delete branch associated with a build using Stash REST api.
# If method fails, falls back on traditional method.
def delete_branch
remote_server = @build.repository.remote_server
begin
Rails.logger.info("Trying to delete branch using Stash REST api")
remote_server.delete_branch(@build.branch)
rescue StashAPIError => e
Rails.logger.warn("Deletion of branch #{@build.branch} failed")
Rails.logger.warn(e.message)
super
end
end
end
| require 'open3'
require 'git_merge_executor'
class StashMergeExecutor < GitMergeExecutor
# Merges the branch associated with a build using the Stash REST api.
# If an API error is raised, falls back on traditional method.
def merge_and_push
remote_server = @build.repository.remote_server
if @build.project.name =~ /-pull_requests$/
begin
Rails.logger.info("Trying to merge branch #{@build.branch} to master after build id #{@build.id} using Stash REST api")
merge_success = remote_server.merge(@build.branch)
unless merge_success
raise GitMergeFailedError
end
return "Successfully merged #{@build.branch}"
rescue RemoteServer::StashAPIError
Rails.logger.info("Error using StashAPI, falling back on old merge method")
end
end
super
end
# Delete branch associated with a build using Stash REST api.
# If method fails, falls back on traditional method.
def delete_branch
remote_server = @build.repository.remote_server
begin
Rails.logger.info("Trying to delete branch using Stash REST api")
remote_server.delete_branch(@build.branch)
rescue RemoteServer::StashAPIError => e
Rails.logger.warn("Deletion of branch #{@build.branch} failed")
Rails.logger.warn(e.message)
super
end
end
end
| Remove minor bug in delete branch | Remove minor bug in delete branch
| Ruby | apache-2.0 | square/kochiku,rudle/kochiku,square/kochiku,rudle/kochiku,moshez/kochiku,rudle/kochiku,moshez/kochiku,moshez/kochiku,rudle/kochiku,moshez/kochiku,square/kochiku,square/kochiku | ruby | ## Code Before:
require 'open3'
require 'git_merge_executor'
class StashMergeExecutor < GitMergeExecutor
# Merges the branch associated with a build using the Stash REST api.
# If an API error is raised, falls back on traditional method.
def merge_and_push
remote_server = @build.repository.remote_server
if @build.project.name =~ /-pull_requests$/
begin
Rails.logger.info("Trying to merge branch #{@build.branch} to master after build id #{@build.id} using Stash REST api")
merge_success = remote_server.merge(@build.branch)
unless merge_success
raise GitMergeFailedError
end
return "Successfully merged #{@build.branch}"
rescue RemoteServer::StashAPIError
Rails.logger.info("Error using StashAPI, falling back on old merge method")
end
end
super
end
# Delete branch associated with a build using Stash REST api.
# If method fails, falls back on traditional method.
def delete_branch
remote_server = @build.repository.remote_server
begin
Rails.logger.info("Trying to delete branch using Stash REST api")
remote_server.delete_branch(@build.branch)
rescue StashAPIError => e
Rails.logger.warn("Deletion of branch #{@build.branch} failed")
Rails.logger.warn(e.message)
super
end
end
end
## Instruction:
Remove minor bug in delete branch
## Code After:
require 'open3'
require 'git_merge_executor'
class StashMergeExecutor < GitMergeExecutor
# Merges the branch associated with a build using the Stash REST api.
# If an API error is raised, falls back on traditional method.
def merge_and_push
remote_server = @build.repository.remote_server
if @build.project.name =~ /-pull_requests$/
begin
Rails.logger.info("Trying to merge branch #{@build.branch} to master after build id #{@build.id} using Stash REST api")
merge_success = remote_server.merge(@build.branch)
unless merge_success
raise GitMergeFailedError
end
return "Successfully merged #{@build.branch}"
rescue RemoteServer::StashAPIError
Rails.logger.info("Error using StashAPI, falling back on old merge method")
end
end
super
end
# Delete branch associated with a build using Stash REST api.
# If method fails, falls back on traditional method.
def delete_branch
remote_server = @build.repository.remote_server
begin
Rails.logger.info("Trying to delete branch using Stash REST api")
remote_server.delete_branch(@build.branch)
rescue RemoteServer::StashAPIError => e
Rails.logger.warn("Deletion of branch #{@build.branch} failed")
Rails.logger.warn(e.message)
super
end
end
end
|
3031b2bcc712db7678c777566e75cde460513ebb | .drone.yml | .drone.yml | kind: pipeline
name: default
steps:
- name: test
image: golang
environment:
GO111MODULE: on
ARN_ROOT: /notify.moe
commands:
- go version
- go get ./...
- go build ./...
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.16.0
- golangci-lint run --enable dupl
- git clone --depth=1 https://github.com/animenotifier/notify.moe $ARN_ROOT
- git clone --depth=1 https://github.com/animenotifier/database ~/.aero/db/arn
- go test -v -race -coverprofile=autocorrect.txt ./autocorrect
- go test -v -race -coverprofile=stringutils.txt ./stringutils
- go test -v -race -coverprofile=validate.txt ./validate
- go test -v -race -coverprofile=root.txt .
- name: coverage
image: plugins/codecov
settings:
token:
from_secret: codecov-token
files:
- root.txt
- autocorrect.txt
- stringutils.txt
- validate.txt
- name: discord
image: appleboy/drone-discord
when:
status:
- failure
settings:
webhook_id:
from_secret: discord-id
webhook_token:
from_secret: discord-token
| kind: pipeline
name: default
steps:
- name: test
image: golang
environment:
GO111MODULE: on
ARN_ROOT: /notify.moe
commands:
- go version
- go get ./...
- go build ./...
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.16.0
- golangci-lint run
- git clone --depth=1 https://github.com/animenotifier/notify.moe $ARN_ROOT
- git clone --depth=1 https://github.com/animenotifier/database ~/.aero/db/arn
- go test -v -race -coverprofile=autocorrect.txt ./autocorrect
- go test -v -race -coverprofile=stringutils.txt ./stringutils
- go test -v -race -coverprofile=validate.txt ./validate
- go test -v -race -coverprofile=root.txt .
- name: coverage
image: plugins/codecov
settings:
token:
from_secret: codecov-token
files:
- root.txt
- autocorrect.txt
- stringutils.txt
- validate.txt
- name: discord
image: appleboy/drone-discord
when:
status:
- failure
settings:
webhook_id:
from_secret: discord-id
webhook_token:
from_secret: discord-token
| Disable duplication checks until fixed | Disable duplication checks until fixed
| YAML | mit | animenotifier/arn | yaml | ## Code Before:
kind: pipeline
name: default
steps:
- name: test
image: golang
environment:
GO111MODULE: on
ARN_ROOT: /notify.moe
commands:
- go version
- go get ./...
- go build ./...
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.16.0
- golangci-lint run --enable dupl
- git clone --depth=1 https://github.com/animenotifier/notify.moe $ARN_ROOT
- git clone --depth=1 https://github.com/animenotifier/database ~/.aero/db/arn
- go test -v -race -coverprofile=autocorrect.txt ./autocorrect
- go test -v -race -coverprofile=stringutils.txt ./stringutils
- go test -v -race -coverprofile=validate.txt ./validate
- go test -v -race -coverprofile=root.txt .
- name: coverage
image: plugins/codecov
settings:
token:
from_secret: codecov-token
files:
- root.txt
- autocorrect.txt
- stringutils.txt
- validate.txt
- name: discord
image: appleboy/drone-discord
when:
status:
- failure
settings:
webhook_id:
from_secret: discord-id
webhook_token:
from_secret: discord-token
## Instruction:
Disable duplication checks until fixed
## Code After:
kind: pipeline
name: default
steps:
- name: test
image: golang
environment:
GO111MODULE: on
ARN_ROOT: /notify.moe
commands:
- go version
- go get ./...
- go build ./...
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.16.0
- golangci-lint run
- git clone --depth=1 https://github.com/animenotifier/notify.moe $ARN_ROOT
- git clone --depth=1 https://github.com/animenotifier/database ~/.aero/db/arn
- go test -v -race -coverprofile=autocorrect.txt ./autocorrect
- go test -v -race -coverprofile=stringutils.txt ./stringutils
- go test -v -race -coverprofile=validate.txt ./validate
- go test -v -race -coverprofile=root.txt .
- name: coverage
image: plugins/codecov
settings:
token:
from_secret: codecov-token
files:
- root.txt
- autocorrect.txt
- stringutils.txt
- validate.txt
- name: discord
image: appleboy/drone-discord
when:
status:
- failure
settings:
webhook_id:
from_secret: discord-id
webhook_token:
from_secret: discord-token
|
01f93db36e8a9ddf1c9da662ec24fc56d36476e1 | .travis.yml | .travis.yml | sudo: false
language: python
python:
- pypy
- pypy3
- 2.6
- 2.7
- 3.3
- 3.4
- 3.5
install:
- pip install -rrequirements-dev.txt coveralls
script:
- coverage run --source sass,sassc,sassutils -m pytest sasstests.py
- flake8 .
after_success:
- coveralls
cache:
directories:
- $HOME/.cache/pip
| language: python
python:
- pypy
- pypy3
- 2.6
- 2.7
- 3.3
- 3.4
- 3.5
install:
- pip install -rrequirements-dev.txt coveralls
script:
- coverage run --source sass,sassc,sassutils -m pytest sasstests.py
- flake8 .
after_success:
- coveralls
cache:
directories:
- $HOME/.cache/pip
| Remove now default 'sudo: false' | Remove now default 'sudo: false'
'sudo: false' is now default on Travis CI. | YAML | mit | dahlia/libsass-python,dahlia/libsass-python | yaml | ## Code Before:
sudo: false
language: python
python:
- pypy
- pypy3
- 2.6
- 2.7
- 3.3
- 3.4
- 3.5
install:
- pip install -rrequirements-dev.txt coveralls
script:
- coverage run --source sass,sassc,sassutils -m pytest sasstests.py
- flake8 .
after_success:
- coveralls
cache:
directories:
- $HOME/.cache/pip
## Instruction:
Remove now default 'sudo: false'
'sudo: false' is now default on Travis CI.
## Code After:
language: python
python:
- pypy
- pypy3
- 2.6
- 2.7
- 3.3
- 3.4
- 3.5
install:
- pip install -rrequirements-dev.txt coveralls
script:
- coverage run --source sass,sassc,sassutils -m pytest sasstests.py
- flake8 .
after_success:
- coveralls
cache:
directories:
- $HOME/.cache/pip
|
29abdb6ceff6038cce37e9e5761513b204a08ea0 | module/json_api_request.js | module/json_api_request.js | /*!
* apiai
* Copyright(c) 2015 http://api.ai/
* Apache 2.0 Licensed
*/
'use strict';
var Request = require('./request').Request;
var util = require('util');
var ServerError = require('./exceptions').ServerError;
exports.JSONApiRequest = module.exports.JSONApiRequest = JSONApiRequest;
util.inherits(JSONApiRequest, Request);
function JSONApiRequest () {
JSONApiRequest.super_.apply(this, arguments);
}
JSONApiRequest.prototype._handleResponse = function(response) {
var self = this;
var body = '';
response.on('data', function(chunk) {
body += chunk;
});
response.on('end', function() {
if (response.statusCode >= 200 && response.statusCode <= 299) {
try {
var json_body = JSON.parse(body);
self.emit('response', json_body);
} catch (error) {
// JSON.parse can throw only one exception, SyntaxError
// All another exceptions throwing from user function,
// because it just rethrowing for better error handling.
if (error instanceof SyntaxError) {
self.emit('error', error);
} else {
throw error;
}
}
} else {
var error = new ServerError(response.statusCode, body, 'Wrong response status code.');
self.emit('error', error);
}
});
};
| /*!
* apiai
* Copyright(c) 2015 http://api.ai/
* Apache 2.0 Licensed
*/
'use strict';
var Request = require('./request').Request;
var util = require('util');
var ServerError = require('./exceptions').ServerError;
exports.JSONApiRequest = module.exports.JSONApiRequest = JSONApiRequest;
util.inherits(JSONApiRequest, Request);
function JSONApiRequest () {
JSONApiRequest.super_.apply(this, arguments);
}
JSONApiRequest.prototype._handleResponse = function(response) {
var self = this;
var body = '';
var buffers = [];
var bufferLength = 0;
response.on('data', function(chunk) {
bufferLength += chunk.length;
buffers.push(chunk);
});
response.on('end', function() {
if (bufferLength) {
body = Buffer.concat(buffers, bufferLength).toString('utf8');
}
buffers = [];
bufferLength = 0;
if (response.statusCode >= 200 && response.statusCode <= 299) {
try {
var json_body = JSON.parse(body);
self.emit('response', json_body);
} catch (error) {
// JSON.parse can throw only one exception, SyntaxError
// All another exceptions throwing from user function,
// because it just rethrowing for better error handling.
if (error instanceof SyntaxError) {
self.emit('error', error);
} else {
throw error;
}
}
} else {
var error = new ServerError(response.statusCode, body, 'Wrong response status code.');
self.emit('error', error);
}
});
};
| Fix issue with wrong data in response | Fix issue with wrong data in response
| JavaScript | apache-2.0 | dialogflow/dialogflow-nodejs-client,api-ai/api-ai-node-js,api-ai/apiai-nodejs-client,api-ai/api-ai-node-js,api-ai/apiai-nodejs-client,dialogflow/dialogflow-nodejs-client | javascript | ## Code Before:
/*!
* apiai
* Copyright(c) 2015 http://api.ai/
* Apache 2.0 Licensed
*/
'use strict';
var Request = require('./request').Request;
var util = require('util');
var ServerError = require('./exceptions').ServerError;
exports.JSONApiRequest = module.exports.JSONApiRequest = JSONApiRequest;
util.inherits(JSONApiRequest, Request);
function JSONApiRequest () {
JSONApiRequest.super_.apply(this, arguments);
}
JSONApiRequest.prototype._handleResponse = function(response) {
var self = this;
var body = '';
response.on('data', function(chunk) {
body += chunk;
});
response.on('end', function() {
if (response.statusCode >= 200 && response.statusCode <= 299) {
try {
var json_body = JSON.parse(body);
self.emit('response', json_body);
} catch (error) {
// JSON.parse can throw only one exception, SyntaxError
// All another exceptions throwing from user function,
// because it just rethrowing for better error handling.
if (error instanceof SyntaxError) {
self.emit('error', error);
} else {
throw error;
}
}
} else {
var error = new ServerError(response.statusCode, body, 'Wrong response status code.');
self.emit('error', error);
}
});
};
## Instruction:
Fix issue with wrong data in response
## Code After:
/*!
* apiai
* Copyright(c) 2015 http://api.ai/
* Apache 2.0 Licensed
*/
'use strict';
var Request = require('./request').Request;
var util = require('util');
var ServerError = require('./exceptions').ServerError;
exports.JSONApiRequest = module.exports.JSONApiRequest = JSONApiRequest;
util.inherits(JSONApiRequest, Request);
function JSONApiRequest () {
JSONApiRequest.super_.apply(this, arguments);
}
JSONApiRequest.prototype._handleResponse = function(response) {
var self = this;
var body = '';
var buffers = [];
var bufferLength = 0;
response.on('data', function(chunk) {
bufferLength += chunk.length;
buffers.push(chunk);
});
response.on('end', function() {
if (bufferLength) {
body = Buffer.concat(buffers, bufferLength).toString('utf8');
}
buffers = [];
bufferLength = 0;
if (response.statusCode >= 200 && response.statusCode <= 299) {
try {
var json_body = JSON.parse(body);
self.emit('response', json_body);
} catch (error) {
// JSON.parse can throw only one exception, SyntaxError
// All another exceptions throwing from user function,
// because it just rethrowing for better error handling.
if (error instanceof SyntaxError) {
self.emit('error', error);
} else {
throw error;
}
}
} else {
var error = new ServerError(response.statusCode, body, 'Wrong response status code.');
self.emit('error', error);
}
});
};
|
c15f064c2e12da8b0d1f0b16f06529699db2d612 | src/Command/MigrationMigrateCommand.php | src/Command/MigrationMigrateCommand.php | <?php
namespace PDOSimpleMigration\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class MigrationMigrateCommand extends AbstractCommand
{
protected function configure()
{
$this
->setName('migrate')
->setDescription('Upgrade to latest migration class')
;
parent::configure();
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->loadConfig($input, $output);
$availables = $this->getAvailables();
$executeds = $this->getExecuteds();
$diff = array_diff($availables, $executeds);
foreach ($diff as $version) {
$executor = new MigrationExecuteCommand();
$executor->executeUp($version, $input, $output);
$stmt = $this->pdo->prepare(
'INSERT INTO '
. $this->tableName
. ' SET version = :version, description = :description'
);
$stmt->bindParam('version', $version);
$stmt->bindParam('description', $this->loadMigrationClass($version)::$description);
$stmt->execute();
}
$output->writeln('<info>Everything updated</info>');
}
}
| <?php
namespace PDOSimpleMigration\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class MigrationMigrateCommand extends AbstractCommand
{
protected function configure()
{
$this
->setName('migrate')
->setDescription('Upgrade to latest migration class')
;
parent::configure();
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->loadConfig($input, $output);
$availables = $this->getAvailables();
$executeds = $this->getExecuteds();
$diff = array_diff($availables, $executeds);
foreach ($diff as $version) {
$executor = new MigrationExecuteCommand();
$executor->executeUp($version, $input, $output);
$stmt = $this->pdo->prepare(
'INSERT INTO '
. $this->tableName
. ' SET version = :version, description = :description'
);
$migrationClass = $this->loadMigrationClass($version);
$stmt->bindParam('version', $version);
$stmt->bindParam('description', $migrationClass::$description);
$stmt->execute();
}
$output->writeln('<info>Everything updated</info>');
}
}
| Fix error PHP <= 5.6 | Fix error PHP <= 5.6
| PHP | mit | fabiopaiva/PDOSimpleMigration | php | ## Code Before:
<?php
namespace PDOSimpleMigration\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class MigrationMigrateCommand extends AbstractCommand
{
protected function configure()
{
$this
->setName('migrate')
->setDescription('Upgrade to latest migration class')
;
parent::configure();
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->loadConfig($input, $output);
$availables = $this->getAvailables();
$executeds = $this->getExecuteds();
$diff = array_diff($availables, $executeds);
foreach ($diff as $version) {
$executor = new MigrationExecuteCommand();
$executor->executeUp($version, $input, $output);
$stmt = $this->pdo->prepare(
'INSERT INTO '
. $this->tableName
. ' SET version = :version, description = :description'
);
$stmt->bindParam('version', $version);
$stmt->bindParam('description', $this->loadMigrationClass($version)::$description);
$stmt->execute();
}
$output->writeln('<info>Everything updated</info>');
}
}
## Instruction:
Fix error PHP <= 5.6
## Code After:
<?php
namespace PDOSimpleMigration\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class MigrationMigrateCommand extends AbstractCommand
{
protected function configure()
{
$this
->setName('migrate')
->setDescription('Upgrade to latest migration class')
;
parent::configure();
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->loadConfig($input, $output);
$availables = $this->getAvailables();
$executeds = $this->getExecuteds();
$diff = array_diff($availables, $executeds);
foreach ($diff as $version) {
$executor = new MigrationExecuteCommand();
$executor->executeUp($version, $input, $output);
$stmt = $this->pdo->prepare(
'INSERT INTO '
. $this->tableName
. ' SET version = :version, description = :description'
);
$migrationClass = $this->loadMigrationClass($version);
$stmt->bindParam('version', $version);
$stmt->bindParam('description', $migrationClass::$description);
$stmt->execute();
}
$output->writeln('<info>Everything updated</info>');
}
}
|
3682d1b364834c44c0b7b8efca722479b43b5cff | spec/factories/tools.rb | spec/factories/tools.rb | FactoryGirl.define do
factory :tool do
tool_slot
device
name { Faker::Pokemon.name }
end
end
| FactoryGirl.define do
factory :tool do
tool_slot
device
name { Faker::Pokemon.name + Faker::Pokemon.name }
end
end
| Change FactoryGirl to make tool names more unique | Change FactoryGirl to make tool names more unique
| Ruby | mit | FarmBot/farmbot-web-app,RickCarlino/farmbot-web-app,gabrielburnworth/Farmbot-Web-App,gabrielburnworth/Farmbot-Web-App,MrChristofferson/Farmbot-Web-API,FarmBot/Farmbot-Web-API,gabrielburnworth/Farmbot-Web-App,gabrielburnworth/Farmbot-Web-App,MrChristofferson/Farmbot-Web-API,RickCarlino/farmbot-web-app,FarmBot/Farmbot-Web-API,FarmBot/farmbot-web-app,RickCarlino/farmbot-web-app,FarmBot/Farmbot-Web-API,MrChristofferson/Farmbot-Web-API,FarmBot/Farmbot-Web-API,MrChristofferson/Farmbot-Web-API,FarmBot/Farmbot-Web-API,RickCarlino/farmbot-web-app,FarmBot/farmbot-web-app,RickCarlino/farmbot-web-app,gabrielburnworth/Farmbot-Web-App | ruby | ## Code Before:
FactoryGirl.define do
factory :tool do
tool_slot
device
name { Faker::Pokemon.name }
end
end
## Instruction:
Change FactoryGirl to make tool names more unique
## Code After:
FactoryGirl.define do
factory :tool do
tool_slot
device
name { Faker::Pokemon.name + Faker::Pokemon.name }
end
end
|
153ce8b0a263edce819a5df534ff89a100c5454a | human_time.go | human_time.go | package main
import (
"github.com/dustin/go-humanize"
"time"
"strings"
)
func HumanTime(time time.Time) string {
original := humanize.Time(time)
parts := strings.Split(original, " ")
return parts[0] + " " + parts[1]
}
| package main
import (
"github.com/dustin/go-humanize"
"time"
"strings"
"math"
)
func HumanTime(time time.Time) string {
original := humanize.Time(time)
parts := strings.Split(original, " ")
length := int(math.Min(float64(len(parts)), 2)) // now / x minutes
parts = parts[:length]
return strings.Join(parts, " ")
}
| Fix fatal error when pokemon expires “now” | Fix fatal error when pokemon expires “now”
| Go | mit | jacobmarshall/pokevision-cli,jacobmarshall/pokevision-cli | go | ## Code Before:
package main
import (
"github.com/dustin/go-humanize"
"time"
"strings"
)
func HumanTime(time time.Time) string {
original := humanize.Time(time)
parts := strings.Split(original, " ")
return parts[0] + " " + parts[1]
}
## Instruction:
Fix fatal error when pokemon expires “now”
## Code After:
package main
import (
"github.com/dustin/go-humanize"
"time"
"strings"
"math"
)
func HumanTime(time time.Time) string {
original := humanize.Time(time)
parts := strings.Split(original, " ")
length := int(math.Min(float64(len(parts)), 2)) // now / x minutes
parts = parts[:length]
return strings.Join(parts, " ")
}
|
a9c64b2c2447da1522ca12f6d891a8d8b9baedb2 | test/Version.nim | test/Version.nim | proc demo(alpha: int=1, item: string="hi", args: seq[string]): int =
## demo entry point with varied, meaningless parameters. A Nim invocation
## might be: demo(alpha=2, @[ "hi", "ho" ]) corresponding to the command
## invocation "demo --alpha=2 hi ho" (assuming executable gets named demo).
echo "alpha:", alpha, " item:", repr(item)
for i, arg in args: echo "positional[", i, "]: ", repr(arg)
return 42
when isMainModule:
import cligen; include cligen/mergeCfgEnv
when defined(versionGit):
const vsn = staticExec "git log -1 | head -n1"
clCfg.version = vsn
dispatch(demo)
elif defined(versionNimble):
const nimbleFile = staticRead "../cligen.nimble" #Use YOURPKG not cligen
clCfg.version = versionFromNimble(nimbleFile)
dispatch(demo)
else:
clCfg.version = "1.5"
when defined(versionShort):
dispatch(demo, short = { "version": 'V' })
else:
dispatch(demo, cmdName="Version")
| proc demo(alpha: int=1, item: string="hi", args: seq[string]): int =
## demo entry point with varied, meaningless parameters. A Nim invocation
## might be: demo(alpha=2, @[ "hi", "ho" ]) corresponding to the command
## invocation "demo --alpha=2 hi ho" (assuming executable gets named demo).
echo "alpha:", alpha, " item:", repr(item)
for i, arg in args: echo "positional[", i, "]: ", repr(arg)
return 42
when isMainModule:
import cligen; include cligen/mergeCfgEnv
when defined(versionGit):
const vsn = staticExec "git describe --tags HEAD"
clCfg.version = vsn
dispatch(demo)
elif defined(versionNimble):
const nimbleFile = staticRead "../cligen.nimble" #Use YOURPKG not cligen
clCfg.version = versionFromNimble(nimbleFile)
dispatch(demo)
else:
clCfg.version = "1.5"
when defined(versionShort):
dispatch(demo, short = { "version": 'V' })
else:
dispatch(demo, cmdName="Version")
| Use git describe in example for a better version string. | Use git describe in example for a better version string.
| Nimrod | isc | c-blake/cligen | nimrod | ## Code Before:
proc demo(alpha: int=1, item: string="hi", args: seq[string]): int =
## demo entry point with varied, meaningless parameters. A Nim invocation
## might be: demo(alpha=2, @[ "hi", "ho" ]) corresponding to the command
## invocation "demo --alpha=2 hi ho" (assuming executable gets named demo).
echo "alpha:", alpha, " item:", repr(item)
for i, arg in args: echo "positional[", i, "]: ", repr(arg)
return 42
when isMainModule:
import cligen; include cligen/mergeCfgEnv
when defined(versionGit):
const vsn = staticExec "git log -1 | head -n1"
clCfg.version = vsn
dispatch(demo)
elif defined(versionNimble):
const nimbleFile = staticRead "../cligen.nimble" #Use YOURPKG not cligen
clCfg.version = versionFromNimble(nimbleFile)
dispatch(demo)
else:
clCfg.version = "1.5"
when defined(versionShort):
dispatch(demo, short = { "version": 'V' })
else:
dispatch(demo, cmdName="Version")
## Instruction:
Use git describe in example for a better version string.
## Code After:
proc demo(alpha: int=1, item: string="hi", args: seq[string]): int =
## demo entry point with varied, meaningless parameters. A Nim invocation
## might be: demo(alpha=2, @[ "hi", "ho" ]) corresponding to the command
## invocation "demo --alpha=2 hi ho" (assuming executable gets named demo).
echo "alpha:", alpha, " item:", repr(item)
for i, arg in args: echo "positional[", i, "]: ", repr(arg)
return 42
when isMainModule:
import cligen; include cligen/mergeCfgEnv
when defined(versionGit):
const vsn = staticExec "git describe --tags HEAD"
clCfg.version = vsn
dispatch(demo)
elif defined(versionNimble):
const nimbleFile = staticRead "../cligen.nimble" #Use YOURPKG not cligen
clCfg.version = versionFromNimble(nimbleFile)
dispatch(demo)
else:
clCfg.version = "1.5"
when defined(versionShort):
dispatch(demo, short = { "version": 'V' })
else:
dispatch(demo, cmdName="Version")
|
3af4c5122961aeeb8173a9862a061340a678fbc1 | lib/opal-jquery/event.rb | lib/opal-jquery/event.rb | class Event < `$.Event`
def current_target
%x{
return $(#{self}.currentTarget);
}
end
def target
%x{
if (#{self}._opalTarget) {
return #{self}._opalTarget;
}
return #{self}._opalTarget = $(#{self}.target);
}
end
def type
`#{self}.type`
end
def which
`#{self}.which`
end
end | class Event < `$.Event`
def current_target
`$(#{self}.currentTarget)`
end
alias_native :default_prevented?, :isDefaultPrevented
alias_native :prevent_default, :preventDefault
def page_x
`#{self}.pageX`
end
def page_y
`#{self}.pageY`
end
alias_native :propagation_stopped?, :propagationStopped
alias_native :stop_propagation, :stopPropagation
def target
%x{
if (#{self}._opalTarget) {
return #{self}._opalTarget;
}
return #{self}._opalTarget = $(#{self}.target);
}
end
def type
`#{self}.type`
end
def which
`#{self}.which`
end
end | Add more useful Event methods | Add more useful Event methods
| Ruby | mit | opal/opal-jquery,opal/opal-jquery,wied03/opal-jquery,xuwupeng2000/opal-jquery,xuwupeng2000/opal-jquery,wied03/opal-jquery,catprintlabs/opal-jquery-beta-minus | ruby | ## Code Before:
class Event < `$.Event`
def current_target
%x{
return $(#{self}.currentTarget);
}
end
def target
%x{
if (#{self}._opalTarget) {
return #{self}._opalTarget;
}
return #{self}._opalTarget = $(#{self}.target);
}
end
def type
`#{self}.type`
end
def which
`#{self}.which`
end
end
## Instruction:
Add more useful Event methods
## Code After:
class Event < `$.Event`
def current_target
`$(#{self}.currentTarget)`
end
alias_native :default_prevented?, :isDefaultPrevented
alias_native :prevent_default, :preventDefault
def page_x
`#{self}.pageX`
end
def page_y
`#{self}.pageY`
end
alias_native :propagation_stopped?, :propagationStopped
alias_native :stop_propagation, :stopPropagation
def target
%x{
if (#{self}._opalTarget) {
return #{self}._opalTarget;
}
return #{self}._opalTarget = $(#{self}.target);
}
end
def type
`#{self}.type`
end
def which
`#{self}.which`
end
end |
059a9fcaed8f732f55869e43af7d2c12cbcf8315 | README.md | README.md | living-style-guide
==================
Our design guidelines in code.
| living-style-guide
==================
Our design guidelines in code.
### Installation
Run the following commands:
```sh
git clone https://github.com/BMJ-Ltd/living-style-guide
cd living-style-guide
npm install
bower install
```
If you don't have [Bower](http://bower.io/) installed, install it using:
```sh
npm install -g bower
```
### Usage
From the `living-style-guide` directory run:
```sh
gulp
```
This will build the project to the `dist` sub-directory, and then watch for changes made to the contents of `src` and automatically rebuild `dist`.
| Add install and usage instructions | Add install and usage instructions | Markdown | mit | BMJ-Ltd/living-style-guide,BMJ-Ltd/living-style-guide,BMJ-Ltd/living-style-guide | markdown | ## Code Before:
living-style-guide
==================
Our design guidelines in code.
## Instruction:
Add install and usage instructions
## Code After:
living-style-guide
==================
Our design guidelines in code.
### Installation
Run the following commands:
```sh
git clone https://github.com/BMJ-Ltd/living-style-guide
cd living-style-guide
npm install
bower install
```
If you don't have [Bower](http://bower.io/) installed, install it using:
```sh
npm install -g bower
```
### Usage
From the `living-style-guide` directory run:
```sh
gulp
```
This will build the project to the `dist` sub-directory, and then watch for changes made to the contents of `src` and automatically rebuild `dist`.
|
355a5fa8b1601ada01c60de80d97c3fbc4988b9f | src/main/java/com/yubico/client/v2/Cmd.java | src/main/java/com/yubico/client/v2/Cmd.java | package com.yubico.client.v2;
/**
* Created by IntelliJ IDEA.
* User: lwid
* Date: 1/28/11
* Time: 2:07 PM
* To change this template use File | Settings | File Templates.
*/
public class Cmd {
public static void main (String args []) throws Exception
{
if (args.length != 2) {
System.err.println("\n*** Test your Yubikey against Yubico OTP validation server ***");
System.err.println("\nUsage: java -jar client.jar Auth_ID OTP");
System.err.println("\nEg. java -jar client.jar 28 vvfucnlcrrnejlbuthlktguhclhvegbungldcrefbnku");
System.err.println("\nTouch Yubikey to generate the OTP. Visit Yubico.com for more details.");
return;
}
int authId = Integer.parseInt(args[0]);
String otp = args[1];
YubicoClient yc = YubicoClient.getClient();
yc.setClientId(authId);
YubicoResponse response = yc.verify(otp);
if(response.getStatus() == YubicoResponseStatus.OK) {
System.out.println("\n* OTP verified OK");
} else {
System.out.println("\n* Failed to verify OTP");
}
System.out.println("\n* Last response: " + response);
System.out.println("\n");
} // End of main
}
| package com.yubico.client.v2;
/**
* Created by IntelliJ IDEA.
* User: lwid
* Date: 1/28/11
* Time: 2:07 PM
* To change this template use File | Settings | File Templates.
*/
public class Cmd {
public static void main (String args []) throws Exception
{
if (args.length != 2) {
System.err.println("\n*** Test your Yubikey against Yubico OTP validation server ***");
System.err.println("\nUsage: java -jar client.jar Auth_ID OTP");
System.err.println("\nEg. java -jar client.jar 28 vvfucnlcrrnejlbuthlktguhclhvegbungldcrefbnku");
System.err.println("\nTouch Yubikey to generate the OTP. Visit Yubico.com for more details.");
return;
}
int authId = Integer.parseInt(args[0]);
String otp = args[1];
YubicoClient yc = YubicoClient.getClient();
yc.setClientId(authId);
YubicoResponse response = yc.verify(otp);
if(response!=null && response.getStatus() == YubicoResponseStatus.OK) {
System.out.println("\n* OTP verified OK");
} else {
System.out.println("\n* Failed to verify OTP");
}
System.out.println("\n* Last response: " + response);
System.out.println("\n");
} // End of main
}
| Handle null returns from client constructor | Handle null returns from client constructor
| Java | bsd-2-clause | Yubico/yubico-java-client,Yubico/yubico-java-client | java | ## Code Before:
package com.yubico.client.v2;
/**
* Created by IntelliJ IDEA.
* User: lwid
* Date: 1/28/11
* Time: 2:07 PM
* To change this template use File | Settings | File Templates.
*/
public class Cmd {
public static void main (String args []) throws Exception
{
if (args.length != 2) {
System.err.println("\n*** Test your Yubikey against Yubico OTP validation server ***");
System.err.println("\nUsage: java -jar client.jar Auth_ID OTP");
System.err.println("\nEg. java -jar client.jar 28 vvfucnlcrrnejlbuthlktguhclhvegbungldcrefbnku");
System.err.println("\nTouch Yubikey to generate the OTP. Visit Yubico.com for more details.");
return;
}
int authId = Integer.parseInt(args[0]);
String otp = args[1];
YubicoClient yc = YubicoClient.getClient();
yc.setClientId(authId);
YubicoResponse response = yc.verify(otp);
if(response.getStatus() == YubicoResponseStatus.OK) {
System.out.println("\n* OTP verified OK");
} else {
System.out.println("\n* Failed to verify OTP");
}
System.out.println("\n* Last response: " + response);
System.out.println("\n");
} // End of main
}
## Instruction:
Handle null returns from client constructor
## Code After:
package com.yubico.client.v2;
/**
* Created by IntelliJ IDEA.
* User: lwid
* Date: 1/28/11
* Time: 2:07 PM
* To change this template use File | Settings | File Templates.
*/
public class Cmd {
public static void main (String args []) throws Exception
{
if (args.length != 2) {
System.err.println("\n*** Test your Yubikey against Yubico OTP validation server ***");
System.err.println("\nUsage: java -jar client.jar Auth_ID OTP");
System.err.println("\nEg. java -jar client.jar 28 vvfucnlcrrnejlbuthlktguhclhvegbungldcrefbnku");
System.err.println("\nTouch Yubikey to generate the OTP. Visit Yubico.com for more details.");
return;
}
int authId = Integer.parseInt(args[0]);
String otp = args[1];
YubicoClient yc = YubicoClient.getClient();
yc.setClientId(authId);
YubicoResponse response = yc.verify(otp);
if(response!=null && response.getStatus() == YubicoResponseStatus.OK) {
System.out.println("\n* OTP verified OK");
} else {
System.out.println("\n* Failed to verify OTP");
}
System.out.println("\n* Last response: " + response);
System.out.println("\n");
} // End of main
}
|
133935d855dd601118c9e559d6585a44a99d9b3f | packages/lt/ltext.yaml | packages/lt/ltext.yaml | homepage: ''
changelog-type: ''
hash: 686ca12e964fa200ea2ae167d1b37d6a3d94b6d3cdba3ca8eece32be87d4e190
test-bench-deps:
base: -any
hspec: -any
maintainer: Athan Clark <athan.clark@gmail.com>
synopsis: Higher-order file applicator
changelog: ''
basic-deps:
base: ! '>=4.6 && <5'
text: -any
composition: -any
parsec: -any
data-default: -any
containers: -any
composition-extra: -any
mtl: -any
transformers: -any
optparse-applicative: -any
pretty: -any
aeson: -any
yaml: -any
directory: -any
all-versions:
- '0.0.0.1'
- '0.0.0.2'
- '0.0.0.3'
author: Athan Clark <athan.clark@gmail.com>
latest: '0.0.0.3'
description-type: haddock
description: ! 'λtext is a general-purpose templating utility for text files.
Turn plaintext files into lambdas -
function application then becomes concatenation.
Please see the <https://github.com/ltext/ltext github page> for more details.'
license-name: BSD3
| homepage: ''
changelog-type: ''
hash: 7e2fe707c7b39cac8241d02ae20907e937c93a39105e50576d834b0fe6045585
test-bench-deps:
base: -any
hspec: -any
mtl: -any
maintainer: Athan Clark <athan.clark@gmail.com>
synopsis: Higher-order file applicator
changelog: ''
basic-deps:
base: ! '>=4.6 && <5'
text: -any
composition: -any
parsec: -any
data-default: -any
containers: -any
composition-extra: -any
mtl: -any
transformers: -any
optparse-applicative: -any
deepseq: -any
pretty: -any
aeson: -any
yaml: -any
directory: -any
all-versions:
- '0.0.0.1'
- '0.0.0.2'
- '0.0.0.3'
- '0.0.0.4'
author: Athan Clark <athan.clark@gmail.com>
latest: '0.0.0.4'
description-type: haddock
description: ! 'λtext is a general-purpose templating utility for text files.
Turn plaintext files into lambdas -
function application then becomes concatenation.
Please see the <https://github.com/ltext/ltext github page> for more details.'
license-name: BSD3
| Update from Hackage at 2015-05-31T16:20:10+0000 | Update from Hackage at 2015-05-31T16:20:10+0000
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: ''
changelog-type: ''
hash: 686ca12e964fa200ea2ae167d1b37d6a3d94b6d3cdba3ca8eece32be87d4e190
test-bench-deps:
base: -any
hspec: -any
maintainer: Athan Clark <athan.clark@gmail.com>
synopsis: Higher-order file applicator
changelog: ''
basic-deps:
base: ! '>=4.6 && <5'
text: -any
composition: -any
parsec: -any
data-default: -any
containers: -any
composition-extra: -any
mtl: -any
transformers: -any
optparse-applicative: -any
pretty: -any
aeson: -any
yaml: -any
directory: -any
all-versions:
- '0.0.0.1'
- '0.0.0.2'
- '0.0.0.3'
author: Athan Clark <athan.clark@gmail.com>
latest: '0.0.0.3'
description-type: haddock
description: ! 'λtext is a general-purpose templating utility for text files.
Turn plaintext files into lambdas -
function application then becomes concatenation.
Please see the <https://github.com/ltext/ltext github page> for more details.'
license-name: BSD3
## Instruction:
Update from Hackage at 2015-05-31T16:20:10+0000
## Code After:
homepage: ''
changelog-type: ''
hash: 7e2fe707c7b39cac8241d02ae20907e937c93a39105e50576d834b0fe6045585
test-bench-deps:
base: -any
hspec: -any
mtl: -any
maintainer: Athan Clark <athan.clark@gmail.com>
synopsis: Higher-order file applicator
changelog: ''
basic-deps:
base: ! '>=4.6 && <5'
text: -any
composition: -any
parsec: -any
data-default: -any
containers: -any
composition-extra: -any
mtl: -any
transformers: -any
optparse-applicative: -any
deepseq: -any
pretty: -any
aeson: -any
yaml: -any
directory: -any
all-versions:
- '0.0.0.1'
- '0.0.0.2'
- '0.0.0.3'
- '0.0.0.4'
author: Athan Clark <athan.clark@gmail.com>
latest: '0.0.0.4'
description-type: haddock
description: ! 'λtext is a general-purpose templating utility for text files.
Turn plaintext files into lambdas -
function application then becomes concatenation.
Please see the <https://github.com/ltext/ltext github page> for more details.'
license-name: BSD3
|
80c827119d9b1deb9a900c5a281ebb084d02ab48 | modules/lang/rust/doctor.el | modules/lang/rust/doctor.el | ;; -*- lexical-binding: t; no-byte-compile: t; -*-
;;; lang/rust/doctor.el
(assert! (or (not (featurep! +lsp))
(featurep! :tools lsp))
"This module requires (:tools lsp)")
(unless (executable-find "rustc")
(warn! "Couldn't find rustc binary"))
(unless (executable-find "cargo")
(warn! "Couldn't find cargo binary"))
(if (featurep! +lsp)
(let ((lsp-server 'rls))
(when (require 'rustic nil t)
(setq lsp-server rustic-lsp-server))
(pcase lsp-server
(`rust-analyzer
(unless (executable-find "ra_lsp_server")
(warn! "Couldn't find rust analyzer (ra_lsp_server)")))
(`rls
(unless (executable-find "rls")
(warn! "Couldn't find rls")))))
(when (require 'racer nil t)
;; racer
(unless (file-exists-p racer-cmd)
(warn! "Couldn't find the racer binary at `racer-cmd'"))
;; rust source code (rustup component add rust-src)
(unless (file-directory-p racer-rust-src-path)
(warn! "Couldn't find Rust's source code at RUST_SRC_PATH or `racer-rust-src-path'"))))
| ;; -*- lexical-binding: t; no-byte-compile: t; -*-
;;; lang/rust/doctor.el
(assert! (or (not (featurep! +lsp))
(featurep! :tools lsp))
"This module requires (:tools lsp)")
(unless (executable-find "rustc")
(warn! "Couldn't find rustc binary"))
(unless (executable-find "cargo")
(warn! "Couldn't find cargo binary"))
(if (featurep! +lsp)
(let ((lsp-server 'rls))
(when (require 'rustic nil t)
(setq lsp-server rustic-lsp-server))
(pcase lsp-server
(`rust-analyzer
(unless (executable-find "rust-analyzer")
(warn! "Couldn't find rust analyzer (rust-analyzer)")))
(`rls
(unless (executable-find "rls")
(warn! "Couldn't find rls")))))
(when (require 'racer nil t)
;; racer
(unless (file-exists-p racer-cmd)
(warn! "Couldn't find the racer binary at `racer-cmd'"))
;; rust source code (rustup component add rust-src)
(unless (file-directory-p racer-rust-src-path)
(warn! "Couldn't find Rust's source code at RUST_SRC_PATH or `racer-rust-src-path'"))))
| Fix references to old rust-analyzer binary | Fix references to old rust-analyzer binary
Closes #2588
| Emacs Lisp | mit | UndeadKernel/emacs_doom,hlissner/doom-emacs,hlissner/.emacs.d,hlissner/.emacs.d,UndeadKernel/emacs_doom,UndeadKernel/emacs_doom,hlissner/.emacs.d,UndeadKernel/emacs_doom,hlissner/.emacs.d,hlissner/.emacs.d,hlissner/doom-emacs,hlissner/doom-emacs,hlissner/.emacs.d,hlissner/doom-emacs,hlissner/.emacs.d,hlissner/doom-emacs,UndeadKernel/emacs_doom,hlissner/doom-emacs,UndeadKernel/emacs_doom,UndeadKernel/emacs_doom,hlissner/doom-emacs,hlissner/.emacs.d | emacs-lisp | ## Code Before:
;; -*- lexical-binding: t; no-byte-compile: t; -*-
;;; lang/rust/doctor.el
(assert! (or (not (featurep! +lsp))
(featurep! :tools lsp))
"This module requires (:tools lsp)")
(unless (executable-find "rustc")
(warn! "Couldn't find rustc binary"))
(unless (executable-find "cargo")
(warn! "Couldn't find cargo binary"))
(if (featurep! +lsp)
(let ((lsp-server 'rls))
(when (require 'rustic nil t)
(setq lsp-server rustic-lsp-server))
(pcase lsp-server
(`rust-analyzer
(unless (executable-find "ra_lsp_server")
(warn! "Couldn't find rust analyzer (ra_lsp_server)")))
(`rls
(unless (executable-find "rls")
(warn! "Couldn't find rls")))))
(when (require 'racer nil t)
;; racer
(unless (file-exists-p racer-cmd)
(warn! "Couldn't find the racer binary at `racer-cmd'"))
;; rust source code (rustup component add rust-src)
(unless (file-directory-p racer-rust-src-path)
(warn! "Couldn't find Rust's source code at RUST_SRC_PATH or `racer-rust-src-path'"))))
## Instruction:
Fix references to old rust-analyzer binary
Closes #2588
## Code After:
;; -*- lexical-binding: t; no-byte-compile: t; -*-
;;; lang/rust/doctor.el
(assert! (or (not (featurep! +lsp))
(featurep! :tools lsp))
"This module requires (:tools lsp)")
(unless (executable-find "rustc")
(warn! "Couldn't find rustc binary"))
(unless (executable-find "cargo")
(warn! "Couldn't find cargo binary"))
(if (featurep! +lsp)
(let ((lsp-server 'rls))
(when (require 'rustic nil t)
(setq lsp-server rustic-lsp-server))
(pcase lsp-server
(`rust-analyzer
(unless (executable-find "rust-analyzer")
(warn! "Couldn't find rust analyzer (rust-analyzer)")))
(`rls
(unless (executable-find "rls")
(warn! "Couldn't find rls")))))
(when (require 'racer nil t)
;; racer
(unless (file-exists-p racer-cmd)
(warn! "Couldn't find the racer binary at `racer-cmd'"))
;; rust source code (rustup component add rust-src)
(unless (file-directory-p racer-rust-src-path)
(warn! "Couldn't find Rust's source code at RUST_SRC_PATH or `racer-rust-src-path'"))))
|
7d53111c20e0c1f5981e060293b9f695dc5863b1 | meta/main.yml | meta/main.yml | ---
dependencies:
- { role: andrewrothstein.docker }
- { role: andrewrothstein.docker-compose }
galaxy_info:
author: Daisuke Baba
description: Install docker version of concourse-ci
license: "license (MIT)"
min_ansible_version: 2.0.0.1
platforms:
- name: EL
versions:
- 7
- name: Ubuntu
versions:
- trusty
- xenial
categories:
- CI
| ---
dependencies:
- { role: andrewrothstein.docker }
- { role: andrewrothstein.docker-compose }
galaxy_info:
author: Daisuke Baba
description: Install docker version of concourse-ci
license: "license (MIT)"
min_ansible_version: 2.0.0.1
platforms:
- name: EL
versions:
- 7
- name: Ubuntu
versions:
- trusty
categories:
- CI
| Remove unsupported version of Ubuntu | Remove unsupported version of Ubuntu
| YAML | mit | dbaba/ansible-role-concourse-ci | yaml | ## Code Before:
---
dependencies:
- { role: andrewrothstein.docker }
- { role: andrewrothstein.docker-compose }
galaxy_info:
author: Daisuke Baba
description: Install docker version of concourse-ci
license: "license (MIT)"
min_ansible_version: 2.0.0.1
platforms:
- name: EL
versions:
- 7
- name: Ubuntu
versions:
- trusty
- xenial
categories:
- CI
## Instruction:
Remove unsupported version of Ubuntu
## Code After:
---
dependencies:
- { role: andrewrothstein.docker }
- { role: andrewrothstein.docker-compose }
galaxy_info:
author: Daisuke Baba
description: Install docker version of concourse-ci
license: "license (MIT)"
min_ansible_version: 2.0.0.1
platforms:
- name: EL
versions:
- 7
- name: Ubuntu
versions:
- trusty
categories:
- CI
|
e27e81522e8ab58d696ac19dd144932d2f0507e6 | app/views/_goal_listing.erb | app/views/_goal_listing.erb | <div class="goal-listing">
<div class="checkbox"></div>
<a href="/goals/<%= goal.id %>"><strong><%= goal.name %></strong></a><br>
<%= goal.pillar.name %>: <%= goal.strand.name %><br>
<span <% if goal.set_at < DateTime.current && !goal.is_completed %> class="active" <% end %>>Start: <%= goal.set_at %></span><br>
<span <% if goal.deadline < (DateTime.current + 3) && !goal.is_completed %> class="active" <% end %>>Deadline: <%= goal.deadline %></span>
</div> | <div class="goal-listing">
<div class="checkbox"></div>
<a href="/goals/<%= goal.id %>"><strong><%= goal.name %></strong></a><br>
<%= goal.pillar.name %>: <%= goal.strand.name %><br>
<% if goal.set_at < DateTime.current && !goal.is_completed %>
<span class="active">
<% else %>
<span>
<% end %>
Start: <%= goal.set_at %></span><br>
<% if goal.deadline < (DateTime.current + 3) && !goal.is_completed %>
<span class="active">
<% else %>
<span>
<% end %>
Deadline: <%= goal.deadline %></span>
</div> | Add proper if-else statement for active spans | Add proper if-else statement for active spans
| HTML+ERB | mit | caonayemi/getting-it-together,caonayemi/getting-it-together,caonayemi/getting-it-together | html+erb | ## Code Before:
<div class="goal-listing">
<div class="checkbox"></div>
<a href="/goals/<%= goal.id %>"><strong><%= goal.name %></strong></a><br>
<%= goal.pillar.name %>: <%= goal.strand.name %><br>
<span <% if goal.set_at < DateTime.current && !goal.is_completed %> class="active" <% end %>>Start: <%= goal.set_at %></span><br>
<span <% if goal.deadline < (DateTime.current + 3) && !goal.is_completed %> class="active" <% end %>>Deadline: <%= goal.deadline %></span>
</div>
## Instruction:
Add proper if-else statement for active spans
## Code After:
<div class="goal-listing">
<div class="checkbox"></div>
<a href="/goals/<%= goal.id %>"><strong><%= goal.name %></strong></a><br>
<%= goal.pillar.name %>: <%= goal.strand.name %><br>
<% if goal.set_at < DateTime.current && !goal.is_completed %>
<span class="active">
<% else %>
<span>
<% end %>
Start: <%= goal.set_at %></span><br>
<% if goal.deadline < (DateTime.current + 3) && !goal.is_completed %>
<span class="active">
<% else %>
<span>
<% end %>
Deadline: <%= goal.deadline %></span>
</div> |
3b34d6829a451c81705586a5ecdcec83aa2e25c0 | openforcefield/meta.yaml | openforcefield/meta.yaml | package:
name: openforcefield
version: 0.2.0
source:
git_url: https://github.com/openforcefield/openforcefield.git
git_tag: 0.2.0
build:
preserve_egg_dir: True
number: 0 # Build number and string do not work together.
#string: py{{ py }}_a1 # Alpha version 1.
skip: True # [py27 or py35]
extra:
#force_upload: True
upload: main # Upload to anaconda with the "main" label.
requirements:
build:
- python
- setuptools
run:
- python
- numpy
- networkx
- parmed
- rdkit
- ambermini
- packaging
# Serialization: Should these be optional?
- toml
- bson
- msgpack-python
- xmltodict
about:
home: https://github.com/openforcefield/openforcefield
license: MIT
license_file: LICENSE
description: The Open Forcefield Toolkit provides implementations of the SMIRNOFF format, parameterization engine, and other tools.
| package:
name: openforcefield
version: 0.2.0
source:
git_url: https://github.com/openforcefield/openforcefield.git
git_tag: 0.2.0
build:
preserve_egg_dir: True
number: 0 # Build number and string do not work together.
#string: py{{ py }}_a1 # Alpha version 1.
skip: True # [win or py27 or py35]
extra:
force_upload: True
upload: main # Upload to anaconda with the "main" label.
requirements:
build:
- python
- setuptools
run:
- python
- numpy
- openmm
- networkx
- parmed
- rdkit
- ambermini
- packaging
# Serialization: Should these be optional?
- toml
- bson
- msgpack-python
- xmltodict
- pyyaml
- cairo ==1.16
about:
home: https://github.com/openforcefield/openforcefield
license: MIT
license_file: LICENSE
description: The Open Forcefield Toolkit provides implementations of the SMIRNOFF format, parameterization engine, and other tools.
| Fix issue with rdkit/cairo/python versions | [openforcefield] Fix issue with rdkit/cairo/python versions | YAML | mit | peastman/conda-recipes,peastman/conda-recipes,omnia-md/conda-recipes,omnia-md/conda-recipes,peastman/conda-recipes,omnia-md/conda-recipes | yaml | ## Code Before:
package:
name: openforcefield
version: 0.2.0
source:
git_url: https://github.com/openforcefield/openforcefield.git
git_tag: 0.2.0
build:
preserve_egg_dir: True
number: 0 # Build number and string do not work together.
#string: py{{ py }}_a1 # Alpha version 1.
skip: True # [py27 or py35]
extra:
#force_upload: True
upload: main # Upload to anaconda with the "main" label.
requirements:
build:
- python
- setuptools
run:
- python
- numpy
- networkx
- parmed
- rdkit
- ambermini
- packaging
# Serialization: Should these be optional?
- toml
- bson
- msgpack-python
- xmltodict
about:
home: https://github.com/openforcefield/openforcefield
license: MIT
license_file: LICENSE
description: The Open Forcefield Toolkit provides implementations of the SMIRNOFF format, parameterization engine, and other tools.
## Instruction:
[openforcefield] Fix issue with rdkit/cairo/python versions
## Code After:
package:
name: openforcefield
version: 0.2.0
source:
git_url: https://github.com/openforcefield/openforcefield.git
git_tag: 0.2.0
build:
preserve_egg_dir: True
number: 0 # Build number and string do not work together.
#string: py{{ py }}_a1 # Alpha version 1.
skip: True # [win or py27 or py35]
extra:
force_upload: True
upload: main # Upload to anaconda with the "main" label.
requirements:
build:
- python
- setuptools
run:
- python
- numpy
- openmm
- networkx
- parmed
- rdkit
- ambermini
- packaging
# Serialization: Should these be optional?
- toml
- bson
- msgpack-python
- xmltodict
- pyyaml
- cairo ==1.16
about:
home: https://github.com/openforcefield/openforcefield
license: MIT
license_file: LICENSE
description: The Open Forcefield Toolkit provides implementations of the SMIRNOFF format, parameterization engine, and other tools.
|
234784bd6d6817d614c82a339700bb1a9f0e900a | README.md | README.md | Interactive code profiling widget for IPython + Jupyter Notebook.
Tested with Jupyter notebook server 4.1.0 and 4.2.0, Python 2.7 and 3.5, IPython 4.1 and IPython 4.2. May be compatible with earlier/later versions.
**This software is a work in progress and is not yet stable/release ready.**
## Dependencies
+ Cython
+ Ipython/Jupyter
+ Bokeh
## Installation
`pip install --user git+https://github.com/j-towns/iprofiler`
## Usage
Once installed using the above command, use
`%load_ext iprofiler`
to import the iprofiler to your notebook, then use the iprofile line magic
`%iprofile [statement]`
to profile a statement, or the cell magic `%%iprofile` to profile a cell.
| Interactive code profiling widget for IPython + Jupyter Notebook.
Tested with Jupyter notebook server 4.1.0 and 4.2.0, Python 2.7 and 3.5, IPython 4.1 and IPython 4.2. May be compatible with earlier/later versions.
**This software is a work in progress and is not yet stable/release ready.**
## Dependencies
+ Cython
+ Ipython/Jupyter
+ Bokeh
## Installation
Clone this repo then run `python setup.py install`.
## Usage
Once installed using the above command, use
`%load_ext iprofiler`
to import the iprofiler to your notebook, then use the iprofile line magic
`%iprofile [statement]`
to profile a statement, or the cell magic `%%iprofile` to profile a cell.
| Change installation in readme.md to local install. | Change installation in readme.md to local install. | Markdown | mit | j-towns/iprofiler,j-towns/iprofiler,j-towns/iprofiler,j-towns/iprofiler | markdown | ## Code Before:
Interactive code profiling widget for IPython + Jupyter Notebook.
Tested with Jupyter notebook server 4.1.0 and 4.2.0, Python 2.7 and 3.5, IPython 4.1 and IPython 4.2. May be compatible with earlier/later versions.
**This software is a work in progress and is not yet stable/release ready.**
## Dependencies
+ Cython
+ Ipython/Jupyter
+ Bokeh
## Installation
`pip install --user git+https://github.com/j-towns/iprofiler`
## Usage
Once installed using the above command, use
`%load_ext iprofiler`
to import the iprofiler to your notebook, then use the iprofile line magic
`%iprofile [statement]`
to profile a statement, or the cell magic `%%iprofile` to profile a cell.
## Instruction:
Change installation in readme.md to local install.
## Code After:
Interactive code profiling widget for IPython + Jupyter Notebook.
Tested with Jupyter notebook server 4.1.0 and 4.2.0, Python 2.7 and 3.5, IPython 4.1 and IPython 4.2. May be compatible with earlier/later versions.
**This software is a work in progress and is not yet stable/release ready.**
## Dependencies
+ Cython
+ Ipython/Jupyter
+ Bokeh
## Installation
Clone this repo then run `python setup.py install`.
## Usage
Once installed using the above command, use
`%load_ext iprofiler`
to import the iprofiler to your notebook, then use the iprofile line magic
`%iprofile [statement]`
to profile a statement, or the cell magic `%%iprofile` to profile a cell.
|
b743d604ad1d7299cc1d891916f70aeb6e369e2b | provisioning/provision.yml | provisioning/provision.yml | ---
- hosts:
- local
- staging
- prod
gather_facts: yes
roles:
- { role: "common" }
- { role: "front-web", tags: ["website"] }
- { role: "app-web", tags: ["website"] }
- { role: "api-db", tags: ["website", "database"] }
- { role: "api-web", tags: ["website", "api"] }
| ---
- hosts:
- local
- staging
- prod
gather_facts: yes
roles:
- { role: "common" }
- { role: "front-web", tags: ["website"] }
- { role: "app-web", tags: ["website"] }
- { role: "api-db", tags: ["website", "database"] }
- { role: "api-web", tags: ["website", "api"] }
- { role: "blockchain", tags: ["database"] }
| Enable the "blockchain" Ansible role. | Enable the "blockchain" Ansible role.
| YAML | mit | promethe42/cocorico,promethe42/cocorico,promethe42/cocorico,promethe42/cocorico,promethe42/cocorico | yaml | ## Code Before:
---
- hosts:
- local
- staging
- prod
gather_facts: yes
roles:
- { role: "common" }
- { role: "front-web", tags: ["website"] }
- { role: "app-web", tags: ["website"] }
- { role: "api-db", tags: ["website", "database"] }
- { role: "api-web", tags: ["website", "api"] }
## Instruction:
Enable the "blockchain" Ansible role.
## Code After:
---
- hosts:
- local
- staging
- prod
gather_facts: yes
roles:
- { role: "common" }
- { role: "front-web", tags: ["website"] }
- { role: "app-web", tags: ["website"] }
- { role: "api-db", tags: ["website", "database"] }
- { role: "api-web", tags: ["website", "api"] }
- { role: "blockchain", tags: ["database"] }
|
6506a55e833ff894abf8a488d16854168dc0a790 | spec/support/authentication_helpers.rb | spec/support/authentication_helpers.rb | module AuthenticationHelpers
def sign_in_as!(user)
visit '/login'
fill_in 'Email', with: user.email
fill_in 'Password', with: 'secret'
click_button 'Login'
end
end
RSpec.configure do |config|
config.include AuthenticationHelpers, type: :feature
config.include Devise::TestHelpers, type: :controller
config.include Rack::Test::Methods, type: :feature
end
| module AuthenticationHelpers
def sign_in_as!(user)
visit '/login'
fill_in 'Email', with: user.email
fill_in 'Password', with: 'secret'
click_button 'Login'
end
end
RSpec.configure do |config|
config.include AuthenticationHelpers, type: :feature
config.include Devise::Test::ControllerHelpers, type: :controller
config.include Rack::Test::Methods, type: :feature
end
| Correct Devise test helpers deprecation warning | Correct Devise test helpers deprecation warning
Example deprecation warning:
DEPRECATION WARNING: [Devise] including `Devise::TestHelpers` is deprecated and will be removed from Devise.
For controller tests, please include `Devise::Test::ControllerHelpers` instead.
(called from <top (required)> at /home/andrew/dev/solidus_auth_devise/spec/controllers/spree/checkout_controller_spec.rb:1)
| Ruby | bsd-3-clause | solidusio/solidus_auth_devise,mayankdedhia/solidus_auth_devise,mayankdedhia/solidus_auth_devise,AngelChaos26/mandrill,mayankdedhia/solidus_auth_devise,solidusio/solidus_auth_devise,AngelChaos26/mandrill,solidusio/solidus_auth_devise,AngelChaos26/mandrill | ruby | ## Code Before:
module AuthenticationHelpers
def sign_in_as!(user)
visit '/login'
fill_in 'Email', with: user.email
fill_in 'Password', with: 'secret'
click_button 'Login'
end
end
RSpec.configure do |config|
config.include AuthenticationHelpers, type: :feature
config.include Devise::TestHelpers, type: :controller
config.include Rack::Test::Methods, type: :feature
end
## Instruction:
Correct Devise test helpers deprecation warning
Example deprecation warning:
DEPRECATION WARNING: [Devise] including `Devise::TestHelpers` is deprecated and will be removed from Devise.
For controller tests, please include `Devise::Test::ControllerHelpers` instead.
(called from <top (required)> at /home/andrew/dev/solidus_auth_devise/spec/controllers/spree/checkout_controller_spec.rb:1)
## Code After:
module AuthenticationHelpers
def sign_in_as!(user)
visit '/login'
fill_in 'Email', with: user.email
fill_in 'Password', with: 'secret'
click_button 'Login'
end
end
RSpec.configure do |config|
config.include AuthenticationHelpers, type: :feature
config.include Devise::Test::ControllerHelpers, type: :controller
config.include Rack::Test::Methods, type: :feature
end
|
d2f506845e451dbb61a3e0133cb8bed68f5ce22d | src/vs/languages/html/common/html.contribution.ts | src/vs/languages/html/common/html.contribution.ts | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import modesExtensions = require('vs/editor/common/modes/modesRegistry');
modesExtensions.registerMode({
id: 'html',
extensions: ['.html', '.htm', '.shtml', '.mdoc', '.jsp', '.asp', '.aspx', '.jshtm'],
aliases: ['HTML', 'htm', 'html', 'xhtml'],
mimetypes: ['text/html', 'text/x-jshtm', 'text/template'],
moduleId: 'vs/languages/html/common/html',
ctorName: 'HTMLMode'
});
| /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import modesExtensions = require('vs/editor/common/modes/modesRegistry');
modesExtensions.registerMode({
id: 'html',
extensions: ['.html', '.htm', '.shtml', '.mdoc', '.jsp', '.asp', '.aspx', '.jshtm'],
aliases: ['HTML', 'htm', 'html', 'xhtml'],
mimetypes: ['text/html', 'text/x-jshtm', 'text/template', 'text/ng-template'],
moduleId: 'vs/languages/html/common/html',
ctorName: 'HTMLMode'
});
| Add text/ng-template to the HTML mime types to enable HTML highlighting/help in Angular templates with in <script> blocks | Add text/ng-template to the HTML mime types to enable HTML highlighting/help in Angular templates with in <script> blocks
| TypeScript | mit | matthewshirley/vscode,f111fei/vscode,joaomoreno/vscode,edumunoz/vscode,the-ress/vscode,rishii7/vscode,mjbvz/vscode,KattMingMing/vscode,f111fei/vscode,0xmohit/vscode,the-ress/vscode,Zalastax/vscode,sifue/vscode,cleidigh/vscode,ups216/vscode,eamodio/vscode,Microsoft/vscode,veeramarni/vscode,microlv/vscode,cleidigh/vscode,hoovercj/vscode,eamodio/vscode,KattMingMing/vscode,matthewshirley/vscode,stkb/vscode,ioklo/vscode,start/vscode,matthewshirley/vscode,hungys/vscode,oneplus1000/vscode,Krzysztof-Cieslak/vscode,eamodio/vscode,williamcspace/vscode,Krzysztof-Cieslak/vscode,cra0zy/VSCode,cleidigh/vscode,Krzysztof-Cieslak/vscode,rishii7/vscode,KattMingMing/vscode,joaomoreno/vscode,eklavyamirani/vscode,eklavyamirani/vscode,williamcspace/vscode,0xmohit/vscode,radshit/vscode,Zalastax/vscode,microsoft/vscode,markrendle/vscode,Krzysztof-Cieslak/vscode,edumunoz/vscode,markrendle/vscode,jchadwick/vscode,stringham/vscode,takumif/vscode,gagangupt16/vscode,charlespierce/vscode,zyml/vscode,michaelcfanning/vscode,rishii7/vscode,charlespierce/vscode,Zalastax/vscode,0xmohit/vscode,radshit/vscode,joaomoreno/vscode,hashhar/vscode,veeramarni/vscode,dersia/vscode,bsmr-x-script/vscode,cleidigh/vscode,matthewshirley/vscode,gagangupt16/vscode,bsmr-x-script/vscode,hoovercj/vscode,eamodio/vscode,Zalastax/vscode,zyml/vscode,cleidigh/vscode,microsoft/vscode,Microsoft/vscode,sifue/vscode,start/vscode,charlespierce/vscode,mjbvz/vscode,gagangupt16/vscode,stringham/vscode,the-ress/vscode,cleidigh/vscode,KattMingMing/vscode,hoovercj/vscode,dersia/vscode,gagangupt16/vscode,zyml/vscode,hashhar/vscode,Microsoft/vscode,veeramarni/vscode,radshit/vscode,zyml/vscode,zyml/vscode,hashhar/vscode,mjbvz/vscode,sifue/vscode,DustinCampbell/vscode,hoovercj/vscode,veeramarni/vscode,ups216/vscode,williamcspace/vscode,start/vscode,radshit/vscode,Microsoft/vscode,alexandrudima/vscode,2947721120/vscode,gagangupt16/vscode,stringham/vscode,joaomoreno/vscode,hashhar/vscode,jchadwick/vscode,SofianHn/vscode,KattMingMing/vscode,microlv/vscode,edumunoz/vscode,Zalastax/vscode,gagangupt16/vscode,gagangupt16/vscode,punker76/vscode,rishii7/vscode,jchadwick/vscode,rishii7/vscode,cleidigh/vscode,Microsoft/vscode,jchadwick/vscode,Zalastax/vscode,0xmohit/vscode,eklavyamirani/vscode,gagangupt16/vscode,mjbvz/vscode,joaomoreno/vscode,tottok-ug/vscode,sifue/vscode,DustinCampbell/vscode,joaomoreno/vscode,ioklo/vscode,jchadwick/vscode,ups216/vscode,rick111111/vscode,radshit/vscode,oneplus1000/vscode,hungys/vscode,michaelcfanning/vscode,hungys/vscode,williamcspace/vscode,DustinCampbell/vscode,landonepps/vscode,takumif/vscode,the-ress/vscode,hungys/vscode,joaomoreno/vscode,alexandrudima/vscode,landonepps/vscode,f111fei/vscode,markrendle/vscode,edumunoz/vscode,f111fei/vscode,veeramarni/vscode,0xmohit/vscode,microsoft/vscode,stringham/vscode,eklavyamirani/vscode,matthewshirley/vscode,stringham/vscode,hashhar/vscode,ioklo/vscode,Krzysztof-Cieslak/vscode,michaelcfanning/vscode,mjbvz/vscode,hungys/vscode,eamodio/vscode,zyml/vscode,cleidigh/vscode,microlv/vscode,veeramarni/vscode,bsmr-x-script/vscode,eklavyamirani/vscode,stringham/vscode,hoovercj/vscode,jchadwick/vscode,hoovercj/vscode,edumunoz/vscode,microsoft/vscode,mjbvz/vscode,eamodio/vscode,Microsoft/vscode,gagangupt16/vscode,rick111111/vscode,DustinCampbell/vscode,edumunoz/vscode,edumunoz/vscode,ioklo/vscode,KattMingMing/vscode,bsmr-x-script/vscode,markrendle/vscode,cleidigh/vscode,charlespierce/vscode,microlv/vscode,edumunoz/vscode,charlespierce/vscode,0xmohit/vscode,williamcspace/vscode,oneplus1000/vscode,rishii7/vscode,williamcspace/vscode,matthewshirley/vscode,the-ress/vscode,Microsoft/vscode,mjbvz/vscode,ups216/vscode,veeramarni/vscode,f111fei/vscode,zyml/vscode,the-ress/vscode,eklavyamirani/vscode,landonepps/vscode,ups216/vscode,mjbvz/vscode,bsmr-x-script/vscode,zyml/vscode,matthewshirley/vscode,Krzysztof-Cieslak/vscode,charlespierce/vscode,the-ress/vscode,rick111111/vscode,punker76/vscode,ioklo/vscode,charlespierce/vscode,jchadwick/vscode,mjbvz/vscode,landonepps/vscode,DustinCampbell/vscode,joaomoreno/vscode,jchadwick/vscode,stringham/vscode,eklavyamirani/vscode,hoovercj/vscode,hoovercj/vscode,veeramarni/vscode,Zalastax/vscode,sifue/vscode,Zalastax/vscode,microsoft/vscode,hoovercj/vscode,DustinCampbell/vscode,williamcspace/vscode,williamcspace/vscode,eamodio/vscode,f111fei/vscode,matthewshirley/vscode,cleidigh/vscode,microlv/vscode,start/vscode,rishii7/vscode,f111fei/vscode,sifue/vscode,hashhar/vscode,joaomoreno/vscode,matthewshirley/vscode,stringham/vscode,DustinCampbell/vscode,zyml/vscode,charlespierce/vscode,veeramarni/vscode,radshit/vscode,landonepps/vscode,sifue/vscode,KattMingMing/vscode,the-ress/vscode,microlv/vscode,bsmr-x-script/vscode,mjbvz/vscode,Microsoft/vscode,rishii7/vscode,joaomoreno/vscode,edumunoz/vscode,Krzysztof-Cieslak/vscode,edumunoz/vscode,jchadwick/vscode,dersia/vscode,ups216/vscode,DustinCampbell/vscode,edumunoz/vscode,veeramarni/vscode,eamodio/vscode,microlv/vscode,radshit/vscode,ioklo/vscode,hungys/vscode,zyml/vscode,cleidigh/vscode,ups216/vscode,stringham/vscode,microlv/vscode,Zalastax/vscode,microsoft/vscode,DustinCampbell/vscode,zyml/vscode,alexandrudima/vscode,sifue/vscode,Microsoft/vscode,Zalastax/vscode,the-ress/vscode,rick111111/vscode,microsoft/vscode,hashhar/vscode,rishii7/vscode,Krzysztof-Cieslak/vscode,hashhar/vscode,dersia/vscode,cleidigh/vscode,jchadwick/vscode,stkb/vscode,tottok-ug/vscode,DustinCampbell/vscode,edumunoz/vscode,hashhar/vscode,matthewshirley/vscode,0xmohit/vscode,hungys/vscode,ups216/vscode,Microsoft/vscode,edumunoz/vscode,veeramarni/vscode,f111fei/vscode,gagangupt16/vscode,KattMingMing/vscode,charlespierce/vscode,Krzysztof-Cieslak/vscode,bsmr-x-script/vscode,bsmr-x-script/vscode,0xmohit/vscode,sifue/vscode,bsmr-x-script/vscode,microsoft/vscode,eklavyamirani/vscode,ioklo/vscode,stringham/vscode,hungys/vscode,williamcspace/vscode,veeramarni/vscode,williamcspace/vscode,microsoft/vscode,f111fei/vscode,microsoft/vscode,stringham/vscode,microlv/vscode,Krzysztof-Cieslak/vscode,microsoft/vscode,landonepps/vscode,mjbvz/vscode,tottok-ug/vscode,stringham/vscode,f111fei/vscode,mjbvz/vscode,williamcspace/vscode,Zalastax/vscode,hoovercj/vscode,rishii7/vscode,ups216/vscode,f111fei/vscode,zyml/vscode,Microsoft/vscode,2947721120/vscode,sifue/vscode,rishii7/vscode,ups216/vscode,edumunoz/vscode,veeramarni/vscode,ups216/vscode,sifue/vscode,the-ress/vscode,joaomoreno/vscode,KattMingMing/vscode,oneplus1000/vscode,eklavyamirani/vscode,microsoft/vscode,veeramarni/vscode,punker76/vscode,matthewshirley/vscode,KattMingMing/vscode,bsmr-x-script/vscode,radshit/vscode,2947721120/vscode,0xmohit/vscode,Krzysztof-Cieslak/vscode,radshit/vscode,cleidigh/vscode,f111fei/vscode,microlv/vscode,radshit/vscode,f111fei/vscode,eklavyamirani/vscode,SofianHn/vscode,the-ress/vscode,jchadwick/vscode,veeramarni/vscode,ioklo/vscode,microlv/vscode,hashhar/vscode,0xmohit/vscode,microlv/vscode,stringham/vscode,gagangupt16/vscode,hashhar/vscode,ups216/vscode,ioklo/vscode,hungys/vscode,williamcspace/vscode,eklavyamirani/vscode,Krzysztof-Cieslak/vscode,microlv/vscode,jchadwick/vscode,ioklo/vscode,Zalastax/vscode,hungys/vscode,eamodio/vscode,williamcspace/vscode,DustinCampbell/vscode,gagangupt16/vscode,f111fei/vscode,rishii7/vscode,Microsoft/vscode,ioklo/vscode,eamodio/vscode,hungys/vscode,eklavyamirani/vscode,0xmohit/vscode,the-ress/vscode,DustinCampbell/vscode,matthewshirley/vscode,KattMingMing/vscode,landonepps/vscode,microlv/vscode,jchadwick/vscode,alexandrudima/vscode,joaomoreno/vscode,radshit/vscode,landonepps/vscode,radshit/vscode,eklavyamirani/vscode,ioklo/vscode,microsoft/vscode,hoovercj/vscode,ioklo/vscode,eamodio/vscode,0xmohit/vscode,landonepps/vscode,mjbvz/vscode,williamcspace/vscode,bsmr-x-script/vscode,gagangupt16/vscode,eamodio/vscode,stringham/vscode,microsoft/vscode,takumif/vscode,charlespierce/vscode,joaomoreno/vscode,the-ress/vscode,eamodio/vscode,DustinCampbell/vscode,0xmohit/vscode,charlespierce/vscode,Zalastax/vscode,sifue/vscode,rishii7/vscode,landonepps/vscode,KattMingMing/vscode,rishii7/vscode,hungys/vscode,edumunoz/vscode,radshit/vscode,stringham/vscode,hungys/vscode,Krzysztof-Cieslak/vscode,f111fei/vscode,microsoft/vscode,eamodio/vscode,hungys/vscode,sifue/vscode,SofianHn/vscode,hashhar/vscode,hungys/vscode,mjbvz/vscode,joaomoreno/vscode,rishii7/vscode,charlespierce/vscode,hashhar/vscode,ups216/vscode,stkb/vscode,eamodio/vscode,sifue/vscode,landonepps/vscode,hoovercj/vscode,DustinCampbell/vscode,hashhar/vscode,ups216/vscode,joaomoreno/vscode,cleidigh/vscode,matthewshirley/vscode,DustinCampbell/vscode,KattMingMing/vscode,jchadwick/vscode,Zalastax/vscode,radshit/vscode,eamodio/vscode,bsmr-x-script/vscode,microlv/vscode,rishii7/vscode,Microsoft/vscode,jchadwick/vscode,DustinCampbell/vscode,charlespierce/vscode,hashhar/vscode,jchadwick/vscode,stringham/vscode,mjbvz/vscode,zyml/vscode,KattMingMing/vscode,Microsoft/vscode,microlv/vscode,eklavyamirani/vscode,landonepps/vscode,rkeithhill/VSCode,hoovercj/vscode,veeramarni/vscode,the-ress/vscode,landonepps/vscode,jchadwick/vscode,matthewshirley/vscode,SofianHn/vscode,Krzysztof-Cieslak/vscode,Microsoft/vscode,0xmohit/vscode,Krzysztof-Cieslak/vscode,eklavyamirani/vscode,zyml/vscode,0xmohit/vscode,charlespierce/vscode,charlespierce/vscode,michaelcfanning/vscode,Krzysztof-Cieslak/vscode,Zalastax/vscode,landonepps/vscode,KattMingMing/vscode,mjbvz/vscode,hoovercj/vscode,KattMingMing/vscode,bsmr-x-script/vscode,cleidigh/vscode,ioklo/vscode,veeramarni/vscode,ioklo/vscode,gagangupt16/vscode,zyml/vscode,sifue/vscode,matthewshirley/vscode,takumif/vscode,gagangupt16/vscode,joaomoreno/vscode,cleidigh/vscode,bsmr-x-script/vscode,2947721120/vscode,Microsoft/vscode,0xmohit/vscode,landonepps/vscode,f111fei/vscode,Microsoft/vscode,eamodio/vscode,ups216/vscode,Zalastax/vscode,gagangupt16/vscode,microsoft/vscode,rishii7/vscode,williamcspace/vscode,hashhar/vscode,the-ress/vscode,charlespierce/vscode,mjbvz/vscode,radshit/vscode,punker76/vscode,eklavyamirani/vscode,hoovercj/vscode,KattMingMing/vscode,Zalastax/vscode,DustinCampbell/vscode,eklavyamirani/vscode,stringham/vscode,zyml/vscode,matthewshirley/vscode,microsoft/vscode,the-ress/vscode,bsmr-x-script/vscode,williamcspace/vscode,joaomoreno/vscode,0xmohit/vscode,stkb/vscode,bsmr-x-script/vscode,landonepps/vscode,hoovercj/vscode,microlv/vscode,tottok-ug/vscode,hashhar/vscode,hungys/vscode,ups216/vscode,cleidigh/vscode,matthewshirley/vscode,charlespierce/vscode,sifue/vscode,Krzysztof-Cieslak/vscode,zyml/vscode,ioklo/vscode,radshit/vscode,landonepps/vscode,gagangupt16/vscode,radshit/vscode,hungys/vscode,ups216/vscode,edumunoz/vscode,hoovercj/vscode,williamcspace/vscode | typescript | ## Code Before:
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import modesExtensions = require('vs/editor/common/modes/modesRegistry');
modesExtensions.registerMode({
id: 'html',
extensions: ['.html', '.htm', '.shtml', '.mdoc', '.jsp', '.asp', '.aspx', '.jshtm'],
aliases: ['HTML', 'htm', 'html', 'xhtml'],
mimetypes: ['text/html', 'text/x-jshtm', 'text/template'],
moduleId: 'vs/languages/html/common/html',
ctorName: 'HTMLMode'
});
## Instruction:
Add text/ng-template to the HTML mime types to enable HTML highlighting/help in Angular templates with in <script> blocks
## Code After:
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import modesExtensions = require('vs/editor/common/modes/modesRegistry');
modesExtensions.registerMode({
id: 'html',
extensions: ['.html', '.htm', '.shtml', '.mdoc', '.jsp', '.asp', '.aspx', '.jshtm'],
aliases: ['HTML', 'htm', 'html', 'xhtml'],
mimetypes: ['text/html', 'text/x-jshtm', 'text/template', 'text/ng-template'],
moduleId: 'vs/languages/html/common/html',
ctorName: 'HTMLMode'
});
|
98c6903e9c757af91e1c59a51d409631b2e52a7b | plugins/hosts/windows/cap/ssh.rb | plugins/hosts/windows/cap/ssh.rb | module VagrantPlugins
module HostWindows
module Cap
class SSH
# Set the ownership and permissions for SSH
# private key
#
# @param [Vagrant::Environment] env
# @param [Pathname] key_path
def self.set_ssh_key_permissions(env, key_path)
script_path = Host.scripts_path.join("set_ssh_key_permissions.ps1")
result = Vagrant::Util::PowerShell.execute(
script_path.to_s, path.to_s,
module_path: Host.module_path.to_s
)
if result.exit_code != 0
raise Vagrant::Errors::PowerShellError,
script: script_path,
stderr: result.stderr
end
end
end
end
end
end
| module VagrantPlugins
module HostWindows
module Cap
class SSH
# Set the ownership and permissions for SSH
# private key
#
# @param [Vagrant::Environment] env
# @param [Pathname] key_path
def self.set_ssh_key_permissions(env, key_path)
script_path = Host.scripts_path.join("set_ssh_key_permissions.ps1")
result = Vagrant::Util::PowerShell.execute(
script_path.to_s, key_path.to_s,
module_path: Host.modules_path.to_s
)
if result.exit_code != 0
raise Vagrant::Errors::PowerShellError,
script: script_path,
stderr: result.stderr
end
result
end
end
end
end
end
| Fix path variable name. Return process result. | Fix path variable name. Return process result.
| Ruby | mit | sni/vagrant,sni/vagrant,gitebra/vagrant,bryson/vagrant,marxarelli/vagrant,bryson/vagrant,mitchellh/vagrant,sni/vagrant,marxarelli/vagrant,marxarelli/vagrant,gitebra/vagrant,chrisroberts/vagrant,mitchellh/vagrant,mitchellh/vagrant,chrisroberts/vagrant,marxarelli/vagrant,bryson/vagrant,sni/vagrant,gitebra/vagrant,chrisroberts/vagrant,chrisroberts/vagrant,bryson/vagrant,gitebra/vagrant,mitchellh/vagrant | ruby | ## Code Before:
module VagrantPlugins
module HostWindows
module Cap
class SSH
# Set the ownership and permissions for SSH
# private key
#
# @param [Vagrant::Environment] env
# @param [Pathname] key_path
def self.set_ssh_key_permissions(env, key_path)
script_path = Host.scripts_path.join("set_ssh_key_permissions.ps1")
result = Vagrant::Util::PowerShell.execute(
script_path.to_s, path.to_s,
module_path: Host.module_path.to_s
)
if result.exit_code != 0
raise Vagrant::Errors::PowerShellError,
script: script_path,
stderr: result.stderr
end
end
end
end
end
end
## Instruction:
Fix path variable name. Return process result.
## Code After:
module VagrantPlugins
module HostWindows
module Cap
class SSH
# Set the ownership and permissions for SSH
# private key
#
# @param [Vagrant::Environment] env
# @param [Pathname] key_path
def self.set_ssh_key_permissions(env, key_path)
script_path = Host.scripts_path.join("set_ssh_key_permissions.ps1")
result = Vagrant::Util::PowerShell.execute(
script_path.to_s, key_path.to_s,
module_path: Host.modules_path.to_s
)
if result.exit_code != 0
raise Vagrant::Errors::PowerShellError,
script: script_path,
stderr: result.stderr
end
result
end
end
end
end
end
|
4c5b6217015610fe7cf3064b59e1b8de1fa41575 | PyFloraBook/input_output/data_coordinator.py | PyFloraBook/input_output/data_coordinator.py | from pathlib import Path
import json
import inspect
import sys
import PyFloraBook
OBSERVATIONS_FOLDER = "observation_data"
RAW_DATA_FOLDER = "raw"
def locate_project_folder() -> Path:
"""Locate top-level project folder
Returns:
Path of the project folder
"""
source_path = Path(inspect.getsourcefile(PyFloraBook)).parent
# This assumes that the highest-level project __init__ file is contained
# in a sub-folder of the project folder
return source_path.parent
def locate_data_folder() -> Path:
"""Return path of the data IO folder
Returns:
Path of data IO folder
"""
return Path(load_configuration()["data_folder"])
def locate_raw_data_folder() -> Path:
"""Return path of the raw data folder
Returns:
Path of raw data folder
"""
return locate_data_folder() / OBSERVATIONS_FOLDER / RAW_DATA_FOLDER
def load_configuration() -> dict:
"""Load project configuration info
Returns:
Dictionary of configuration info.
"""
configuration = Path(locate_project_folder() / "configuration.json")
with configuration.open() as config_file:
return json.load(config_file)
def locate_current_script_folder() -> Path:
"""Return path of the currently running script
Returns:
Path of current script
"""
return Path(sys.path[0])
| from pathlib import Path
import json
import inspect
import sys
import PyFloraBook
# Globals
OBSERVATIONS_FOLDER = "observation_data"
RAW_OBSERVATIONS_FOLDER = "raw_observations"
RAW_COUNTS_FOLDER = "raw_counts"
def locate_project_folder() -> Path:
"""Locate top-level project folder
Returns:
Path of the project folder
"""
source_path = Path(inspect.getsourcefile(PyFloraBook)).parent
# This assumes that the highest-level project __init__ file is contained
# in a sub-folder of the project folder
return source_path.parent
def locate_data_folder() -> Path:
"""Return path of the data IO folder
Returns:
Path of data IO folder
"""
return Path(load_configuration()["data_folder"])
def locate_raw_observations_folder() -> Path:
"""Return path of the raw observations data folder
Returns:
Path of raw observations data folder
"""
return (locate_data_folder() / OBSERVATIONS_FOLDER /
RAW_OBSERVATIONS_FOLDER)
def locate_raw_counts_folder() -> Path:
"""Return path of the raw counts data folder
Returns:
Path of raw counts data folder
"""
return locate_data_folder() / OBSERVATIONS_FOLDER / RAW_COUNTS_FOLDER
def load_configuration() -> dict:
"""Load project configuration info
Returns:
Dictionary of configuration info.
"""
configuration = Path(locate_project_folder() / "configuration.json")
with configuration.open() as config_file:
return json.load(config_file)
def locate_current_script_folder() -> Path:
"""Return path of the currently running script
Returns:
Path of current script
"""
return Path(sys.path[0])
| Support separate folders for raw observations and raw counts | Support separate folders for raw observations and raw counts
| Python | mit | jnfrye/local_plants_book | python | ## Code Before:
from pathlib import Path
import json
import inspect
import sys
import PyFloraBook
OBSERVATIONS_FOLDER = "observation_data"
RAW_DATA_FOLDER = "raw"
def locate_project_folder() -> Path:
"""Locate top-level project folder
Returns:
Path of the project folder
"""
source_path = Path(inspect.getsourcefile(PyFloraBook)).parent
# This assumes that the highest-level project __init__ file is contained
# in a sub-folder of the project folder
return source_path.parent
def locate_data_folder() -> Path:
"""Return path of the data IO folder
Returns:
Path of data IO folder
"""
return Path(load_configuration()["data_folder"])
def locate_raw_data_folder() -> Path:
"""Return path of the raw data folder
Returns:
Path of raw data folder
"""
return locate_data_folder() / OBSERVATIONS_FOLDER / RAW_DATA_FOLDER
def load_configuration() -> dict:
"""Load project configuration info
Returns:
Dictionary of configuration info.
"""
configuration = Path(locate_project_folder() / "configuration.json")
with configuration.open() as config_file:
return json.load(config_file)
def locate_current_script_folder() -> Path:
"""Return path of the currently running script
Returns:
Path of current script
"""
return Path(sys.path[0])
## Instruction:
Support separate folders for raw observations and raw counts
## Code After:
from pathlib import Path
import json
import inspect
import sys
import PyFloraBook
# Globals
OBSERVATIONS_FOLDER = "observation_data"
RAW_OBSERVATIONS_FOLDER = "raw_observations"
RAW_COUNTS_FOLDER = "raw_counts"
def locate_project_folder() -> Path:
"""Locate top-level project folder
Returns:
Path of the project folder
"""
source_path = Path(inspect.getsourcefile(PyFloraBook)).parent
# This assumes that the highest-level project __init__ file is contained
# in a sub-folder of the project folder
return source_path.parent
def locate_data_folder() -> Path:
"""Return path of the data IO folder
Returns:
Path of data IO folder
"""
return Path(load_configuration()["data_folder"])
def locate_raw_observations_folder() -> Path:
"""Return path of the raw observations data folder
Returns:
Path of raw observations data folder
"""
return (locate_data_folder() / OBSERVATIONS_FOLDER /
RAW_OBSERVATIONS_FOLDER)
def locate_raw_counts_folder() -> Path:
"""Return path of the raw counts data folder
Returns:
Path of raw counts data folder
"""
return locate_data_folder() / OBSERVATIONS_FOLDER / RAW_COUNTS_FOLDER
def load_configuration() -> dict:
"""Load project configuration info
Returns:
Dictionary of configuration info.
"""
configuration = Path(locate_project_folder() / "configuration.json")
with configuration.open() as config_file:
return json.load(config_file)
def locate_current_script_folder() -> Path:
"""Return path of the currently running script
Returns:
Path of current script
"""
return Path(sys.path[0])
|
7d3586bb5fdaf5e0313b2b2c306fbac847e7847a | docs/source/user_guide/index.rst | docs/source/user_guide/index.rst | ==========
User Guide
==========
.. toctree::
:maxdepth: 2
:glob:
airwaveapiclient
aplist
apdetail
apgraph
sample_code
| ==========
User Guide
==========
.. toctree::
:maxdepth: 2
:glob:
airwaveapiclient
aplist
apdetail
apgraph
report
sample_code
| Add report doc at user guide | Add report doc at user guide
| reStructuredText | mit | mtoshi/airwaveapiclient,mtoshi/airwaveapiclient | restructuredtext | ## Code Before:
==========
User Guide
==========
.. toctree::
:maxdepth: 2
:glob:
airwaveapiclient
aplist
apdetail
apgraph
sample_code
## Instruction:
Add report doc at user guide
## Code After:
==========
User Guide
==========
.. toctree::
:maxdepth: 2
:glob:
airwaveapiclient
aplist
apdetail
apgraph
report
sample_code
|
8d53a7478a139770d9ffb241ec2985123c403845 | bookmarks/bookmarks/models.py | bookmarks/bookmarks/models.py | from __future__ import unicode_literals
from django.db import models
from django.utils import timezone
from django.dispatch import receiver
from django.conf import settings
from taggit.managers import TaggableManager
import requests
class Bookmark(models.Model):
title = models.CharField(max_length=200, blank=True, null=True)
description = models.TextField(blank=True, null=True)
date_added = models.DateTimeField(default=timezone.now, blank=True)
tags = TaggableManager(blank=True)
private = models.BooleanField(default=False)
url = models.URLField(max_length=500)
def __unicode__(self):
return "{}: {} [{}]".format(
self.pk,
self.title[:40],
self.date_added
)
@receiver(models.signals.post_save, sender=Bookmark)
def bookmark_pre_save_handler(sender, instance, created, *args, **kwargs):
# Only run for new items, not updates
if created:
if not hasattr(settings, 'SLACK_WEBHOOK_URL'):
return
payload = {
'channel': "#bookmarks-dev",
'username': "Bookmarks",
'text': "{}".format(
"Bookmark added:",
),
'icon_emoji': ":blue_book:",
'attachments': [
{
"fallback": instance.title,
"color": "good",
"title": instance.title,
"title_link": instance.url,
"text": instance.description,
}
]
}
requests.post(settings.SLACK_WEBHOOK_URL, json=payload)
| from __future__ import unicode_literals
from django.db import models
from django.utils import timezone
from django.dispatch import receiver
from django.conf import settings
from taggit.managers import TaggableManager
import requests
class Bookmark(models.Model):
title = models.CharField(max_length=200, blank=True, null=True)
description = models.TextField(blank=True, null=True)
date_added = models.DateTimeField(default=timezone.now, blank=True)
tags = TaggableManager(blank=True)
private = models.BooleanField(default=False)
url = models.URLField(max_length=500)
def __unicode__(self):
return "{}: {} [{}]".format(
self.pk,
self.title[:40],
self.date_added
)
@receiver(models.signals.post_save, sender=Bookmark)
def bookmark_pre_save_handler(sender, instance, created, *args, **kwargs):
# Only run for new items, not updates
if created:
if not hasattr(settings, 'SLACK_WEBHOOK_URL'):
return
payload = {
'channel': "#bookmarks-dev",
'username': "Bookmarks",
'text': "<{}|{}>\n{}".format(
instance.url,
instance.title,
instance.description,
),
'icon_emoji': ":blue_book:",
'unfurl_links': True
}
requests.post(settings.SLACK_WEBHOOK_URL, json=payload)
| Remove attachment and use slack link unfurling | Remove attachment and use slack link unfurling
| Python | mit | tom-henderson/bookmarks,tom-henderson/bookmarks,tom-henderson/bookmarks | python | ## Code Before:
from __future__ import unicode_literals
from django.db import models
from django.utils import timezone
from django.dispatch import receiver
from django.conf import settings
from taggit.managers import TaggableManager
import requests
class Bookmark(models.Model):
title = models.CharField(max_length=200, blank=True, null=True)
description = models.TextField(blank=True, null=True)
date_added = models.DateTimeField(default=timezone.now, blank=True)
tags = TaggableManager(blank=True)
private = models.BooleanField(default=False)
url = models.URLField(max_length=500)
def __unicode__(self):
return "{}: {} [{}]".format(
self.pk,
self.title[:40],
self.date_added
)
@receiver(models.signals.post_save, sender=Bookmark)
def bookmark_pre_save_handler(sender, instance, created, *args, **kwargs):
# Only run for new items, not updates
if created:
if not hasattr(settings, 'SLACK_WEBHOOK_URL'):
return
payload = {
'channel': "#bookmarks-dev",
'username': "Bookmarks",
'text': "{}".format(
"Bookmark added:",
),
'icon_emoji': ":blue_book:",
'attachments': [
{
"fallback": instance.title,
"color": "good",
"title": instance.title,
"title_link": instance.url,
"text": instance.description,
}
]
}
requests.post(settings.SLACK_WEBHOOK_URL, json=payload)
## Instruction:
Remove attachment and use slack link unfurling
## Code After:
from __future__ import unicode_literals
from django.db import models
from django.utils import timezone
from django.dispatch import receiver
from django.conf import settings
from taggit.managers import TaggableManager
import requests
class Bookmark(models.Model):
title = models.CharField(max_length=200, blank=True, null=True)
description = models.TextField(blank=True, null=True)
date_added = models.DateTimeField(default=timezone.now, blank=True)
tags = TaggableManager(blank=True)
private = models.BooleanField(default=False)
url = models.URLField(max_length=500)
def __unicode__(self):
return "{}: {} [{}]".format(
self.pk,
self.title[:40],
self.date_added
)
@receiver(models.signals.post_save, sender=Bookmark)
def bookmark_pre_save_handler(sender, instance, created, *args, **kwargs):
# Only run for new items, not updates
if created:
if not hasattr(settings, 'SLACK_WEBHOOK_URL'):
return
payload = {
'channel': "#bookmarks-dev",
'username': "Bookmarks",
'text': "<{}|{}>\n{}".format(
instance.url,
instance.title,
instance.description,
),
'icon_emoji': ":blue_book:",
'unfurl_links': True
}
requests.post(settings.SLACK_WEBHOOK_URL, json=payload)
|
997bc3cbf5efb8b8a6b3f4d75deae2c22072e640 | tests/integration/components/ember-x-editable-test.js | tests/integration/components/ember-x-editable-test.js | import { moduleForComponent, test } from 'ember-qunit';
import { find, focus, triggerEvent } from 'ember-native-dom-helpers';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('ember-x-editable', 'Integration | Component | ember x editable', {
integration: true
});
test('mouseEnter/mouseLeave', async function(assert) {
this.set('mouseInsideComponent', false);
this.render(hbs`{{x-editable-text mouseInsideComponent=mouseInsideComponent validator=validator value=value}}`);
await triggerEvent(find('.x-base'), 'mouseover');
assert.equal(this.get('mouseInsideComponent'), true);
await triggerEvent(find('.x-base'), 'mouseout');
assert.equal(this.get('mouseInsideComponent'), false);
});
test('Empty value', async function(assert) {
this.set('value', 'Empty');
this.render(hbs`{{x-editable-text validator=validator value=value}}`);
await focus(find('.x-base div input'));
assert.equal(this.get('value'), '');
});
| import { moduleForComponent, test } from 'ember-qunit';
import { click, fillIn, find, focus, triggerEvent } from 'ember-native-dom-helpers';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('ember-x-editable', 'Integration | Component | ember x editable', {
integration: true
});
test('mouseEnter/mouseLeave', async function(assert) {
this.set('mouseInsideComponent', false);
this.render(hbs`{{x-editable-text mouseInsideComponent=mouseInsideComponent validator=validator value=value}}`);
await triggerEvent(find('.x-base'), 'mouseover');
assert.equal(this.get('mouseInsideComponent'), true);
await triggerEvent(find('.x-base'), 'mouseout');
assert.equal(this.get('mouseInsideComponent'), false);
});
test('Empty value', async function(assert) {
this.set('value', 'Empty');
this.render(hbs`{{x-editable-text validator=validator value=value}}`);
await focus(find('.x-base div input'));
assert.equal(this.get('value'), '');
});
test('No validator passed', async function(assert) {
this.set('value', 'foo');
this.render(hbs`{{x-editable-text value=value}}`);
await fillIn(find('.x-base div input'), '');
await click('.editable-submit');
assert.equal(this.get('value'), 'Empty');
});
| Add test for no validator case | Add test for no validator case
| JavaScript | mit | rwwagner90/ember-x-editable-addon,shipshapecode/ember-x-editable,rwwagner90/ember-x-editable-addon,shipshapecode/ember-x-editable | javascript | ## Code Before:
import { moduleForComponent, test } from 'ember-qunit';
import { find, focus, triggerEvent } from 'ember-native-dom-helpers';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('ember-x-editable', 'Integration | Component | ember x editable', {
integration: true
});
test('mouseEnter/mouseLeave', async function(assert) {
this.set('mouseInsideComponent', false);
this.render(hbs`{{x-editable-text mouseInsideComponent=mouseInsideComponent validator=validator value=value}}`);
await triggerEvent(find('.x-base'), 'mouseover');
assert.equal(this.get('mouseInsideComponent'), true);
await triggerEvent(find('.x-base'), 'mouseout');
assert.equal(this.get('mouseInsideComponent'), false);
});
test('Empty value', async function(assert) {
this.set('value', 'Empty');
this.render(hbs`{{x-editable-text validator=validator value=value}}`);
await focus(find('.x-base div input'));
assert.equal(this.get('value'), '');
});
## Instruction:
Add test for no validator case
## Code After:
import { moduleForComponent, test } from 'ember-qunit';
import { click, fillIn, find, focus, triggerEvent } from 'ember-native-dom-helpers';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('ember-x-editable', 'Integration | Component | ember x editable', {
integration: true
});
test('mouseEnter/mouseLeave', async function(assert) {
this.set('mouseInsideComponent', false);
this.render(hbs`{{x-editable-text mouseInsideComponent=mouseInsideComponent validator=validator value=value}}`);
await triggerEvent(find('.x-base'), 'mouseover');
assert.equal(this.get('mouseInsideComponent'), true);
await triggerEvent(find('.x-base'), 'mouseout');
assert.equal(this.get('mouseInsideComponent'), false);
});
test('Empty value', async function(assert) {
this.set('value', 'Empty');
this.render(hbs`{{x-editable-text validator=validator value=value}}`);
await focus(find('.x-base div input'));
assert.equal(this.get('value'), '');
});
test('No validator passed', async function(assert) {
this.set('value', 'foo');
this.render(hbs`{{x-editable-text value=value}}`);
await fillIn(find('.x-base div input'), '');
await click('.editable-submit');
assert.equal(this.get('value'), 'Empty');
});
|
9a51c4bede4afe947612e87e53a708694a905835 | squidb-processor/src/com/yahoo/squidb/processor/data/ErrorInfo.java | squidb-processor/src/com/yahoo/squidb/processor/data/ErrorInfo.java | /*
* Copyright 2015, Yahoo Inc.
* Copyrights licensed under the Apache 2.0 License.
* See the accompanying LICENSE file for terms.
*/
package com.yahoo.squidb.processor.data;
import com.yahoo.aptutils.model.DeclaredTypeName;
/**
* Tuple class to hold logged error info, to be written by the
* {@link com.yahoo.squidb.processor.plugins.defaults.ErrorLoggingPlugin}.
*/
public final class ErrorInfo {
public final DeclaredTypeName errorClass; // The class on which to log the error
public final String element; // The specific element on which to log the error (or null/empty to log on the class)
public final String message; // The error message to log
public ErrorInfo(DeclaredTypeName errorClass, String element, String message) {
this.errorClass = errorClass;
this.element = element;
this.message = message;
}
}
| /*
* Copyright 2015, Yahoo Inc.
* Copyrights licensed under the Apache 2.0 License.
* See the accompanying LICENSE file for terms.
*/
package com.yahoo.squidb.processor.data;
import com.yahoo.aptutils.model.DeclaredTypeName;
/**
* Tuple class to hold logged error info, to be written by the
* {@link com.yahoo.squidb.processor.plugins.defaults.ErrorLoggingPlugin}.
*/
public final class ErrorInfo {
/**
* The class on which to log the error
*/
public final DeclaredTypeName errorClass;
/**
* The specific element on which to log the error (or null/empty to log on the class)
*/
public final String element;
/**
* The error message to log
*/
public final String message;
public ErrorInfo(DeclaredTypeName errorClass, String element, String message) {
this.errorClass = errorClass;
this.element = element;
this.message = message;
}
}
| Move comments to public javadocs | Move comments to public javadocs
| Java | apache-2.0 | yahoo/squidb,yahoo/squidb,yahoo/squidb,yahoo/squidb,yahoo/squidb | java | ## Code Before:
/*
* Copyright 2015, Yahoo Inc.
* Copyrights licensed under the Apache 2.0 License.
* See the accompanying LICENSE file for terms.
*/
package com.yahoo.squidb.processor.data;
import com.yahoo.aptutils.model.DeclaredTypeName;
/**
* Tuple class to hold logged error info, to be written by the
* {@link com.yahoo.squidb.processor.plugins.defaults.ErrorLoggingPlugin}.
*/
public final class ErrorInfo {
public final DeclaredTypeName errorClass; // The class on which to log the error
public final String element; // The specific element on which to log the error (or null/empty to log on the class)
public final String message; // The error message to log
public ErrorInfo(DeclaredTypeName errorClass, String element, String message) {
this.errorClass = errorClass;
this.element = element;
this.message = message;
}
}
## Instruction:
Move comments to public javadocs
## Code After:
/*
* Copyright 2015, Yahoo Inc.
* Copyrights licensed under the Apache 2.0 License.
* See the accompanying LICENSE file for terms.
*/
package com.yahoo.squidb.processor.data;
import com.yahoo.aptutils.model.DeclaredTypeName;
/**
* Tuple class to hold logged error info, to be written by the
* {@link com.yahoo.squidb.processor.plugins.defaults.ErrorLoggingPlugin}.
*/
public final class ErrorInfo {
/**
* The class on which to log the error
*/
public final DeclaredTypeName errorClass;
/**
* The specific element on which to log the error (or null/empty to log on the class)
*/
public final String element;
/**
* The error message to log
*/
public final String message;
public ErrorInfo(DeclaredTypeName errorClass, String element, String message) {
this.errorClass = errorClass;
this.element = element;
this.message = message;
}
}
|
8bbf5d0425ec5857f166a63b270dcd4c54fec5b4 | app/views/welcome/index.html.erb | app/views/welcome/index.html.erb | <div class="welcome-container">
<div class="row">
<div class="col s12"><h2>Welcome to Global Host</h2></div>
</div>
<div class="row">
<div class="col s12"><h4>Friends in far places</h4></div>
</div>
<div class="row">
<div class="col s12">
<%= render '/sessions/form' %>
</div>
</div>
<hr class=user-page-hr>
<br>
<div class="row">
<div class="col s12">
<%= link_to("Register", new_user_path, class:"waves-effect waves-light btn")%>
</div>
</div>
</div>
| <div class="welcome-container">
<div class="row">
<div class="col s12"><h2>Welcome to Global Host</h2></div>
</div>
<div class="row">
<div class="col s12"><h4>Find friends in far places</h4></div>
</div>
<div class="row">
<div class="col s12">
<%= render '/sessions/form' %>
</div>
</div>
<hr class=user-page-hr>
<br>
<div class="row">
<div class="col s12">
<div class="category-title">
Not a user?
</div>
<%= link_to("Register", new_user_path)%>
</div>
</div>
</div>
| Make register button less proiment | Make register button less proiment
| HTML+ERB | mit | Aslonski/Global-Host,Aslonski/Global-Host,Aslonski/Global-Host | html+erb | ## Code Before:
<div class="welcome-container">
<div class="row">
<div class="col s12"><h2>Welcome to Global Host</h2></div>
</div>
<div class="row">
<div class="col s12"><h4>Friends in far places</h4></div>
</div>
<div class="row">
<div class="col s12">
<%= render '/sessions/form' %>
</div>
</div>
<hr class=user-page-hr>
<br>
<div class="row">
<div class="col s12">
<%= link_to("Register", new_user_path, class:"waves-effect waves-light btn")%>
</div>
</div>
</div>
## Instruction:
Make register button less proiment
## Code After:
<div class="welcome-container">
<div class="row">
<div class="col s12"><h2>Welcome to Global Host</h2></div>
</div>
<div class="row">
<div class="col s12"><h4>Find friends in far places</h4></div>
</div>
<div class="row">
<div class="col s12">
<%= render '/sessions/form' %>
</div>
</div>
<hr class=user-page-hr>
<br>
<div class="row">
<div class="col s12">
<div class="category-title">
Not a user?
</div>
<%= link_to("Register", new_user_path)%>
</div>
</div>
</div>
|
44ae15fe9b28cf9f8d5d3a67b5fdf72f53325dce | gulp-tasks/copy.js | gulp-tasks/copy.js | /**
* External dependencies
*/
import gulp from 'gulp';
import del from 'del';
gulp.task( 'copy', () => {
del.sync( [ './release/**/*' ] );
gulp.src(
[
'readme.txt',
'google-site-kit.php',
'dist/*.js',
'dist/assets/**/*',
'bin/**/*',
'includes/**/*',
'third-party/**/*',
'!third-party/**/**/{tests,Tests,doc?(s),examples}/**/*',
'!third-party/**/**/{*.md,*.yml,phpunit.*}',
'!**/*.map',
'!bin/local-env/**/*',
'!bin/local-env/',
'!dist/admin.js',
'!dist/adminbar.js',
'!dist/wpdashboard.js',
],
{ base: '.' }
)
.pipe( gulp.dest( 'release' ) );
} );
| /**
* External dependencies
*/
import gulp from 'gulp';
import del from 'del';
gulp.task( 'copy', () => {
del.sync( [ './release/**/*' ] );
gulp.src(
[
'readme.txt',
'google-site-kit.php',
'uninstall.php',
'dist/*.js',
'dist/assets/**/*',
'bin/**/*',
'includes/**/*',
'third-party/**/*',
'!third-party/**/**/{tests,Tests,doc?(s),examples}/**/*',
'!third-party/**/**/{*.md,*.yml,phpunit.*}',
'!**/*.map',
'!bin/local-env/**/*',
'!bin/local-env/',
'!dist/admin.js',
'!dist/adminbar.js',
'!dist/wpdashboard.js',
],
{ base: '.' }
)
.pipe( gulp.dest( 'release' ) );
} );
| Update packaging script to include uninstall.php file. | Update packaging script to include uninstall.php file.
| JavaScript | apache-2.0 | google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp | javascript | ## Code Before:
/**
* External dependencies
*/
import gulp from 'gulp';
import del from 'del';
gulp.task( 'copy', () => {
del.sync( [ './release/**/*' ] );
gulp.src(
[
'readme.txt',
'google-site-kit.php',
'dist/*.js',
'dist/assets/**/*',
'bin/**/*',
'includes/**/*',
'third-party/**/*',
'!third-party/**/**/{tests,Tests,doc?(s),examples}/**/*',
'!third-party/**/**/{*.md,*.yml,phpunit.*}',
'!**/*.map',
'!bin/local-env/**/*',
'!bin/local-env/',
'!dist/admin.js',
'!dist/adminbar.js',
'!dist/wpdashboard.js',
],
{ base: '.' }
)
.pipe( gulp.dest( 'release' ) );
} );
## Instruction:
Update packaging script to include uninstall.php file.
## Code After:
/**
* External dependencies
*/
import gulp from 'gulp';
import del from 'del';
gulp.task( 'copy', () => {
del.sync( [ './release/**/*' ] );
gulp.src(
[
'readme.txt',
'google-site-kit.php',
'uninstall.php',
'dist/*.js',
'dist/assets/**/*',
'bin/**/*',
'includes/**/*',
'third-party/**/*',
'!third-party/**/**/{tests,Tests,doc?(s),examples}/**/*',
'!third-party/**/**/{*.md,*.yml,phpunit.*}',
'!**/*.map',
'!bin/local-env/**/*',
'!bin/local-env/',
'!dist/admin.js',
'!dist/adminbar.js',
'!dist/wpdashboard.js',
],
{ base: '.' }
)
.pipe( gulp.dest( 'release' ) );
} );
|
746551086a57d0c1786e5ae09a8f13f2d411a142 | README.md | README.md | <pre style="line-height:1; background-color:#FFFFFF; border-radius: 0px; border:none; padding:0">
<code style="font-family:Monospace; background-color:transparent">
_ _
| | | |
__ _____ ___ | |_ ___ ___ | |___
\ \ /\ / / _ \ / _ \| __/ _ \ / _ \| / __|
\ V V / (_) | (_) | || (_) | (_) | \__ \
\_/\_/ \___/ \___/ \__\___/ \___/|_|___/
</code>
</pre>
---
This repository host the Homebrew wooga tools tap.
### Install
To use this tap simply add it to your Homebrew installation by issuing the following command.
```bash
brew tap wooga/tools
```
### Deinstall
You can remove the tap just as easily by _untaping_ it.
```bash
brew untap wooga/tools
```
### List all available tools
In a shell run the following command to list all available wooga tools
```bash
brew search wooga/tools
```
## MIT License
Copyright (C) 2016 Wooga | <pre style="line-height:1; background-color:#FFFFFF; border-radius: 0px; border:none; padding:0">
<code style="font-family:Monospace; background-color:transparent">
_ _
| | | |
__ _____ ___ | |_ ___ ___ | |___
\ \ /\ / / _ \ / _ \| __/ _ \ / _ \| / __|
\ V V / (_) | (_) | || (_) | (_) | \__ \
\_/\_/ \___/ \___/ \__\___/ \___/|_|___/
</code>
</pre>
[](https://travis-ci.org/wooga/homebrew-tools)
---
This repository host the Homebrew wooga tools tap.
### Install
To use this tap simply add it to your Homebrew installation by issuing the following command.
```bash
brew tap wooga/tools
```
### Deinstall
You can remove the tap just as easily by _untaping_ it.
```bash
brew untap wooga/tools
```
### List all available tools
In a shell run the following command to list all available wooga tools
```bash
brew search wooga/tools
```
## MIT License
Copyright (C) 2016 Wooga | Update Readme with travis badge | Update Readme with travis badge
| Markdown | mit | wooga/homebrew-tools | markdown | ## Code Before:
<pre style="line-height:1; background-color:#FFFFFF; border-radius: 0px; border:none; padding:0">
<code style="font-family:Monospace; background-color:transparent">
_ _
| | | |
__ _____ ___ | |_ ___ ___ | |___
\ \ /\ / / _ \ / _ \| __/ _ \ / _ \| / __|
\ V V / (_) | (_) | || (_) | (_) | \__ \
\_/\_/ \___/ \___/ \__\___/ \___/|_|___/
</code>
</pre>
---
This repository host the Homebrew wooga tools tap.
### Install
To use this tap simply add it to your Homebrew installation by issuing the following command.
```bash
brew tap wooga/tools
```
### Deinstall
You can remove the tap just as easily by _untaping_ it.
```bash
brew untap wooga/tools
```
### List all available tools
In a shell run the following command to list all available wooga tools
```bash
brew search wooga/tools
```
## MIT License
Copyright (C) 2016 Wooga
## Instruction:
Update Readme with travis badge
## Code After:
<pre style="line-height:1; background-color:#FFFFFF; border-radius: 0px; border:none; padding:0">
<code style="font-family:Monospace; background-color:transparent">
_ _
| | | |
__ _____ ___ | |_ ___ ___ | |___
\ \ /\ / / _ \ / _ \| __/ _ \ / _ \| / __|
\ V V / (_) | (_) | || (_) | (_) | \__ \
\_/\_/ \___/ \___/ \__\___/ \___/|_|___/
</code>
</pre>
[](https://travis-ci.org/wooga/homebrew-tools)
---
This repository host the Homebrew wooga tools tap.
### Install
To use this tap simply add it to your Homebrew installation by issuing the following command.
```bash
brew tap wooga/tools
```
### Deinstall
You can remove the tap just as easily by _untaping_ it.
```bash
brew untap wooga/tools
```
### List all available tools
In a shell run the following command to list all available wooga tools
```bash
brew search wooga/tools
```
## MIT License
Copyright (C) 2016 Wooga |
ea37af3a71e5f218b6b38d1dba23482e1389f002 | gnu/usr.bin/binutils/gasp/Makefile | gnu/usr.bin/binutils/gasp/Makefile |
.include "../Makefile.inc0"
.PATH: ${SRCDIR}/gas
SUBDIR= doc
PROG= gasp
SRCS+= gasp.c macro.c sb.c hash.c
CFLAGS+= -I${SRCDIR}
CFLAGS+= -I${SRCDIR}/gas
CFLAGS+= -I${SRCDIR}/gas/config
CFLAGS+= -I${.CURDIR}/../as/${TARGET_ARCH}-freebsd
CFLAGS+= -DBFD_ASSEMBLER
LDADD+= -L${RELTOP}/libiberty -liberty
DPADD+= ${RELTOP}/libiberty/libiberty.a
NOMAN= 1
.include <bsd.prog.mk>
|
.include "../Makefile.inc0"
.PATH: ${SRCDIR}/gas
SUBDIR= doc
PROG= gasp
SRCS+= gasp.c macro.c sb.c hash.c
CFLAGS+= -I${SRCDIR}
CFLAGS+= -I${SRCDIR}/gas
CFLAGS+= -I${SRCDIR}/gas/config
CFLAGS+= -I${.CURDIR}/../as/${TARGET_ARCH}-freebsd
CFLAGS+= -DBFD_ASSEMBLER
LDADD+= -L${RELTOP}/libiberty -liberty
DPADD+= ${RELTOP}/libiberty/libiberty.a
.include <bsd.prog.mk>
| Add a manpage for gasp. | Add a manpage for gasp.
| unknown | bsd-3-clause | jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase | unknown | ## Code Before:
.include "../Makefile.inc0"
.PATH: ${SRCDIR}/gas
SUBDIR= doc
PROG= gasp
SRCS+= gasp.c macro.c sb.c hash.c
CFLAGS+= -I${SRCDIR}
CFLAGS+= -I${SRCDIR}/gas
CFLAGS+= -I${SRCDIR}/gas/config
CFLAGS+= -I${.CURDIR}/../as/${TARGET_ARCH}-freebsd
CFLAGS+= -DBFD_ASSEMBLER
LDADD+= -L${RELTOP}/libiberty -liberty
DPADD+= ${RELTOP}/libiberty/libiberty.a
NOMAN= 1
.include <bsd.prog.mk>
## Instruction:
Add a manpage for gasp.
## Code After:
.include "../Makefile.inc0"
.PATH: ${SRCDIR}/gas
SUBDIR= doc
PROG= gasp
SRCS+= gasp.c macro.c sb.c hash.c
CFLAGS+= -I${SRCDIR}
CFLAGS+= -I${SRCDIR}/gas
CFLAGS+= -I${SRCDIR}/gas/config
CFLAGS+= -I${.CURDIR}/../as/${TARGET_ARCH}-freebsd
CFLAGS+= -DBFD_ASSEMBLER
LDADD+= -L${RELTOP}/libiberty -liberty
DPADD+= ${RELTOP}/libiberty/libiberty.a
.include <bsd.prog.mk>
|
092bd3d506ec281a24adcecef6ca498443df5f59 | kboard/board/urls.py | kboard/board/urls.py |
from django.conf.urls import url
from . import views
app_name = 'board'
urlpatterns = [
url(r'^$', views.board_list, name='board_list'),
url(r'^(?P<board_slug>[-a-z]+)/$', views.post_list, name='post_list'),
url(r'^(?P<board_slug>[-a-z]+)/new/$', views.new_post, name='new_post'),
url(r'^(?P<post_id>\d+)/delete/$', views.delete_post, name='delete_post'),
url(r'^(?P<post_id>\d+)/$', views.view_post, name='view_post'),
url(r'^(?P<post_id>\d+)/comment/new/$', views.new_comment, name='new_comment'),
url(r'^(?P<post_id>\d+)/comment/delete/$', views.delete_comment, name='delete_comment'),
]
|
from django.conf.urls import url
from . import views
app_name = 'board'
urlpatterns = [
url(r'^$', views.board_list, name='board_list'),
url(r'^(?P<board_slug>[-a-z]+)/$', views.post_list, name='post_list'),
url(r'^(?P<board_slug>[-a-z]+)/new/$', views.new_post, name='new_post'),
url(r'^(?P<post_id>\d+)/delete/$', views.delete_post, name='delete_post'),
url(r'^(?P<post_id>\d+)/$', views.view_post, name='view_post'),
url(r'^(?P<post_id>\d+)/comment/new/$', views.new_comment, name='new_comment'),
url(r'^(?P<post_id>\d+)/comment/(?P<comment_id>\d+)/delete/$', views.delete_comment, name='delete_comment'),
]
| Add 'comment_id' parameter in 'delete_comment' url | Add 'comment_id' parameter in 'delete_comment' url
| Python | mit | hyesun03/k-board,guswnsxodlf/k-board,hyesun03/k-board,kboard/kboard,guswnsxodlf/k-board,kboard/kboard,guswnsxodlf/k-board,cjh5414/kboard,darjeeling/k-board,hyesun03/k-board,kboard/kboard,cjh5414/kboard,cjh5414/kboard | python | ## Code Before:
from django.conf.urls import url
from . import views
app_name = 'board'
urlpatterns = [
url(r'^$', views.board_list, name='board_list'),
url(r'^(?P<board_slug>[-a-z]+)/$', views.post_list, name='post_list'),
url(r'^(?P<board_slug>[-a-z]+)/new/$', views.new_post, name='new_post'),
url(r'^(?P<post_id>\d+)/delete/$', views.delete_post, name='delete_post'),
url(r'^(?P<post_id>\d+)/$', views.view_post, name='view_post'),
url(r'^(?P<post_id>\d+)/comment/new/$', views.new_comment, name='new_comment'),
url(r'^(?P<post_id>\d+)/comment/delete/$', views.delete_comment, name='delete_comment'),
]
## Instruction:
Add 'comment_id' parameter in 'delete_comment' url
## Code After:
from django.conf.urls import url
from . import views
app_name = 'board'
urlpatterns = [
url(r'^$', views.board_list, name='board_list'),
url(r'^(?P<board_slug>[-a-z]+)/$', views.post_list, name='post_list'),
url(r'^(?P<board_slug>[-a-z]+)/new/$', views.new_post, name='new_post'),
url(r'^(?P<post_id>\d+)/delete/$', views.delete_post, name='delete_post'),
url(r'^(?P<post_id>\d+)/$', views.view_post, name='view_post'),
url(r'^(?P<post_id>\d+)/comment/new/$', views.new_comment, name='new_comment'),
url(r'^(?P<post_id>\d+)/comment/(?P<comment_id>\d+)/delete/$', views.delete_comment, name='delete_comment'),
]
|
6fa2ccc5eee5e7d3fa76a989a029f4a8ba6ee0a7 | app.js | app.js | var express = require('express'), app = express(), swig = require('swig');
var bodyParser = require('body-parser');
var https = require('https'), config = require('./config');
app.engine('html', swig.renderFile);
app.set('view engine', 'html');
app.set('views', __dirname + '/pages');
app.set('view cache', false);
swig.setDefaults({ cache: false });
app.use(express.static(__dirname + '/public'));
app.use(bodyParser());
app.use(bodyParser.json({ type: 'application/vnd.api+json' }));
app.get('/', function(req, res) {
res.render('index', { 'foo': 'hi' });
});
app.post('/hook', function(req, res) {
if (req.body && req.body.after) {
console.log("checking: " + req.body.after);
var request = https.request({ 'host': 'api.github.com',
'path': '/repos/' + config.repoURL + '/status/' + req.body.after + '?access_token=' + config.githubToken,
'method': 'POST'}, function(res) {
res.on('data', function(data) {
console.log(data);
});
});
request.write(JSON.stringify({ 'state': 'pending' }));
request.end();
}
res.end();
});
app.listen(2345);
| var express = require('express'), app = express(), swig = require('swig');
var bodyParser = require('body-parser');
var https = require('https'), config = require('./config');
app.engine('html', swig.renderFile);
app.set('view engine', 'html');
app.set('views', __dirname + '/pages');
app.set('view cache', false);
swig.setDefaults({ cache: false });
app.use(express.static(__dirname + '/public'));
app.use(bodyParser());
app.use(bodyParser.json({ type: 'application/vnd.api+json' }));
app.get('/', function(req, res) {
res.render('index', { 'foo': 'hi' });
});
app.post('/hook', function(req, res) {
if (req.body && req.body.after) {
console.log("checking: " + req.body.after);
var request = https.request({ 'host': 'api.github.com',
'path': '/repos/' + config.repoURL + '/status/' + req.body.after + '?access_token=' + config.githubToken,
'method': 'POST'}, function(res) {
res.on('data', function(data) {
console.log(data.toString());
});
});
request.write(JSON.stringify({ 'state': 'pending' }));
request.end();
}
res.end();
});
app.listen(2345);
| Convert debug info to string | Convert debug info to string
| JavaScript | mit | iveysaur/PiCi | javascript | ## Code Before:
var express = require('express'), app = express(), swig = require('swig');
var bodyParser = require('body-parser');
var https = require('https'), config = require('./config');
app.engine('html', swig.renderFile);
app.set('view engine', 'html');
app.set('views', __dirname + '/pages');
app.set('view cache', false);
swig.setDefaults({ cache: false });
app.use(express.static(__dirname + '/public'));
app.use(bodyParser());
app.use(bodyParser.json({ type: 'application/vnd.api+json' }));
app.get('/', function(req, res) {
res.render('index', { 'foo': 'hi' });
});
app.post('/hook', function(req, res) {
if (req.body && req.body.after) {
console.log("checking: " + req.body.after);
var request = https.request({ 'host': 'api.github.com',
'path': '/repos/' + config.repoURL + '/status/' + req.body.after + '?access_token=' + config.githubToken,
'method': 'POST'}, function(res) {
res.on('data', function(data) {
console.log(data);
});
});
request.write(JSON.stringify({ 'state': 'pending' }));
request.end();
}
res.end();
});
app.listen(2345);
## Instruction:
Convert debug info to string
## Code After:
var express = require('express'), app = express(), swig = require('swig');
var bodyParser = require('body-parser');
var https = require('https'), config = require('./config');
app.engine('html', swig.renderFile);
app.set('view engine', 'html');
app.set('views', __dirname + '/pages');
app.set('view cache', false);
swig.setDefaults({ cache: false });
app.use(express.static(__dirname + '/public'));
app.use(bodyParser());
app.use(bodyParser.json({ type: 'application/vnd.api+json' }));
app.get('/', function(req, res) {
res.render('index', { 'foo': 'hi' });
});
app.post('/hook', function(req, res) {
if (req.body && req.body.after) {
console.log("checking: " + req.body.after);
var request = https.request({ 'host': 'api.github.com',
'path': '/repos/' + config.repoURL + '/status/' + req.body.after + '?access_token=' + config.githubToken,
'method': 'POST'}, function(res) {
res.on('data', function(data) {
console.log(data.toString());
});
});
request.write(JSON.stringify({ 'state': 'pending' }));
request.end();
}
res.end();
});
app.listen(2345);
|
0861b92137da5ba9b53a9e38892012d5bb7b2b4f | app/apps/themes/hub_theme/views/layouts/article.html.erb | app/apps/themes/hub_theme/views/layouts/article.html.erb | <!DOCTYPE html>
<html lang="en">
<head>
<!-- META SECTION -->
<title>Trenton Business Hub</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- END META SECTION -->
<script src="https://use.fontawesome.com/d41d269865.js"></script>
<%= stylesheet_link_tag theme_asset_path("css/main") %>
<%= javascript_include_tag theme_asset_path("js/main.js") %>
<%= raw the_head %>
</head>
<body>
<div class="wrap">
<div class="header"><%= render "partials/nav" %></div>
<div class="event-card-section"><%= render "partials/article" %></div>
<div class="sidebar"><%= render "partials/newsclipping" %></div>
<div class="clear"></div>
<%= render "partials/footer" %>
</div>
</body>
</html>
| <!DOCTYPE html>
<html lang="en">
<head>
<!-- META SECTION -->
<title>Trenton Business Hub</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- END META SECTION -->
<script src="https://use.fontawesome.com/d41d269865.js"></script>
<link href="https://fonts.googleapis.com/css?family=Exo:600" rel="stylesheet">
<%= stylesheet_link_tag theme_asset_path("css/main") %>
<%= javascript_include_tag theme_asset_path("js/main.js") %>
<%= raw the_head %>
</head>
<body>
<div class="wrap">
<div class="header"><%= render "partials/nav" %></div>
<div class="event-card-section"><%= render "partials/article" %></div>
<div class="sidebar"><%= render "partials/newsclipping" %></div>
<div class="clear"></div>
<%= render "partials/footer" %>
</div>
</body>
</html>
| Add Google fonts api to article layout | Add Google fonts api to article layout
| HTML+ERB | mit | jdollete/trenton-business-portal,jdollete/trenton-business-portal,jdollete/trenton-business-portal | html+erb | ## Code Before:
<!DOCTYPE html>
<html lang="en">
<head>
<!-- META SECTION -->
<title>Trenton Business Hub</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- END META SECTION -->
<script src="https://use.fontawesome.com/d41d269865.js"></script>
<%= stylesheet_link_tag theme_asset_path("css/main") %>
<%= javascript_include_tag theme_asset_path("js/main.js") %>
<%= raw the_head %>
</head>
<body>
<div class="wrap">
<div class="header"><%= render "partials/nav" %></div>
<div class="event-card-section"><%= render "partials/article" %></div>
<div class="sidebar"><%= render "partials/newsclipping" %></div>
<div class="clear"></div>
<%= render "partials/footer" %>
</div>
</body>
</html>
## Instruction:
Add Google fonts api to article layout
## Code After:
<!DOCTYPE html>
<html lang="en">
<head>
<!-- META SECTION -->
<title>Trenton Business Hub</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- END META SECTION -->
<script src="https://use.fontawesome.com/d41d269865.js"></script>
<link href="https://fonts.googleapis.com/css?family=Exo:600" rel="stylesheet">
<%= stylesheet_link_tag theme_asset_path("css/main") %>
<%= javascript_include_tag theme_asset_path("js/main.js") %>
<%= raw the_head %>
</head>
<body>
<div class="wrap">
<div class="header"><%= render "partials/nav" %></div>
<div class="event-card-section"><%= render "partials/article" %></div>
<div class="sidebar"><%= render "partials/newsclipping" %></div>
<div class="clear"></div>
<%= render "partials/footer" %>
</div>
</body>
</html>
|
2702f0df5398ef263da65a2add36cb0168edbfad | README.md | README.md |
Registration and Change submission formats can be found here:
https://github.com/praekeltfoundation/ndoh-hub/blob/develop/README.md
## Generating translations
You can run a command like this from the `config/` directory to update
the JSON files when the PO catalogs change:
```
find . -name "go-app-ussd_popi_faq.*po" -exec jspot json {} \;
```
|
Registration and Change submission formats can be found here:
https://github.com/praekeltfoundation/ndoh-hub/blob/develop/README.md
## Generating translations
You can run a command like this from the `config/` directory to update
the JSON files when the PO catalogs change:
```
find . -name "go-app-ussd_popi_faq.*po" -exec jspot json {} \;
```
## Trying out the applications
There is a docker compose setup that should allow someone to easily get all the
components up and running to be able to easily try out the USSD lines.
Requirements:
- docker
- docker-compose
- curl
- telnet
Firstly, change to the docker-compose folder and run the `up` command:
```
cd docker-compose
docker-compose up
```
Then, once all the services are up and running, run the setup script for the
initial setup of all the services:
```
./setup.sh
```
Then, you can use telnet to access the various USSD lines:
- Public USSD: `telnet localhost 9001`
Currently, only the English language is set up and working. Any other language
selections will result in an error
Example:
```
~ telnet localhost 9001
Escape character is '^]'.
Please provide "to_addr":
*120*1234#
Please provide "from_addr":
+27821234567
[Sending all messages to: *120*1234# and from: +27821234567]
Welcome to the Department of Health's MomConnect. Please select your language
1. isiZulu
2. isiXhosa
3. Afrikaans
4. English
5. Sesotho sa Leboa
6. More
``` | Update readme with how to use docker-compose setup | Update readme with how to use docker-compose setup
| Markdown | bsd-3-clause | praekeltfoundation/ndoh-jsbox,praekeltfoundation/ndoh-jsbox | markdown | ## Code Before:
Registration and Change submission formats can be found here:
https://github.com/praekeltfoundation/ndoh-hub/blob/develop/README.md
## Generating translations
You can run a command like this from the `config/` directory to update
the JSON files when the PO catalogs change:
```
find . -name "go-app-ussd_popi_faq.*po" -exec jspot json {} \;
```
## Instruction:
Update readme with how to use docker-compose setup
## Code After:
Registration and Change submission formats can be found here:
https://github.com/praekeltfoundation/ndoh-hub/blob/develop/README.md
## Generating translations
You can run a command like this from the `config/` directory to update
the JSON files when the PO catalogs change:
```
find . -name "go-app-ussd_popi_faq.*po" -exec jspot json {} \;
```
## Trying out the applications
There is a docker compose setup that should allow someone to easily get all the
components up and running to be able to easily try out the USSD lines.
Requirements:
- docker
- docker-compose
- curl
- telnet
Firstly, change to the docker-compose folder and run the `up` command:
```
cd docker-compose
docker-compose up
```
Then, once all the services are up and running, run the setup script for the
initial setup of all the services:
```
./setup.sh
```
Then, you can use telnet to access the various USSD lines:
- Public USSD: `telnet localhost 9001`
Currently, only the English language is set up and working. Any other language
selections will result in an error
Example:
```
~ telnet localhost 9001
Escape character is '^]'.
Please provide "to_addr":
*120*1234#
Please provide "from_addr":
+27821234567
[Sending all messages to: *120*1234# and from: +27821234567]
Welcome to the Department of Health's MomConnect. Please select your language
1. isiZulu
2. isiXhosa
3. Afrikaans
4. English
5. Sesotho sa Leboa
6. More
``` |
413d9a9d20e4e1c10ba9e47ab06fd2d2ffa9aed4 | lib/minitest/fivemat_plugin.rb | lib/minitest/fivemat_plugin.rb | require 'fivemat/elapsed_time'
module Minitest
class FivematReporter < Reporter
include ElapsedTime
def record(result)
if @class != result.class
if @class
print_elapsed_time(io, @class_start_time)
io.print "\n"
end
@class = result.class
@class_start_time = Time.now
io.print "#@class "
end
end
def report
super
print_elapsed_time(io, @class_start_time) if @class_start_time
end
end
def self.plugin_fivemat_init(options)
if reporter.kind_of?(CompositeReporter)
reporter.reporters.unshift(FivematReporter.new(options[:io], options))
end
end
end
| require 'fivemat/elapsed_time'
module Minitest
class FivematReporter < Reporter
include ElapsedTime
def record(result)
if defined?(@class) && @class != result.class
if @class
print_elapsed_time(io, @class_start_time)
io.print "\n"
end
@class = result.class
@class_start_time = Time.now
io.print "#@class "
end
end
def report
super
print_elapsed_time(io, @class_start_time) if defined? @class_start_time
end
end
def self.plugin_fivemat_init(options)
if reporter.kind_of?(CompositeReporter)
reporter.reporters.unshift(FivematReporter.new(options[:io], options))
end
end
end
| Fix instance variable @class not initialized warning | Fix instance variable @class not initialized warning
| Ruby | mit | tpope/fivemat | ruby | ## Code Before:
require 'fivemat/elapsed_time'
module Minitest
class FivematReporter < Reporter
include ElapsedTime
def record(result)
if @class != result.class
if @class
print_elapsed_time(io, @class_start_time)
io.print "\n"
end
@class = result.class
@class_start_time = Time.now
io.print "#@class "
end
end
def report
super
print_elapsed_time(io, @class_start_time) if @class_start_time
end
end
def self.plugin_fivemat_init(options)
if reporter.kind_of?(CompositeReporter)
reporter.reporters.unshift(FivematReporter.new(options[:io], options))
end
end
end
## Instruction:
Fix instance variable @class not initialized warning
## Code After:
require 'fivemat/elapsed_time'
module Minitest
class FivematReporter < Reporter
include ElapsedTime
def record(result)
if defined?(@class) && @class != result.class
if @class
print_elapsed_time(io, @class_start_time)
io.print "\n"
end
@class = result.class
@class_start_time = Time.now
io.print "#@class "
end
end
def report
super
print_elapsed_time(io, @class_start_time) if defined? @class_start_time
end
end
def self.plugin_fivemat_init(options)
if reporter.kind_of?(CompositeReporter)
reporter.reporters.unshift(FivematReporter.new(options[:io], options))
end
end
end
|
6abbccd2fef1ae43311bc6b22515b8984c720e34 | css/custom.css | css/custom.css | text-decoration: underline;
}
.container li a { text-decoration: underline; }
.intro-header {
-webkit-transition: background-image 2s ease-in-out;
-moz-transition: background-image 2s ease-in-out;
-ms-transition: background-image 2s ease-in-out;
-o-transition: background-image 2s ease-in-out;
transition: background-image 2s ease-in-out;
}
/**
* For tag cloud and archives
* http://blog.meinside.pe.kr/Adding-tag-cloud-and-archives-page-to-Jekyll/
*/
.tag-cloud {
list-style: none;
padding: 0;
text-align: justify;
font-size: 16px;
li {
display: inline-block;
margin: 0 12px 12px 0;
}
}
#archives {
padding: 5px;
}
.archive-group {
margin: 5px;
border-top: 1px solid #ddd;
}
.archive-item {
margin-left: 5px;
}
.post-tags {
text-align: right;
}
.navbar {
background-color: rgba(0, 0, 0, 0.3);
} | text-decoration: underline;
}
.container li a { text-decoration: underline; }
.intro-header {
-webkit-transition: background-image 2s ease-in-out;
-moz-transition: background-image 2s ease-in-out;
-ms-transition: background-image 2s ease-in-out;
-o-transition: background-image 2s ease-in-out;
transition: background-image 2s ease-in-out;
}
/**
* For tag cloud and archives
* http://blog.meinside.pe.kr/Adding-tag-cloud-and-archives-page-to-Jekyll/
*/
.tag-cloud {
list-style: none;
padding: 0;
text-align: justify;
font-size: 16px;
li {
display: inline-block;
margin: 0 12px 12px 0;
}
}
#archives {
padding: 5px;
}
.archive-group {
margin: 5px;
border-top: 1px solid #ddd;
}
.archive-item {
margin-left: 5px;
}
.post-tags {
text-align: right;
}
@media screen and (min-width: 768px) {
.navbar {
background-color: rgba(0, 0, 0, 0.3);
}
} | Fix menu on screens under 768px wide | Fix menu on screens under 768px wide
| CSS | apache-2.0 | jannecederberg/jannecederberg.github.io,jannecederberg/jannecederberg.github.io,jannecederberg/jannecederberg.github.io,jannecederberg/jannecederberg.github.io,jannecederberg/jannecederberg.github.io | css | ## Code Before:
text-decoration: underline;
}
.container li a { text-decoration: underline; }
.intro-header {
-webkit-transition: background-image 2s ease-in-out;
-moz-transition: background-image 2s ease-in-out;
-ms-transition: background-image 2s ease-in-out;
-o-transition: background-image 2s ease-in-out;
transition: background-image 2s ease-in-out;
}
/**
* For tag cloud and archives
* http://blog.meinside.pe.kr/Adding-tag-cloud-and-archives-page-to-Jekyll/
*/
.tag-cloud {
list-style: none;
padding: 0;
text-align: justify;
font-size: 16px;
li {
display: inline-block;
margin: 0 12px 12px 0;
}
}
#archives {
padding: 5px;
}
.archive-group {
margin: 5px;
border-top: 1px solid #ddd;
}
.archive-item {
margin-left: 5px;
}
.post-tags {
text-align: right;
}
.navbar {
background-color: rgba(0, 0, 0, 0.3);
}
## Instruction:
Fix menu on screens under 768px wide
## Code After:
text-decoration: underline;
}
.container li a { text-decoration: underline; }
.intro-header {
-webkit-transition: background-image 2s ease-in-out;
-moz-transition: background-image 2s ease-in-out;
-ms-transition: background-image 2s ease-in-out;
-o-transition: background-image 2s ease-in-out;
transition: background-image 2s ease-in-out;
}
/**
* For tag cloud and archives
* http://blog.meinside.pe.kr/Adding-tag-cloud-and-archives-page-to-Jekyll/
*/
.tag-cloud {
list-style: none;
padding: 0;
text-align: justify;
font-size: 16px;
li {
display: inline-block;
margin: 0 12px 12px 0;
}
}
#archives {
padding: 5px;
}
.archive-group {
margin: 5px;
border-top: 1px solid #ddd;
}
.archive-item {
margin-left: 5px;
}
.post-tags {
text-align: right;
}
@media screen and (min-width: 768px) {
.navbar {
background-color: rgba(0, 0, 0, 0.3);
}
} |
b7e78657497c9d3f9b837cdfa3f6cfac9908f53f | Hammer/Reduce.swift | Hammer/Reduce.swift | // Copyright (c) 2014 Rob Rix. All rights reserved.
/// Traverse a recursive language.
func reduce<Into, Alphabet>(language: Language<Alphabet>, initial: Into, combine: (Into, Language<Alphabet>) -> Into) -> Into {
var memo = Dictionary<Language<Alphabet>, Into>()
return _reduce(memo, language, initial, combine)
}
func _reduce<Into, Alphabet>(var memo: Dictionary<Language<Alphabet>, Into>, language: Language<Alphabet>, initial: Into, combine: (Into, Language<Alphabet>) -> Into) -> Into {
if let cached = memo[language] { return cached }
memo[language] = initial
var into = combine(initial, language)
memo[language] = into
switch language {
case .Empty:
fallthrough
case .Null:
fallthrough
case .Literal:
break
case let .Alternation(left, right):
into = _reduce(memo, left, into, combine)
into = _reduce(memo, right, into, combine)
case let .Concatenation(first, second):
into = _reduce(memo, first, into, combine)
into = _reduce(memo, second, into, combine)
case let .Repetition(language):
into = _reduce(memo, language, into, combine)
case let .Reduction(language, _):
into = _reduce(memo, language, into, combine)
}
return into
}
| // Copyright (c) 2014 Rob Rix. All rights reserved.
/// Traverse a recursive language.
extension Language : Testable {
func reduce<Into>(initial: Into, combine: (Into, Language<Alphabet>) -> Into) -> Into {
var memo = Dictionary<Language<Alphabet>, Into>()
return _reduce(memo, self, initial, combine)
}
}
func _reduce<Into, Alphabet>(var memo: Dictionary<Language<Alphabet>, Into>, language: Language<Alphabet>, initial: Into, combine: (Into, Language<Alphabet>) -> Into) -> Into {
if let cached = memo[language] { return cached }
memo[language] = initial
var into = combine(initial, language)
memo[language] = into
switch language {
case .Empty:
fallthrough
case .Null:
fallthrough
case .Literal:
break
case let .Alternation(left, right):
into = _reduce(memo, left, into, combine)
into = _reduce(memo, right, into, combine)
case let .Concatenation(first, second):
into = _reduce(memo, first, into, combine)
into = _reduce(memo, second, into, combine)
case let .Repetition(language):
into = _reduce(memo, language, into, combine)
case let .Reduction(language, _):
into = _reduce(memo, language, into, combine)
}
return into
}
| Move reduce into the Language type. | Move reduce into the Language type.
| Swift | mit | robrix/Hammer.swift,robrix/Hammer.swift | swift | ## Code Before:
// Copyright (c) 2014 Rob Rix. All rights reserved.
/// Traverse a recursive language.
func reduce<Into, Alphabet>(language: Language<Alphabet>, initial: Into, combine: (Into, Language<Alphabet>) -> Into) -> Into {
var memo = Dictionary<Language<Alphabet>, Into>()
return _reduce(memo, language, initial, combine)
}
func _reduce<Into, Alphabet>(var memo: Dictionary<Language<Alphabet>, Into>, language: Language<Alphabet>, initial: Into, combine: (Into, Language<Alphabet>) -> Into) -> Into {
if let cached = memo[language] { return cached }
memo[language] = initial
var into = combine(initial, language)
memo[language] = into
switch language {
case .Empty:
fallthrough
case .Null:
fallthrough
case .Literal:
break
case let .Alternation(left, right):
into = _reduce(memo, left, into, combine)
into = _reduce(memo, right, into, combine)
case let .Concatenation(first, second):
into = _reduce(memo, first, into, combine)
into = _reduce(memo, second, into, combine)
case let .Repetition(language):
into = _reduce(memo, language, into, combine)
case let .Reduction(language, _):
into = _reduce(memo, language, into, combine)
}
return into
}
## Instruction:
Move reduce into the Language type.
## Code After:
// Copyright (c) 2014 Rob Rix. All rights reserved.
/// Traverse a recursive language.
extension Language : Testable {
func reduce<Into>(initial: Into, combine: (Into, Language<Alphabet>) -> Into) -> Into {
var memo = Dictionary<Language<Alphabet>, Into>()
return _reduce(memo, self, initial, combine)
}
}
func _reduce<Into, Alphabet>(var memo: Dictionary<Language<Alphabet>, Into>, language: Language<Alphabet>, initial: Into, combine: (Into, Language<Alphabet>) -> Into) -> Into {
if let cached = memo[language] { return cached }
memo[language] = initial
var into = combine(initial, language)
memo[language] = into
switch language {
case .Empty:
fallthrough
case .Null:
fallthrough
case .Literal:
break
case let .Alternation(left, right):
into = _reduce(memo, left, into, combine)
into = _reduce(memo, right, into, combine)
case let .Concatenation(first, second):
into = _reduce(memo, first, into, combine)
into = _reduce(memo, second, into, combine)
case let .Repetition(language):
into = _reduce(memo, language, into, combine)
case let .Reduction(language, _):
into = _reduce(memo, language, into, combine)
}
return into
}
|
e94ff44b23f74fe86edb0bf04d5b2d7b65de965a | README.rdoc | README.rdoc | = SuperSettings
This project rocks and uses MIT-LICENSE. | = SuperSettings {<img src="https://travis-ci.org/sidapa/super_settings.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/sidapa/super_settings]
This project rocks and uses MIT-LICENSE. | Add build status badge to readme | Add build status badge to readme
| RDoc | mit | sidapa/super_settings | rdoc | ## Code Before:
= SuperSettings
This project rocks and uses MIT-LICENSE.
## Instruction:
Add build status badge to readme
## Code After:
= SuperSettings {<img src="https://travis-ci.org/sidapa/super_settings.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/sidapa/super_settings]
This project rocks and uses MIT-LICENSE. |
a8828ce67e0a3547d76492ee51757c3c04d78336 | app/lib/userstatus.js | app/lib/userstatus.js | // SERVER: Listen for events
if(Meteor.isServer) {
// listen for user logout events, call the clearAssignments server method
UserStatus.events.on("connectionLogout", function(fields){
//console.log("Logout Event");
//console.log(fields.userId);
Meteor.call('clearAssignments', Meteor.users.findOne({_id: fields.userId}));
});
// listen for user idle events, for now do nothing but in the future maybe logout
UserStatus.events.on("connectionIdle", function(fields){
//console.log("Idle Event");
//console.log(fields.userId);
//Meteor.call('logoutUser', Meteor.users.findOne({_id: fields.userId}));
});
}
// CLIENT: Start idle monitor
if(Meteor.isClient) {
try {
UserStatus.startMonitor({
threshold: 300000,
idleOnBlur: false
});
}
// not ideal but sometimes startMonitor throws a sync error
catch (e) {}
}
| // SERVER: Listen for events
if(Meteor.isServer) {
// listen for user logout events, call the clearAssignments server method
UserStatus.events.on("connectionLogout", function(fields){
//console.log("Logout Event");
//console.log(fields.userId);
Meteor.call('clearAssignments', Meteor.users.findOne({_id: fields.userId}));
});
// listen for user idle events, for now do nothing but in the future maybe logout
UserStatus.events.on("connectionIdle", function(fields){
//console.log("Idle Event");
//console.log(fields.userId);
//Meteor.call('logoutUser', Meteor.users.findOne({_id: fields.userId}));
});
}
// CLIENT: Start idle monitor
if(Meteor.isClient) {
try {
UserStatus.startMonitor({
// idle after five minutes, do not count blurring the window as idle
threshold: 300000,
idleOnBlur: false
});
}
// not ideal but sometimes startMonitor throws a sync error
catch (e) {}
}
| Add comment for user idle | Add comment for user idle
| JavaScript | mit | wtwalsh/nexq,wtwalsh/nexq | javascript | ## Code Before:
// SERVER: Listen for events
if(Meteor.isServer) {
// listen for user logout events, call the clearAssignments server method
UserStatus.events.on("connectionLogout", function(fields){
//console.log("Logout Event");
//console.log(fields.userId);
Meteor.call('clearAssignments', Meteor.users.findOne({_id: fields.userId}));
});
// listen for user idle events, for now do nothing but in the future maybe logout
UserStatus.events.on("connectionIdle", function(fields){
//console.log("Idle Event");
//console.log(fields.userId);
//Meteor.call('logoutUser', Meteor.users.findOne({_id: fields.userId}));
});
}
// CLIENT: Start idle monitor
if(Meteor.isClient) {
try {
UserStatus.startMonitor({
threshold: 300000,
idleOnBlur: false
});
}
// not ideal but sometimes startMonitor throws a sync error
catch (e) {}
}
## Instruction:
Add comment for user idle
## Code After:
// SERVER: Listen for events
if(Meteor.isServer) {
// listen for user logout events, call the clearAssignments server method
UserStatus.events.on("connectionLogout", function(fields){
//console.log("Logout Event");
//console.log(fields.userId);
Meteor.call('clearAssignments', Meteor.users.findOne({_id: fields.userId}));
});
// listen for user idle events, for now do nothing but in the future maybe logout
UserStatus.events.on("connectionIdle", function(fields){
//console.log("Idle Event");
//console.log(fields.userId);
//Meteor.call('logoutUser', Meteor.users.findOne({_id: fields.userId}));
});
}
// CLIENT: Start idle monitor
if(Meteor.isClient) {
try {
UserStatus.startMonitor({
// idle after five minutes, do not count blurring the window as idle
threshold: 300000,
idleOnBlur: false
});
}
// not ideal but sometimes startMonitor throws a sync error
catch (e) {}
}
|
f16f9e8c7c46d2b8db129d31de1d69a3c306dec6 | Http/routes.php | Http/routes.php | <?php
Route::group(['prefix' => Config::get('core::core.admin-prefix'), 'namespace' => 'Modules\Workshop\Http\Controllers'],
function () {
Route::get('modules', ['as' => 'dashboard.modules.index', 'uses' => 'ModulesController@index']);
Route::post('modules', ['as' => 'dashboard.modules.store', 'uses' => 'ModulesController@store']);
# Workbench
Route::get('workbench', ['as' => 'dashboard.workbench.index', 'uses' => 'WorkbenchController@index']);
Route::post('generate', ['as' => 'dashboard.workbench.generate.index', 'uses' => 'WorkbenchController@generate']);
Route::post('migrate', ['as' => 'dashboard.workbench.migrate.index', 'uses' => 'WorkbenchController@migrate']);
Route::post('install', ['as' => 'dashboard.workbench.install.index', 'uses' => 'WorkbenchController@install']);
Route::post('seed', ['as' => 'dashboard.workbench.seed.index', 'uses' => 'WorkbenchController@seed']);
}
); | <?php
Route::group(['prefix' => LaravelLocalization::setLocale(), 'before' => 'LaravelLocalizationRedirectFilter'], function()
{
Route::group(['prefix' => Config::get('core::core.admin-prefix'), 'namespace' => 'Modules\Workshop\Http\Controllers'],
function () {
Route::get('modules', ['as' => 'dashboard.modules.index', 'uses' => 'ModulesController@index']);
Route::post('modules', ['as' => 'dashboard.modules.store', 'uses' => 'ModulesController@store']);
# Workbench
Route::get('workbench', ['as' => 'dashboard.workbench.index', 'uses' => 'WorkbenchController@index']);
Route::post('generate', ['as' => 'dashboard.workbench.generate.index', 'uses' => 'WorkbenchController@generate']);
Route::post('migrate', ['as' => 'dashboard.workbench.migrate.index', 'uses' => 'WorkbenchController@migrate']);
Route::post('install', ['as' => 'dashboard.workbench.install.index', 'uses' => 'WorkbenchController@install']);
Route::post('seed', ['as' => 'dashboard.workbench.seed.index', 'uses' => 'WorkbenchController@seed']);
}
);
});
| Add i18n route and route filter | Add i18n route and route filter
| PHP | mit | oimken/Workshop,oimken/Workshop,AsgardCms/Workshop,AsgardCms/Workshop,bitsoflove/Workshop,Erocanti/Workshop,ruscon/Workshop | php | ## Code Before:
<?php
Route::group(['prefix' => Config::get('core::core.admin-prefix'), 'namespace' => 'Modules\Workshop\Http\Controllers'],
function () {
Route::get('modules', ['as' => 'dashboard.modules.index', 'uses' => 'ModulesController@index']);
Route::post('modules', ['as' => 'dashboard.modules.store', 'uses' => 'ModulesController@store']);
# Workbench
Route::get('workbench', ['as' => 'dashboard.workbench.index', 'uses' => 'WorkbenchController@index']);
Route::post('generate', ['as' => 'dashboard.workbench.generate.index', 'uses' => 'WorkbenchController@generate']);
Route::post('migrate', ['as' => 'dashboard.workbench.migrate.index', 'uses' => 'WorkbenchController@migrate']);
Route::post('install', ['as' => 'dashboard.workbench.install.index', 'uses' => 'WorkbenchController@install']);
Route::post('seed', ['as' => 'dashboard.workbench.seed.index', 'uses' => 'WorkbenchController@seed']);
}
);
## Instruction:
Add i18n route and route filter
## Code After:
<?php
Route::group(['prefix' => LaravelLocalization::setLocale(), 'before' => 'LaravelLocalizationRedirectFilter'], function()
{
Route::group(['prefix' => Config::get('core::core.admin-prefix'), 'namespace' => 'Modules\Workshop\Http\Controllers'],
function () {
Route::get('modules', ['as' => 'dashboard.modules.index', 'uses' => 'ModulesController@index']);
Route::post('modules', ['as' => 'dashboard.modules.store', 'uses' => 'ModulesController@store']);
# Workbench
Route::get('workbench', ['as' => 'dashboard.workbench.index', 'uses' => 'WorkbenchController@index']);
Route::post('generate', ['as' => 'dashboard.workbench.generate.index', 'uses' => 'WorkbenchController@generate']);
Route::post('migrate', ['as' => 'dashboard.workbench.migrate.index', 'uses' => 'WorkbenchController@migrate']);
Route::post('install', ['as' => 'dashboard.workbench.install.index', 'uses' => 'WorkbenchController@install']);
Route::post('seed', ['as' => 'dashboard.workbench.seed.index', 'uses' => 'WorkbenchController@seed']);
}
);
});
|
a2cfed4a0dd1fdac6e319cb487cdfd77719baff1 | app/models/uploaded_file.rb | app/models/uploaded_file.rb | require "flex_deployment_client/middleware/uploaded_file_middleware"
require "flex_deployment_client/requestor/uploaded_file_requestor"
module FlexDeploymentClient
class UploadedFile < ModelBase
def file=(value)
if value=~/^file:\/\//
filename = value.match(/^file:\/\/(.*)$/)[1]
mime_type = MIME::Types.type_for(filename).first.content_type
bin_data = File.open(filename, 'rb') {|f| f.read }
super("data:#{mime_type};base64,#{Base64.encode64(bin_data)}")
elsif value=~/^http(s?):\/\//
self.file_url = value
else
super
end
end
def self.upload(attributes)
parser.parse(self, connection.run(:post, table_name, { data: { type: :uploaded_files, attributes: attributes } }, custom_headers.merge({ "Content-Type": "multipart/form-data" }))).first
end
end
end | require "flex_deployment_client/middleware/uploaded_file_middleware"
require "flex_deployment_client/requestor/uploaded_file_requestor"
module FlexDeploymentClient
class UploadedFile < ModelBase
def file=(value)
if value=~/^file:\/\//
filename = value.match(/^file:\/\/(.*)$/)[1]
mime_type = MIME::Types.type_for(filename).first.content_type
bin_data = File.open(filename, 'rb') {|f| f.read }
super("data:#{mime_type};base64,#{Base64.encode64(bin_data)}")
elsif value=~/^http(s?):\/\//
self.file_url = value
else
super
end
end
def self.upload(attributes)
parser.parse(self, connection.run(:post, table_name, { data: { type: :uploaded_files, attributes: attributes } }, custom_headers.merge({ "Content-Type": "application/vnd.api+json" }))).first
end
end
end | Update upload request Content-Type header from multipart/form-data to application/vnd.api+json | Update upload request Content-Type header from multipart/form-data to application/vnd.api+json
| Ruby | mit | flex-commerce/flex_deployment_client,flex-commerce/flex_deployment_client | ruby | ## Code Before:
require "flex_deployment_client/middleware/uploaded_file_middleware"
require "flex_deployment_client/requestor/uploaded_file_requestor"
module FlexDeploymentClient
class UploadedFile < ModelBase
def file=(value)
if value=~/^file:\/\//
filename = value.match(/^file:\/\/(.*)$/)[1]
mime_type = MIME::Types.type_for(filename).first.content_type
bin_data = File.open(filename, 'rb') {|f| f.read }
super("data:#{mime_type};base64,#{Base64.encode64(bin_data)}")
elsif value=~/^http(s?):\/\//
self.file_url = value
else
super
end
end
def self.upload(attributes)
parser.parse(self, connection.run(:post, table_name, { data: { type: :uploaded_files, attributes: attributes } }, custom_headers.merge({ "Content-Type": "multipart/form-data" }))).first
end
end
end
## Instruction:
Update upload request Content-Type header from multipart/form-data to application/vnd.api+json
## Code After:
require "flex_deployment_client/middleware/uploaded_file_middleware"
require "flex_deployment_client/requestor/uploaded_file_requestor"
module FlexDeploymentClient
class UploadedFile < ModelBase
def file=(value)
if value=~/^file:\/\//
filename = value.match(/^file:\/\/(.*)$/)[1]
mime_type = MIME::Types.type_for(filename).first.content_type
bin_data = File.open(filename, 'rb') {|f| f.read }
super("data:#{mime_type};base64,#{Base64.encode64(bin_data)}")
elsif value=~/^http(s?):\/\//
self.file_url = value
else
super
end
end
def self.upload(attributes)
parser.parse(self, connection.run(:post, table_name, { data: { type: :uploaded_files, attributes: attributes } }, custom_headers.merge({ "Content-Type": "application/vnd.api+json" }))).first
end
end
end |
4eedd9650715409c434f72a4edf07f30f241c0b1 | iOS/Article/OpenInSafariActivity.swift | iOS/Article/OpenInSafariActivity.swift | //
// OpenInSafariActivity.swift
// NetNewsWire-iOS
//
// Created by Maurice Parker on 1/9/20.
// Copyright © 2020 Ranchero Software. All rights reserved.
//
import UIKit
class OpenInSafariActivity: UIActivity {
private var activityItems: [Any]?
override var activityTitle: String? {
return NSLocalizedString("Open in Safari", comment: "Open in Safari")
}
override var activityImage: UIImage? {
return UIImage(systemName: "safari", withConfiguration: UIImage.SymbolConfiguration(pointSize: 20, weight: .regular))
}
override var activityType: UIActivity.ActivityType? {
return UIActivity.ActivityType(rawValue: "com.rancharo.NetNewsWire-Evergreen.safari")
}
override class var activityCategory: UIActivity.Category {
return .action
}
override func canPerform(withActivityItems activityItems: [Any]) -> Bool {
return true
}
override func prepare(withActivityItems activityItems: [Any]) {
self.activityItems = activityItems
}
override func perform() {
guard let url = activityItems?.first as? URL else { return }
UIApplication.shared.open(url, options: [:], completionHandler: nil)
activityDidFinish(true)
}
}
| //
// OpenInSafariActivity.swift
// NetNewsWire-iOS
//
// Created by Maurice Parker on 1/9/20.
// Copyright © 2020 Ranchero Software. All rights reserved.
//
import UIKit
class OpenInSafariActivity: UIActivity {
private var activityItems: [Any]?
override var activityTitle: String? {
return NSLocalizedString("Open in Safari", comment: "Open in Safari")
}
override var activityImage: UIImage? {
return UIImage(systemName: "safari", withConfiguration: UIImage.SymbolConfiguration(pointSize: 20, weight: .regular))
}
override var activityType: UIActivity.ActivityType? {
return UIActivity.ActivityType(rawValue: "com.rancharo.NetNewsWire-Evergreen.safari")
}
override class var activityCategory: UIActivity.Category {
return .action
}
override func canPerform(withActivityItems activityItems: [Any]) -> Bool {
return true
}
override func prepare(withActivityItems activityItems: [Any]) {
self.activityItems = activityItems
}
override func perform() {
guard let url = activityItems?.firstElementPassingTest({ $0 is URL }) as? URL else {
activityDidFinish(false)
return
}
UIApplication.shared.open(url, options: [:], completionHandler: nil)
activityDidFinish(true)
}
}
| Fix regression that prevented Safari from opening from Activity dialog. | Fix regression that prevented Safari from opening from Activity dialog.
| Swift | mit | brentsimmons/Evergreen,brentsimmons/Evergreen,brentsimmons/Evergreen,brentsimmons/Evergreen | swift | ## Code Before:
//
// OpenInSafariActivity.swift
// NetNewsWire-iOS
//
// Created by Maurice Parker on 1/9/20.
// Copyright © 2020 Ranchero Software. All rights reserved.
//
import UIKit
class OpenInSafariActivity: UIActivity {
private var activityItems: [Any]?
override var activityTitle: String? {
return NSLocalizedString("Open in Safari", comment: "Open in Safari")
}
override var activityImage: UIImage? {
return UIImage(systemName: "safari", withConfiguration: UIImage.SymbolConfiguration(pointSize: 20, weight: .regular))
}
override var activityType: UIActivity.ActivityType? {
return UIActivity.ActivityType(rawValue: "com.rancharo.NetNewsWire-Evergreen.safari")
}
override class var activityCategory: UIActivity.Category {
return .action
}
override func canPerform(withActivityItems activityItems: [Any]) -> Bool {
return true
}
override func prepare(withActivityItems activityItems: [Any]) {
self.activityItems = activityItems
}
override func perform() {
guard let url = activityItems?.first as? URL else { return }
UIApplication.shared.open(url, options: [:], completionHandler: nil)
activityDidFinish(true)
}
}
## Instruction:
Fix regression that prevented Safari from opening from Activity dialog.
## Code After:
//
// OpenInSafariActivity.swift
// NetNewsWire-iOS
//
// Created by Maurice Parker on 1/9/20.
// Copyright © 2020 Ranchero Software. All rights reserved.
//
import UIKit
class OpenInSafariActivity: UIActivity {
private var activityItems: [Any]?
override var activityTitle: String? {
return NSLocalizedString("Open in Safari", comment: "Open in Safari")
}
override var activityImage: UIImage? {
return UIImage(systemName: "safari", withConfiguration: UIImage.SymbolConfiguration(pointSize: 20, weight: .regular))
}
override var activityType: UIActivity.ActivityType? {
return UIActivity.ActivityType(rawValue: "com.rancharo.NetNewsWire-Evergreen.safari")
}
override class var activityCategory: UIActivity.Category {
return .action
}
override func canPerform(withActivityItems activityItems: [Any]) -> Bool {
return true
}
override func prepare(withActivityItems activityItems: [Any]) {
self.activityItems = activityItems
}
override func perform() {
guard let url = activityItems?.firstElementPassingTest({ $0 is URL }) as? URL else {
activityDidFinish(false)
return
}
UIApplication.shared.open(url, options: [:], completionHandler: nil)
activityDidFinish(true)
}
}
|
42e556a64dc15254fdf22528938516f1dbe12043 | README.md | README.md |
Easily tap into a pipeline.
## Uses
Some filters like `gulp-coffee` process all files. What if you want to process
all JS and Coffee files in a single pipeline. Use tap to filter out '.coffee'
files and process them through coffee filter and let JavaScript files passthrough.
gulp.src("src/**/*.{coffee,js}")
.pipe(tap(function(file, t) {
if (path.extname(file.path) === '.coffee') {
return t.through(coffee, []);
}
}))
.pipe(gulp.dest('build'));
What if you want to change content like add a header? No need for a separate
filter, just chage the content.
tap(function(file) {
file.contents = Buffer.concat([
new Buffer('HEADER'),
file.contents
]);
});
If you do not return a stream, tap forwards your changes.
## License
The MIT License (MIT)
|
Easily tap into a pipeline.
## Uses
Some filters like `gulp-coffee` process all files. What if you want to process
all JS and Coffee files in a single pipeline. Use `tap` to filter out `.coffee`
files and process them through the `coffee` filter and let JavaScript files
pass through.
```js
gulp.src("src/**/*.{coffee,js}")
.pipe(tap(function(file, t) {
if (path.extname(file.path) === '.coffee') {
return t.through(coffee, []);
}
}))
.pipe(gulp.dest('build'));
```
What if you want to change content like add a header? No need for a separate
filter, just change the content.
```js
tap(function(file) {
file.contents = Buffer.concat([
new Buffer('HEADER'),
file.contents
]);
});
```
If you do not return a stream, tap forwards your changes.
## License
The MIT License (MIT)
| Fix typos, grammar, and formatting in readme | Fix typos, grammar, and formatting in readme
Formatting changes only include converting two code blocks from indented to fenced with explicit JS syntax highlighting. | Markdown | mit | geejs/gulp-tap | markdown | ## Code Before:
Easily tap into a pipeline.
## Uses
Some filters like `gulp-coffee` process all files. What if you want to process
all JS and Coffee files in a single pipeline. Use tap to filter out '.coffee'
files and process them through coffee filter and let JavaScript files passthrough.
gulp.src("src/**/*.{coffee,js}")
.pipe(tap(function(file, t) {
if (path.extname(file.path) === '.coffee') {
return t.through(coffee, []);
}
}))
.pipe(gulp.dest('build'));
What if you want to change content like add a header? No need for a separate
filter, just chage the content.
tap(function(file) {
file.contents = Buffer.concat([
new Buffer('HEADER'),
file.contents
]);
});
If you do not return a stream, tap forwards your changes.
## License
The MIT License (MIT)
## Instruction:
Fix typos, grammar, and formatting in readme
Formatting changes only include converting two code blocks from indented to fenced with explicit JS syntax highlighting.
## Code After:
Easily tap into a pipeline.
## Uses
Some filters like `gulp-coffee` process all files. What if you want to process
all JS and Coffee files in a single pipeline. Use `tap` to filter out `.coffee`
files and process them through the `coffee` filter and let JavaScript files
pass through.
```js
gulp.src("src/**/*.{coffee,js}")
.pipe(tap(function(file, t) {
if (path.extname(file.path) === '.coffee') {
return t.through(coffee, []);
}
}))
.pipe(gulp.dest('build'));
```
What if you want to change content like add a header? No need for a separate
filter, just change the content.
```js
tap(function(file) {
file.contents = Buffer.concat([
new Buffer('HEADER'),
file.contents
]);
});
```
If you do not return a stream, tap forwards your changes.
## License
The MIT License (MIT)
|
21882ab7a21eb17f0d23d2d2459fdb3c6e787322 | libpkg/pkg_util.h | libpkg/pkg_util.h |
struct array {
size_t cap;
size_t len;
void **data;
};
#define STARTS_WITH(string, needle) (strncasecmp(string, needle, strlen(needle)) == 0)
#define ERROR_SQLITE(db) \
EMIT_PKG_ERROR("sqlite: %s", sqlite3_errmsg(db))
int sbuf_set(struct sbuf **, const char *);
const char * sbuf_get(struct sbuf *);
void sbuf_reset(struct sbuf *);
void sbuf_free(struct sbuf *);
int mkdirs(const char *path);
int file_to_buffer(const char *, char **, off_t *);
int format_exec_cmd(char **, const char *, const char *, const char *);
int split_chr(char *, char);
int file_fetch(const char *, const char *);
int is_dir(const char *);
int is_conf_file(const char *path, char newpath[MAXPATHLEN]);
int sha256_file(const char *, char[65]);
void sha256_str(const char *, char[65]);
#endif
| EMIT_PKG_ERROR("sqlite: %s", sqlite3_errmsg(db))
int sbuf_set(struct sbuf **, const char *);
const char * sbuf_get(struct sbuf *);
void sbuf_reset(struct sbuf *);
void sbuf_free(struct sbuf *);
int mkdirs(const char *path);
int file_to_buffer(const char *, char **, off_t *);
int format_exec_cmd(char **, const char *, const char *, const char *);
int split_chr(char *, char);
int file_fetch(const char *, const char *);
int is_dir(const char *);
int is_conf_file(const char *path, char newpath[MAXPATHLEN]);
int sha256_file(const char *, char[65]);
void sha256_str(const char *, char[65]);
#endif
| Remove last occurences of the dead struct array | Remove last occurences of the dead struct array
| C | bsd-2-clause | en90/pkg,khorben/pkg,en90/pkg,khorben/pkg,Open343/pkg,skoef/pkg,Open343/pkg,skoef/pkg,junovitch/pkg,junovitch/pkg,khorben/pkg | c | ## Code Before:
struct array {
size_t cap;
size_t len;
void **data;
};
#define STARTS_WITH(string, needle) (strncasecmp(string, needle, strlen(needle)) == 0)
#define ERROR_SQLITE(db) \
EMIT_PKG_ERROR("sqlite: %s", sqlite3_errmsg(db))
int sbuf_set(struct sbuf **, const char *);
const char * sbuf_get(struct sbuf *);
void sbuf_reset(struct sbuf *);
void sbuf_free(struct sbuf *);
int mkdirs(const char *path);
int file_to_buffer(const char *, char **, off_t *);
int format_exec_cmd(char **, const char *, const char *, const char *);
int split_chr(char *, char);
int file_fetch(const char *, const char *);
int is_dir(const char *);
int is_conf_file(const char *path, char newpath[MAXPATHLEN]);
int sha256_file(const char *, char[65]);
void sha256_str(const char *, char[65]);
#endif
## Instruction:
Remove last occurences of the dead struct array
## Code After:
EMIT_PKG_ERROR("sqlite: %s", sqlite3_errmsg(db))
int sbuf_set(struct sbuf **, const char *);
const char * sbuf_get(struct sbuf *);
void sbuf_reset(struct sbuf *);
void sbuf_free(struct sbuf *);
int mkdirs(const char *path);
int file_to_buffer(const char *, char **, off_t *);
int format_exec_cmd(char **, const char *, const char *, const char *);
int split_chr(char *, char);
int file_fetch(const char *, const char *);
int is_dir(const char *);
int is_conf_file(const char *path, char newpath[MAXPATHLEN]);
int sha256_file(const char *, char[65]);
void sha256_str(const char *, char[65]);
#endif
|
b8d744237aebf359ad5c26b51c5b10bbb35d51e0 | rat-excludes.txt | rat-excludes.txt | rat-excludes.txt
.*
.*/**
CODE_OF_CONDUCT.md
CONTRIBUTING.md
eclipse.md
PULL_REQUEST_TEMPLATE.md
README.md
**/*.jmx
bin/*.csv
bin/*.xml
bin/*.jtl
bin/examples/**
bin/report-output/**
bin/report-template/**
bin/testfiles/**
build/**
build-local.properties
docs/**
extras/*.txt
extras/*.json
**/images/**
lib/aareadme.txt
lib/opt/**
licenses/bin/**
licenses/src/**
local/**
printable_docs/**
reports/**
res/META-INF/jmeter_as_ascii_art.txt
src/core/org/apache/jmeter/help.txt
test/resources/**
**/*.log
**/download_jmeter.cgi
| rat-excludes.txt
.*
.*/**
CODE_OF_CONDUCT.md
CONTRIBUTING.md
eclipse.md
PULL_REQUEST_TEMPLATE.md
README.md
**/*.jmx
bin/*.csv
bin/*.xml
bin/*.jtl
bin/examples/**
bin/report-output/**
bin/report-template/**
bin/testfiles/**
build/**
build-local.properties
dist/*.md5
dist/*.sha512
docs/**
extras/*.txt
extras/*.json
**/images/**
lib/aareadme.txt
lib/opt/**
licenses/bin/**
licenses/src/**
local/**
printable_docs/**
reports/**
res/META-INF/jmeter_as_ascii_art.txt
src/core/org/apache/jmeter/help.txt
test/resources/**
**/*.log
**/download_jmeter.cgi
| Exclude hashsum-files from dist folder for rat | Exclude hashsum-files from dist folder for rat
git-svn-id: https://svn.apache.org/repos/asf/jmeter/trunk@1818470 13f79535-47bb-0310-9956-ffa450edef68
Former-commit-id: be6f0f7e75ea1b0a73e863bbfca1f62561b1aad9 | Text | apache-2.0 | benbenw/jmeter,etnetera/jmeter,ham1/jmeter,apache/jmeter,benbenw/jmeter,ham1/jmeter,etnetera/jmeter,etnetera/jmeter,etnetera/jmeter,ham1/jmeter,benbenw/jmeter,apache/jmeter,ham1/jmeter,etnetera/jmeter,apache/jmeter,ham1/jmeter,apache/jmeter,apache/jmeter,benbenw/jmeter | text | ## Code Before:
rat-excludes.txt
.*
.*/**
CODE_OF_CONDUCT.md
CONTRIBUTING.md
eclipse.md
PULL_REQUEST_TEMPLATE.md
README.md
**/*.jmx
bin/*.csv
bin/*.xml
bin/*.jtl
bin/examples/**
bin/report-output/**
bin/report-template/**
bin/testfiles/**
build/**
build-local.properties
docs/**
extras/*.txt
extras/*.json
**/images/**
lib/aareadme.txt
lib/opt/**
licenses/bin/**
licenses/src/**
local/**
printable_docs/**
reports/**
res/META-INF/jmeter_as_ascii_art.txt
src/core/org/apache/jmeter/help.txt
test/resources/**
**/*.log
**/download_jmeter.cgi
## Instruction:
Exclude hashsum-files from dist folder for rat
git-svn-id: https://svn.apache.org/repos/asf/jmeter/trunk@1818470 13f79535-47bb-0310-9956-ffa450edef68
Former-commit-id: be6f0f7e75ea1b0a73e863bbfca1f62561b1aad9
## Code After:
rat-excludes.txt
.*
.*/**
CODE_OF_CONDUCT.md
CONTRIBUTING.md
eclipse.md
PULL_REQUEST_TEMPLATE.md
README.md
**/*.jmx
bin/*.csv
bin/*.xml
bin/*.jtl
bin/examples/**
bin/report-output/**
bin/report-template/**
bin/testfiles/**
build/**
build-local.properties
dist/*.md5
dist/*.sha512
docs/**
extras/*.txt
extras/*.json
**/images/**
lib/aareadme.txt
lib/opt/**
licenses/bin/**
licenses/src/**
local/**
printable_docs/**
reports/**
res/META-INF/jmeter_as_ascii_art.txt
src/core/org/apache/jmeter/help.txt
test/resources/**
**/*.log
**/download_jmeter.cgi
|
eb44002a5429834ab9a2fb51c14a3847362cbd4c | cmd/edgectl/notify.go | cmd/edgectl/notify.go | package main
import (
"fmt"
"runtime"
"github.com/datawire/ambassador/pkg/supervisor"
)
var notifyRAI *RunAsInfo
// Notify displays a desktop banner notification to the user
func Notify(p *supervisor.Process, message string) {
if notifyRAI == nil {
var err error
notifyRAI, err = GuessRunAsInfo(p)
if err != nil {
p.Log(err)
notifyRAI = &RunAsInfo{}
}
}
var args []string
switch runtime.GOOS {
case "darwin":
script := fmt.Sprintf("display notification \"Edge Control Daemon\" with title \"%s\"", message)
args = []string{"osascript", "-e", script}
case "linux":
args = []string{"notify-send", "Edge Control Daemon", message}
default:
return
}
p.Logf("NOTIFY: %s", message)
cmd := notifyRAI.Command(p, args...)
if err := cmd.Run(); err != nil {
p.Logf("ERROR while notifying: %v", err)
}
}
// MaybeNotify displays a notification only if a value changes
func MaybeNotify(p *supervisor.Process, name string, old, new bool) {
if old != new {
Notify(p, fmt.Sprintf("%s: %t -> %t", name, old, new))
}
}
| package main
import (
"fmt"
"runtime"
"github.com/datawire/ambassador/pkg/supervisor"
)
var (
notifyRAI *RunAsInfo
notifyEnabled = false
)
// Notify displays a desktop banner notification to the user
func Notify(p *supervisor.Process, message string) {
p.Logf("----------------------------------------------------------------------")
p.Logf("NOTIFY: %s", message)
p.Logf("----------------------------------------------------------------------")
if !notifyEnabled {
return
}
if notifyRAI == nil {
var err error
notifyRAI, err = GuessRunAsInfo(p)
if err != nil {
p.Log(err)
notifyRAI = &RunAsInfo{}
}
}
var args []string
switch runtime.GOOS {
case "darwin":
script := fmt.Sprintf("display notification \"Edge Control Daemon\" with title \"%s\"", message)
args = []string{"osascript", "-e", script}
case "linux":
args = []string{"notify-send", "Edge Control Daemon", message}
default:
return
}
cmd := notifyRAI.Command(p, args...)
if err := cmd.Run(); err != nil {
p.Logf("ERROR while notifying: %v", err)
}
}
// MaybeNotify displays a notification only if a value changes
func MaybeNotify(p *supervisor.Process, name string, old, new bool) {
if old != new {
Notify(p, fmt.Sprintf("%s: %t -> %t", name, old, new))
}
}
| Make it possible to disable notifications; disable them | Make it possible to disable notifications; disable them
| Go | apache-2.0 | datawire/ambassador,datawire/ambassador,datawire/ambassador,datawire/ambassador,datawire/ambassador | go | ## Code Before:
package main
import (
"fmt"
"runtime"
"github.com/datawire/ambassador/pkg/supervisor"
)
var notifyRAI *RunAsInfo
// Notify displays a desktop banner notification to the user
func Notify(p *supervisor.Process, message string) {
if notifyRAI == nil {
var err error
notifyRAI, err = GuessRunAsInfo(p)
if err != nil {
p.Log(err)
notifyRAI = &RunAsInfo{}
}
}
var args []string
switch runtime.GOOS {
case "darwin":
script := fmt.Sprintf("display notification \"Edge Control Daemon\" with title \"%s\"", message)
args = []string{"osascript", "-e", script}
case "linux":
args = []string{"notify-send", "Edge Control Daemon", message}
default:
return
}
p.Logf("NOTIFY: %s", message)
cmd := notifyRAI.Command(p, args...)
if err := cmd.Run(); err != nil {
p.Logf("ERROR while notifying: %v", err)
}
}
// MaybeNotify displays a notification only if a value changes
func MaybeNotify(p *supervisor.Process, name string, old, new bool) {
if old != new {
Notify(p, fmt.Sprintf("%s: %t -> %t", name, old, new))
}
}
## Instruction:
Make it possible to disable notifications; disable them
## Code After:
package main
import (
"fmt"
"runtime"
"github.com/datawire/ambassador/pkg/supervisor"
)
var (
notifyRAI *RunAsInfo
notifyEnabled = false
)
// Notify displays a desktop banner notification to the user
func Notify(p *supervisor.Process, message string) {
p.Logf("----------------------------------------------------------------------")
p.Logf("NOTIFY: %s", message)
p.Logf("----------------------------------------------------------------------")
if !notifyEnabled {
return
}
if notifyRAI == nil {
var err error
notifyRAI, err = GuessRunAsInfo(p)
if err != nil {
p.Log(err)
notifyRAI = &RunAsInfo{}
}
}
var args []string
switch runtime.GOOS {
case "darwin":
script := fmt.Sprintf("display notification \"Edge Control Daemon\" with title \"%s\"", message)
args = []string{"osascript", "-e", script}
case "linux":
args = []string{"notify-send", "Edge Control Daemon", message}
default:
return
}
cmd := notifyRAI.Command(p, args...)
if err := cmd.Run(); err != nil {
p.Logf("ERROR while notifying: %v", err)
}
}
// MaybeNotify displays a notification only if a value changes
func MaybeNotify(p *supervisor.Process, name string, old, new bool) {
if old != new {
Notify(p, fmt.Sprintf("%s: %t -> %t", name, old, new))
}
}
|
d83f479e463e7b07e3adb7e11d1441f80df7b5be | spec/spec_helper.rb | spec/spec_helper.rb | require 'simplecov'
SimpleCov.start
| require 'simplecov'
# Start the code coverage inspector here so any tests that are run
# which include the spec_helper count towards the code that is covered.
SimpleCov.start
RSpec.configure do |config|
# These two settings work together to allow you to limit a spec run
# to individual examples or groups you care about by tagging them with
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
# get run.
config.filter_run :focus
config.run_all_when_everything_filtered = true
end
| Add support for RSpec :focus keyword | Add support for RSpec :focus keyword
| Ruby | mit | lessan/toyrobot | ruby | ## Code Before:
require 'simplecov'
SimpleCov.start
## Instruction:
Add support for RSpec :focus keyword
## Code After:
require 'simplecov'
# Start the code coverage inspector here so any tests that are run
# which include the spec_helper count towards the code that is covered.
SimpleCov.start
RSpec.configure do |config|
# These two settings work together to allow you to limit a spec run
# to individual examples or groups you care about by tagging them with
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
# get run.
config.filter_run :focus
config.run_all_when_everything_filtered = true
end
|
d50d7ff90300c6c21f7d459e057b886a7281bc25 | src/js/examples/arrow-example.js | src/js/examples/arrow-example.js | /* global window */
window.es6Example = window.es6Example || {};
window.es6Example.arrow = {};
window.es6Example.arrow.code =
`let square = x => x * x;
let add = (a, b) => a + b;
let pi = () => 3.1415;
console.log(square(5));
console.log(add(3, 4));
console.log(pi());`;
window.es6Example.arrow.display = 'Arrow Functions';
| /* global window */
window.es6Example = window.es6Example || {};
window.es6Example.arrow = {};
window.es6Example.arrow.code =
`const square = x => x * x;
const add = (a, b) => a + b;
const pi = () => 3.1415;
console.log(square(5));
console.log(add(3, 4));
console.log(pi());`;
window.es6Example.arrow.display = 'Arrow Functions';
| Use const for variables that aren't re-assigned | Use const for variables that aren't re-assigned | JavaScript | mit | esfiddle/esfiddle,esfiddle/esfiddle,esfiddle/esfiddle,joshghent/es6-fiddle-web,joshghent/es6-fiddle-web | javascript | ## Code Before:
/* global window */
window.es6Example = window.es6Example || {};
window.es6Example.arrow = {};
window.es6Example.arrow.code =
`let square = x => x * x;
let add = (a, b) => a + b;
let pi = () => 3.1415;
console.log(square(5));
console.log(add(3, 4));
console.log(pi());`;
window.es6Example.arrow.display = 'Arrow Functions';
## Instruction:
Use const for variables that aren't re-assigned
## Code After:
/* global window */
window.es6Example = window.es6Example || {};
window.es6Example.arrow = {};
window.es6Example.arrow.code =
`const square = x => x * x;
const add = (a, b) => a + b;
const pi = () => 3.1415;
console.log(square(5));
console.log(add(3, 4));
console.log(pi());`;
window.es6Example.arrow.display = 'Arrow Functions';
|
25cc1ad01c077e23bddb4d34fe655fb3500043a9 | ncharts/fixtures/datasets_cabl.json | ncharts/fixtures/datasets_cabl.json | [
{
"fields": {
"variables": [],
"platforms": [
"ISFS"
],
"start_time": "2015-02-18T00:00:00+00:00",
"end_time": "2015-06-26T00:00:00+00:00",
"location": "Boulder Atmospheric Observatory and Erie High School",
"name": "geo_tiltcor",
"long_name": "CABL, winds in geographic coordinates, 3D winds tilt-corrected",
"project": "CABL",
"url": "https://www.eol.ucar.edu/field_projects/cabl",
"status": "Preliminary"
},
"model": "ncharts.dataset",
"pk": 15
},
{
"fields": {
"directory": "/net/isf/isff/projects/CABL/ISFF/netcdf/qc_geo_tiltcor",
"filenames": "isfs_tc_%Y%m%d.nc"
},
"model": "ncharts.filedataset",
"pk": 15
}
]
| [
{
"fields": {
"variables": [],
"platforms": [
"ISFS"
],
"start_time": "2015-02-18T00:00:00+00:00",
"end_time": "2015-06-26T00:00:00+00:00",
"location": "Boulder Atmospheric Observatory and Erie High School",
"name": "geo_tiltcor",
"long_name": "CABL, winds in geographic coordinates, 3D winds tilt-corrected",
"project": "CABL",
"url": "https://www.eol.ucar.edu/field_projects/cabl",
"status": "Preliminary"
},
"model": "ncharts.dataset",
"pk": 15
},
{
"fields": {
"directory": "/net/ftp/pub/archive/isff/projects/cabl/netcdf/qc_geo_tiltcor",
"filenames": "isfs_tc_%Y%m%d.nc"
},
"model": "ncharts.filedataset",
"pk": 15
}
]
| Change directory for cabl data | Change directory for cabl data
| JSON | bsd-2-clause | nguyenduchien1994/django-ncharts,nguyenduchien1994/django-ncharts,nguyenduchien1994/django-ncharts,nguyenduchien1994/django-ncharts,nguyenduchien1994/django-ncharts | json | ## Code Before:
[
{
"fields": {
"variables": [],
"platforms": [
"ISFS"
],
"start_time": "2015-02-18T00:00:00+00:00",
"end_time": "2015-06-26T00:00:00+00:00",
"location": "Boulder Atmospheric Observatory and Erie High School",
"name": "geo_tiltcor",
"long_name": "CABL, winds in geographic coordinates, 3D winds tilt-corrected",
"project": "CABL",
"url": "https://www.eol.ucar.edu/field_projects/cabl",
"status": "Preliminary"
},
"model": "ncharts.dataset",
"pk": 15
},
{
"fields": {
"directory": "/net/isf/isff/projects/CABL/ISFF/netcdf/qc_geo_tiltcor",
"filenames": "isfs_tc_%Y%m%d.nc"
},
"model": "ncharts.filedataset",
"pk": 15
}
]
## Instruction:
Change directory for cabl data
## Code After:
[
{
"fields": {
"variables": [],
"platforms": [
"ISFS"
],
"start_time": "2015-02-18T00:00:00+00:00",
"end_time": "2015-06-26T00:00:00+00:00",
"location": "Boulder Atmospheric Observatory and Erie High School",
"name": "geo_tiltcor",
"long_name": "CABL, winds in geographic coordinates, 3D winds tilt-corrected",
"project": "CABL",
"url": "https://www.eol.ucar.edu/field_projects/cabl",
"status": "Preliminary"
},
"model": "ncharts.dataset",
"pk": 15
},
{
"fields": {
"directory": "/net/ftp/pub/archive/isff/projects/cabl/netcdf/qc_geo_tiltcor",
"filenames": "isfs_tc_%Y%m%d.nc"
},
"model": "ncharts.filedataset",
"pk": 15
}
]
|
0b0beac6257ba03ea06559d206a4078d1b163db2 | handlers/main.yml | handlers/main.yml | ---
# handlers file for ansible-role-cuda
- name: reload systemd unit files
systemd:
daemon-reload: yes
when: ansible_connection != 'chroot'
- name: Initialize the GPUs
command: /bin/bash /usr/local/bin/cuda_init.sh
when:
- cuda_init|bool
- cuda_init_restart_service|bool
- ansible_connection != 'chroot'
- name: Restart cuda_init service
service:
name: cuda_init
state: restarted
when:
- cuda_init|bool
- cuda_init_restart_service|bool
- ansible_service_mgr == "systemd"
- name: ZZ CUDA Restart server
command: sleep 2 && /sbin/shutdown -r now "Node software upgrade reboot"
async: 1
poll: 0
ignore_errors: true
when:
- cuda_packages_installation.changed
- cuda_restart_node_on_install|bool
- ansible_connection != 'chroot'
# define the variable running_as_ansible_pull in the ansible-pull playbook, like local.yml
- name: ZZ CUDA Wait for server to restart
wait_for:
host: "{{ ansible_ssh_host | default(inventory_hostname) }}"
state: started
delay: 30
timeout: 300
connection: local
become: false
when:
- cuda_restart_node_on_install|bool
- (running_as_ansible_pull is not defined or running_as_ansible_pull == False)
- ansible_connection != 'chroot'
# vim:ft=ansible:
| ---
# handlers file for ansible-role-cuda
- name: reload systemd unit files
shell: systemctl daemon-reload
when: ansible_connection != 'chroot'
- name: Initialize the GPUs
command: /bin/bash /usr/local/bin/cuda_init.sh
when:
- cuda_init|bool
- cuda_init_restart_service|bool
- ansible_connection != 'chroot'
- name: Restart cuda_init service
service:
name: cuda_init
state: restarted
when:
- cuda_init|bool
- cuda_init_restart_service|bool
- ansible_service_mgr == "systemd"
- name: ZZ CUDA Restart server
command: sleep 2 && /sbin/shutdown -r now "Node software upgrade reboot"
async: 1
poll: 0
ignore_errors: true
when:
- cuda_packages_installation.changed
- cuda_restart_node_on_install|bool
- ansible_connection != 'chroot'
# define the variable running_as_ansible_pull in the ansible-pull playbook, like local.yml
- name: ZZ CUDA Wait for server to restart
wait_for:
host: "{{ ansible_ssh_host | default(inventory_hostname) }}"
state: started
delay: 30
timeout: 300
connection: local
become: false
when:
- cuda_restart_node_on_install|bool
- (running_as_ansible_pull is not defined or running_as_ansible_pull == False)
- ansible_connection != 'chroot'
# vim:ft=ansible:
| Revert "use systemd module instead of shell" | Revert "use systemd module instead of shell"
This reverts commit 622eea697a18496ab7316787ed020c64b0b95120.
| YAML | mit | CSC-IT-Center-for-Science/ansible-role-cuda | yaml | ## Code Before:
---
# handlers file for ansible-role-cuda
- name: reload systemd unit files
systemd:
daemon-reload: yes
when: ansible_connection != 'chroot'
- name: Initialize the GPUs
command: /bin/bash /usr/local/bin/cuda_init.sh
when:
- cuda_init|bool
- cuda_init_restart_service|bool
- ansible_connection != 'chroot'
- name: Restart cuda_init service
service:
name: cuda_init
state: restarted
when:
- cuda_init|bool
- cuda_init_restart_service|bool
- ansible_service_mgr == "systemd"
- name: ZZ CUDA Restart server
command: sleep 2 && /sbin/shutdown -r now "Node software upgrade reboot"
async: 1
poll: 0
ignore_errors: true
when:
- cuda_packages_installation.changed
- cuda_restart_node_on_install|bool
- ansible_connection != 'chroot'
# define the variable running_as_ansible_pull in the ansible-pull playbook, like local.yml
- name: ZZ CUDA Wait for server to restart
wait_for:
host: "{{ ansible_ssh_host | default(inventory_hostname) }}"
state: started
delay: 30
timeout: 300
connection: local
become: false
when:
- cuda_restart_node_on_install|bool
- (running_as_ansible_pull is not defined or running_as_ansible_pull == False)
- ansible_connection != 'chroot'
# vim:ft=ansible:
## Instruction:
Revert "use systemd module instead of shell"
This reverts commit 622eea697a18496ab7316787ed020c64b0b95120.
## Code After:
---
# handlers file for ansible-role-cuda
- name: reload systemd unit files
shell: systemctl daemon-reload
when: ansible_connection != 'chroot'
- name: Initialize the GPUs
command: /bin/bash /usr/local/bin/cuda_init.sh
when:
- cuda_init|bool
- cuda_init_restart_service|bool
- ansible_connection != 'chroot'
- name: Restart cuda_init service
service:
name: cuda_init
state: restarted
when:
- cuda_init|bool
- cuda_init_restart_service|bool
- ansible_service_mgr == "systemd"
- name: ZZ CUDA Restart server
command: sleep 2 && /sbin/shutdown -r now "Node software upgrade reboot"
async: 1
poll: 0
ignore_errors: true
when:
- cuda_packages_installation.changed
- cuda_restart_node_on_install|bool
- ansible_connection != 'chroot'
# define the variable running_as_ansible_pull in the ansible-pull playbook, like local.yml
- name: ZZ CUDA Wait for server to restart
wait_for:
host: "{{ ansible_ssh_host | default(inventory_hostname) }}"
state: started
delay: 30
timeout: 300
connection: local
become: false
when:
- cuda_restart_node_on_install|bool
- (running_as_ansible_pull is not defined or running_as_ansible_pull == False)
- ansible_connection != 'chroot'
# vim:ft=ansible:
|
d6871bd477dc33f65d1d56e2ce2160ce1caa0142 | Kwf/Update/20160824ComponentLinkViewCache.php | Kwf/Update/20160824ComponentLinkViewCache.php | <?php
class Kwf_Update_20160824ComponentLinkViewCache extends Kwf_Update
{
protected $_tags = array('kwc');
public function update()
{
Kwf_Component_Cache::getInstance()->deleteViewCache(array(
'type' => 'componentLink'
));
}
}
| <?php
class Kwf_Update_20160824ComponentLinkViewCache extends Kwf_Update
{
protected $_tags = array('kwc');
public function update()
{
//required for addition of Kwf_Component_Data::getLinkClass
Kwf_Component_Cache::getInstance()->deleteViewCache(array(
'type' => 'componentLink'
));
}
}
| Add comment why this update script is required | Add comment why this update script is required
| PHP | bsd-2-clause | koala-framework/koala-framework,koala-framework/koala-framework | php | ## Code Before:
<?php
class Kwf_Update_20160824ComponentLinkViewCache extends Kwf_Update
{
protected $_tags = array('kwc');
public function update()
{
Kwf_Component_Cache::getInstance()->deleteViewCache(array(
'type' => 'componentLink'
));
}
}
## Instruction:
Add comment why this update script is required
## Code After:
<?php
class Kwf_Update_20160824ComponentLinkViewCache extends Kwf_Update
{
protected $_tags = array('kwc');
public function update()
{
//required for addition of Kwf_Component_Data::getLinkClass
Kwf_Component_Cache::getInstance()->deleteViewCache(array(
'type' => 'componentLink'
));
}
}
|
8f5d490c90329431f0620dae70c830d23769ddb3 | Rendering/OpenGL2/Testing/Cxx/CMakeLists.txt | Rendering/OpenGL2/Testing/Cxx/CMakeLists.txt | vtk_add_test_cxx(${vtk-module}CxxTests tests
TestRenderWidget.cxx
TestVBOPLYMapper.cxx
TestVBOPointsLines.cxx
)
vtk_test_cxx_executable(${vtk-module}CxxTests tests RENDERING_FACTORY)
| vtk_add_test_cxx(${vtk-module}CxxTests tests
#TestRenderWidget.cxx # Very experimental, fails, does nothing useful yet.
TestVBOPLYMapper.cxx
TestVBOPointsLines.cxx
)
vtk_test_cxx_executable(${vtk-module}CxxTests tests RENDERING_FACTORY)
| Disable test for render widget | Disable test for render widget
Not doing anything useful yet, fails.
Change-Id: I07e1f382da72bf404432d98be6fc2c83cd94f6f0
| Text | bsd-3-clause | gram526/VTK,sumedhasingla/VTK,SimVascular/VTK,demarle/VTK,mspark93/VTK,msmolens/VTK,SimVascular/VTK,hendradarwin/VTK,gram526/VTK,keithroe/vtkoptix,sumedhasingla/VTK,johnkit/vtk-dev,sumedhasingla/VTK,ashray/VTK-EVM,jmerkow/VTK,demarle/VTK,msmolens/VTK,ashray/VTK-EVM,demarle/VTK,keithroe/vtkoptix,msmolens/VTK,SimVascular/VTK,gram526/VTK,SimVascular/VTK,berendkleinhaneveld/VTK,gram526/VTK,mspark93/VTK,sumedhasingla/VTK,keithroe/vtkoptix,hendradarwin/VTK,demarle/VTK,johnkit/vtk-dev,msmolens/VTK,ashray/VTK-EVM,keithroe/vtkoptix,johnkit/vtk-dev,gram526/VTK,keithroe/vtkoptix,jmerkow/VTK,jmerkow/VTK,msmolens/VTK,berendkleinhaneveld/VTK,berendkleinhaneveld/VTK,jmerkow/VTK,hendradarwin/VTK,mspark93/VTK,jmerkow/VTK,demarle/VTK,demarle/VTK,ashray/VTK-EVM,sumedhasingla/VTK,sankhesh/VTK,mspark93/VTK,hendradarwin/VTK,candy7393/VTK,candy7393/VTK,demarle/VTK,sankhesh/VTK,ashray/VTK-EVM,msmolens/VTK,jmerkow/VTK,sankhesh/VTK,jmerkow/VTK,hendradarwin/VTK,gram526/VTK,sankhesh/VTK,sumedhasingla/VTK,hendradarwin/VTK,SimVascular/VTK,candy7393/VTK,berendkleinhaneveld/VTK,sankhesh/VTK,johnkit/vtk-dev,gram526/VTK,johnkit/vtk-dev,SimVascular/VTK,msmolens/VTK,SimVascular/VTK,keithroe/vtkoptix,SimVascular/VTK,hendradarwin/VTK,demarle/VTK,sumedhasingla/VTK,johnkit/vtk-dev,berendkleinhaneveld/VTK,mspark93/VTK,ashray/VTK-EVM,berendkleinhaneveld/VTK,jmerkow/VTK,candy7393/VTK,candy7393/VTK,sankhesh/VTK,gram526/VTK,mspark93/VTK,msmolens/VTK,keithroe/vtkoptix,keithroe/vtkoptix,ashray/VTK-EVM,mspark93/VTK,sankhesh/VTK,sankhesh/VTK,mspark93/VTK,johnkit/vtk-dev,sumedhasingla/VTK,candy7393/VTK,candy7393/VTK,ashray/VTK-EVM,berendkleinhaneveld/VTK,candy7393/VTK | text | ## Code Before:
vtk_add_test_cxx(${vtk-module}CxxTests tests
TestRenderWidget.cxx
TestVBOPLYMapper.cxx
TestVBOPointsLines.cxx
)
vtk_test_cxx_executable(${vtk-module}CxxTests tests RENDERING_FACTORY)
## Instruction:
Disable test for render widget
Not doing anything useful yet, fails.
Change-Id: I07e1f382da72bf404432d98be6fc2c83cd94f6f0
## Code After:
vtk_add_test_cxx(${vtk-module}CxxTests tests
#TestRenderWidget.cxx # Very experimental, fails, does nothing useful yet.
TestVBOPLYMapper.cxx
TestVBOPointsLines.cxx
)
vtk_test_cxx_executable(${vtk-module}CxxTests tests RENDERING_FACTORY)
|
a6426554c9c23a92de20ae261f11999f1fce4022 | templates/games/installer-form.html | templates/games/installer-form.html | {% extends "base.html" %}
{% block title %}
{% if new %}
Create new installer for {{ game }}
{% else %}
Edit installer for {{ game }}
{% endif %}
| Lutris
{% endblock %}
{% block extra_head %}
{{ form.media.css }}
{% endblock %}
{% block content %}
{% if new %}
<h1>New installer for {{ game }}</h1>
{% else %}
<h1>Edit installer for {{ game }}</h1>
{% endif %}
<div class="row">
<div class="col-sm-7">
<div class="well">
<form action="" method="post">
{% csrf_token %}
{% for field in form %}
{{ field.errors }}
{% endfor %}
{{ form.as_p }}
<input type="submit" class="btn btn-primary" value="Save"/>
<a class='btn' href="{{game.get_absolute_url}}">Cancel</a>
</form>
</div>
</div>
<div class="col-sm-5">
<div class="well docs">
{% include "docs/installers.html" %}
</div>
</div>
</div>
{% endblock %}
{% block scripts %}
<script>
$(function(){
$.fn.select2.defaults.set("width", null);
$.fn.select2.defaults.set("theme", 'bootstrap');
});
</script>
{{ block.super }}
{{ form.media.js }}
{% endblock %}
| {% extends "base.html" %}
{% block title %}
{% if new %}
Create new installer for {{ game }}
{% else %}
Edit installer for {{ game }}
{% endif %}
| Lutris
{% endblock %}
{% block extra_head %}
{{ form.media.css }}
{% endblock %}
{% block content %}
{% if new %}
<h1>New installer for {{ game }}</h1>
{% else %}
<h1>Edit installer for {{ game }}</h1>
{% endif %}
<div class="row">
<div class="col-sm-7">
<div class="well">
<form action="" method="post">
{% csrf_token %}
{% for field in form %}
{{ field.errors }}
{% endfor %}
{{ form.as_p }}
<input type="submit" class="btn" name="save" value="Save draft">
<input type="submit" class="btn btn-primary" name="submit" value="Submit to moderation"/>
<a class='btn' href="{{game.get_absolute_url}}">Cancel</a>
</form>
</div>
</div>
<div class="col-sm-5">
<div class="well docs">
{% include "docs/installers.html" %}
</div>
</div>
</div>
{% endblock %}
{% block scripts %}
<script>
$(function(){
$.fn.select2.defaults.set("width", null);
$.fn.select2.defaults.set("theme", 'bootstrap');
});
</script>
{{ block.super }}
{{ form.media.js }}
{% endblock %}
| Add Save draft button to installer form | Add Save draft button to installer form
| HTML | agpl-3.0 | lutris/website,lutris/website,Turupawn/website,Turupawn/website,lutris/website,Turupawn/website,lutris/website,Turupawn/website | html | ## Code Before:
{% extends "base.html" %}
{% block title %}
{% if new %}
Create new installer for {{ game }}
{% else %}
Edit installer for {{ game }}
{% endif %}
| Lutris
{% endblock %}
{% block extra_head %}
{{ form.media.css }}
{% endblock %}
{% block content %}
{% if new %}
<h1>New installer for {{ game }}</h1>
{% else %}
<h1>Edit installer for {{ game }}</h1>
{% endif %}
<div class="row">
<div class="col-sm-7">
<div class="well">
<form action="" method="post">
{% csrf_token %}
{% for field in form %}
{{ field.errors }}
{% endfor %}
{{ form.as_p }}
<input type="submit" class="btn btn-primary" value="Save"/>
<a class='btn' href="{{game.get_absolute_url}}">Cancel</a>
</form>
</div>
</div>
<div class="col-sm-5">
<div class="well docs">
{% include "docs/installers.html" %}
</div>
</div>
</div>
{% endblock %}
{% block scripts %}
<script>
$(function(){
$.fn.select2.defaults.set("width", null);
$.fn.select2.defaults.set("theme", 'bootstrap');
});
</script>
{{ block.super }}
{{ form.media.js }}
{% endblock %}
## Instruction:
Add Save draft button to installer form
## Code After:
{% extends "base.html" %}
{% block title %}
{% if new %}
Create new installer for {{ game }}
{% else %}
Edit installer for {{ game }}
{% endif %}
| Lutris
{% endblock %}
{% block extra_head %}
{{ form.media.css }}
{% endblock %}
{% block content %}
{% if new %}
<h1>New installer for {{ game }}</h1>
{% else %}
<h1>Edit installer for {{ game }}</h1>
{% endif %}
<div class="row">
<div class="col-sm-7">
<div class="well">
<form action="" method="post">
{% csrf_token %}
{% for field in form %}
{{ field.errors }}
{% endfor %}
{{ form.as_p }}
<input type="submit" class="btn" name="save" value="Save draft">
<input type="submit" class="btn btn-primary" name="submit" value="Submit to moderation"/>
<a class='btn' href="{{game.get_absolute_url}}">Cancel</a>
</form>
</div>
</div>
<div class="col-sm-5">
<div class="well docs">
{% include "docs/installers.html" %}
</div>
</div>
</div>
{% endblock %}
{% block scripts %}
<script>
$(function(){
$.fn.select2.defaults.set("width", null);
$.fn.select2.defaults.set("theme", 'bootstrap');
});
</script>
{{ block.super }}
{{ form.media.js }}
{% endblock %}
|
55362407c77b2452437cc45a307698dfcd3448f3 | pawn.json | pawn.json | {
"user": "lassir",
"repo": "bcrypt-samp",
"include_path": "pawn",
"resources": [
{
"name": "^bcrypt-samp-.+-windows\\.zip$",
"platform": "windows",
"archive": true,
"plugins": ["bcrypt-samp-.+/bcrypt-samp.dll"]
},
{
"name": "^bcrypt-samp-.+-debian[_-]7.*\\.(?:tar\\.gz|zip)$",
"platform": "linux",
"archive": true,
"plugins": ["bcrypt-samp-.+/bcrypt-samp.so"]
}
],
"runtime": {
"plugins": ["lassir/bcrypt-samp"]
}
} | {
"user": "lassir",
"repo": "bcrypt-samp",
"include_path": "pawn",
"resources": [
{
"name": "^bcrypt-samp-.+-windows\\.zip$",
"platform": "windows",
"archive": true,
"plugins": ["bcrypt-samp-.+/bcrypt-samp.dll"]
},
{
"name": "^bcrypt-samp-.*(debian|ubuntu).*\\.tar.gz$",
"platform": "linux",
"archive": true,
"plugins": ["bcrypt-samp-.+/bcrypt-samp.so"]
}
],
"runtime": {
"plugins": ["lassir/bcrypt-samp"]
}
}
| Fix sampctl config name regex | Fix sampctl config name regex
| JSON | mit | lassir/bcrypt-samp,lassir/bcrypt-samp | json | ## Code Before:
{
"user": "lassir",
"repo": "bcrypt-samp",
"include_path": "pawn",
"resources": [
{
"name": "^bcrypt-samp-.+-windows\\.zip$",
"platform": "windows",
"archive": true,
"plugins": ["bcrypt-samp-.+/bcrypt-samp.dll"]
},
{
"name": "^bcrypt-samp-.+-debian[_-]7.*\\.(?:tar\\.gz|zip)$",
"platform": "linux",
"archive": true,
"plugins": ["bcrypt-samp-.+/bcrypt-samp.so"]
}
],
"runtime": {
"plugins": ["lassir/bcrypt-samp"]
}
}
## Instruction:
Fix sampctl config name regex
## Code After:
{
"user": "lassir",
"repo": "bcrypt-samp",
"include_path": "pawn",
"resources": [
{
"name": "^bcrypt-samp-.+-windows\\.zip$",
"platform": "windows",
"archive": true,
"plugins": ["bcrypt-samp-.+/bcrypt-samp.dll"]
},
{
"name": "^bcrypt-samp-.*(debian|ubuntu).*\\.tar.gz$",
"platform": "linux",
"archive": true,
"plugins": ["bcrypt-samp-.+/bcrypt-samp.so"]
}
],
"runtime": {
"plugins": ["lassir/bcrypt-samp"]
}
}
|
742db68490fd7dace0c46375c68a2ec1409f8f65 | README.md | README.md | hr.model [](https://travis-ci.org/HappyRhino/hr.model)
=============================
> Data modelling utility
## Installation
```
$ npm install hr.model
```
### Documentation
#### Creation
Create a new model by extending the default `Model`:
```js
var Model = require("hr.model");
var MyModel = Model.extend({
});
```
Create an instance with attributes using:
```js
var post = new Post({}, {
title: "My Post"
});
```
#### Attributes
Default values are defined in the `defaults` property of the model:
```js
var Post = Model.extend({
defaults: {
title: ""
}
});
```
Set an attribute using `.set`:
```js
post.set("title", "My Awesome Posts");
```
Get an attribute using `.get`:
```js
post.get("title");
```
Depp attribtes can be use:
```js
post.set("count", {
"likes": 0,
"tweets": 0
})
post.set("count.likes", 500);
post.get("count")
// -> { "likes": 500, "tweets": 0 }
post.get("count.likes")
// -> 500
```
| hr.model [](https://travis-ci.org/HappyRhino/hr.model)
=============================
> Data modelling utility
## Installation
```
$ npm install hr.model
```
### Documentation
#### Creation
Create a new model by extending the default `Model`:
```js
var Model = require("hr.model");
var MyModel = Model.extend({
});
```
Create an instance with attributes using:
```js
var post = new Post({}, {
title: "My Post"
});
```
#### Attributes
Default values are defined in the `defaults` property of the model:
```js
var Post = Model.extend({
defaults: {
title: ""
}
});
```
Set an attribute using `.set`:
```js
post.set("title", "My Awesome Posts");
```
Get an attribute using `.get`:
```js
post.get("title");
```
Depp attribtes can be use:
```js
post.set("count", {
"likes": 0,
"tweets": 0
})
post.set("count.likes", 500);
post.get("count")
// -> { "likes": 500, "tweets": 0 }
post.get("count.likes")
// -> 500
```
#### Events
```js
// Triggered for every set of modifications
post.on("set", function() { ... });
// Triggered for every change on attributes
post.on("change:title", function() { ... });
```
| Add section about events on documentation | Add section about events on documentation | Markdown | apache-2.0 | HappyRhino/hr.model | markdown | ## Code Before:
hr.model [](https://travis-ci.org/HappyRhino/hr.model)
=============================
> Data modelling utility
## Installation
```
$ npm install hr.model
```
### Documentation
#### Creation
Create a new model by extending the default `Model`:
```js
var Model = require("hr.model");
var MyModel = Model.extend({
});
```
Create an instance with attributes using:
```js
var post = new Post({}, {
title: "My Post"
});
```
#### Attributes
Default values are defined in the `defaults` property of the model:
```js
var Post = Model.extend({
defaults: {
title: ""
}
});
```
Set an attribute using `.set`:
```js
post.set("title", "My Awesome Posts");
```
Get an attribute using `.get`:
```js
post.get("title");
```
Depp attribtes can be use:
```js
post.set("count", {
"likes": 0,
"tweets": 0
})
post.set("count.likes", 500);
post.get("count")
// -> { "likes": 500, "tweets": 0 }
post.get("count.likes")
// -> 500
```
## Instruction:
Add section about events on documentation
## Code After:
hr.model [](https://travis-ci.org/HappyRhino/hr.model)
=============================
> Data modelling utility
## Installation
```
$ npm install hr.model
```
### Documentation
#### Creation
Create a new model by extending the default `Model`:
```js
var Model = require("hr.model");
var MyModel = Model.extend({
});
```
Create an instance with attributes using:
```js
var post = new Post({}, {
title: "My Post"
});
```
#### Attributes
Default values are defined in the `defaults` property of the model:
```js
var Post = Model.extend({
defaults: {
title: ""
}
});
```
Set an attribute using `.set`:
```js
post.set("title", "My Awesome Posts");
```
Get an attribute using `.get`:
```js
post.get("title");
```
Depp attribtes can be use:
```js
post.set("count", {
"likes": 0,
"tweets": 0
})
post.set("count.likes", 500);
post.get("count")
// -> { "likes": 500, "tweets": 0 }
post.get("count.likes")
// -> 500
```
#### Events
```js
// Triggered for every set of modifications
post.on("set", function() { ... });
// Triggered for every change on attributes
post.on("change:title", function() { ... });
```
|
2958e793ea30d879afe265bb511183e4512fc049 | webstr/core/config.py | webstr/core/config.py |
# Copyright 2016 Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import logging
import sys
SELENIUM_LOG_LEVEL = logging.INFO
SCHEME = 'https'
PORT = 443
BROWSER = 'Firefox'
BROWSER_VERSION = ''
BROWSER_PLATFORM = 'ANY'
SELENIUM_SERVER = 'selenium-grid.example.com'
SELENIUM_PORT = 4444
BROWSER_WIDTH = 1280
BROWSER_HEIGHT = 1024
def update_value(key_name, value, force=False):
"""
Update single value of this config module.
"""
this_module = sys.modules[__name__]
key_name = key_name.upper()
# raise AttributeError if we try to define new value (unless force is used)
if not force:
getattr(this_module, key_name)
setattr(this_module, key_name, value)
|
# Copyright 2016 Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import logging
import sys
SELENIUM_LOG_LEVEL = logging.INFO
SCHEME = 'https'
PORT = 443
BROWSER = 'Firefox'
BROWSER_VERSION = ''
BROWSER_PLATFORM = 'ANY'
SELENIUM_SERVER = None
SELENIUM_PORT = 4444
BROWSER_WIDTH = 1280
BROWSER_HEIGHT = 1024
def update_value(key_name, value, force=False):
"""
Update single value of this config module.
"""
this_module = sys.modules[__name__]
key_name = key_name.upper()
# raise AttributeError if we try to define new value (unless force is used)
if not force:
getattr(this_module, key_name)
setattr(this_module, key_name, value)
| Change the default value for SELENIUM_SERVER | Change the default value for SELENIUM_SERVER
with this change it is possible to use webstr on localhost without any action
Change-Id: Ife533552d7a746401df01c03af0b2d1caf0702b5
Signed-off-by: ltrilety <b0b91364d2d251c1396ffbe2df56e3ab774d4d4b@redhat.com>
| Python | apache-2.0 | Webstr-framework/webstr | python | ## Code Before:
# Copyright 2016 Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import logging
import sys
SELENIUM_LOG_LEVEL = logging.INFO
SCHEME = 'https'
PORT = 443
BROWSER = 'Firefox'
BROWSER_VERSION = ''
BROWSER_PLATFORM = 'ANY'
SELENIUM_SERVER = 'selenium-grid.example.com'
SELENIUM_PORT = 4444
BROWSER_WIDTH = 1280
BROWSER_HEIGHT = 1024
def update_value(key_name, value, force=False):
"""
Update single value of this config module.
"""
this_module = sys.modules[__name__]
key_name = key_name.upper()
# raise AttributeError if we try to define new value (unless force is used)
if not force:
getattr(this_module, key_name)
setattr(this_module, key_name, value)
## Instruction:
Change the default value for SELENIUM_SERVER
with this change it is possible to use webstr on localhost without any action
Change-Id: Ife533552d7a746401df01c03af0b2d1caf0702b5
Signed-off-by: ltrilety <b0b91364d2d251c1396ffbe2df56e3ab774d4d4b@redhat.com>
## Code After:
# Copyright 2016 Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import logging
import sys
SELENIUM_LOG_LEVEL = logging.INFO
SCHEME = 'https'
PORT = 443
BROWSER = 'Firefox'
BROWSER_VERSION = ''
BROWSER_PLATFORM = 'ANY'
SELENIUM_SERVER = None
SELENIUM_PORT = 4444
BROWSER_WIDTH = 1280
BROWSER_HEIGHT = 1024
def update_value(key_name, value, force=False):
"""
Update single value of this config module.
"""
this_module = sys.modules[__name__]
key_name = key_name.upper()
# raise AttributeError if we try to define new value (unless force is used)
if not force:
getattr(this_module, key_name)
setattr(this_module, key_name, value)
|
c7511d81236f2a28019d8d8e103b03e0d1150e32 | django_website/blog/admin.py | django_website/blog/admin.py | from __future__ import absolute_import
from django.contrib import admin
from .models import Entry
admin.site.register(Entry,
list_display = ('headline', 'pub_date', 'is_active', 'is_published', 'author'),
list_filter = ('is_active',),
exclude = ('summary_html', 'body_html'),
prepopulated_fields = {"slug": ("headline",)}
)
| from __future__ import absolute_import
from django.contrib import admin
from .models import Entry
class EntryAdmin(admin.ModelAdmin):
list_display = ('headline', 'pub_date', 'is_active', 'is_published', 'author')
list_filter = ('is_active',)
exclude = ('summary_html', 'body_html')
prepopulated_fields = {"slug": ("headline",)}
admin.site.register(Entry, EntryAdmin)
| Use proper ModelAdmin for blog entry | Use proper ModelAdmin for blog entry | Python | bsd-3-clause | khkaminska/djangoproject.com,nanuxbe/django,rmoorman/djangoproject.com,gnarf/djangoproject.com,relekang/djangoproject.com,relekang/djangoproject.com,django/djangoproject.com,alawnchen/djangoproject.com,vxvinh1511/djangoproject.com,nanuxbe/django,nanuxbe/django,django/djangoproject.com,xavierdutreilh/djangoproject.com,gnarf/djangoproject.com,django/djangoproject.com,relekang/djangoproject.com,alawnchen/djangoproject.com,khkaminska/djangoproject.com,alawnchen/djangoproject.com,django/djangoproject.com,rmoorman/djangoproject.com,relekang/djangoproject.com,hassanabidpk/djangoproject.com,rmoorman/djangoproject.com,rmoorman/djangoproject.com,xavierdutreilh/djangoproject.com,khkaminska/djangoproject.com,django/djangoproject.com,xavierdutreilh/djangoproject.com,xavierdutreilh/djangoproject.com,django/djangoproject.com,hassanabidpk/djangoproject.com,vxvinh1511/djangoproject.com,gnarf/djangoproject.com,hassanabidpk/djangoproject.com,hassanabidpk/djangoproject.com,nanuxbe/django,vxvinh1511/djangoproject.com,gnarf/djangoproject.com,vxvinh1511/djangoproject.com,khkaminska/djangoproject.com,alawnchen/djangoproject.com | python | ## Code Before:
from __future__ import absolute_import
from django.contrib import admin
from .models import Entry
admin.site.register(Entry,
list_display = ('headline', 'pub_date', 'is_active', 'is_published', 'author'),
list_filter = ('is_active',),
exclude = ('summary_html', 'body_html'),
prepopulated_fields = {"slug": ("headline",)}
)
## Instruction:
Use proper ModelAdmin for blog entry
## Code After:
from __future__ import absolute_import
from django.contrib import admin
from .models import Entry
class EntryAdmin(admin.ModelAdmin):
list_display = ('headline', 'pub_date', 'is_active', 'is_published', 'author')
list_filter = ('is_active',)
exclude = ('summary_html', 'body_html')
prepopulated_fields = {"slug": ("headline",)}
admin.site.register(Entry, EntryAdmin)
|
6e75abd68e515591c00934d0d086f05129e6ff79 | README.md | README.md | servo
========
[](http://travis-ci.org/fgrosse/servo)
[](https://coveralls.io/r/fgrosse/servo?branch=master)
[](https://godoc.org/github.com/fgrosse/servo)
[](https://github.com/fgrosse/servo/blob/master/LICENSE)
**Note: This project is at the very early stages of its development.**
### Dependencies
* go 1.3 or higher
* [gopkg.in/yaml.v2][1] (LGPLv3)
[1]: https://github.com/go-yaml/yaml/tree/v2
| servo
========
[](http://travis-ci.org/fgrosse/servo)
[](https://coveralls.io/r/fgrosse/servo?branch=master)
[](https://godoc.org/github.com/fgrosse/servo)
[](https://github.com/fgrosse/servo/blob/master/LICENSE)
Servo is a web framework that heavily relies on dependency injection to wire up your application.
**Note: This project is still at the early stages of its development.**
### Example Implementation
You can have a look at an example that uses servo to build a simple web application at **https://github.com/fgrosse/servo-example**.
### First Bundles
Servo is build in bundles. This means that servo applications pull in dependencies by using other bundles.
For an example see how bundles are used [in the example][2]
So far the following bundloes are implemented:
* https://github.com/fgrosse/servo-logxi
* https://github.com/fgrosse/servo-gorilla
### Dependencies
* go 1.3 or higher
* [gopkg.in/yaml.v2][1] (LGPLv3)
[1]: https://github.com/go-yaml/yaml/tree/v2
[2]: https://github.com/fgrosse/servo-example/blob/master/main.go#L15
| Add link to servo-example and document first bundles | Add link to servo-example and document first bundles | Markdown | mit | fgrosse/servo,fgrosse/servo | markdown | ## Code Before:
servo
========
[](http://travis-ci.org/fgrosse/servo)
[](https://coveralls.io/r/fgrosse/servo?branch=master)
[](https://godoc.org/github.com/fgrosse/servo)
[](https://github.com/fgrosse/servo/blob/master/LICENSE)
**Note: This project is at the very early stages of its development.**
### Dependencies
* go 1.3 or higher
* [gopkg.in/yaml.v2][1] (LGPLv3)
[1]: https://github.com/go-yaml/yaml/tree/v2
## Instruction:
Add link to servo-example and document first bundles
## Code After:
servo
========
[](http://travis-ci.org/fgrosse/servo)
[](https://coveralls.io/r/fgrosse/servo?branch=master)
[](https://godoc.org/github.com/fgrosse/servo)
[](https://github.com/fgrosse/servo/blob/master/LICENSE)
Servo is a web framework that heavily relies on dependency injection to wire up your application.
**Note: This project is still at the early stages of its development.**
### Example Implementation
You can have a look at an example that uses servo to build a simple web application at **https://github.com/fgrosse/servo-example**.
### First Bundles
Servo is build in bundles. This means that servo applications pull in dependencies by using other bundles.
For an example see how bundles are used [in the example][2]
So far the following bundloes are implemented:
* https://github.com/fgrosse/servo-logxi
* https://github.com/fgrosse/servo-gorilla
### Dependencies
* go 1.3 or higher
* [gopkg.in/yaml.v2][1] (LGPLv3)
[1]: https://github.com/go-yaml/yaml/tree/v2
[2]: https://github.com/fgrosse/servo-example/blob/master/main.go#L15
|
738a7cc75fe112630f29ed08ce68546ac1939728 | server/packet/packet_entity_equipment.c | server/packet/packet_entity_equipment.c |
void packet_send_entity_equipment(struct client *client, struct client *c, uint16_t slot, struct item *item, uint16_t damage)
{
bedrock_packet packet;
struct item_stack stack;
stack.id = item->id;
stack.count = 1;
stack.metadata = damage;
packet_init(&packet, SERVER_ENTITY_EQUIPMENT);
packet_pack_int(&packet, &c->id, sizeof(c->id));
packet_pack_int(&packet, &slot, sizeof(slot));
packet_pack_slot(&packet, &stack);
client_send_packet(client, &packet);
}
|
void packet_send_entity_equipment(struct client *client, struct client *c, uint16_t slot, struct item *item, uint16_t damage)
{
bedrock_packet packet;
struct item_stack stack;
stack.id = item->id ? item->id : -1;
stack.count = 1;
stack.metadata = damage;
packet_init(&packet, SERVER_ENTITY_EQUIPMENT);
packet_pack_int(&packet, &c->id, sizeof(c->id));
packet_pack_int(&packet, &slot, sizeof(slot));
packet_pack_slot(&packet, &stack);
client_send_packet(client, &packet);
}
| Fix client crash from changing item to nothing | Fix client crash from changing item to nothing
| C | bsd-2-clause | Adam-/bedrock,Adam-/bedrock | c | ## Code Before:
void packet_send_entity_equipment(struct client *client, struct client *c, uint16_t slot, struct item *item, uint16_t damage)
{
bedrock_packet packet;
struct item_stack stack;
stack.id = item->id;
stack.count = 1;
stack.metadata = damage;
packet_init(&packet, SERVER_ENTITY_EQUIPMENT);
packet_pack_int(&packet, &c->id, sizeof(c->id));
packet_pack_int(&packet, &slot, sizeof(slot));
packet_pack_slot(&packet, &stack);
client_send_packet(client, &packet);
}
## Instruction:
Fix client crash from changing item to nothing
## Code After:
void packet_send_entity_equipment(struct client *client, struct client *c, uint16_t slot, struct item *item, uint16_t damage)
{
bedrock_packet packet;
struct item_stack stack;
stack.id = item->id ? item->id : -1;
stack.count = 1;
stack.metadata = damage;
packet_init(&packet, SERVER_ENTITY_EQUIPMENT);
packet_pack_int(&packet, &c->id, sizeof(c->id));
packet_pack_int(&packet, &slot, sizeof(slot));
packet_pack_slot(&packet, &stack);
client_send_packet(client, &packet);
}
|
93ea6c34fdc0a152742eec1d2a7d1e025b054244 | docs/sync-doc.sh | docs/sync-doc.sh | TARGET=../../nextflow-website/assets
if egrep "^release = '.*edge'$" -c conf.py >/dev/null; then
MODE=edge
else
MODE=latest
fi
LATEST=$TARGET/docs/$MODE/
mkdir -p $LATEST
rsync -r _build/html/ $LATEST
( cd ../../nextflow-website; ./jbake)
| TARGET=../../nextflow-website/assets
if egrep "^release = '.*edge|.*SNAPSHOT'$" -c conf.py >/dev/null; then
MODE=edge
else
MODE=latest
fi
LATEST=$TARGET/docs/$MODE/
mkdir -p $LATEST
rsync -r _build/html/ $LATEST
( cd ../../nextflow-website; ./jbake)
| Add snapshot to docs sync | Add snapshot to docs sync
| Shell | apache-2.0 | nextflow-io/nextflow,robsyme/nextflow,robsyme/nextflow,nextflow-io/nextflow,nextflow-io/nextflow,robsyme/nextflow,nextflow-io/nextflow,robsyme/nextflow,robsyme/nextflow,nextflow-io/nextflow | shell | ## Code Before:
TARGET=../../nextflow-website/assets
if egrep "^release = '.*edge'$" -c conf.py >/dev/null; then
MODE=edge
else
MODE=latest
fi
LATEST=$TARGET/docs/$MODE/
mkdir -p $LATEST
rsync -r _build/html/ $LATEST
( cd ../../nextflow-website; ./jbake)
## Instruction:
Add snapshot to docs sync
## Code After:
TARGET=../../nextflow-website/assets
if egrep "^release = '.*edge|.*SNAPSHOT'$" -c conf.py >/dev/null; then
MODE=edge
else
MODE=latest
fi
LATEST=$TARGET/docs/$MODE/
mkdir -p $LATEST
rsync -r _build/html/ $LATEST
( cd ../../nextflow-website; ./jbake)
|
a0b1d9966a30859d004ee6feb2b9623a05fa5965 | task.js | task.js |
const fs = require('fs')
const add = require('./commands/add')
const list = require('./commands/list')
const done = require('./commands/done')
const command = process.argv[2]
const argument = process.argv.slice(3).join(' ')
switch(command) {
case "add":
add(argument)
break;
case "list":
list()
break;
case "done":
done(argument)
}
|
const fs = require('fs')
const add = require('./commands/add')
const list = require('./commands/list')
const done = require('./commands/done')
const command = process.argv[2]
const argument = process.argv.slice(3).join(' ')
switch(command) {
case "add":
add(argument)
break;
case "list":
list()
break;
case "done":
done(argument)
break;
default:
console.log("Invalid command, use \"add\", \"list\", or \"done\"")
}
| Add default case to switch statement | Add default case to switch statement
| JavaScript | mit | breyana/Command-Line-Todo-List | javascript | ## Code Before:
const fs = require('fs')
const add = require('./commands/add')
const list = require('./commands/list')
const done = require('./commands/done')
const command = process.argv[2]
const argument = process.argv.slice(3).join(' ')
switch(command) {
case "add":
add(argument)
break;
case "list":
list()
break;
case "done":
done(argument)
}
## Instruction:
Add default case to switch statement
## Code After:
const fs = require('fs')
const add = require('./commands/add')
const list = require('./commands/list')
const done = require('./commands/done')
const command = process.argv[2]
const argument = process.argv.slice(3).join(' ')
switch(command) {
case "add":
add(argument)
break;
case "list":
list()
break;
case "done":
done(argument)
break;
default:
console.log("Invalid command, use \"add\", \"list\", or \"done\"")
}
|
b8bcc946b7f82ff9f99b655ec9d14658b839487c | app/views/projects/_contributors.html.erb | app/views/projects/_contributors.html.erb | <% if @contributors.length > 0 %>
<div class="row">
<div class="col-md-12">
<h4 data-ga-tracked-el='top-contributors'>Top Contributors <small><%= link_to 'See all', repository_contributors_path(@repository.to_param) %></small></h4>
<%= render @contributors %>
</div>
</div>
<% end %> | <% if @contributors.length > 0 %>
<div class="row">
<div class="col-md-12">
<hr>
<h3 data-ga-tracked-el='top-contributors'>Contributors</h4>
<%= render @contributors %>
<%= link_to 'See all contributors', repository_contributors_path(@repository.to_param) %>
</div>
</div>
<% end %> | Add tracked el to contributors | Add tracked el to contributors
* add tracked el
* move ‘see all’ link to bottom (matching explore and see all links
elsewhere)
| HTML+ERB | agpl-3.0 | librariesio/libraries.io,abrophy/libraries.io,librariesio/libraries.io,librariesio/libraries.io,abrophy/libraries.io,abrophy/libraries.io,librariesio/libraries.io | html+erb | ## Code Before:
<% if @contributors.length > 0 %>
<div class="row">
<div class="col-md-12">
<h4 data-ga-tracked-el='top-contributors'>Top Contributors <small><%= link_to 'See all', repository_contributors_path(@repository.to_param) %></small></h4>
<%= render @contributors %>
</div>
</div>
<% end %>
## Instruction:
Add tracked el to contributors
* add tracked el
* move ‘see all’ link to bottom (matching explore and see all links
elsewhere)
## Code After:
<% if @contributors.length > 0 %>
<div class="row">
<div class="col-md-12">
<hr>
<h3 data-ga-tracked-el='top-contributors'>Contributors</h4>
<%= render @contributors %>
<%= link_to 'See all contributors', repository_contributors_path(@repository.to_param) %>
</div>
</div>
<% end %> |
d1f45de88f0c5fe6b27fde59015b156294bda1be | main.go | main.go | package main
import (
"flag"
"fmt"
"os"
"os/exec"
)
var output string
func init() {
flag.Usage = func() {
fmt.Printf("Usage: %s [-out=out.path] in.path\n\n", os.Args[0])
flag.PrintDefaults()
}
flag.StringVar(&output, "out", "out.go", "Specify a path to the output file")
flag.Parse()
}
func main() {
checkRequirements()
file, err := os.Open(flag.Arg(0))
if err != nil {
fmt.Printf("Error! %s\n", err)
os.Exit(2)
}
defer file.Close()
prog := "go"
path, err := exec.LookPath(prog)
if err != nil {
fmt.Printf("Please, install %s first.", prog)
}
fmt.Printf("%s is available at %s\n", prog, path)
fmt.Printf("input file: %s, output file: %s\n", flag.Arg(0), output)
}
func checkRequirements() {
args := flag.Args()
if len(args) == 0 {
flag.Usage()
fmt.Printf("Error! The input file is required\n")
os.Exit(1)
} else if len(args) > 1 {
fmt.Printf("Notice! To many positional arguments, ignoring %v\n", args[1:])
}
}
| package main
import (
"flag"
"fmt"
"log"
"os"
"os/exec"
)
var output string
func init() {
flag.Usage = func() {
fmt.Printf("Usage: %s [-out=out.path] in.path\n\n", os.Args[0])
flag.PrintDefaults()
}
flag.StringVar(&output, "out", "out.go", "Specify a path to the output file")
flag.Parse()
}
func main() {
checkRequirements()
file, err := os.Open(flag.Arg(0))
if err != nil {
log.Fatalf("%s\n", err)
}
defer file.Close()
prog := "go"
path, err := exec.LookPath(prog)
if err != nil {
log.Fatalf("please, install %s first.", prog)
}
fmt.Printf("%s is available at %s\n", prog, path)
fmt.Printf("input file: %s, output file: %s\n", flag.Arg(0), output)
}
func checkRequirements() {
args := flag.Args()
if len(args) == 0 {
flag.Usage()
log.Fatalf("the input file not specified\n")
} else if len(args) > 1 {
log.Printf("to many positional arguments, ignoring %v\n", args[1:])
}
}
| Use `log` package instead of `fmt` for logging and exiting | Use `log` package instead of `fmt` for logging and exiting
| Go | mit | konjoot/go-inspect | go | ## Code Before:
package main
import (
"flag"
"fmt"
"os"
"os/exec"
)
var output string
func init() {
flag.Usage = func() {
fmt.Printf("Usage: %s [-out=out.path] in.path\n\n", os.Args[0])
flag.PrintDefaults()
}
flag.StringVar(&output, "out", "out.go", "Specify a path to the output file")
flag.Parse()
}
func main() {
checkRequirements()
file, err := os.Open(flag.Arg(0))
if err != nil {
fmt.Printf("Error! %s\n", err)
os.Exit(2)
}
defer file.Close()
prog := "go"
path, err := exec.LookPath(prog)
if err != nil {
fmt.Printf("Please, install %s first.", prog)
}
fmt.Printf("%s is available at %s\n", prog, path)
fmt.Printf("input file: %s, output file: %s\n", flag.Arg(0), output)
}
func checkRequirements() {
args := flag.Args()
if len(args) == 0 {
flag.Usage()
fmt.Printf("Error! The input file is required\n")
os.Exit(1)
} else if len(args) > 1 {
fmt.Printf("Notice! To many positional arguments, ignoring %v\n", args[1:])
}
}
## Instruction:
Use `log` package instead of `fmt` for logging and exiting
## Code After:
package main
import (
"flag"
"fmt"
"log"
"os"
"os/exec"
)
var output string
func init() {
flag.Usage = func() {
fmt.Printf("Usage: %s [-out=out.path] in.path\n\n", os.Args[0])
flag.PrintDefaults()
}
flag.StringVar(&output, "out", "out.go", "Specify a path to the output file")
flag.Parse()
}
func main() {
checkRequirements()
file, err := os.Open(flag.Arg(0))
if err != nil {
log.Fatalf("%s\n", err)
}
defer file.Close()
prog := "go"
path, err := exec.LookPath(prog)
if err != nil {
log.Fatalf("please, install %s first.", prog)
}
fmt.Printf("%s is available at %s\n", prog, path)
fmt.Printf("input file: %s, output file: %s\n", flag.Arg(0), output)
}
func checkRequirements() {
args := flag.Args()
if len(args) == 0 {
flag.Usage()
log.Fatalf("the input file not specified\n")
} else if len(args) > 1 {
log.Printf("to many positional arguments, ignoring %v\n", args[1:])
}
}
|
168bb6c1bf687f514c58e09cb953c0621c80bf92 | README.md | README.md |
**lita-slack** is an adapter for [Lita](https://www.lita.io/) that allows you to use the robot with [Slack](https://slack.com/). The current adapter is not compatible with pre-1.0.0 versions, as it now uses Slack's [Real Time Messaging API](https://api.slack.com/rtm).
## Installation
Add **lita-slack** to your Lita instance's Gemfile:
``` ruby
gem "lita-slack"
```
## Configuration
### Required attributes
* `token` (String) – The bot's Slack API token. Create a bot and get its token at https://my.slack.com/services/new/bot.
### Example
``` ruby
Lita.configure do |config|
config.robot.name = "Lita"
config.robot.adapter = :slack
config.adapters.slack.token = "abcd-1234567890-hWYd21AmMH2UHAkx29vb5c1Y"
end
```
## Events
* `:connected` - When the robot has connected to Slack. No payload.
* `:disconnected` - When the robot has disconnected from Slack. No payload.
## License
[MIT](http://opensource.org/licenses/MIT)
|
**lita-slack** is an adapter for [Lita](https://www.lita.io/) that allows you to use the robot with [Slack](https://slack.com/). The current adapter is not compatible with pre-1.0.0 versions, as it now uses Slack's [Real Time Messaging API](https://api.slack.com/rtm).
## Installation
Add **lita-slack** to your Lita instance's Gemfile:
``` ruby
gem "lita-slack"
```
## Configuration
### Required attributes
* `token` (String) – The bot's Slack API token. Create a bot and get its token at https://my.slack.com/services/new/bot.
**Note**: When using lita-slack, the adapter will overwrite the bot's name and mention name with the values set on the server, so `config.robot.name` and `config.robot.mention_name` will have no effect.
### Example
``` ruby
Lita.configure do |config|
config.robot.adapter = :slack
config.adapters.slack.token = "abcd-1234567890-hWYd21AmMH2UHAkx29vb5c1Y"
end
```
## Events
* `:connected` - When the robot has connected to Slack. No payload.
* `:disconnected` - When the robot has disconnected from Slack. No payload.
## License
[MIT](http://opensource.org/licenses/MIT)
| Add note about the robot's name and mention name being automatically set. | Add note about the robot's name and mention name being automatically set.
| Markdown | mit | erikogan/lita-slack,SCPR/lita-slack,clintkelly/lita-slack,byroot/lita-slack,litaio/lita-slack,kenjij/lita-slack,pallan/lita-slack,envoy/lita-slack,jaisonerick/lita-slack,librato/lita-slack,ajaleelp/lita-slack,josacar/lita-slack | markdown | ## Code Before:
**lita-slack** is an adapter for [Lita](https://www.lita.io/) that allows you to use the robot with [Slack](https://slack.com/). The current adapter is not compatible with pre-1.0.0 versions, as it now uses Slack's [Real Time Messaging API](https://api.slack.com/rtm).
## Installation
Add **lita-slack** to your Lita instance's Gemfile:
``` ruby
gem "lita-slack"
```
## Configuration
### Required attributes
* `token` (String) – The bot's Slack API token. Create a bot and get its token at https://my.slack.com/services/new/bot.
### Example
``` ruby
Lita.configure do |config|
config.robot.name = "Lita"
config.robot.adapter = :slack
config.adapters.slack.token = "abcd-1234567890-hWYd21AmMH2UHAkx29vb5c1Y"
end
```
## Events
* `:connected` - When the robot has connected to Slack. No payload.
* `:disconnected` - When the robot has disconnected from Slack. No payload.
## License
[MIT](http://opensource.org/licenses/MIT)
## Instruction:
Add note about the robot's name and mention name being automatically set.
## Code After:
**lita-slack** is an adapter for [Lita](https://www.lita.io/) that allows you to use the robot with [Slack](https://slack.com/). The current adapter is not compatible with pre-1.0.0 versions, as it now uses Slack's [Real Time Messaging API](https://api.slack.com/rtm).
## Installation
Add **lita-slack** to your Lita instance's Gemfile:
``` ruby
gem "lita-slack"
```
## Configuration
### Required attributes
* `token` (String) – The bot's Slack API token. Create a bot and get its token at https://my.slack.com/services/new/bot.
**Note**: When using lita-slack, the adapter will overwrite the bot's name and mention name with the values set on the server, so `config.robot.name` and `config.robot.mention_name` will have no effect.
### Example
``` ruby
Lita.configure do |config|
config.robot.adapter = :slack
config.adapters.slack.token = "abcd-1234567890-hWYd21AmMH2UHAkx29vb5c1Y"
end
```
## Events
* `:connected` - When the robot has connected to Slack. No payload.
* `:disconnected` - When the robot has disconnected from Slack. No payload.
## License
[MIT](http://opensource.org/licenses/MIT)
|
a4bfb1f2f26230c97d6266cfd28a715b2de9e65f | src/_patterns/02-components/05-bolt-background-shapes/src/shape-groups.json | src/_patterns/02-components/05-bolt-background-shapes/src/shape-groups.json | {
"A": [
{
"shape": "circle-square",
"color": "yellow",
"interiorColor": "indigo"
},
{
"shape": "outline-circle",
"color": "orange"
},
{
"shape": "square-square",
"color": "orange",
"interiorColor": "yellow"
},
{
"shape": "little-circle",
"color": "teal"
},
{
"shape": "square-square",
"color": "teal",
"interiorColor": "indigo"
},
{
"shape": "little-circle",
"color": "orange"
}
],
"B": [
{
"shape": "square-square",
"color": "yellow",
"interiorColor": "indigo"
},
{
"shape": "outline-circle",
"color": "orange"
},
{
"shape": "square-square",
"color": "orange",
"interiorColor": "indigo"
},
{
"shape": "little-circle",
"color": "teal"
},
{
"shape": "circle-circle",
"color": "yellow",
"interiorColor": "orange"
},
{
"shape": "outline-circle",
"color": "yellow"
}
]
}
| {
"A": [
{
"shape": "circle-square",
"color": "yellow",
"interiorColor": "indigo"
},
{
"shape": "outline-circle",
"color": "orange"
},
{
"shape": "square-square",
"color": "teal",
"interiorColor": "indigo"
},
{
"shape": "little-circle",
"color": "teal"
},
{
"shape": "square-square",
"color": "yellow",
"interiorColor": "indigo"
},
{
"shape": "little-circle",
"color": "orange"
}
],
"B": [
{
"shape": "square-square",
"color": "teal",
"interiorColor": "indigo"
},
{
"shape": "outline-circle",
"color": "yellow"
},
{
"shape": "square-square",
"color": "orange",
"interiorColor": "indigo"
},
{
"shape": "little-circle",
"color": "teal"
},
{
"shape": "circle-circle",
"color": "teal",
"interiorColor": "orange"
},
{
"shape": "outline-circle",
"color": "yellow"
}
]
}
| Update shape colors based on feedback from Matt | BK-26: Update shape colors based on feedback from Matt
| JSON | mit | bolt-design-system/bolt,bolt-design-system/bolt,bolt-design-system/bolt,bolt-design-system/bolt,bolt-design-system/bolt | json | ## Code Before:
{
"A": [
{
"shape": "circle-square",
"color": "yellow",
"interiorColor": "indigo"
},
{
"shape": "outline-circle",
"color": "orange"
},
{
"shape": "square-square",
"color": "orange",
"interiorColor": "yellow"
},
{
"shape": "little-circle",
"color": "teal"
},
{
"shape": "square-square",
"color": "teal",
"interiorColor": "indigo"
},
{
"shape": "little-circle",
"color": "orange"
}
],
"B": [
{
"shape": "square-square",
"color": "yellow",
"interiorColor": "indigo"
},
{
"shape": "outline-circle",
"color": "orange"
},
{
"shape": "square-square",
"color": "orange",
"interiorColor": "indigo"
},
{
"shape": "little-circle",
"color": "teal"
},
{
"shape": "circle-circle",
"color": "yellow",
"interiorColor": "orange"
},
{
"shape": "outline-circle",
"color": "yellow"
}
]
}
## Instruction:
BK-26: Update shape colors based on feedback from Matt
## Code After:
{
"A": [
{
"shape": "circle-square",
"color": "yellow",
"interiorColor": "indigo"
},
{
"shape": "outline-circle",
"color": "orange"
},
{
"shape": "square-square",
"color": "teal",
"interiorColor": "indigo"
},
{
"shape": "little-circle",
"color": "teal"
},
{
"shape": "square-square",
"color": "yellow",
"interiorColor": "indigo"
},
{
"shape": "little-circle",
"color": "orange"
}
],
"B": [
{
"shape": "square-square",
"color": "teal",
"interiorColor": "indigo"
},
{
"shape": "outline-circle",
"color": "yellow"
},
{
"shape": "square-square",
"color": "orange",
"interiorColor": "indigo"
},
{
"shape": "little-circle",
"color": "teal"
},
{
"shape": "circle-circle",
"color": "teal",
"interiorColor": "orange"
},
{
"shape": "outline-circle",
"color": "yellow"
}
]
}
|
3485612b635e6d0e9a0f9289c16bc31648d10f2c | PercentEncoder/PercentEncoder/String+PercentEncoder.swift | PercentEncoder/PercentEncoder/String+PercentEncoder.swift | //
// String+PercentEncoder.swift
// PercentEncoder
//
// Created by Kazunobu Tasaka on 8/4/15.
// Copyright (c) 2015 Kazunobu Tasaka. All rights reserved.
//
import Foundation
public extension String {
func encodeURI() -> String {
return PercentEncoding.EncodeURI.evaluate(string: self)
}
func encodeURIComponent() -> String {
return PercentEncoding.EncodeURIComponent.evaluate(string: self)
}
func decodeURI() -> String {
return PercentEncoding.DecodeURI.evaluate(string: self)
}
func decodeURIComponent() -> String {
return PercentEncoding.DecodeURIComponent.evaluate(string: self)
}
} | //
// String+PercentEncoder.swift
// PercentEncoder
//
// Created by Kazunobu Tasaka on 8/4/15.
// Copyright (c) 2015 Kazunobu Tasaka. All rights reserved.
//
import Foundation
public extension String {
func ped_encodeURI() -> String {
return PercentEncoding.EncodeURI.evaluate(string: self)
}
func ped_encodeURIComponent() -> String {
return PercentEncoding.EncodeURIComponent.evaluate(string: self)
}
func ped_decodeURI() -> String {
return PercentEncoding.DecodeURI.evaluate(string: self)
}
func ped_decodeURIComponent() -> String {
return PercentEncoding.DecodeURIComponent.evaluate(string: self)
}
} | Append prefix string "ped" to String extension methods | Append prefix string "ped" to String extension methods
| Swift | mit | tasanobu/PercentEncoder,tasanobu/PercentEncoder | swift | ## Code Before:
//
// String+PercentEncoder.swift
// PercentEncoder
//
// Created by Kazunobu Tasaka on 8/4/15.
// Copyright (c) 2015 Kazunobu Tasaka. All rights reserved.
//
import Foundation
public extension String {
func encodeURI() -> String {
return PercentEncoding.EncodeURI.evaluate(string: self)
}
func encodeURIComponent() -> String {
return PercentEncoding.EncodeURIComponent.evaluate(string: self)
}
func decodeURI() -> String {
return PercentEncoding.DecodeURI.evaluate(string: self)
}
func decodeURIComponent() -> String {
return PercentEncoding.DecodeURIComponent.evaluate(string: self)
}
}
## Instruction:
Append prefix string "ped" to String extension methods
## Code After:
//
// String+PercentEncoder.swift
// PercentEncoder
//
// Created by Kazunobu Tasaka on 8/4/15.
// Copyright (c) 2015 Kazunobu Tasaka. All rights reserved.
//
import Foundation
public extension String {
func ped_encodeURI() -> String {
return PercentEncoding.EncodeURI.evaluate(string: self)
}
func ped_encodeURIComponent() -> String {
return PercentEncoding.EncodeURIComponent.evaluate(string: self)
}
func ped_decodeURI() -> String {
return PercentEncoding.DecodeURI.evaluate(string: self)
}
func ped_decodeURIComponent() -> String {
return PercentEncoding.DecodeURIComponent.evaluate(string: self)
}
} |
13d7c887a2c3926622d6c66fa1e0202527bb915a | features/step_definitions/website_management_steps.rb | features/step_definitions/website_management_steps.rb | Given /^I am logged in as an administrator$/ do
@current_user = User.create!(
:email => 'a@b.c',
:name => 'Admin',
:password => 'admin'
) { |u| u.admin = true }
Given "I am on the login page"
fill_in("Email", :with => 'a@b.c')
fill_in("Password", :with => 'admin')
click_button("Login")
visit url_for response.redirected_to()
end
Then /^I should see a list of websites$/ do
Then "I should see \"#{websites(:guitar_gear).name}\""
Then "I should see \"#{websites(:website_without_analytics).name}\""
end
Then /^I should see links to edit websites$/ do
# check one of the websites
response.should have_xpath("//a[@href='#{edit_website_path(websites(:guitar_gear))}']")
end
Then /^I should see a link to add a new website$/ do
response.should have_xpath("//a[@href='#{new_website_path}']")
end
Then /^a new website should exist with the domain "([^\"]*)"$/ do |domain|
Website.find_by_domain(domain).should_not be_nil
end
| Given /^I am logged in as an administrator$/ do
@current_user = User.create!(
:email => 'admin@example.org',
:name => 'Admin',
:password => 'admin'
) { |u| u.admin = true }
Given "I am on the login page"
fill_in("Email", :with => @current_user.email)
fill_in("Password", :with => @current_user.password)
click_button("Login")
visit url_for response.redirected_to()
end
Then /^I should see a list of websites$/ do
Then "I should see \"#{websites(:guitar_gear).name}\""
Then "I should see \"#{websites(:website_without_analytics).name}\""
end
Then /^I should see links to edit websites$/ do
# check one of the websites
response.should have_xpath("//a[@href='#{edit_website_path(websites(:guitar_gear))}']")
end
Then /^I should see a link to add a new website$/ do
response.should have_xpath("//a[@href='#{new_website_path}']")
end
Then /^a new website should exist with the domain "([^\"]*)"$/ do |domain|
Website.find_by_domain(domain).should_not be_nil
end
| Use a valid email address for administrator user account in 'I am logged in as an administrator' cucumber step | Use a valid email address for administrator user account in 'I am logged in as an administrator' cucumber step
| Ruby | mit | ianfleeton/zmey,ianfleeton/zmey,ianfleeton/zmey,ianfleeton/zmey | ruby | ## Code Before:
Given /^I am logged in as an administrator$/ do
@current_user = User.create!(
:email => 'a@b.c',
:name => 'Admin',
:password => 'admin'
) { |u| u.admin = true }
Given "I am on the login page"
fill_in("Email", :with => 'a@b.c')
fill_in("Password", :with => 'admin')
click_button("Login")
visit url_for response.redirected_to()
end
Then /^I should see a list of websites$/ do
Then "I should see \"#{websites(:guitar_gear).name}\""
Then "I should see \"#{websites(:website_without_analytics).name}\""
end
Then /^I should see links to edit websites$/ do
# check one of the websites
response.should have_xpath("//a[@href='#{edit_website_path(websites(:guitar_gear))}']")
end
Then /^I should see a link to add a new website$/ do
response.should have_xpath("//a[@href='#{new_website_path}']")
end
Then /^a new website should exist with the domain "([^\"]*)"$/ do |domain|
Website.find_by_domain(domain).should_not be_nil
end
## Instruction:
Use a valid email address for administrator user account in 'I am logged in as an administrator' cucumber step
## Code After:
Given /^I am logged in as an administrator$/ do
@current_user = User.create!(
:email => 'admin@example.org',
:name => 'Admin',
:password => 'admin'
) { |u| u.admin = true }
Given "I am on the login page"
fill_in("Email", :with => @current_user.email)
fill_in("Password", :with => @current_user.password)
click_button("Login")
visit url_for response.redirected_to()
end
Then /^I should see a list of websites$/ do
Then "I should see \"#{websites(:guitar_gear).name}\""
Then "I should see \"#{websites(:website_without_analytics).name}\""
end
Then /^I should see links to edit websites$/ do
# check one of the websites
response.should have_xpath("//a[@href='#{edit_website_path(websites(:guitar_gear))}']")
end
Then /^I should see a link to add a new website$/ do
response.should have_xpath("//a[@href='#{new_website_path}']")
end
Then /^a new website should exist with the domain "([^\"]*)"$/ do |domain|
Website.find_by_domain(domain).should_not be_nil
end
|
90798c3cb69b621834bc5d4066e24a1ff67ff59c | locales/fr/share.properties | locales/fr/share.properties |
title=Merci de votre inscription !
# Alt text for button
share_email_tooltip=Partager par courriel
# Alt text for button
share_fb_tooltip=Partager sur Facebook
# Alt text for button
share_twitter_tooltip=Partager sur twitter
# Message when sharing via email
# Message when sharing via Facebook
fb_share_title_b=À quoi jouent-ils en ce moment ?
fb_share_desc_b=Vous n’avez peut-être pas beaucoup entendu parler de la réforme du droit d’auteur, mais c’est un sujet critique pour l’internet. Apprenez-en davantage sur le sujet et rejoignez le mouvement ! {fbLink}
# Used in a tweet, please keep under 130 characters (including the link variable)
# Used in a tweet, please keep under 130 characters (including the link variable)
|
title=Merci de votre inscription !
headline=N’hésitez pas à utiliser les boutons ci-dessous pour faire passer le message :
# Alt text for button
share_email_tooltip=Partager par courriel
# Alt text for button
share_fb_tooltip=Partager sur Facebook
# Alt text for button
share_twitter_tooltip=Partager sur twitter
# Message when sharing via email, feel free to rephrase the subject so that it looks legit
# Message when sharing via Facebook
fb_share_title_b=À quoi jouent-ils en ce moment ?
fb_share_desc_b=Vous n’avez peut-être pas beaucoup entendu parler de la réforme du droit d’auteur, mais c’est un sujet critique pour l’internet. Apprenez-en davantage sur le sujet et rejoignez le mouvement ! {fbLink}
# Used in a tweet, please keep under 130 characters (including the link variable)
# Used in a tweet, please keep under 130 characters (including the link variable)
| Update French (fr) localization of EU Copyright campaign | Pontoon: Update French (fr) localization of EU Copyright campaign
Localization authors:
- Théo Chevalier <theo.chevalier11@gmail.com>
| INI | mpl-2.0 | mozilla/copyright | ini | ## Code Before:
title=Merci de votre inscription !
# Alt text for button
share_email_tooltip=Partager par courriel
# Alt text for button
share_fb_tooltip=Partager sur Facebook
# Alt text for button
share_twitter_tooltip=Partager sur twitter
# Message when sharing via email
# Message when sharing via Facebook
fb_share_title_b=À quoi jouent-ils en ce moment ?
fb_share_desc_b=Vous n’avez peut-être pas beaucoup entendu parler de la réforme du droit d’auteur, mais c’est un sujet critique pour l’internet. Apprenez-en davantage sur le sujet et rejoignez le mouvement ! {fbLink}
# Used in a tweet, please keep under 130 characters (including the link variable)
# Used in a tweet, please keep under 130 characters (including the link variable)
## Instruction:
Pontoon: Update French (fr) localization of EU Copyright campaign
Localization authors:
- Théo Chevalier <theo.chevalier11@gmail.com>
## Code After:
title=Merci de votre inscription !
headline=N’hésitez pas à utiliser les boutons ci-dessous pour faire passer le message :
# Alt text for button
share_email_tooltip=Partager par courriel
# Alt text for button
share_fb_tooltip=Partager sur Facebook
# Alt text for button
share_twitter_tooltip=Partager sur twitter
# Message when sharing via email, feel free to rephrase the subject so that it looks legit
# Message when sharing via Facebook
fb_share_title_b=À quoi jouent-ils en ce moment ?
fb_share_desc_b=Vous n’avez peut-être pas beaucoup entendu parler de la réforme du droit d’auteur, mais c’est un sujet critique pour l’internet. Apprenez-en davantage sur le sujet et rejoignez le mouvement ! {fbLink}
# Used in a tweet, please keep under 130 characters (including the link variable)
# Used in a tweet, please keep under 130 characters (including the link variable)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.