commit stringlengths 40 40 | old_file stringlengths 4 184 | new_file stringlengths 4 184 | old_contents stringlengths 1 3.6k | new_contents stringlengths 5 3.38k | subject stringlengths 15 778 | message stringlengths 16 6.74k | lang stringclasses 201 values | license stringclasses 13 values | repos stringlengths 6 116k | config stringclasses 201 values | content stringlengths 137 7.24k | diff stringlengths 26 5.55k | diff_length int64 1 123 | relative_diff_length float64 0.01 89 | n_lines_added int64 0 108 | n_lines_deleted int64 0 106 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5fce35665c9376ae21896547f788b10672e8a990 | src/main/java/openmods/utils/CachedFactory.java | src/main/java/openmods/utils/CachedFactory.java | package openmods.utils;
import java.util.Map;
import com.google.common.collect.Maps;
public abstract class CachedFactory<K, V> {
private final Map<K, V> cache = Maps.newHashMap();
public V getOrCreate(K key) {
V value = cache.get(key);
if (value == null) {
value = create(key);
cache.put(key, value);
}
return value;
}
protected abstract V create(K key);
}
| package openmods.utils;
import java.util.Map;
import com.google.common.collect.Maps;
public abstract class CachedFactory<K, V> {
private final Map<K, V> cache = Maps.newHashMap();
public V getOrCreate(K key) {
V value = cache.get(key);
if (value == null) {
value = create(key);
cache.put(key, value);
}
return value;
}
public V remove(K key) {
return cache.remove(key);
}
protected abstract V create(K key);
}
| Add remove method to cached factory | Add remove method to cached factory
| Java | mit | nevercast/OpenModsLib,OpenMods/OpenModsLib,OpenMods/OpenModsLib | java | ## Code Before:
package openmods.utils;
import java.util.Map;
import com.google.common.collect.Maps;
public abstract class CachedFactory<K, V> {
private final Map<K, V> cache = Maps.newHashMap();
public V getOrCreate(K key) {
V value = cache.get(key);
if (value == null) {
value = create(key);
cache.put(key, value);
}
return value;
}
protected abstract V create(K key);
}
## Instruction:
Add remove method to cached factory
## Code After:
package openmods.utils;
import java.util.Map;
import com.google.common.collect.Maps;
public abstract class CachedFactory<K, V> {
private final Map<K, V> cache = Maps.newHashMap();
public V getOrCreate(K key) {
V value = cache.get(key);
if (value == null) {
value = create(key);
cache.put(key, value);
}
return value;
}
public V remove(K key) {
return cache.remove(key);
}
protected abstract V create(K key);
}
| package openmods.utils;
import java.util.Map;
import com.google.common.collect.Maps;
public abstract class CachedFactory<K, V> {
private final Map<K, V> cache = Maps.newHashMap();
public V getOrCreate(K key) {
V value = cache.get(key);
if (value == null) {
value = create(key);
cache.put(key, value);
}
return value;
}
+ public V remove(K key) {
+ return cache.remove(key);
+ }
+
protected abstract V create(K key);
} | 4 | 0.173913 | 4 | 0 |
76887acef713e2b3451eaa9a0e6b73fb11d6d0ea | src/html/assets/themes/fabrizio1.0/templates/partials/credential-markup.php | src/html/assets/themes/fabrizio1.0/templates/partials/credential-markup.php | <h4>Details for your app: <em><?php $this->utility->safe($name); ?></em></h4>
<div class="row">
<div class="span12">
<table class="table left-header">
<tr>
<td class="span2">Name</td>
<td><?php $this->utility->safe($name); ?></td>
</tr>
<tr>
<td>Consumer Key</td>
<td><?php $this->utility->safe($id); ?></td>
</tr>
<tr>
<td>Consumer Secret</td>
<td><?php $this->utility->safe($clientSecret); ?></td>
</tr>
<tr>
<td>OAuth Token</td>
<td><?php $this->utility->safe($userToken); ?></td>
</tr>
<tr>
<td>OAuth Secret</td>
<td><?php $this->utility->safe($userSecret); ?></td>
</tr>
<tr>
<td>Type</td>
<td>
<?php $this->utility->safe($type); ?>
<?php if($type !== Credential::typeAccess) { ?>
<small>(Only access tokens can be used)</small>
<?php } ?>
</td>
</tr>
</table>
</div>
</div>
<a href="#" class="batchHide close" title="Close this dialog"><i class="icon-remove batchHide"></i></a>
| <h4>Details for your app: <em><?php $this->utility->safe($name); ?></em></h4>
<div class="row">
<div class="span12">
<table class="table left-header">
<tr>
<td class="span2">Name</td>
<td><?php $this->utility->safe($name); ?></td>
</tr>
<tr>
<td>consumerKey =</td>
<td><?php $this->utility->safe($id); ?></td>
</tr>
<tr>
<td>consumerSecret =</td>
<td><?php $this->utility->safe($clientSecret); ?></td>
</tr>
<tr>
<td>token =</td>
<td><?php $this->utility->safe($userToken); ?></td>
</tr>
<tr>
<td>tokenSecret =</td>
<td><?php $this->utility->safe($userSecret); ?></td>
</tr>
<tr>
<td>Type</td>
<td>
<?php $this->utility->safe($type); ?>
<?php if($type !== Credential::typeAccess) { ?>
<small>(Only access tokens can be used)</small>
<?php } ?>
</td>
</tr>
</table>
</div>
</div>
<a href="#" class="batchHide close" title="Close this dialog"><i class="icon-remove batchHide"></i></a>
| Change credential text to use the same identifiers as the commandline tools | Change credential text to use the same identifiers as the commandline tools
This allows a single simple cut/paste into a config file.
| PHP | apache-2.0 | EMarcais/frontend,photo/frontend,meatcar/frontend,EMarcais/frontend,yetixxx83/frontend,photo/frontend,photo/frontend,Yetangitu/frontend,Yetangitu/frontend,Yetangitu/frontend,photo/frontend,meatcar/frontend,yetixxx83/frontend,ashwingj/frontend,EMarcais/frontend,mrzen/trovebox,ashwingj/frontend,mrzen/trovebox,meatcar/frontend,mrzen/trovebox,mrzen/trovebox,ashwingj/frontend,Yetangitu/frontend,yetixxx83/frontend,EMarcais/frontend,ashwingj/frontend,meatcar/frontend,yetixxx83/frontend | php | ## Code Before:
<h4>Details for your app: <em><?php $this->utility->safe($name); ?></em></h4>
<div class="row">
<div class="span12">
<table class="table left-header">
<tr>
<td class="span2">Name</td>
<td><?php $this->utility->safe($name); ?></td>
</tr>
<tr>
<td>Consumer Key</td>
<td><?php $this->utility->safe($id); ?></td>
</tr>
<tr>
<td>Consumer Secret</td>
<td><?php $this->utility->safe($clientSecret); ?></td>
</tr>
<tr>
<td>OAuth Token</td>
<td><?php $this->utility->safe($userToken); ?></td>
</tr>
<tr>
<td>OAuth Secret</td>
<td><?php $this->utility->safe($userSecret); ?></td>
</tr>
<tr>
<td>Type</td>
<td>
<?php $this->utility->safe($type); ?>
<?php if($type !== Credential::typeAccess) { ?>
<small>(Only access tokens can be used)</small>
<?php } ?>
</td>
</tr>
</table>
</div>
</div>
<a href="#" class="batchHide close" title="Close this dialog"><i class="icon-remove batchHide"></i></a>
## Instruction:
Change credential text to use the same identifiers as the commandline tools
This allows a single simple cut/paste into a config file.
## Code After:
<h4>Details for your app: <em><?php $this->utility->safe($name); ?></em></h4>
<div class="row">
<div class="span12">
<table class="table left-header">
<tr>
<td class="span2">Name</td>
<td><?php $this->utility->safe($name); ?></td>
</tr>
<tr>
<td>consumerKey =</td>
<td><?php $this->utility->safe($id); ?></td>
</tr>
<tr>
<td>consumerSecret =</td>
<td><?php $this->utility->safe($clientSecret); ?></td>
</tr>
<tr>
<td>token =</td>
<td><?php $this->utility->safe($userToken); ?></td>
</tr>
<tr>
<td>tokenSecret =</td>
<td><?php $this->utility->safe($userSecret); ?></td>
</tr>
<tr>
<td>Type</td>
<td>
<?php $this->utility->safe($type); ?>
<?php if($type !== Credential::typeAccess) { ?>
<small>(Only access tokens can be used)</small>
<?php } ?>
</td>
</tr>
</table>
</div>
</div>
<a href="#" class="batchHide close" title="Close this dialog"><i class="icon-remove batchHide"></i></a>
| <h4>Details for your app: <em><?php $this->utility->safe($name); ?></em></h4>
<div class="row">
<div class="span12">
<table class="table left-header">
<tr>
<td class="span2">Name</td>
<td><?php $this->utility->safe($name); ?></td>
</tr>
<tr>
- <td>Consumer Key</td>
? ^ -
+ <td>consumerKey =</td>
? ^ ++
<td><?php $this->utility->safe($id); ?></td>
</tr>
<tr>
- <td>Consumer Secret</td>
? ^ -
+ <td>consumerSecret =</td>
? ^ ++
<td><?php $this->utility->safe($clientSecret); ?></td>
</tr>
<tr>
- <td>OAuth Token</td>
? --- ---
+ <td>token =</td>
? ++
<td><?php $this->utility->safe($userToken); ?></td>
</tr>
<tr>
- <td>OAuth Secret</td>
? --- ^^
+ <td>tokenSecret =</td>
? ^^^^ ++
<td><?php $this->utility->safe($userSecret); ?></td>
</tr>
<tr>
<td>Type</td>
<td>
<?php $this->utility->safe($type); ?>
<?php if($type !== Credential::typeAccess) { ?>
<small>(Only access tokens can be used)</small>
<?php } ?>
</td>
</tr>
</table>
</div>
</div>
<a href="#" class="batchHide close" title="Close this dialog"><i class="icon-remove batchHide"></i></a> | 8 | 0.216216 | 4 | 4 |
7e71970b1cb76c8a916e365491ca07252a61a208 | src/server.js | src/server.js | import express from 'express';
import ReactDOMServer from 'react-dom/server'
import {Router} from 'react-router';
import MemoryHistory from 'react-router/lib/MemoryHistory';
import React from 'react';
import routes from './routing';
let app = express();
//app.engine('html', require('ejs').renderFile);
//app.set('view engine', 'html');
app.use(function (req, res, next) {
let history = new MemoryHistory([req.url]);
let html = ReactDOMServer.renderToString(
<Router history={history}>
{routes}
</Router>
);
return res.send(html);
/*var router = Router.create({location: req.url, routes: routes})
router.run(function(Handler, state) {
var html = ReactDOMServer.renderToString(<Handler/>)
return res.render('react_page', {html: html})
})*/
});
let server = app.listen(8000, function () {
var host = server.address().address;
var port = server.address().port;
console.log('Example app listening at http://%s:%s', host, port);
});
| import express from 'express';
import ReactDOMServer from 'react-dom/server'
import {Router} from 'react-router';
import MemoryHistory from 'react-router/lib/MemoryHistory';
import React from 'react';
import routes from './routing';
let app = express();
//app.engine('html', require('ejs').renderFile);
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');
app.use(express.static('../public'));
app.use(function (req, res, next) {
let history = new MemoryHistory([req.url]);
let html = ReactDOMServer.renderToString(
<Router history={history}>
{routes}
</Router>
);
return res.render('index', {html: html});
});
let server = app.listen(8000, function () {
var host = server.address().address;
var port = server.address().port;
console.log('Example app listening at http://%s:%s', host, port);
});
| Handle initial page laod via express | Handle initial page laod via express
| JavaScript | agpl-3.0 | voidxnull/libertysoil-site,Lokiedu/libertysoil-site,voidxnull/libertysoil-site,Lokiedu/libertysoil-site | javascript | ## Code Before:
import express from 'express';
import ReactDOMServer from 'react-dom/server'
import {Router} from 'react-router';
import MemoryHistory from 'react-router/lib/MemoryHistory';
import React from 'react';
import routes from './routing';
let app = express();
//app.engine('html', require('ejs').renderFile);
//app.set('view engine', 'html');
app.use(function (req, res, next) {
let history = new MemoryHistory([req.url]);
let html = ReactDOMServer.renderToString(
<Router history={history}>
{routes}
</Router>
);
return res.send(html);
/*var router = Router.create({location: req.url, routes: routes})
router.run(function(Handler, state) {
var html = ReactDOMServer.renderToString(<Handler/>)
return res.render('react_page', {html: html})
})*/
});
let server = app.listen(8000, function () {
var host = server.address().address;
var port = server.address().port;
console.log('Example app listening at http://%s:%s', host, port);
});
## Instruction:
Handle initial page laod via express
## Code After:
import express from 'express';
import ReactDOMServer from 'react-dom/server'
import {Router} from 'react-router';
import MemoryHistory from 'react-router/lib/MemoryHistory';
import React from 'react';
import routes from './routing';
let app = express();
//app.engine('html', require('ejs').renderFile);
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');
app.use(express.static('../public'));
app.use(function (req, res, next) {
let history = new MemoryHistory([req.url]);
let html = ReactDOMServer.renderToString(
<Router history={history}>
{routes}
</Router>
);
return res.render('index', {html: html});
});
let server = app.listen(8000, function () {
var host = server.address().address;
var port = server.address().port;
console.log('Example app listening at http://%s:%s', host, port);
});
| import express from 'express';
import ReactDOMServer from 'react-dom/server'
import {Router} from 'react-router';
import MemoryHistory from 'react-router/lib/MemoryHistory';
import React from 'react';
import routes from './routing';
let app = express();
//app.engine('html', require('ejs').renderFile);
+
+ app.set('views', __dirname + '/views');
- //app.set('view engine', 'html');
? -- ^^^^
+ app.set('view engine', 'ejs');
? ^^^
+
+ app.use(express.static('../public'));
app.use(function (req, res, next) {
let history = new MemoryHistory([req.url]);
let html = ReactDOMServer.renderToString(
<Router history={history}>
{routes}
</Router>
);
- return res.send(html);
+ return res.render('index', {html: html});
- /*var router = Router.create({location: req.url, routes: routes})
- router.run(function(Handler, state) {
- var html = ReactDOMServer.renderToString(<Handler/>)
- return res.render('react_page', {html: html})
- })*/
});
let server = app.listen(8000, function () {
var host = server.address().address;
var port = server.address().port;
console.log('Example app listening at http://%s:%s', host, port);
}); | 13 | 0.342105 | 6 | 7 |
e64cb6727eb613289f51428610899293de452b64 | tcp_listeners.go | tcp_listeners.go | // Copyright (c) 2017, Janoš Guljaš <janos@resenje.org>
// All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package web
import (
"net"
"time"
)
// TCPKeepAliveListener sets TCP keep alive period.
type TCPKeepAliveListener struct {
*net.TCPListener
}
// NewTCPKeepAliveListener creates TCPKeepAliveListener
// from net.TCPListener.
func NewTCPKeepAliveListener(listener *net.TCPListener) TCPKeepAliveListener {
return TCPKeepAliveListener{TCPListener: listener}
}
// Accept accepts TCP connection and sets TCP keep alive period
func (ln TCPKeepAliveListener) Accept() (c net.Conn, err error) {
tc, err := ln.AcceptTCP()
if err != nil {
return
}
tc.SetKeepAlive(true)
tc.SetKeepAlivePeriod(3 * time.Minute)
return tc, nil
}
| // Copyright (c) 2017, Janoš Guljaš <janos@resenje.org>
// All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package web
import (
"net"
"time"
)
// TCPKeepAliveListener sets TCP keep alive period.
type TCPKeepAliveListener struct {
*net.TCPListener
}
// NewTCPKeepAliveListener creates TCPKeepAliveListener
// from net.TCPListener.
func NewTCPKeepAliveListener(listener *net.TCPListener) TCPKeepAliveListener {
return TCPKeepAliveListener{TCPListener: listener}
}
// Accept accepts TCP connection and sets TCP keep alive period
func (ln TCPKeepAliveListener) Accept() (c net.Conn, err error) {
tc, err := ln.AcceptTCP()
if err != nil {
return
}
if err := tc.SetKeepAlive(true); err != nil {
return nil, err
}
if err := tc.SetKeepAlivePeriod(3 * time.Minute); err != nil {
return nil, err
}
return tc, nil
}
| Check for errors from SetKeepAlive and SetKeepAlivePeriod in TCPKeepAliveListener Accept method | Check for errors from SetKeepAlive and SetKeepAlivePeriod in TCPKeepAliveListener Accept method
| Go | bsd-3-clause | janos/web,janos/httputils | go | ## Code Before:
// Copyright (c) 2017, Janoš Guljaš <janos@resenje.org>
// All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package web
import (
"net"
"time"
)
// TCPKeepAliveListener sets TCP keep alive period.
type TCPKeepAliveListener struct {
*net.TCPListener
}
// NewTCPKeepAliveListener creates TCPKeepAliveListener
// from net.TCPListener.
func NewTCPKeepAliveListener(listener *net.TCPListener) TCPKeepAliveListener {
return TCPKeepAliveListener{TCPListener: listener}
}
// Accept accepts TCP connection and sets TCP keep alive period
func (ln TCPKeepAliveListener) Accept() (c net.Conn, err error) {
tc, err := ln.AcceptTCP()
if err != nil {
return
}
tc.SetKeepAlive(true)
tc.SetKeepAlivePeriod(3 * time.Minute)
return tc, nil
}
## Instruction:
Check for errors from SetKeepAlive and SetKeepAlivePeriod in TCPKeepAliveListener Accept method
## Code After:
// Copyright (c) 2017, Janoš Guljaš <janos@resenje.org>
// All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package web
import (
"net"
"time"
)
// TCPKeepAliveListener sets TCP keep alive period.
type TCPKeepAliveListener struct {
*net.TCPListener
}
// NewTCPKeepAliveListener creates TCPKeepAliveListener
// from net.TCPListener.
func NewTCPKeepAliveListener(listener *net.TCPListener) TCPKeepAliveListener {
return TCPKeepAliveListener{TCPListener: listener}
}
// Accept accepts TCP connection and sets TCP keep alive period
func (ln TCPKeepAliveListener) Accept() (c net.Conn, err error) {
tc, err := ln.AcceptTCP()
if err != nil {
return
}
if err := tc.SetKeepAlive(true); err != nil {
return nil, err
}
if err := tc.SetKeepAlivePeriod(3 * time.Minute); err != nil {
return nil, err
}
return tc, nil
}
| // Copyright (c) 2017, Janoš Guljaš <janos@resenje.org>
// All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package web
import (
"net"
"time"
)
// TCPKeepAliveListener sets TCP keep alive period.
type TCPKeepAliveListener struct {
*net.TCPListener
}
// NewTCPKeepAliveListener creates TCPKeepAliveListener
// from net.TCPListener.
func NewTCPKeepAliveListener(listener *net.TCPListener) TCPKeepAliveListener {
return TCPKeepAliveListener{TCPListener: listener}
}
// Accept accepts TCP connection and sets TCP keep alive period
func (ln TCPKeepAliveListener) Accept() (c net.Conn, err error) {
tc, err := ln.AcceptTCP()
if err != nil {
return
}
- tc.SetKeepAlive(true)
+ if err := tc.SetKeepAlive(true); err != nil {
+ return nil, err
+ }
- tc.SetKeepAlivePeriod(3 * time.Minute)
+ if err := tc.SetKeepAlivePeriod(3 * time.Minute); err != nil {
? ++++++++++ ++++++++++++++
+ return nil, err
+ }
return tc, nil
} | 8 | 0.242424 | 6 | 2 |
8b30f787d3dabb9072ee0517cf0e5e92daa1038f | l10n_ch_dta_base_transaction_id/wizard/create_dta.py | l10n_ch_dta_base_transaction_id/wizard/create_dta.py |
from openerp.osv import orm
class DTAFileGenerator(orm.TransientModel):
_inherit = "create.dta.wizard"
def _set_bank_data(self, cr, uid, data, pline, elec_context,
seq, context=None):
super(DTAFileGenerator, self).\
_set_bank_data(cr, uid, data, pline,
elec_context, seq, context=context)
if pline.move_line_id.transaction_ref:
elec_context['reference'] = pline.move_line_id.transaction_ref
|
from openerp.osv import orm
class DTAFileGenerator(orm.TransientModel):
_inherit = "create.dta.wizard"
def _set_bank_data(self, cr, uid, pline, elec_context,
seq, context=None):
super(DTAFileGenerator, self).\
_set_bank_data(cr, uid, pline,
elec_context, seq, context=context)
if pline.move_line_id.transaction_ref:
elec_context['reference'] = pline.move_line_id.transaction_ref
| Fix TypeError: _set_bank_data() takes at least 7 arguments (7 given) | Fix TypeError: _set_bank_data() takes at least 7 arguments (7 given)
| Python | agpl-3.0 | open-net-sarl/l10n-switzerland,open-net-sarl/l10n-switzerland,BT-ojossen/l10n-switzerland,BT-ojossen/l10n-switzerland | python | ## Code Before:
from openerp.osv import orm
class DTAFileGenerator(orm.TransientModel):
_inherit = "create.dta.wizard"
def _set_bank_data(self, cr, uid, data, pline, elec_context,
seq, context=None):
super(DTAFileGenerator, self).\
_set_bank_data(cr, uid, data, pline,
elec_context, seq, context=context)
if pline.move_line_id.transaction_ref:
elec_context['reference'] = pline.move_line_id.transaction_ref
## Instruction:
Fix TypeError: _set_bank_data() takes at least 7 arguments (7 given)
## Code After:
from openerp.osv import orm
class DTAFileGenerator(orm.TransientModel):
_inherit = "create.dta.wizard"
def _set_bank_data(self, cr, uid, pline, elec_context,
seq, context=None):
super(DTAFileGenerator, self).\
_set_bank_data(cr, uid, pline,
elec_context, seq, context=context)
if pline.move_line_id.transaction_ref:
elec_context['reference'] = pline.move_line_id.transaction_ref
|
from openerp.osv import orm
class DTAFileGenerator(orm.TransientModel):
_inherit = "create.dta.wizard"
- def _set_bank_data(self, cr, uid, data, pline, elec_context,
? ------
+ def _set_bank_data(self, cr, uid, pline, elec_context,
seq, context=None):
super(DTAFileGenerator, self).\
- _set_bank_data(cr, uid, data, pline,
? ------
+ _set_bank_data(cr, uid, pline,
elec_context, seq, context=context)
if pline.move_line_id.transaction_ref:
elec_context['reference'] = pline.move_line_id.transaction_ref | 4 | 0.285714 | 2 | 2 |
075f73aa134e1c9c7d80dee6fc043bc2108e79d8 | setter-for-catan.scala | setter-for-catan.scala |
classpath="${CLASSPATH}"
unset CLASSPATH
exec ${SCALA_HOME}/bin/scala -cp "${classpath}" "$0" "$@" 2>&1
!#
import sfc.board._
/*
* @author noel.yap@gmail.com
*/
object `setter-for-catan` {
def main(args: Array[String]) {
if (args.length == 1) {
println(args(0) match {
case "small" => SmallBoard.board
case "small-spiral" => SmallSpiralBoard.board
case "small-traders-and-barbarians" => SmallTradersAndBarbariansBoard.board
case "small-traders-and-barbarians-spiral" => SmallTradersAndBarbariansSpiralBoard.board
})
}
}
}
|
classpath="${CLASSPATH}"
unset CLASSPATH # this is needed to prevent Scala object not found errors
exec ${SCALA_HOME}/bin/scala -cp "${classpath}" "$0" "$@" 2>&1
!#
import sfc.board._
/*
* @author noel.yap@gmail.com
*/
object `setter-for-catan` {
def main(args: Array[String]) {
if (args.length == 1) {
println(args(0) match {
case "small" => SmallBoard.board
case "small-spiral" => SmallSpiralBoard.board
case "small-traders-and-barbarians" => SmallTradersAndBarbariansBoard.board
case "small-traders-and-barbarians-spiral" => SmallTradersAndBarbariansSpiralBoard.board
})
}
}
}
| Comment added describing why `unset CLASSPATH` is needed. | Comment added describing why `unset CLASSPATH` is needed.
| Scala | apache-2.0 | noel-yap/setter-for-catan,noel-yap/setter-for-catan,noel-yap/setter-for-catan | scala | ## Code Before:
classpath="${CLASSPATH}"
unset CLASSPATH
exec ${SCALA_HOME}/bin/scala -cp "${classpath}" "$0" "$@" 2>&1
!#
import sfc.board._
/*
* @author noel.yap@gmail.com
*/
object `setter-for-catan` {
def main(args: Array[String]) {
if (args.length == 1) {
println(args(0) match {
case "small" => SmallBoard.board
case "small-spiral" => SmallSpiralBoard.board
case "small-traders-and-barbarians" => SmallTradersAndBarbariansBoard.board
case "small-traders-and-barbarians-spiral" => SmallTradersAndBarbariansSpiralBoard.board
})
}
}
}
## Instruction:
Comment added describing why `unset CLASSPATH` is needed.
## Code After:
classpath="${CLASSPATH}"
unset CLASSPATH # this is needed to prevent Scala object not found errors
exec ${SCALA_HOME}/bin/scala -cp "${classpath}" "$0" "$@" 2>&1
!#
import sfc.board._
/*
* @author noel.yap@gmail.com
*/
object `setter-for-catan` {
def main(args: Array[String]) {
if (args.length == 1) {
println(args(0) match {
case "small" => SmallBoard.board
case "small-spiral" => SmallSpiralBoard.board
case "small-traders-and-barbarians" => SmallTradersAndBarbariansBoard.board
case "small-traders-and-barbarians-spiral" => SmallTradersAndBarbariansSpiralBoard.board
})
}
}
}
|
classpath="${CLASSPATH}"
- unset CLASSPATH
+ unset CLASSPATH # this is needed to prevent Scala object not found errors
exec ${SCALA_HOME}/bin/scala -cp "${classpath}" "$0" "$@" 2>&1
!#
import sfc.board._
/*
* @author noel.yap@gmail.com
*/
object `setter-for-catan` {
def main(args: Array[String]) {
if (args.length == 1) {
println(args(0) match {
case "small" => SmallBoard.board
case "small-spiral" => SmallSpiralBoard.board
case "small-traders-and-barbarians" => SmallTradersAndBarbariansBoard.board
case "small-traders-and-barbarians-spiral" => SmallTradersAndBarbariansSpiralBoard.board
})
}
}
} | 2 | 0.083333 | 1 | 1 |
a27aacfd79001adf5aa5403569a1a3d29b763658 | app/views/admin/topics/show.html.erb | app/views/admin/topics/show.html.erb | <% title "#{admin_title} #{t(:discussions, default: 'Discussions')}: #{@topic.id} #{@topic.name.titleize}" %>
<div class="row">
<div id="admin-left-nav" class="hidden-xs col-md-3 col-sm-2 ticket-stats">
<%= render partial: 'admin/topics/tiny' %>
</div>
<div id="tickets" class="col-md-9 main-panel">
<%= render 'ticket' %>
</div>
</div>
| <% title "#{admin_title} #{t(:discussions, default: 'Discussions')}: #{@topic.id} #{@topic.name.titleize}" %>
<div class="row">
<div id="admin-left-nav" class="hidden-xs hidden-sm col-md-3 ticket-stats">
<%= render partial: 'admin/topics/tiny' %>
</div>
<div id="tickets" class="col-md-9 main-panel">
<%= render 'ticket' %>
</div>
</div>
| Fix ticket show upper gap bug | Fix ticket show upper gap bug
| HTML+ERB | mit | scott/helpy__helpdesk_knowledgebase,scott/helpy__helpdesk_knowledgebase,scott/helpy__helpdesk_knowledgebase,helpyio/helpy,helpyio/helpy,helpyio/helpy,helpyio/helpy | html+erb | ## Code Before:
<% title "#{admin_title} #{t(:discussions, default: 'Discussions')}: #{@topic.id} #{@topic.name.titleize}" %>
<div class="row">
<div id="admin-left-nav" class="hidden-xs col-md-3 col-sm-2 ticket-stats">
<%= render partial: 'admin/topics/tiny' %>
</div>
<div id="tickets" class="col-md-9 main-panel">
<%= render 'ticket' %>
</div>
</div>
## Instruction:
Fix ticket show upper gap bug
## Code After:
<% title "#{admin_title} #{t(:discussions, default: 'Discussions')}: #{@topic.id} #{@topic.name.titleize}" %>
<div class="row">
<div id="admin-left-nav" class="hidden-xs hidden-sm col-md-3 ticket-stats">
<%= render partial: 'admin/topics/tiny' %>
</div>
<div id="tickets" class="col-md-9 main-panel">
<%= render 'ticket' %>
</div>
</div>
| <% title "#{admin_title} #{t(:discussions, default: 'Discussions')}: #{@topic.id} #{@topic.name.titleize}" %>
<div class="row">
- <div id="admin-left-nav" class="hidden-xs col-md-3 col-sm-2 ticket-stats">
? ---------
+ <div id="admin-left-nav" class="hidden-xs hidden-sm col-md-3 ticket-stats">
? ++++++++++
<%= render partial: 'admin/topics/tiny' %>
</div>
<div id="tickets" class="col-md-9 main-panel">
<%= render 'ticket' %>
</div>
</div> | 2 | 0.181818 | 1 | 1 |
d98eb6b0cfed978c210821e61cd53703d5161bbb | lib/tree.coffee | lib/tree.coffee | module.exports =
treeView: null
activate: (rootView, @state) ->
if state
@createView().attach() if state.attached
else if rootView.project.getPath() and not rootView.pathToOpenIsFile
@createView().attach()
rootView.command 'tree-view:toggle', => @createView().toggle()
rootView.command 'tree-view:reveal-active-file', => @createView().revealActiveFile()
deactivate: ->
@treeView?.deactivate()
@treeView = null
serialize: ->
if @treeView?
@treeView.serialize()
else
@state
createView: ->
unless @treeView?
TreeView = require 'tree-view/lib/tree-view'
@treeView = TreeView.activate(@state)
@treeView
| module.exports =
treeView: null
activate: (@state) ->
if state
@createView().attach() if state.attached
else if rootView.project.getPath() and not rootView.pathToOpenIsFile
@createView().attach()
rootView.command 'tree-view:toggle', => @createView().toggle()
rootView.command 'tree-view:reveal-active-file', => @createView().revealActiveFile()
deactivate: ->
@treeView?.deactivate()
@treeView = null
serialize: ->
if @treeView?
@treeView.serialize()
else
@state
createView: ->
unless @treeView?
TreeView = require 'tree-view/lib/tree-view'
@treeView = TreeView.activate(@state)
@treeView
| Remove rootView as parameter to activate | Remove rootView as parameter to activate
| CoffeeScript | mit | matthewbauer/tree-view,learn-co/learn-ide-tree,Galactix/tree-view,ALEXGUOQ/tree-view,samu/tree-view,tomekwi/tree-view,laituan245/tree-view,rajendrant/tree-view-remote,ayumi/tree-view,cgrabowski/webgl-studio-tree-view,thgaskell/tree-view,atom/tree-view,pombredanne/tree-view-1,benjaminRomano/tree-view,jasonhinkle/tree-view,jarig/tree-view,tbryant/tree-view | coffeescript | ## Code Before:
module.exports =
treeView: null
activate: (rootView, @state) ->
if state
@createView().attach() if state.attached
else if rootView.project.getPath() and not rootView.pathToOpenIsFile
@createView().attach()
rootView.command 'tree-view:toggle', => @createView().toggle()
rootView.command 'tree-view:reveal-active-file', => @createView().revealActiveFile()
deactivate: ->
@treeView?.deactivate()
@treeView = null
serialize: ->
if @treeView?
@treeView.serialize()
else
@state
createView: ->
unless @treeView?
TreeView = require 'tree-view/lib/tree-view'
@treeView = TreeView.activate(@state)
@treeView
## Instruction:
Remove rootView as parameter to activate
## Code After:
module.exports =
treeView: null
activate: (@state) ->
if state
@createView().attach() if state.attached
else if rootView.project.getPath() and not rootView.pathToOpenIsFile
@createView().attach()
rootView.command 'tree-view:toggle', => @createView().toggle()
rootView.command 'tree-view:reveal-active-file', => @createView().revealActiveFile()
deactivate: ->
@treeView?.deactivate()
@treeView = null
serialize: ->
if @treeView?
@treeView.serialize()
else
@state
createView: ->
unless @treeView?
TreeView = require 'tree-view/lib/tree-view'
@treeView = TreeView.activate(@state)
@treeView
| module.exports =
treeView: null
- activate: (rootView, @state) ->
? ----------
+ activate: (@state) ->
if state
@createView().attach() if state.attached
else if rootView.project.getPath() and not rootView.pathToOpenIsFile
@createView().attach()
rootView.command 'tree-view:toggle', => @createView().toggle()
rootView.command 'tree-view:reveal-active-file', => @createView().revealActiveFile()
deactivate: ->
@treeView?.deactivate()
@treeView = null
serialize: ->
if @treeView?
@treeView.serialize()
else
@state
createView: ->
unless @treeView?
TreeView = require 'tree-view/lib/tree-view'
@treeView = TreeView.activate(@state)
@treeView | 2 | 0.074074 | 1 | 1 |
b575680875009b97539c7cfa69427dcb378163e4 | scripts/UpdateData/README.md | scripts/UpdateData/README.md | 1. Install dependencies by running `pip install -r Requirements.txt -t .`
1. Create your own `secrets.py` based on `secrets.py.sample`.
1. Create a `database_connections` folder as a sibling to `main.py` and add `SGID10.sde` & `UDNR.sde`.
1. Schedule to run nightly using windows scheduler
1. Action: "Start a program"
1. Program/script: <Path to python.exe>
1. Add arguments: <path to `main.py`>
| 1. Install dependencies by running `pip install -r Requirements.txt -t .`
1. Create your own `secrets.py` based on `secrets.py.sample`.
1. Create a `database_connections` folder as a sibling to `main.py` and add `SGID10.sde` & `UDNR.sde`.
1. Schedule to run nightly using windows scheduler
1. Action: "Start a program"
1. Program/script: <Path to python.exe>
1. Add arguments: <path to `main.py`>
Note: This script must be run from the folder that contains `main.py`.
| Add note about current folder | Add note about current folder
[ci-skip]
| Markdown | mit | agrc/wri-web,agrc/wri-web,agrc/wri-web | markdown | ## Code Before:
1. Install dependencies by running `pip install -r Requirements.txt -t .`
1. Create your own `secrets.py` based on `secrets.py.sample`.
1. Create a `database_connections` folder as a sibling to `main.py` and add `SGID10.sde` & `UDNR.sde`.
1. Schedule to run nightly using windows scheduler
1. Action: "Start a program"
1. Program/script: <Path to python.exe>
1. Add arguments: <path to `main.py`>
## Instruction:
Add note about current folder
[ci-skip]
## Code After:
1. Install dependencies by running `pip install -r Requirements.txt -t .`
1. Create your own `secrets.py` based on `secrets.py.sample`.
1. Create a `database_connections` folder as a sibling to `main.py` and add `SGID10.sde` & `UDNR.sde`.
1. Schedule to run nightly using windows scheduler
1. Action: "Start a program"
1. Program/script: <Path to python.exe>
1. Add arguments: <path to `main.py`>
Note: This script must be run from the folder that contains `main.py`.
| 1. Install dependencies by running `pip install -r Requirements.txt -t .`
1. Create your own `secrets.py` based on `secrets.py.sample`.
1. Create a `database_connections` folder as a sibling to `main.py` and add `SGID10.sde` & `UDNR.sde`.
1. Schedule to run nightly using windows scheduler
1. Action: "Start a program"
1. Program/script: <Path to python.exe>
1. Add arguments: <path to `main.py`>
+
+ Note: This script must be run from the folder that contains `main.py`. | 2 | 0.285714 | 2 | 0 |
b169230f90cdceb3776948bd9b21c5df0d16763c | packages/ta/takahashi.yaml | packages/ta/takahashi.yaml | homepage: ''
changelog-type: ''
hash: 907771d78ac3db503a9d832bae2dcc3a20d03a3a7698ff7769cb9e84703b27a1
test-bench-deps: {}
maintainer: tokiwoousaka
synopsis: create slide for presentation.
changelog: ''
basic-deps:
base: ! '>=4.6 && <5'
reasonable-operational: ! '>=0.1'
reasonable-lens: ! '>=0.2.1'
mtl: ! '>=2.1'
all-versions:
- '0.2.0.0'
- '0.2.0.1'
- '0.2.0.2'
author: tokiwoousaka
latest: '0.2.0.2'
description-type: haddock
description: library for create slide for your presentation.
license-name: MIT
| homepage: ''
changelog-type: ''
hash: b65b4a818f1ddbaa406d7e93888888c25c64e85e8aa8dada38eb2fc784ebd179
test-bench-deps: {}
maintainer: tokiwoousaka
synopsis: create slide for presentation.
changelog: ''
basic-deps:
base: ! '>=4.6 && <5'
monad-skeleton: -any
lens: -any
mtl: -any
all-versions:
- '0.2.0.0'
- '0.2.0.1'
- '0.2.0.2'
- '0.2.1.0'
- '0.2.2.0'
author: tokiwoousaka
latest: '0.2.2.0'
description-type: haddock
description: library for create slide for your presentation.
license-name: MIT
| Update from Hackage at 2015-07-14T06:19:14+0000 | Update from Hackage at 2015-07-14T06:19:14+0000
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: ''
changelog-type: ''
hash: 907771d78ac3db503a9d832bae2dcc3a20d03a3a7698ff7769cb9e84703b27a1
test-bench-deps: {}
maintainer: tokiwoousaka
synopsis: create slide for presentation.
changelog: ''
basic-deps:
base: ! '>=4.6 && <5'
reasonable-operational: ! '>=0.1'
reasonable-lens: ! '>=0.2.1'
mtl: ! '>=2.1'
all-versions:
- '0.2.0.0'
- '0.2.0.1'
- '0.2.0.2'
author: tokiwoousaka
latest: '0.2.0.2'
description-type: haddock
description: library for create slide for your presentation.
license-name: MIT
## Instruction:
Update from Hackage at 2015-07-14T06:19:14+0000
## Code After:
homepage: ''
changelog-type: ''
hash: b65b4a818f1ddbaa406d7e93888888c25c64e85e8aa8dada38eb2fc784ebd179
test-bench-deps: {}
maintainer: tokiwoousaka
synopsis: create slide for presentation.
changelog: ''
basic-deps:
base: ! '>=4.6 && <5'
monad-skeleton: -any
lens: -any
mtl: -any
all-versions:
- '0.2.0.0'
- '0.2.0.1'
- '0.2.0.2'
- '0.2.1.0'
- '0.2.2.0'
author: tokiwoousaka
latest: '0.2.2.0'
description-type: haddock
description: library for create slide for your presentation.
license-name: MIT
| homepage: ''
changelog-type: ''
- hash: 907771d78ac3db503a9d832bae2dcc3a20d03a3a7698ff7769cb9e84703b27a1
+ hash: b65b4a818f1ddbaa406d7e93888888c25c64e85e8aa8dada38eb2fc784ebd179
test-bench-deps: {}
maintainer: tokiwoousaka
synopsis: create slide for presentation.
changelog: ''
basic-deps:
base: ! '>=4.6 && <5'
- reasonable-operational: ! '>=0.1'
- reasonable-lens: ! '>=0.2.1'
- mtl: ! '>=2.1'
+ monad-skeleton: -any
+ lens: -any
+ mtl: -any
all-versions:
- '0.2.0.0'
- '0.2.0.1'
- '0.2.0.2'
+ - '0.2.1.0'
+ - '0.2.2.0'
author: tokiwoousaka
- latest: '0.2.0.2'
? --
+ latest: '0.2.2.0'
? ++
description-type: haddock
description: library for create slide for your presentation.
license-name: MIT | 12 | 0.571429 | 7 | 5 |
0fc93372091c0cbc3a00cfecfaf67013c295b7d6 | app/app.css | app/app.css | Button {
font-size: 42;
horizontal-align: center;
}
ActivityIndicator {
width: 30;
color: #2E6DAD;
}
Label {
padding: 15;
}
ActionBar {
color: white;
background-color: #2E6DAD;
}
.title {
font-size: 30;
horizontal-align: center;
margin: 20;
}
.message {
font-size: 20;
color: #284848;
horizontal-align: center;
margin: 0 20;
text-align: center;
}
.card {
border-color: #2E6DAD;
border-width: 1;
border-radius: 5;
width: 95%;
margin-bottom: 10;
}
.page-header {
font-weight: bold;
}
.list-header {
background-color: #2E6DAD;
color: white;
}
| Button {
font-size: 42;
horizontal-align: center;
}
ActivityIndicator {
margin: 10 0;
width: 30;
color: #2E6DAD;
}
Label {
padding: 15;
}
ActionBar {
color: white;
background-color: #2E6DAD;
}
.title {
font-size: 30;
horizontal-align: center;
margin: 20;
}
.message {
font-size: 20;
color: #284848;
horizontal-align: center;
margin: 0 20;
text-align: center;
}
.card {
border-color: #2E6DAD;
border-width: 1;
border-radius: 5;
width: 95%;
margin-bottom: 10;
}
.page-header {
font-weight: bold;
}
.list-header {
background-color: #2E6DAD;
color: white;
}
| Add breathing room at above and below all activity indicators | Add breathing room at above and below all activity indicators
| CSS | mit | ModusCreateOrg/framework-shootout-nativescript | css | ## Code Before:
Button {
font-size: 42;
horizontal-align: center;
}
ActivityIndicator {
width: 30;
color: #2E6DAD;
}
Label {
padding: 15;
}
ActionBar {
color: white;
background-color: #2E6DAD;
}
.title {
font-size: 30;
horizontal-align: center;
margin: 20;
}
.message {
font-size: 20;
color: #284848;
horizontal-align: center;
margin: 0 20;
text-align: center;
}
.card {
border-color: #2E6DAD;
border-width: 1;
border-radius: 5;
width: 95%;
margin-bottom: 10;
}
.page-header {
font-weight: bold;
}
.list-header {
background-color: #2E6DAD;
color: white;
}
## Instruction:
Add breathing room at above and below all activity indicators
## Code After:
Button {
font-size: 42;
horizontal-align: center;
}
ActivityIndicator {
margin: 10 0;
width: 30;
color: #2E6DAD;
}
Label {
padding: 15;
}
ActionBar {
color: white;
background-color: #2E6DAD;
}
.title {
font-size: 30;
horizontal-align: center;
margin: 20;
}
.message {
font-size: 20;
color: #284848;
horizontal-align: center;
margin: 0 20;
text-align: center;
}
.card {
border-color: #2E6DAD;
border-width: 1;
border-radius: 5;
width: 95%;
margin-bottom: 10;
}
.page-header {
font-weight: bold;
}
.list-header {
background-color: #2E6DAD;
color: white;
}
| Button {
font-size: 42;
horizontal-align: center;
}
ActivityIndicator {
+ margin: 10 0;
width: 30;
color: #2E6DAD;
}
Label {
padding: 15;
}
ActionBar {
color: white;
background-color: #2E6DAD;
}
.title {
font-size: 30;
horizontal-align: center;
margin: 20;
}
.message {
font-size: 20;
color: #284848;
horizontal-align: center;
margin: 0 20;
text-align: center;
}
.card {
border-color: #2E6DAD;
border-width: 1;
border-radius: 5;
width: 95%;
margin-bottom: 10;
}
.page-header {
font-weight: bold;
}
.list-header {
background-color: #2E6DAD;
color: white;
}
| 1 | 0.02 | 1 | 0 |
70323f5b27811f0f9484fc2743b87409d5a755d4 | web/controllers/tp_rating_plan_controller.ex | web/controllers/tp_rating_plan_controller.ex | defmodule CgratesWebJsonapi.TpRatingPlanController do
use CgratesWebJsonapi.Web, :controller
use CgratesWebJsonapi.Web, :controller
use JaResource
use CgratesWebJsonapi.TpSubresource
use CgratesWebJsonapi.DefaultSorting
alias CgratesWebJsonapi.TpRatingPlan
plug JaResource
def handle_show(conn, id), do: Repo.get!(TpRatingPlan, id)
def filter(_conn, query, "tag", tag), do: query |> where([r], like(r.tag, ^"%#{tag}%"))
def filter(_conn, query, "destrates_tag", tag), do: query |> where([r], like(r.destrates_tag, ^"%#{tag}%"))
def filter(_conn, query, "timing_tag", tag), do: query |> where([r], like(r.timing_tag, ^"%#{tag}%"))
def filter(_conn, query, "weight", weight), do: query |> where([r], like(r.weight, ^"%#{weight}%"))
end
| defmodule CgratesWebJsonapi.TpRatingPlanController do
use CgratesWebJsonapi.Web, :controller
use CgratesWebJsonapi.Web, :controller
use JaResource
use CgratesWebJsonapi.TpSubresource
use CgratesWebJsonapi.DefaultSorting
alias CgratesWebJsonapi.TpRatingPlan
plug JaResource
def handle_show(conn, id), do: Repo.get!(TpRatingPlan, id)
def filter(_conn, query, "tag", tag), do: query |> where([r], like(r.tag, ^"%#{tag}%"))
def filter(_conn, query, "destrates_tag", tag), do: query |> where([r], like(r.destrates_tag, ^"%#{tag}%"))
def filter(_conn, query, "timing_tag", tag), do: query |> where([r], like(r.timing_tag, ^"%#{tag}%"))
def filter(_conn, query, "weight", weight), do: query |> where(weight: ^weight))
end
| Fix filter by weight for TpRatingPlan | Fix filter by weight for TpRatingPlan | Elixir | mit | cgrates-web/cgrates_web_jsonapi | elixir | ## Code Before:
defmodule CgratesWebJsonapi.TpRatingPlanController do
use CgratesWebJsonapi.Web, :controller
use CgratesWebJsonapi.Web, :controller
use JaResource
use CgratesWebJsonapi.TpSubresource
use CgratesWebJsonapi.DefaultSorting
alias CgratesWebJsonapi.TpRatingPlan
plug JaResource
def handle_show(conn, id), do: Repo.get!(TpRatingPlan, id)
def filter(_conn, query, "tag", tag), do: query |> where([r], like(r.tag, ^"%#{tag}%"))
def filter(_conn, query, "destrates_tag", tag), do: query |> where([r], like(r.destrates_tag, ^"%#{tag}%"))
def filter(_conn, query, "timing_tag", tag), do: query |> where([r], like(r.timing_tag, ^"%#{tag}%"))
def filter(_conn, query, "weight", weight), do: query |> where([r], like(r.weight, ^"%#{weight}%"))
end
## Instruction:
Fix filter by weight for TpRatingPlan
## Code After:
defmodule CgratesWebJsonapi.TpRatingPlanController do
use CgratesWebJsonapi.Web, :controller
use CgratesWebJsonapi.Web, :controller
use JaResource
use CgratesWebJsonapi.TpSubresource
use CgratesWebJsonapi.DefaultSorting
alias CgratesWebJsonapi.TpRatingPlan
plug JaResource
def handle_show(conn, id), do: Repo.get!(TpRatingPlan, id)
def filter(_conn, query, "tag", tag), do: query |> where([r], like(r.tag, ^"%#{tag}%"))
def filter(_conn, query, "destrates_tag", tag), do: query |> where([r], like(r.destrates_tag, ^"%#{tag}%"))
def filter(_conn, query, "timing_tag", tag), do: query |> where([r], like(r.timing_tag, ^"%#{tag}%"))
def filter(_conn, query, "weight", weight), do: query |> where(weight: ^weight))
end
| defmodule CgratesWebJsonapi.TpRatingPlanController do
use CgratesWebJsonapi.Web, :controller
use CgratesWebJsonapi.Web, :controller
use JaResource
use CgratesWebJsonapi.TpSubresource
use CgratesWebJsonapi.DefaultSorting
alias CgratesWebJsonapi.TpRatingPlan
plug JaResource
def handle_show(conn, id), do: Repo.get!(TpRatingPlan, id)
def filter(_conn, query, "tag", tag), do: query |> where([r], like(r.tag, ^"%#{tag}%"))
def filter(_conn, query, "destrates_tag", tag), do: query |> where([r], like(r.destrates_tag, ^"%#{tag}%"))
def filter(_conn, query, "timing_tag", tag), do: query |> where([r], like(r.timing_tag, ^"%#{tag}%"))
- def filter(_conn, query, "weight", weight), do: query |> where([r], like(r.weight, ^"%#{weight}%"))
? ------------ ^ ---- ---
+ def filter(_conn, query, "weight", weight), do: query |> where(weight: ^weight))
? ^
end | 2 | 0.105263 | 1 | 1 |
94fde42122ff992448f4914b9958bfde89e85fd5 | README.md | README.md |
Powerful database abstraction layer with many features for database schema introspection, schema management and PDO abstraction.
* Master: [](http://travis-ci.org/doctrine/dbal)
* 2.2: [](http://travis-ci.org/doctrine/dbal)
* 2.1.x: [](http://travis-ci.org/doctrine/dbal)
## More resources:
* [Website](http://www.doctrine-project.org)
* [Documentation](http://www.doctrine-project.org/projects/dbal/current/docs/en)
* [Issue Tracker](http://www.doctrine-project.org/jira/browse/DBAL)
* [Downloads](http://github.com/doctrine/dbal/downloads)
|
Powerful database abstraction layer with many features for database schema introspection, schema management and PDO abstraction.
* Master: [](http://travis-ci.org/doctrine/dbal)
* 2.2: [](http://travis-ci.org/doctrine/dbal)
* 2.1.x: [](http://travis-ci.org/doctrine/dbal)
## More resources:
* [Website](http://www.doctrine-project.org/projects/dbal.html)
* [Documentation](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/)
* [Issue Tracker](http://www.doctrine-project.org/jira/browse/DBAL)
* [Downloads](http://github.com/doctrine/dbal/downloads)
| Update doc links in Readme. | Update doc links in Readme.
| Markdown | mit | hason/dbal,mariuz/dbal,cassvail/dbal,AlexDpy/dbal,janschoenherr/dbal,deeky666/dbal,LionwareSolutions/dbal,lafourchette/dbal,zeroedin-bill/dbal,Ocramius/dbal,shivergard/dbal,hason/dbal,helicon-os/doctrine-dbal,arima-ryunosuke/dbal,kupishkis/dbal,helicon-os/doctrine-dbal,adrienbrault/dbal,zeroedin-bill/dbal,mihai-stancu/doctrine-dbal,DHager/dbal,mathroc/dbal,bspeterson/dbal,BenMorel/dbal,mihai-stancu/doctrine-dbal,kupishkis/dbal,easybiblabs/dbal,AlexDpy/dbal,nfrignani/dbal,mihai-stancu/dbal,mariuz/dbal,bspeterson/dbal,kupishkis/dbal,stof/dbal,vutung2311/dbal,vortgo/dbal,mikeSimonson/dbal,lcobucci/dbal,sarcher/dbal,webonyx/dbal,Tobion/dbal,nfrignani/dbal,drieschel/dbal,PowerKiKi/dbal,cassvail/dbal,lcobucci/dbal,mRoca/dbal,tk-s/dbal,tk-s/dbal,v-bartusevicius/dbal,Ocramius/dbal,mihai-stancu/dbal,kimhemsoe/dbal,easybiblabs/dbal,deeky666/dbal,drieschel/dbal,arima-ryunosuke/dbal,stchr/dbal,PowerKiKi/dbal,DataSyntax/dbal,BenMorel/dbal,vutung2311/dbal,adrienbrault/dbal,mikeSimonson/dbal,wuxu92/dbal,mbeccati/dbal,Tobion/dbal,vortgo/dbal,adrienbrault/dbal,mathroc/dbal,wuxu92/dbal,sarcher/dbal,webonyx/dbal,janschoenherr/dbal,mRoca/dbal,stof/dbal,gencer/dbal,doctrine/dbal,PowerKiKi/dbal,v-bartusevicius/dbal,hason/dbal,easybiblabs/dbal,gencer/dbal,DataSyntax/dbal,webonyx/dbal,arima-ryunosuke/dbal,LionwareSolutions/dbal,doctrine/dbal,kimhemsoe/dbal,mariuz/dbal,sarcher/dbal,shivergard/dbal,LionwareSolutions/dbal,mbeccati/dbal,lafourchette/dbal,stchr/dbal,DHager/dbal | markdown | ## Code Before:
Powerful database abstraction layer with many features for database schema introspection, schema management and PDO abstraction.
* Master: [](http://travis-ci.org/doctrine/dbal)
* 2.2: [](http://travis-ci.org/doctrine/dbal)
* 2.1.x: [](http://travis-ci.org/doctrine/dbal)
## More resources:
* [Website](http://www.doctrine-project.org)
* [Documentation](http://www.doctrine-project.org/projects/dbal/current/docs/en)
* [Issue Tracker](http://www.doctrine-project.org/jira/browse/DBAL)
* [Downloads](http://github.com/doctrine/dbal/downloads)
## Instruction:
Update doc links in Readme.
## Code After:
Powerful database abstraction layer with many features for database schema introspection, schema management and PDO abstraction.
* Master: [](http://travis-ci.org/doctrine/dbal)
* 2.2: [](http://travis-ci.org/doctrine/dbal)
* 2.1.x: [](http://travis-ci.org/doctrine/dbal)
## More resources:
* [Website](http://www.doctrine-project.org/projects/dbal.html)
* [Documentation](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/)
* [Issue Tracker](http://www.doctrine-project.org/jira/browse/DBAL)
* [Downloads](http://github.com/doctrine/dbal/downloads)
|
Powerful database abstraction layer with many features for database schema introspection, schema management and PDO abstraction.
* Master: [](http://travis-ci.org/doctrine/dbal)
* 2.2: [](http://travis-ci.org/doctrine/dbal)
* 2.1.x: [](http://travis-ci.org/doctrine/dbal)
## More resources:
- * [Website](http://www.doctrine-project.org)
+ * [Website](http://www.doctrine-project.org/projects/dbal.html)
? +++++++++++++++++++
- * [Documentation](http://www.doctrine-project.org/projects/dbal/current/docs/en)
? ^^^ ---- -------
+ * [Documentation](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/)
? ^^^^ +++++++++ ++++++
* [Issue Tracker](http://www.doctrine-project.org/jira/browse/DBAL)
* [Downloads](http://github.com/doctrine/dbal/downloads) | 4 | 0.307692 | 2 | 2 |
87888fd4f68dc0c34fb84e3b13cdc420befe7b9a | app/assets/javascripts/express_admin/utility.js | app/assets/javascripts/express_admin/utility.js | $(function() {
// toggle on/off switch
$(document).on('click', '[data-toggle]', function() {
targetHide = $(this).data('toggle-hide')
targetShow = $(this).data('toggle-show')
$('[data-toggle-name="' + targetHide + '"]').addClass('hide')
$('[data-toggle-name="' + targetShow + '"]').removeClass('hide')
.find('input:text, textarea').first().focus()
});
// AJAX request utility
AJAXRequest = function(url, method, data, success, error)
{
return $.ajax({
url : url,
type : method,
data : data,
dataType : 'JSON',
cache : false,
success : function(json)
{
success(json)
},
error : function()
{
error()
}
});
}
});
| $(function() {
// toggle on/off switch
$(document).on('click', '[data-toggle]', function() {
targetHide = $(this).data('toggle-hide')
targetShow = $(this).data('toggle-show')
$('[data-toggle-name="' + targetHide + '"]').addClass('hide')
$('[data-toggle-name="' + targetShow + '"]').removeClass('hide')
});
// AJAX request utility
AJAXRequest = function(url, method, data, success, error)
{
return $.ajax({
url : url,
type : method,
data : data,
dataType : 'JSON',
cache : false,
success : function(json)
{
success(json)
},
error : function()
{
error()
}
});
}
});
| Remove the auto focus on element toggle feature | Remove the auto focus on element toggle feature
| JavaScript | mit | aelogica/express_admin,aelogica/express_admin,aelogica/express_admin,aelogica/express_admin | javascript | ## Code Before:
$(function() {
// toggle on/off switch
$(document).on('click', '[data-toggle]', function() {
targetHide = $(this).data('toggle-hide')
targetShow = $(this).data('toggle-show')
$('[data-toggle-name="' + targetHide + '"]').addClass('hide')
$('[data-toggle-name="' + targetShow + '"]').removeClass('hide')
.find('input:text, textarea').first().focus()
});
// AJAX request utility
AJAXRequest = function(url, method, data, success, error)
{
return $.ajax({
url : url,
type : method,
data : data,
dataType : 'JSON',
cache : false,
success : function(json)
{
success(json)
},
error : function()
{
error()
}
});
}
});
## Instruction:
Remove the auto focus on element toggle feature
## Code After:
$(function() {
// toggle on/off switch
$(document).on('click', '[data-toggle]', function() {
targetHide = $(this).data('toggle-hide')
targetShow = $(this).data('toggle-show')
$('[data-toggle-name="' + targetHide + '"]').addClass('hide')
$('[data-toggle-name="' + targetShow + '"]').removeClass('hide')
});
// AJAX request utility
AJAXRequest = function(url, method, data, success, error)
{
return $.ajax({
url : url,
type : method,
data : data,
dataType : 'JSON',
cache : false,
success : function(json)
{
success(json)
},
error : function()
{
error()
}
});
}
});
| $(function() {
// toggle on/off switch
$(document).on('click', '[data-toggle]', function() {
targetHide = $(this).data('toggle-hide')
targetShow = $(this).data('toggle-show')
$('[data-toggle-name="' + targetHide + '"]').addClass('hide')
$('[data-toggle-name="' + targetShow + '"]').removeClass('hide')
- .find('input:text, textarea').first().focus()
});
// AJAX request utility
AJAXRequest = function(url, method, data, success, error)
{
return $.ajax({
url : url,
type : method,
data : data,
dataType : 'JSON',
cache : false,
success : function(json)
{
success(json)
},
error : function()
{
error()
}
});
}
}); | 1 | 0.032258 | 0 | 1 |
560831185980b3caffbe9365c45d73c468de67b3 | src/settings/LanguagePickerItem.js | src/settings/LanguagePickerItem.js | /* @flow */
import React, { PureComponent } from 'react';
import { StyleSheet, View } from 'react-native';
import type { Context } from '../types';
import { RawLabel, Touchable } from '../common';
import { BRAND_COLOR } from '../styles';
import { IconDone } from '../common/Icons';
const componentStyles = StyleSheet.create({
flag: {
paddingRight: 8,
},
language: {
flex: 1,
},
});
type Props = {
locale: string,
flag: string,
name: string,
selected: boolean,
onValueChange: (locale: string) => void,
};
export default class LanguagePickerItem extends PureComponent<Props> {
context: Context;
props: Props;
static contextTypes = {
styles: () => null,
};
render() {
const { styles } = this.context;
const { locale, flag, name, selected, onValueChange } = this.props;
return (
<Touchable onPress={() => onValueChange(locale)}>
<View style={styles.listItem}>
<RawLabel style={componentStyles.flag} text={flag} />
<RawLabel style={componentStyles.language} text={name} />
{selected && <IconDone size={16} color={BRAND_COLOR} />}
</View>
</Touchable>
);
}
}
| /* @flow */
import React, { PureComponent } from 'react';
import { StyleSheet, View } from 'react-native';
import type { Context } from '../types';
import { RawLabel, Touchable } from '../common';
import { BRAND_COLOR } from '../styles';
import { IconDone } from '../common/Icons';
const componentStyles = StyleSheet.create({
flag: {
paddingRight: 8,
},
language: {
flex: 1,
},
listItem: {
flexDirection: 'row',
alignItems: 'center',
paddingTop: 8,
paddingBottom: 8,
paddingLeft: 16,
paddingRight: 16,
},
});
type Props = {
locale: string,
flag: string,
name: string,
selected: boolean,
onValueChange: (locale: string) => void,
};
export default class LanguagePickerItem extends PureComponent<Props> {
context: Context;
props: Props;
static contextTypes = {
styles: () => null,
};
render() {
const { locale, flag, name, selected, onValueChange } = this.props;
return (
<Touchable onPress={() => onValueChange(locale)}>
<View style={componentStyles.listItem}>
<RawLabel style={componentStyles.flag} text={flag} />
<RawLabel style={componentStyles.language} text={name} />
{selected && <IconDone size={16} color={BRAND_COLOR} />}
</View>
</Touchable>
);
}
}
| Define language list item style locally. | language-settings: Define language list item style locally.
This list is doing something idiosyncratic, following a particular iOS
settings-UI convention; so it won't necessarily follow our normal
style for a list.
This commit just copies the global style in, without yet changing it.
| JavaScript | apache-2.0 | vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile | javascript | ## Code Before:
/* @flow */
import React, { PureComponent } from 'react';
import { StyleSheet, View } from 'react-native';
import type { Context } from '../types';
import { RawLabel, Touchable } from '../common';
import { BRAND_COLOR } from '../styles';
import { IconDone } from '../common/Icons';
const componentStyles = StyleSheet.create({
flag: {
paddingRight: 8,
},
language: {
flex: 1,
},
});
type Props = {
locale: string,
flag: string,
name: string,
selected: boolean,
onValueChange: (locale: string) => void,
};
export default class LanguagePickerItem extends PureComponent<Props> {
context: Context;
props: Props;
static contextTypes = {
styles: () => null,
};
render() {
const { styles } = this.context;
const { locale, flag, name, selected, onValueChange } = this.props;
return (
<Touchable onPress={() => onValueChange(locale)}>
<View style={styles.listItem}>
<RawLabel style={componentStyles.flag} text={flag} />
<RawLabel style={componentStyles.language} text={name} />
{selected && <IconDone size={16} color={BRAND_COLOR} />}
</View>
</Touchable>
);
}
}
## Instruction:
language-settings: Define language list item style locally.
This list is doing something idiosyncratic, following a particular iOS
settings-UI convention; so it won't necessarily follow our normal
style for a list.
This commit just copies the global style in, without yet changing it.
## Code After:
/* @flow */
import React, { PureComponent } from 'react';
import { StyleSheet, View } from 'react-native';
import type { Context } from '../types';
import { RawLabel, Touchable } from '../common';
import { BRAND_COLOR } from '../styles';
import { IconDone } from '../common/Icons';
const componentStyles = StyleSheet.create({
flag: {
paddingRight: 8,
},
language: {
flex: 1,
},
listItem: {
flexDirection: 'row',
alignItems: 'center',
paddingTop: 8,
paddingBottom: 8,
paddingLeft: 16,
paddingRight: 16,
},
});
type Props = {
locale: string,
flag: string,
name: string,
selected: boolean,
onValueChange: (locale: string) => void,
};
export default class LanguagePickerItem extends PureComponent<Props> {
context: Context;
props: Props;
static contextTypes = {
styles: () => null,
};
render() {
const { locale, flag, name, selected, onValueChange } = this.props;
return (
<Touchable onPress={() => onValueChange(locale)}>
<View style={componentStyles.listItem}>
<RawLabel style={componentStyles.flag} text={flag} />
<RawLabel style={componentStyles.language} text={name} />
{selected && <IconDone size={16} color={BRAND_COLOR} />}
</View>
</Touchable>
);
}
}
| /* @flow */
import React, { PureComponent } from 'react';
import { StyleSheet, View } from 'react-native';
import type { Context } from '../types';
import { RawLabel, Touchable } from '../common';
import { BRAND_COLOR } from '../styles';
import { IconDone } from '../common/Icons';
const componentStyles = StyleSheet.create({
flag: {
paddingRight: 8,
},
language: {
flex: 1,
+ },
+ listItem: {
+ flexDirection: 'row',
+ alignItems: 'center',
+ paddingTop: 8,
+ paddingBottom: 8,
+ paddingLeft: 16,
+ paddingRight: 16,
},
});
type Props = {
locale: string,
flag: string,
name: string,
selected: boolean,
onValueChange: (locale: string) => void,
};
export default class LanguagePickerItem extends PureComponent<Props> {
context: Context;
props: Props;
static contextTypes = {
styles: () => null,
};
render() {
- const { styles } = this.context;
const { locale, flag, name, selected, onValueChange } = this.props;
return (
<Touchable onPress={() => onValueChange(locale)}>
- <View style={styles.listItem}>
? ^
+ <View style={componentStyles.listItem}>
? ^^^^^^^^^^
<RawLabel style={componentStyles.flag} text={flag} />
<RawLabel style={componentStyles.language} text={name} />
{selected && <IconDone size={16} color={BRAND_COLOR} />}
</View>
</Touchable>
);
}
} | 11 | 0.22449 | 9 | 2 |
adb530e758ab49dc24ea51d6c913cbca6b9ccabf | config/library/exist.xml | config/library/exist.xml | <?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://exist-db.org/ns/expath-pkg">
<jar>exist-messaging-replication-@VERSION@.jar</jar>
<jar>activemq-client-5.10.0.jar</jar>
<jar>activemq-jms-pool-5.10.0.jar</jar>
<jar>activemq-pool-5.10.0jar</jar>
<jar>geronimo-j2ee-management_1.1_spec-1.0.1.jar</jar>
<jar>geronimo-jms_1.1_spec-1.1.1.jar</jar>
<jar>hawtbuf-1.10.jar</jar>
<java>
<namespace>http://exist-db.org/xquery/messaging</namespace>
<class>org.exist.messaging.xquery.MessagingModule</class>
</java>
<java>
<namespace>http://exist-db.org/xquery/replication</namespace>
<class>org.exist.replication.xquery.ReplicationModule</class>
</java>
</package>
| <?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://exist-db.org/ns/expath-pkg">
<jar>exist-messaging-replication-@VERSION@.jar</jar>
<jar>activemq-client-5.10.0.jar</jar>
<jar>activemq-jms-pool-5.10.0.jar</jar>
<jar>activemq-pool-5.10.0jar</jar>
<jar>geronimo-j2ee-management_1.1_spec-1.0.1.jar</jar>
<jar>geronimo-jms_1.1_spec-1.1.1.jar</jar>
<jar>hawtbuf-1.10.jar</jar>
<java>
<namespace>http://exist-db.org/xquery/jms</namespace>
<class>org.exist.jms.xquery.JmsModule</class>
</java>
<java>
<namespace>http://exist-db.org/xquery/messaging</namespace>
<class>org.exist.jms.xquery.MessagingModule</class>
</java>
<java>
<namespace>http://exist-db.org/xquery/replication</namespace>
<class>org.exist.jms.xquery.ReplicationModule</class>
</java>
</package>
| Make config file match new module packages | Make config file match new module packages
| XML | lgpl-2.1 | ljo/messaging-replication,eXist-db/messaging-replication,ljo/messaging-replication,dizzzz/messaging-replication,ljo/messaging-replication,eXist-db/messaging-replication,dizzzz/messaging-replication,dizzzz/messaging-replication,eXist-db/messaging-replication | xml | ## Code Before:
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://exist-db.org/ns/expath-pkg">
<jar>exist-messaging-replication-@VERSION@.jar</jar>
<jar>activemq-client-5.10.0.jar</jar>
<jar>activemq-jms-pool-5.10.0.jar</jar>
<jar>activemq-pool-5.10.0jar</jar>
<jar>geronimo-j2ee-management_1.1_spec-1.0.1.jar</jar>
<jar>geronimo-jms_1.1_spec-1.1.1.jar</jar>
<jar>hawtbuf-1.10.jar</jar>
<java>
<namespace>http://exist-db.org/xquery/messaging</namespace>
<class>org.exist.messaging.xquery.MessagingModule</class>
</java>
<java>
<namespace>http://exist-db.org/xquery/replication</namespace>
<class>org.exist.replication.xquery.ReplicationModule</class>
</java>
</package>
## Instruction:
Make config file match new module packages
## Code After:
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://exist-db.org/ns/expath-pkg">
<jar>exist-messaging-replication-@VERSION@.jar</jar>
<jar>activemq-client-5.10.0.jar</jar>
<jar>activemq-jms-pool-5.10.0.jar</jar>
<jar>activemq-pool-5.10.0jar</jar>
<jar>geronimo-j2ee-management_1.1_spec-1.0.1.jar</jar>
<jar>geronimo-jms_1.1_spec-1.1.1.jar</jar>
<jar>hawtbuf-1.10.jar</jar>
<java>
<namespace>http://exist-db.org/xquery/jms</namespace>
<class>org.exist.jms.xquery.JmsModule</class>
</java>
<java>
<namespace>http://exist-db.org/xquery/messaging</namespace>
<class>org.exist.jms.xquery.MessagingModule</class>
</java>
<java>
<namespace>http://exist-db.org/xquery/replication</namespace>
<class>org.exist.jms.xquery.ReplicationModule</class>
</java>
</package>
| <?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://exist-db.org/ns/expath-pkg">
<jar>exist-messaging-replication-@VERSION@.jar</jar>
<jar>activemq-client-5.10.0.jar</jar>
<jar>activemq-jms-pool-5.10.0.jar</jar>
<jar>activemq-pool-5.10.0jar</jar>
<jar>geronimo-j2ee-management_1.1_spec-1.0.1.jar</jar>
<jar>geronimo-jms_1.1_spec-1.1.1.jar</jar>
<jar>hawtbuf-1.10.jar</jar>
<java>
+ <namespace>http://exist-db.org/xquery/jms</namespace>
+ <class>org.exist.jms.xquery.JmsModule</class>
+ </java>
+ <java>
<namespace>http://exist-db.org/xquery/messaging</namespace>
- <class>org.exist.messaging.xquery.MessagingModule</class>
? - ------
+ <class>org.exist.jms.xquery.MessagingModule</class>
? +
</java>
<java>
<namespace>http://exist-db.org/xquery/replication</namespace>
- <class>org.exist.replication.xquery.ReplicationModule</class>
? ^^^^^^^^^^^
+ <class>org.exist.jms.xquery.ReplicationModule</class>
? ^^^
</java>
</package> | 8 | 0.444444 | 6 | 2 |
37a73986d3d36353a30e661b3989dcd8a646bc39 | 04/jjhampton-ch4-list.js | 04/jjhampton-ch4-list.js | // Write a function arrayToList that builds up a data structure like the previous one when given [1, 2, 3] as argument, and write a listToArray function that produces an array from a list. Also write the helper functions prepend, which takes an element and a list and creates a new list that adds the element to the front of the input list, and nth, which takes a list and a number and returns the element at the given position in the list, or undefined when there is no such element.
function arrayToList(array) {
const arrayLength = array.length;
let list = null;
for (let i = array.length - 1; i >= 0; i-- ) {
list = {
value: array[i],
rest: list
};
}
return list;
}
const theArray = [1, 2, 3, 4, 5, 6, 7, 8];
console.log(arrayToList(theArray));
function listToArray(list) {
console.log(list);
const array = [
list.value,
list.rest.value,
list.rest.rest.value
];
return array;
}
// const theList = arrayToList([1, 2, 3]);
// console.log(listToArray(theList));
// write helper function 'prepend', which takes an element and a list and creates a new list that adds the element to the front of the input list
function prepend(element, list) {
let newList;
// do some stuff here
return newList;
} | // Write a function arrayToList that builds up a data structure like the previous one when given [1, 2, 3] as argument, and write a listToArray function that produces an array from a list. Also write the helper functions prepend, which takes an element and a list and creates a new list that adds the element to the front of the input list, and nth, which takes a list and a number and returns the element at the given position in the list, or undefined when there is no such element.
function arrayToList(array) {
const arrayLength = array.length;
let list = null;
for (let i = array.length - 1; i >= 0; i-- ) {
list = {
value: array[i],
rest: list
};
}
return list;
}
const theArray = [1, 2, 3, 4, 5, 6, 7, 8];
console.log(arrayToList(theArray));
function listToArray(list) {
let array = [];
for (let currentNode = list; currentNode; currentNode = currentNode.rest) {
array.push(currentNode.value);
}
return array;
}
const theList = arrayToList([1, 2, 3, 4, 5, 6, 7, 8]);
console.log(listToArray(theList));
// write helper function 'prepend', which takes an element and a list and creates a new list that adds the element to the front of the input list
function prepend(element, list) {
let newList;
// do some stuff here
return newList;
} | Refactor listToArray to work with list parameters of dynamic sizes | Refactor listToArray to work with list parameters of dynamic sizes
| JavaScript | mit | OperationCode/eloquent-js | javascript | ## Code Before:
// Write a function arrayToList that builds up a data structure like the previous one when given [1, 2, 3] as argument, and write a listToArray function that produces an array from a list. Also write the helper functions prepend, which takes an element and a list and creates a new list that adds the element to the front of the input list, and nth, which takes a list and a number and returns the element at the given position in the list, or undefined when there is no such element.
function arrayToList(array) {
const arrayLength = array.length;
let list = null;
for (let i = array.length - 1; i >= 0; i-- ) {
list = {
value: array[i],
rest: list
};
}
return list;
}
const theArray = [1, 2, 3, 4, 5, 6, 7, 8];
console.log(arrayToList(theArray));
function listToArray(list) {
console.log(list);
const array = [
list.value,
list.rest.value,
list.rest.rest.value
];
return array;
}
// const theList = arrayToList([1, 2, 3]);
// console.log(listToArray(theList));
// write helper function 'prepend', which takes an element and a list and creates a new list that adds the element to the front of the input list
function prepend(element, list) {
let newList;
// do some stuff here
return newList;
}
## Instruction:
Refactor listToArray to work with list parameters of dynamic sizes
## Code After:
// Write a function arrayToList that builds up a data structure like the previous one when given [1, 2, 3] as argument, and write a listToArray function that produces an array from a list. Also write the helper functions prepend, which takes an element and a list and creates a new list that adds the element to the front of the input list, and nth, which takes a list and a number and returns the element at the given position in the list, or undefined when there is no such element.
function arrayToList(array) {
const arrayLength = array.length;
let list = null;
for (let i = array.length - 1; i >= 0; i-- ) {
list = {
value: array[i],
rest: list
};
}
return list;
}
const theArray = [1, 2, 3, 4, 5, 6, 7, 8];
console.log(arrayToList(theArray));
function listToArray(list) {
let array = [];
for (let currentNode = list; currentNode; currentNode = currentNode.rest) {
array.push(currentNode.value);
}
return array;
}
const theList = arrayToList([1, 2, 3, 4, 5, 6, 7, 8]);
console.log(listToArray(theList));
// write helper function 'prepend', which takes an element and a list and creates a new list that adds the element to the front of the input list
function prepend(element, list) {
let newList;
// do some stuff here
return newList;
} | // Write a function arrayToList that builds up a data structure like the previous one when given [1, 2, 3] as argument, and write a listToArray function that produces an array from a list. Also write the helper functions prepend, which takes an element and a list and creates a new list that adds the element to the front of the input list, and nth, which takes a list and a number and returns the element at the given position in the list, or undefined when there is no such element.
function arrayToList(array) {
const arrayLength = array.length;
let list = null;
for (let i = array.length - 1; i >= 0; i-- ) {
list = {
value: array[i],
rest: list
};
}
return list;
}
const theArray = [1, 2, 3, 4, 5, 6, 7, 8];
console.log(arrayToList(theArray));
function listToArray(list) {
- console.log(list);
- const array = [
? ^^^^
+ let array = [];
? ^^ ++
+ for (let currentNode = list; currentNode; currentNode = currentNode.rest) {
+ array.push(currentNode.value);
+ }
- list.value,
- list.rest.value,
- list.rest.rest.value
- ];
return array;
}
- // const theList = arrayToList([1, 2, 3]);
? ---
+ const theList = arrayToList([1, 2, 3, 4, 5, 6, 7, 8]);
? +++++++++++++++
- // console.log(listToArray(theList));
? ---
+ console.log(listToArray(theList));
// write helper function 'prepend', which takes an element and a list and creates a new list that adds the element to the front of the input list
function prepend(element, list) {
let newList;
// do some stuff here
return newList;
} | 14 | 0.368421 | 6 | 8 |
8120a9a82f4aab3b23a582fab0f5c4d0cdc1eff6 | src/main/resources/config/application-prod.yml | src/main/resources/config/application-prod.yml |
spring:
profiles:
active: prod
cloud:
config:
server:
native:
search-locations: file:./central-config
git:
# sample prod config using the central-directory folder in the jhipster-registry github repos
uri: https://github.com/jhipster/jhipster-registry/
search-paths: central-config
prefix: /config
thymeleaf:
cache: true
|
spring:
profiles:
active: prod
cloud:
config:
server:
native:
search-locations: file:./central-config
git:
# sample prod config using the central-directory folder in the jhipster-registry github repos
uri: https://github.com/jhipster/jhipster-registry/
search-paths: central-config
prefix: /config
thymeleaf:
cache: true
server:
compression:
enabled: true
mime-types: text/html,text/xml,text/plain,text/css, application/javascript, application/json
min-response-size: 1024
| Add Gzip compression in production | Add Gzip compression in production
| YAML | apache-2.0 | huiqiangyang/registry,huiqiangyang/registry,huiqiangyang/registry,huiqiangyang/registry,huiqiangyang/registry | yaml | ## Code Before:
spring:
profiles:
active: prod
cloud:
config:
server:
native:
search-locations: file:./central-config
git:
# sample prod config using the central-directory folder in the jhipster-registry github repos
uri: https://github.com/jhipster/jhipster-registry/
search-paths: central-config
prefix: /config
thymeleaf:
cache: true
## Instruction:
Add Gzip compression in production
## Code After:
spring:
profiles:
active: prod
cloud:
config:
server:
native:
search-locations: file:./central-config
git:
# sample prod config using the central-directory folder in the jhipster-registry github repos
uri: https://github.com/jhipster/jhipster-registry/
search-paths: central-config
prefix: /config
thymeleaf:
cache: true
server:
compression:
enabled: true
mime-types: text/html,text/xml,text/plain,text/css, application/javascript, application/json
min-response-size: 1024
|
spring:
profiles:
active: prod
cloud:
config:
server:
native:
search-locations: file:./central-config
git:
# sample prod config using the central-directory folder in the jhipster-registry github repos
uri: https://github.com/jhipster/jhipster-registry/
search-paths: central-config
prefix: /config
thymeleaf:
cache: true
+
+ server:
+ compression:
+ enabled: true
+ mime-types: text/html,text/xml,text/plain,text/css, application/javascript, application/json
+ min-response-size: 1024 | 6 | 0.352941 | 6 | 0 |
d9ec89269c8e2c39602e70b87943074e8f853065 | lib/rails_bootstrap_navbar.rb | lib/rails_bootstrap_navbar.rb | require_relative 'rails_bootstrap_navbar/version'
require_relative 'rails_bootstrap_navbar/railtie'
| require_relative 'rails_bootstrap_navbar/version'
require_relative 'rails_bootstrap_navbar/railtie' if defined?(Rails)
| Load Railtie only when Rails is defined | Load Railtie only when Rails is defined
| Ruby | mit | zBMNForks/rails-bootstrap-navbar,bootstrap-ruby/rails-bootstrap-navbar | ruby | ## Code Before:
require_relative 'rails_bootstrap_navbar/version'
require_relative 'rails_bootstrap_navbar/railtie'
## Instruction:
Load Railtie only when Rails is defined
## Code After:
require_relative 'rails_bootstrap_navbar/version'
require_relative 'rails_bootstrap_navbar/railtie' if defined?(Rails)
| require_relative 'rails_bootstrap_navbar/version'
- require_relative 'rails_bootstrap_navbar/railtie'
+ require_relative 'rails_bootstrap_navbar/railtie' if defined?(Rails)
? +++++++++++++++++++
| 2 | 1 | 1 | 1 |
26086b26b86abf32c263641f73f5857945c2e783 | packages/ye/yesod-job-queue.yaml | packages/ye/yesod-job-queue.yaml | homepage: https://github.com/nakaji-dayo/yesod-job-queue#readme
changelog-type: ''
hash: aba2c457cb8174c56fcf8a46b05dcda173899df4f640f8731f4a3feac01ac243
test-bench-deps:
yesod-job-queue: -any
base: -any
maintainer: nakaji.dayo@gmail.com
synopsis: Background jobs library for Yesod. contains management API and web interface.
Queue backend is Redis.
changelog: ''
basic-deps:
bytestring: -any
yesod-job-queue: -any
stm: -any
yesod-core: -any
base: ! '>=4.7 && <5'
time: -any
text: -any
uuid: -any
cron: -any
yesod: -any
classy-prelude-yesod: -any
lens: -any
monad-logger: -any
file-embed: -any
api-field-json-th: -any
hedis: -any
resourcet: -any
persistent-sqlite: -any
aeson: -any
all-versions:
- '0.1.0.0'
author: Daishi Nakajima
latest: '0.1.0.0'
description-type: haddock
description: Please see README.md
license-name: BSD3
| homepage: https://github.com/nakaji-dayo/yesod-job-queue#readme
changelog-type: ''
hash: e4bca487a4bd98ad6c3567362cccc7cd75d9ef733e1343c7d15feb224a467f6c
test-bench-deps:
yesod-job-queue: -any
base: -any
maintainer: nakaji.dayo@gmail.com
synopsis: Background jobs library for Yesod. contains management API and web interface.
Queue backend is Redis.
changelog: ''
basic-deps:
bytestring: -any
yesod-job-queue: -any
stm: -any
yesod-core: -any
base: ! '>=4.7 && <5'
time: -any
text: -any
uuid: -any
cron: -any
yesod: -any
classy-prelude-yesod: -any
lens: -any
monad-logger: -any
file-embed: -any
api-field-json-th: -any
hedis: -any
resourcet: -any
persistent-sqlite: -any
aeson: -any
all-versions:
- '0.1.0.0'
author: Daishi Nakajima
latest: '0.1.0.0'
description-type: haddock
description: Please see README.md
license-name: BSD3
| Update from Hackage at 2016-04-19T03:39:53+0000 | Update from Hackage at 2016-04-19T03:39:53+0000
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: https://github.com/nakaji-dayo/yesod-job-queue#readme
changelog-type: ''
hash: aba2c457cb8174c56fcf8a46b05dcda173899df4f640f8731f4a3feac01ac243
test-bench-deps:
yesod-job-queue: -any
base: -any
maintainer: nakaji.dayo@gmail.com
synopsis: Background jobs library for Yesod. contains management API and web interface.
Queue backend is Redis.
changelog: ''
basic-deps:
bytestring: -any
yesod-job-queue: -any
stm: -any
yesod-core: -any
base: ! '>=4.7 && <5'
time: -any
text: -any
uuid: -any
cron: -any
yesod: -any
classy-prelude-yesod: -any
lens: -any
monad-logger: -any
file-embed: -any
api-field-json-th: -any
hedis: -any
resourcet: -any
persistent-sqlite: -any
aeson: -any
all-versions:
- '0.1.0.0'
author: Daishi Nakajima
latest: '0.1.0.0'
description-type: haddock
description: Please see README.md
license-name: BSD3
## Instruction:
Update from Hackage at 2016-04-19T03:39:53+0000
## Code After:
homepage: https://github.com/nakaji-dayo/yesod-job-queue#readme
changelog-type: ''
hash: e4bca487a4bd98ad6c3567362cccc7cd75d9ef733e1343c7d15feb224a467f6c
test-bench-deps:
yesod-job-queue: -any
base: -any
maintainer: nakaji.dayo@gmail.com
synopsis: Background jobs library for Yesod. contains management API and web interface.
Queue backend is Redis.
changelog: ''
basic-deps:
bytestring: -any
yesod-job-queue: -any
stm: -any
yesod-core: -any
base: ! '>=4.7 && <5'
time: -any
text: -any
uuid: -any
cron: -any
yesod: -any
classy-prelude-yesod: -any
lens: -any
monad-logger: -any
file-embed: -any
api-field-json-th: -any
hedis: -any
resourcet: -any
persistent-sqlite: -any
aeson: -any
all-versions:
- '0.1.0.0'
author: Daishi Nakajima
latest: '0.1.0.0'
description-type: haddock
description: Please see README.md
license-name: BSD3
| homepage: https://github.com/nakaji-dayo/yesod-job-queue#readme
changelog-type: ''
- hash: aba2c457cb8174c56fcf8a46b05dcda173899df4f640f8731f4a3feac01ac243
+ hash: e4bca487a4bd98ad6c3567362cccc7cd75d9ef733e1343c7d15feb224a467f6c
test-bench-deps:
yesod-job-queue: -any
base: -any
maintainer: nakaji.dayo@gmail.com
synopsis: Background jobs library for Yesod. contains management API and web interface.
Queue backend is Redis.
changelog: ''
basic-deps:
bytestring: -any
yesod-job-queue: -any
stm: -any
yesod-core: -any
base: ! '>=4.7 && <5'
time: -any
text: -any
uuid: -any
cron: -any
yesod: -any
classy-prelude-yesod: -any
lens: -any
monad-logger: -any
file-embed: -any
api-field-json-th: -any
hedis: -any
resourcet: -any
persistent-sqlite: -any
aeson: -any
all-versions:
- '0.1.0.0'
author: Daishi Nakajima
latest: '0.1.0.0'
description-type: haddock
description: Please see README.md
license-name: BSD3 | 2 | 0.054054 | 1 | 1 |
be9f414c1c4371bf69d6b05de184057faa1a6304 | _layouts/presentation.html | _layouts/presentation.html | <!DOCTYPE html>
<html>
<head>
<title>{{page.title}}</title>
<meta charset="utf-8">
<style>
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
</style>
<link rel="stylesheet" type="text/css" href="./main.css">
</head>
<body>
<textarea id="source">
{{content}}
</textarea>
<script src="{{site.base_url}}/js/remark-latest.min.js">
</script>
<script>
var slideshow = remark.create({});
</script>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<title>{{page.title}}</title>
<meta charset="utf-8">
<style>
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
</style>
<link rel="stylesheet" type="text/css" href="./main.css">
</head>
<body>
<textarea id="source">
{{content}}
</textarea>
<script src="{{site.base_url}}/js/remark-latest.min.js">
</script>
<script>
var slideshow = remark.create({ 'ratio': '16:9' });
</script>
</body>
</html>
| Update slide ratio to 16:9 | Update slide ratio to 16:9
| HTML | mit | z-jason/z-jason-pages,z-jason/z-jason.github.io,z-jason/z-jason.github.io,z-jason/z-jason-pages | html | ## Code Before:
<!DOCTYPE html>
<html>
<head>
<title>{{page.title}}</title>
<meta charset="utf-8">
<style>
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
</style>
<link rel="stylesheet" type="text/css" href="./main.css">
</head>
<body>
<textarea id="source">
{{content}}
</textarea>
<script src="{{site.base_url}}/js/remark-latest.min.js">
</script>
<script>
var slideshow = remark.create({});
</script>
</body>
</html>
## Instruction:
Update slide ratio to 16:9
## Code After:
<!DOCTYPE html>
<html>
<head>
<title>{{page.title}}</title>
<meta charset="utf-8">
<style>
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
</style>
<link rel="stylesheet" type="text/css" href="./main.css">
</head>
<body>
<textarea id="source">
{{content}}
</textarea>
<script src="{{site.base_url}}/js/remark-latest.min.js">
</script>
<script>
var slideshow = remark.create({ 'ratio': '16:9' });
</script>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<title>{{page.title}}</title>
<meta charset="utf-8">
<style>
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
</style>
<link rel="stylesheet" type="text/css" href="./main.css">
</head>
<body>
<textarea id="source">
{{content}}
</textarea>
<script src="{{site.base_url}}/js/remark-latest.min.js">
</script>
<script>
- var slideshow = remark.create({});
+ var slideshow = remark.create({ 'ratio': '16:9' });
? +++++++++++++++++
</script>
</body>
</html> | 2 | 0.086957 | 1 | 1 |
3ef72dcd871b0f60c44d4e9018a4ea0119a007ab | README.md | README.md | Applicationize
===================
Applicationize your favorite web apps by wrapping them inside a Chrome extension that runs standalone like a native desktop app.
http://applicationize.com/
How it Works
---
1. Enter a URL to any web app, such as https://web.whatsapp.com/.
2. Press Enter and download the generated `.crx` Chrome extension.
3. Open a new tab and navigate to [chrome://extensions/](chrome://extensions/) (copy the link and open it manually).
4. Drag the downloaded `.crx` file from its download folder to the extensions page and install it. Don't drag it from within Chrome, it may not work as expected.
That's it! Access the applicationized web app via the **Chrome App Launcher**. If you're on Mac, drag it from the **Launchpad** to your dock to create a shortcut to it!
Run the Server
---
Run the following commands in the root directory of this project.
npm install
npm start
| Applicationize
===================
Applicationize your favorite web apps by wrapping them inside a Chrome extension that runs standalone like a native desktop app.
http://applicationize.com/
How it Works
---
1. Enter a URL to any web app, such as https://web.whatsapp.com/.
2. Press Enter and download the generated `.crx` Chrome extension.
3. Open a new tab and navigate to chrome://extensions/
4. Drag the downloaded `.crx` file from its download folder to the extensions page and install it. Don't drag it from within Chrome, it may not work as expected.
That's it! Access the applicationized web app via the **Chrome App Launcher**. If you're on Mac, drag it from the **Launchpad** to your dock to create a shortcut to it!
Run the Server
---
Run the following commands in the root directory of this project.
npm install
npm start
| Disable link to chrome://extensions since GitHub blocks it | Disable link to chrome://extensions since GitHub blocks it | Markdown | apache-2.0 | eladnava/applicationize,eladnava/applicationize,maryum375/applicationize,maryum375/applicationize | markdown | ## Code Before:
Applicationize
===================
Applicationize your favorite web apps by wrapping them inside a Chrome extension that runs standalone like a native desktop app.
http://applicationize.com/
How it Works
---
1. Enter a URL to any web app, such as https://web.whatsapp.com/.
2. Press Enter and download the generated `.crx` Chrome extension.
3. Open a new tab and navigate to [chrome://extensions/](chrome://extensions/) (copy the link and open it manually).
4. Drag the downloaded `.crx` file from its download folder to the extensions page and install it. Don't drag it from within Chrome, it may not work as expected.
That's it! Access the applicationized web app via the **Chrome App Launcher**. If you're on Mac, drag it from the **Launchpad** to your dock to create a shortcut to it!
Run the Server
---
Run the following commands in the root directory of this project.
npm install
npm start
## Instruction:
Disable link to chrome://extensions since GitHub blocks it
## Code After:
Applicationize
===================
Applicationize your favorite web apps by wrapping them inside a Chrome extension that runs standalone like a native desktop app.
http://applicationize.com/
How it Works
---
1. Enter a URL to any web app, such as https://web.whatsapp.com/.
2. Press Enter and download the generated `.crx` Chrome extension.
3. Open a new tab and navigate to chrome://extensions/
4. Drag the downloaded `.crx` file from its download folder to the extensions page and install it. Don't drag it from within Chrome, it may not work as expected.
That's it! Access the applicationized web app via the **Chrome App Launcher**. If you're on Mac, drag it from the **Launchpad** to your dock to create a shortcut to it!
Run the Server
---
Run the following commands in the root directory of this project.
npm install
npm start
| Applicationize
===================
Applicationize your favorite web apps by wrapping them inside a Chrome extension that runs standalone like a native desktop app.
http://applicationize.com/
How it Works
---
1. Enter a URL to any web app, such as https://web.whatsapp.com/.
2. Press Enter and download the generated `.crx` Chrome extension.
- 3. Open a new tab and navigate to [chrome://extensions/](chrome://extensions/) (copy the link and open it manually).
+ 3. Open a new tab and navigate to chrome://extensions/
4. Drag the downloaded `.crx` file from its download folder to the extensions page and install it. Don't drag it from within Chrome, it may not work as expected.
That's it! Access the applicationized web app via the **Chrome App Launcher**. If you're on Mac, drag it from the **Launchpad** to your dock to create a shortcut to it!
Run the Server
---
Run the following commands in the root directory of this project.
npm install
npm start | 2 | 0.086957 | 1 | 1 |
1d6ca6169f2112a30187e2b0c4e186318d2d51dc | bower.json | bower.json | {
"name": "proto",
"version": "0.0.1",
"homepage": "https://github.com/LupoLibero/Lupo-proto",
"authors": [
"Sylvain Duchesne",
"Da Silva Jonathan"
],
"description": "Prototype of Lupo",
"moduleType": [
"globals",
"node"
],
"keywords": [
"Lupo",
"Libero",
"LupoLibero",
"Cloud",
"Privacy"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"packages",
"static/vendor",
"test",
"tests"
],
"dependencies": {
"angular": "1.2.16",
"angular-couchdb": "LupoLibero/ngCouch",
"angular-ui-router": "~0.2.10",
"angular-resource": "~1.2.14",
"sjcl": "bitwiseshiftleft/sjcl",
"jsencrypt": "travist/jsencrypt",
"angular-pouchdb": "~0.1.5",
"assert": "Jxck/assert",
"angular-spinner": "~0.4.0"
}
}
| {
"name": "proto",
"version": "0.0.1",
"homepage": "https://github.com/LupoLibero/Lupo-proto",
"authors": [
"Sylvain Duchesne",
"Da Silva Jonathan"
],
"description": "Prototype of Lupo",
"moduleType": [
"globals",
"node"
],
"keywords": [
"Lupo",
"Libero",
"LupoLibero",
"Cloud",
"Privacy"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"packages",
"static/vendor",
"test",
"tests"
],
"dependencies": {
"angular": "1.3.*",
"angular-couchdb": "LupoLibero/ngCouch",
"angular-ui-router": "~0.2.10",
"angular-resource": "~1.2.14",
"sjcl": "bitwiseshiftleft/sjcl",
"jsencrypt": "travist/jsencrypt",
"angular-pouchdb": "~0.1.5",
"assert": "Jxck/assert",
"angular-spinner": "~0.4.0"
},
"resolutions": {
"angular": "1.3.*"
}
}
| Use the beta version of angularjs. | Use the beta version of angularjs.
| JSON | mit | LupoLibero/Lupo-proto | json | ## Code Before:
{
"name": "proto",
"version": "0.0.1",
"homepage": "https://github.com/LupoLibero/Lupo-proto",
"authors": [
"Sylvain Duchesne",
"Da Silva Jonathan"
],
"description": "Prototype of Lupo",
"moduleType": [
"globals",
"node"
],
"keywords": [
"Lupo",
"Libero",
"LupoLibero",
"Cloud",
"Privacy"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"packages",
"static/vendor",
"test",
"tests"
],
"dependencies": {
"angular": "1.2.16",
"angular-couchdb": "LupoLibero/ngCouch",
"angular-ui-router": "~0.2.10",
"angular-resource": "~1.2.14",
"sjcl": "bitwiseshiftleft/sjcl",
"jsencrypt": "travist/jsencrypt",
"angular-pouchdb": "~0.1.5",
"assert": "Jxck/assert",
"angular-spinner": "~0.4.0"
}
}
## Instruction:
Use the beta version of angularjs.
## Code After:
{
"name": "proto",
"version": "0.0.1",
"homepage": "https://github.com/LupoLibero/Lupo-proto",
"authors": [
"Sylvain Duchesne",
"Da Silva Jonathan"
],
"description": "Prototype of Lupo",
"moduleType": [
"globals",
"node"
],
"keywords": [
"Lupo",
"Libero",
"LupoLibero",
"Cloud",
"Privacy"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"packages",
"static/vendor",
"test",
"tests"
],
"dependencies": {
"angular": "1.3.*",
"angular-couchdb": "LupoLibero/ngCouch",
"angular-ui-router": "~0.2.10",
"angular-resource": "~1.2.14",
"sjcl": "bitwiseshiftleft/sjcl",
"jsencrypt": "travist/jsencrypt",
"angular-pouchdb": "~0.1.5",
"assert": "Jxck/assert",
"angular-spinner": "~0.4.0"
},
"resolutions": {
"angular": "1.3.*"
}
}
| {
"name": "proto",
"version": "0.0.1",
"homepage": "https://github.com/LupoLibero/Lupo-proto",
"authors": [
"Sylvain Duchesne",
"Da Silva Jonathan"
],
"description": "Prototype of Lupo",
"moduleType": [
"globals",
"node"
],
"keywords": [
"Lupo",
"Libero",
"LupoLibero",
"Cloud",
"Privacy"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"packages",
"static/vendor",
"test",
"tests"
],
"dependencies": {
- "angular": "1.2.16",
? ^ ^^
+ "angular": "1.3.*",
? ^ ^
"angular-couchdb": "LupoLibero/ngCouch",
"angular-ui-router": "~0.2.10",
"angular-resource": "~1.2.14",
"sjcl": "bitwiseshiftleft/sjcl",
"jsencrypt": "travist/jsencrypt",
"angular-pouchdb": "~0.1.5",
"assert": "Jxck/assert",
"angular-spinner": "~0.4.0"
+ },
+ "resolutions": {
+ "angular": "1.3.*"
}
} | 5 | 0.121951 | 4 | 1 |
44728efa617d8b486b27fef33b5b33b52c78137b | lib/facter/python_version.rb | lib/facter/python_version.rb |
def get_python_version(executable)
if Facter::Util::Resolution.which(executable)
Facter::Util::Resolution.exec("#{executable} -V 2>&1").match(/^.*(\d+\.\d+\.\d+)$/)[1]
end
end
Facter.add("python_version") do
setcode do
get_python_version 'python'
end
end
Facter.add("python2_version") do
setcode do
default_version = get_python_version 'python'
if default_version.nil? or !default_version.start_with?('2')
get_python_version 'python2'
else
default_version
end
end
end
Facter.add("python3_version") do
setcode do
get_python_version 'python3'
end
end
|
def get_python_version(executable)
if Facter::Util::Resolution.which(executable)
results = Facter::Util::Resolution.exec("#{executable} -V 2>&1").match(/^.*(\d+\.\d+\.\d+)$/)
if results
results[1]
end
end
end
Facter.add("python_version") do
setcode do
get_python_version 'python'
end
end
Facter.add("python2_version") do
setcode do
default_version = get_python_version 'python'
if default_version.nil? or !default_version.start_with?('2')
get_python_version 'python2'
else
default_version
end
end
end
Facter.add("python3_version") do
setcode do
get_python_version 'python3'
end
end
| Check that we have results before returning a value | Check that we have results before returning a value
Without this change, empty results yield a message like the following in
Facter output.
undefined method `[]' for nil:NilClass
This work captures the results and check to them to ensure we return
a valid value.
| Ruby | apache-2.0 | xaque208/puppet-python,ody/puppet-python,vicinus/puppet-python,skpy/puppet-python,ody/puppet-python,xaque208/puppet-python,stankevich/puppet-python,stankevich/puppet-python,ghoneycutt/puppet-python,vicinus/puppet-python,ghoneycutt/puppet-python,skpy/puppet-python,xaque208/puppet-python | ruby | ## Code Before:
def get_python_version(executable)
if Facter::Util::Resolution.which(executable)
Facter::Util::Resolution.exec("#{executable} -V 2>&1").match(/^.*(\d+\.\d+\.\d+)$/)[1]
end
end
Facter.add("python_version") do
setcode do
get_python_version 'python'
end
end
Facter.add("python2_version") do
setcode do
default_version = get_python_version 'python'
if default_version.nil? or !default_version.start_with?('2')
get_python_version 'python2'
else
default_version
end
end
end
Facter.add("python3_version") do
setcode do
get_python_version 'python3'
end
end
## Instruction:
Check that we have results before returning a value
Without this change, empty results yield a message like the following in
Facter output.
undefined method `[]' for nil:NilClass
This work captures the results and check to them to ensure we return
a valid value.
## Code After:
def get_python_version(executable)
if Facter::Util::Resolution.which(executable)
results = Facter::Util::Resolution.exec("#{executable} -V 2>&1").match(/^.*(\d+\.\d+\.\d+)$/)
if results
results[1]
end
end
end
Facter.add("python_version") do
setcode do
get_python_version 'python'
end
end
Facter.add("python2_version") do
setcode do
default_version = get_python_version 'python'
if default_version.nil? or !default_version.start_with?('2')
get_python_version 'python2'
else
default_version
end
end
end
Facter.add("python3_version") do
setcode do
get_python_version 'python3'
end
end
|
def get_python_version(executable)
if Facter::Util::Resolution.which(executable)
- Facter::Util::Resolution.exec("#{executable} -V 2>&1").match(/^.*(\d+\.\d+\.\d+)$/)[1]
? ---
+ results = Facter::Util::Resolution.exec("#{executable} -V 2>&1").match(/^.*(\d+\.\d+\.\d+)$/)
? ++++++++++
+ if results
+ results[1]
+ end
end
end
Facter.add("python_version") do
setcode do
get_python_version 'python'
end
end
Facter.add("python2_version") do
setcode do
default_version = get_python_version 'python'
if default_version.nil? or !default_version.start_with?('2')
get_python_version 'python2'
else
default_version
end
end
end
Facter.add("python3_version") do
setcode do
get_python_version 'python3'
end
end | 5 | 0.172414 | 4 | 1 |
c07b037f021e0dcc800cfcb01248acc23fc9bec0 | radar/web/templates/patient/lab_results_table.html | radar/web/templates/patient/lab_results_table.html | {% extends 'patient/lab_results_base.html' %}
{% set current_lab_results_page = 'table' %}
{% from 'macros/ordering.html' import render_sortable_column %}
{% block content %}
{{ super() }}
<form class="form lab-result-table" method="GET">
<p>
{{ form.result_codes(class='form-control') }}
</p>
<p>
<button type="submit" class="btn btn-primary btn-xs">Update Columns</button>
</p>
</form>
{% if table %}
<table class="table table-condensed table-striped">
<thead>
<tr>
<th>{{ render_sortable_column(ordering, 'date', 'Date') }}</th>
{% for x, sort_key in result_columns %}
<th>{{ render_sortable_column(ordering, sort_key, x.short_name) }}</th>
{% endfor %}
<th>{{ render_sortable_column(ordering, 'source', 'Data Source') }}</th>
</tr>
</thead>
<tbody>
{% for x in table %}
<tr>
<td>{{ x.date | datetime_format("%d/%m/%Y %H:%M") | missing }}</td>
{% for value in x %}
<td>{{ value | missing }}</td>
{% endfor %}
<td>{{ x.facility.name }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>No matching lab results.</p>
{% endif %}
{% endblock %} | {% extends 'patient/lab_results_base.html' %}
{% set current_lab_results_page = 'table' %}
{% from 'macros/ordering.html' import render_sortable_column %}
{% block content %}
{{ super() }}
<form class="form lab-result-table" method="GET">
<p>
{{ form.result_codes(class='form-control') }}
</p>
<p>
<button type="submit" class="btn btn-primary btn-xs">Update Columns</button>
</p>
</form>
{% if table %}
<table class="table table-condensed table-striped">
<thead>
<tr>
<th>{{ render_sortable_column(ordering, 'date', 'Date') }}</th>
{% for x, sort_key in result_columns %}
<th>
{{ render_sortable_column(ordering, sort_key, x.short_name) }}
{% if x.units %}
<small>({{ x.units }})</small>
{% endif %}
</th>
{% endfor %}
<th>{{ render_sortable_column(ordering, 'source', 'Data Source') }}</th>
</tr>
</thead>
<tbody>
{% for x in table %}
<tr>
<td>{{ x.date | datetime_format("%d/%m/%Y %H:%M") | missing }}</td>
{% for value in x %}
<td>{{ value | missing }}</td>
{% endfor %}
<td>{{ x.facility.name }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>No matching lab results.</p>
{% endif %}
{% endblock %} | Add units to lab result table | Add units to lab result table
| HTML | agpl-3.0 | renalreg/radar,renalreg/radar,renalreg/radar,renalreg/radar | html | ## Code Before:
{% extends 'patient/lab_results_base.html' %}
{% set current_lab_results_page = 'table' %}
{% from 'macros/ordering.html' import render_sortable_column %}
{% block content %}
{{ super() }}
<form class="form lab-result-table" method="GET">
<p>
{{ form.result_codes(class='form-control') }}
</p>
<p>
<button type="submit" class="btn btn-primary btn-xs">Update Columns</button>
</p>
</form>
{% if table %}
<table class="table table-condensed table-striped">
<thead>
<tr>
<th>{{ render_sortable_column(ordering, 'date', 'Date') }}</th>
{% for x, sort_key in result_columns %}
<th>{{ render_sortable_column(ordering, sort_key, x.short_name) }}</th>
{% endfor %}
<th>{{ render_sortable_column(ordering, 'source', 'Data Source') }}</th>
</tr>
</thead>
<tbody>
{% for x in table %}
<tr>
<td>{{ x.date | datetime_format("%d/%m/%Y %H:%M") | missing }}</td>
{% for value in x %}
<td>{{ value | missing }}</td>
{% endfor %}
<td>{{ x.facility.name }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>No matching lab results.</p>
{% endif %}
{% endblock %}
## Instruction:
Add units to lab result table
## Code After:
{% extends 'patient/lab_results_base.html' %}
{% set current_lab_results_page = 'table' %}
{% from 'macros/ordering.html' import render_sortable_column %}
{% block content %}
{{ super() }}
<form class="form lab-result-table" method="GET">
<p>
{{ form.result_codes(class='form-control') }}
</p>
<p>
<button type="submit" class="btn btn-primary btn-xs">Update Columns</button>
</p>
</form>
{% if table %}
<table class="table table-condensed table-striped">
<thead>
<tr>
<th>{{ render_sortable_column(ordering, 'date', 'Date') }}</th>
{% for x, sort_key in result_columns %}
<th>
{{ render_sortable_column(ordering, sort_key, x.short_name) }}
{% if x.units %}
<small>({{ x.units }})</small>
{% endif %}
</th>
{% endfor %}
<th>{{ render_sortable_column(ordering, 'source', 'Data Source') }}</th>
</tr>
</thead>
<tbody>
{% for x in table %}
<tr>
<td>{{ x.date | datetime_format("%d/%m/%Y %H:%M") | missing }}</td>
{% for value in x %}
<td>{{ value | missing }}</td>
{% endfor %}
<td>{{ x.facility.name }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>No matching lab results.</p>
{% endif %}
{% endblock %} | {% extends 'patient/lab_results_base.html' %}
{% set current_lab_results_page = 'table' %}
{% from 'macros/ordering.html' import render_sortable_column %}
{% block content %}
{{ super() }}
<form class="form lab-result-table" method="GET">
<p>
{{ form.result_codes(class='form-control') }}
</p>
<p>
<button type="submit" class="btn btn-primary btn-xs">Update Columns</button>
</p>
</form>
{% if table %}
<table class="table table-condensed table-striped">
<thead>
<tr>
<th>{{ render_sortable_column(ordering, 'date', 'Date') }}</th>
{% for x, sort_key in result_columns %}
+ <th>
- <th>{{ render_sortable_column(ordering, sort_key, x.short_name) }}</th>
? ^^^^ -----
+ {{ render_sortable_column(ordering, sort_key, x.short_name) }}
? ^^^^
+
+ {% if x.units %}
+ <small>({{ x.units }})</small>
+ {% endif %}
+ </th>
{% endfor %}
<th>{{ render_sortable_column(ordering, 'source', 'Data Source') }}</th>
</tr>
</thead>
<tbody>
{% for x in table %}
<tr>
<td>{{ x.date | datetime_format("%d/%m/%Y %H:%M") | missing }}</td>
{% for value in x %}
<td>{{ value | missing }}</td>
{% endfor %}
<td>{{ x.facility.name }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>No matching lab results.</p>
{% endif %}
{% endblock %} | 8 | 0.156863 | 7 | 1 |
cab44aaa0bc8079d2b09f50fdf73861b32fa2f78 | app/views/dashboard/conversation.html.erb | app/views/dashboard/conversation.html.erb | <div class="chat-box">
<div class="header">
Narayan Prusty
</div>
<div id="messages" class="messages">
<ul>
<% @conversation.messages.each do |message| %>
<li>
<span class="<%= message.sender == current_user ? 'right' : 'left' %>"><%= message.body %></span>
<div class="clear"></div>
</li>
<% end %>
</ul>
<div class="clear"></div>
</div>
<div class="input-box">
<textarea placeholder="Enter message"></textarea>
</div>
</div>
| <div class="chat-box">
<div class="header">
Narayan Prusty
</div>
<div id="messages" class="messages">
<ul>
<% @conversation.messages.each do |message| %>
<li>
<span class="<%= message.sender == current_user ? 'right' : 'left' %>"><%= message.body %></span>
<div class="clear"></div>
</li>
<% end %>
</ul>
<div class="clear"></div>
</div>
<div class="input-box">
<textarea placeholder="Enter message"></textarea>
</div>
<%= form_for @message do |f| %>
<%= fields_for :conversation do |ff| %>
<%= ff.hidden_field :id %>
<% end %>
<%= f.text_field :body, class: "form-control" %>
<%= f.button 'Submit' %>
<% end %>
</div>
| Add form to send a new message | Add form to send a new message
| HTML+ERB | agpl-3.0 | payloadtech/mailpenny,payloadtech/mailpenny,payloadtech/mailpenny | html+erb | ## Code Before:
<div class="chat-box">
<div class="header">
Narayan Prusty
</div>
<div id="messages" class="messages">
<ul>
<% @conversation.messages.each do |message| %>
<li>
<span class="<%= message.sender == current_user ? 'right' : 'left' %>"><%= message.body %></span>
<div class="clear"></div>
</li>
<% end %>
</ul>
<div class="clear"></div>
</div>
<div class="input-box">
<textarea placeholder="Enter message"></textarea>
</div>
</div>
## Instruction:
Add form to send a new message
## Code After:
<div class="chat-box">
<div class="header">
Narayan Prusty
</div>
<div id="messages" class="messages">
<ul>
<% @conversation.messages.each do |message| %>
<li>
<span class="<%= message.sender == current_user ? 'right' : 'left' %>"><%= message.body %></span>
<div class="clear"></div>
</li>
<% end %>
</ul>
<div class="clear"></div>
</div>
<div class="input-box">
<textarea placeholder="Enter message"></textarea>
</div>
<%= form_for @message do |f| %>
<%= fields_for :conversation do |ff| %>
<%= ff.hidden_field :id %>
<% end %>
<%= f.text_field :body, class: "form-control" %>
<%= f.button 'Submit' %>
<% end %>
</div>
| <div class="chat-box">
<div class="header">
Narayan Prusty
</div>
<div id="messages" class="messages">
<ul>
<% @conversation.messages.each do |message| %>
<li>
<span class="<%= message.sender == current_user ? 'right' : 'left' %>"><%= message.body %></span>
<div class="clear"></div>
</li>
<% end %>
</ul>
<div class="clear"></div>
</div>
<div class="input-box">
<textarea placeholder="Enter message"></textarea>
</div>
+ <%= form_for @message do |f| %>
+ <%= fields_for :conversation do |ff| %>
+ <%= ff.hidden_field :id %>
+ <% end %>
+ <%= f.text_field :body, class: "form-control" %>
+ <%= f.button 'Submit' %>
+ <% end %>
</div> | 7 | 0.333333 | 7 | 0 |
0c6dccdf2aaca1831bacd5bf710abeb38281b5ac | lib/maruku/output/entity_table.rb | lib/maruku/output/entity_table.rb | require 'nokogiri'
require 'singleton'
module MaRuKu::Out
Entity = Struct.new(:html_num, :html_entity, :latex_string, :latex_package)
class EntityTable
# Sad but true
include Singleton
def initialize
@entity_table = {}
xml = File.read(File.join(File.dirname(__FILE__), '..', '..', '..', 'data', 'entities.xml'))
doc = Nokogiri::XML::Document.parse(xml)
doc.xpath("//char").each do |c|
num = c['num'].to_i
name = c['name']
convert = c['convertTo']
package = c['package']
e = Entity.new(num, name, convert, package)
@entity_table[name] = e
@entity_table[num] = e
end
end
def entity(name)
@entity_table[name]
end
end
end
| require 'rexml/document'
require 'singleton'
module MaRuKu::Out
Entity = Struct.new(:html_num, :html_entity, :latex_string, :latex_package)
class EntityTable
# Sad but true
include Singleton
def initialize
@entity_table = {}
xml = File.new(File.join(File.dirname(__FILE__), '..', '..', '..', 'data', 'entities.xml'))
doc = REXML::Document.new(xml)
doc.elements.each("//char") do |c|
num = c.attributes['num'].to_i
name = c.attributes['name']
convert = c.attributes['convertTo']
package = c.attributes['package']
e = Entity.new(num, name, convert, package)
@entity_table[name] = e
@entity_table[num] = e
end
end
def entity(name)
@entity_table[name]
end
end
end
| Use REXML to load the entities table (once, at startup) rather than Nokogiri. | Use REXML to load the entities table (once, at startup) rather than Nokogiri.
| Ruby | mit | distler/maruku,bhollis/maruku,distler/maruku | ruby | ## Code Before:
require 'nokogiri'
require 'singleton'
module MaRuKu::Out
Entity = Struct.new(:html_num, :html_entity, :latex_string, :latex_package)
class EntityTable
# Sad but true
include Singleton
def initialize
@entity_table = {}
xml = File.read(File.join(File.dirname(__FILE__), '..', '..', '..', 'data', 'entities.xml'))
doc = Nokogiri::XML::Document.parse(xml)
doc.xpath("//char").each do |c|
num = c['num'].to_i
name = c['name']
convert = c['convertTo']
package = c['package']
e = Entity.new(num, name, convert, package)
@entity_table[name] = e
@entity_table[num] = e
end
end
def entity(name)
@entity_table[name]
end
end
end
## Instruction:
Use REXML to load the entities table (once, at startup) rather than Nokogiri.
## Code After:
require 'rexml/document'
require 'singleton'
module MaRuKu::Out
Entity = Struct.new(:html_num, :html_entity, :latex_string, :latex_package)
class EntityTable
# Sad but true
include Singleton
def initialize
@entity_table = {}
xml = File.new(File.join(File.dirname(__FILE__), '..', '..', '..', 'data', 'entities.xml'))
doc = REXML::Document.new(xml)
doc.elements.each("//char") do |c|
num = c.attributes['num'].to_i
name = c.attributes['name']
convert = c.attributes['convertTo']
package = c.attributes['package']
e = Entity.new(num, name, convert, package)
@entity_table[name] = e
@entity_table[num] = e
end
end
def entity(name)
@entity_table[name]
end
end
end
| - require 'nokogiri'
+ require 'rexml/document'
require 'singleton'
module MaRuKu::Out
Entity = Struct.new(:html_num, :html_entity, :latex_string, :latex_package)
class EntityTable
# Sad but true
include Singleton
def initialize
@entity_table = {}
- xml = File.read(File.join(File.dirname(__FILE__), '..', '..', '..', 'data', 'entities.xml'))
? ^ ^^
+ xml = File.new(File.join(File.dirname(__FILE__), '..', '..', '..', 'data', 'entities.xml'))
? ^ ^
- doc = Nokogiri::XML::Document.parse(xml)
? ^^^^^^^^^^ ^^^^
+ doc = REXML::Document.new(xml)
? ^^ ^ +
- doc.xpath("//char").each do |c|
? ^^ ^ -----
+ doc.elements.each("//char") do |c|
? ^^^^^^^^^^ ^
- num = c['num'].to_i
+ num = c.attributes['num'].to_i
? +++++++++++
- name = c['name']
+ name = c.attributes['name']
? +++++++++++
- convert = c['convertTo']
+ convert = c.attributes['convertTo']
? +++++++++++
- package = c['package']
+ package = c.attributes['package']
? +++++++++++
e = Entity.new(num, name, convert, package)
@entity_table[name] = e
@entity_table[num] = e
end
end
def entity(name)
@entity_table[name]
end
end
end
| 16 | 0.484848 | 8 | 8 |
dcf929552a057c60bb0920db46d828160b0f0255 | demo/runner.js | demo/runner.js | var esformatter = require( 'esformatter' );
esformatter.register( require( '../lib/plugin' ) );
var fs = require( 'fs' );
var path = require( 'path' );
var files = fs.readdirSync( './entry/' );
files.forEach( function ( file ) {
var codeStr = fs.readFileSync( './entry/' + file ).toString();
var formattedCode = esformatter.format( codeStr, {
'whiteSpace': {
'value': ' ',
'removeTrailing': 1,
'before': {
ObjectPatternClosingBrace: 1
},
'after': {
ObjectPatternOpeningBrace: 1
},
},
'jsx': {
'formatJSX': true,
'attrsOnSameLineAsTag': true,
'maxAttrsOnTag': 3,
'firstAttributeOnSameLine': true,
'spaceInJSXExpressionContainers': ' ',
'alignWithFirstAttribute': false,
'formatJSXExpressions': false,
'htmlOptions': {
'brace_style': 'collapse',
'indent_char': ' ',
'indent_size': 2,
'max_preserve_newlines': 2,
'preserve_newlines': true
}
}
} );
fs.writeFileSync( './result/' + path.basename( file ), formattedCode );
} );
| var esformatter = require( 'esformatter' );
esformatter.register( require( '../lib/plugin' ) );
var fs = require( 'fs' );
var path = require( 'path' );
var files = fs.readdirSync( './entry/' );
files.forEach( function ( file ) {
var codeStr = fs.readFileSync( './entry/' + file ).toString();
var options = {
'whiteSpace': {
'value': ' ',
'removeTrailing': 1,
'before': {
ObjectPatternClosingBrace: 1
},
'after': {
ObjectPatternOpeningBrace: 1
},
},
'jsx': {
'formatJSX': true,
'attrsOnSameLineAsTag': true,
'maxAttrsOnTag': 3,
'firstAttributeOnSameLine': true,
'spaceInJSXExpressionContainers': ' ',
'alignWithFirstAttribute': false,
'formatJSXExpressions': false,
'htmlOptions': {
'brace_style': 'collapse',
'indent_char': ' ',
'indent_size': 2,
'max_preserve_newlines': 2,
'preserve_newlines': true
}
}
};
var formattedCode = esformatter.format( codeStr, options );
fs.writeFileSync( './result/' + path.basename( file ), formattedCode );
var reformattedCode = esformatter.format( formattedCode, options );
if (formattedCode !== reformattedCode) {
throw new Error( 'Expected ' + file + ' to reformat to the same result' );
}
} );
| Reformat within demo to ensure equal results | Reformat within demo to ensure equal results
| JavaScript | mit | royriojas/esformatter-jsx | javascript | ## Code Before:
var esformatter = require( 'esformatter' );
esformatter.register( require( '../lib/plugin' ) );
var fs = require( 'fs' );
var path = require( 'path' );
var files = fs.readdirSync( './entry/' );
files.forEach( function ( file ) {
var codeStr = fs.readFileSync( './entry/' + file ).toString();
var formattedCode = esformatter.format( codeStr, {
'whiteSpace': {
'value': ' ',
'removeTrailing': 1,
'before': {
ObjectPatternClosingBrace: 1
},
'after': {
ObjectPatternOpeningBrace: 1
},
},
'jsx': {
'formatJSX': true,
'attrsOnSameLineAsTag': true,
'maxAttrsOnTag': 3,
'firstAttributeOnSameLine': true,
'spaceInJSXExpressionContainers': ' ',
'alignWithFirstAttribute': false,
'formatJSXExpressions': false,
'htmlOptions': {
'brace_style': 'collapse',
'indent_char': ' ',
'indent_size': 2,
'max_preserve_newlines': 2,
'preserve_newlines': true
}
}
} );
fs.writeFileSync( './result/' + path.basename( file ), formattedCode );
} );
## Instruction:
Reformat within demo to ensure equal results
## Code After:
var esformatter = require( 'esformatter' );
esformatter.register( require( '../lib/plugin' ) );
var fs = require( 'fs' );
var path = require( 'path' );
var files = fs.readdirSync( './entry/' );
files.forEach( function ( file ) {
var codeStr = fs.readFileSync( './entry/' + file ).toString();
var options = {
'whiteSpace': {
'value': ' ',
'removeTrailing': 1,
'before': {
ObjectPatternClosingBrace: 1
},
'after': {
ObjectPatternOpeningBrace: 1
},
},
'jsx': {
'formatJSX': true,
'attrsOnSameLineAsTag': true,
'maxAttrsOnTag': 3,
'firstAttributeOnSameLine': true,
'spaceInJSXExpressionContainers': ' ',
'alignWithFirstAttribute': false,
'formatJSXExpressions': false,
'htmlOptions': {
'brace_style': 'collapse',
'indent_char': ' ',
'indent_size': 2,
'max_preserve_newlines': 2,
'preserve_newlines': true
}
}
};
var formattedCode = esformatter.format( codeStr, options );
fs.writeFileSync( './result/' + path.basename( file ), formattedCode );
var reformattedCode = esformatter.format( formattedCode, options );
if (formattedCode !== reformattedCode) {
throw new Error( 'Expected ' + file + ' to reformat to the same result' );
}
} );
| var esformatter = require( 'esformatter' );
esformatter.register( require( '../lib/plugin' ) );
var fs = require( 'fs' );
var path = require( 'path' );
var files = fs.readdirSync( './entry/' );
files.forEach( function ( file ) {
var codeStr = fs.readFileSync( './entry/' + file ).toString();
- var formattedCode = esformatter.format( codeStr, {
+ var options = {
'whiteSpace': {
'value': ' ',
'removeTrailing': 1,
'before': {
ObjectPatternClosingBrace: 1
},
'after': {
ObjectPatternOpeningBrace: 1
},
},
'jsx': {
'formatJSX': true,
'attrsOnSameLineAsTag': true,
'maxAttrsOnTag': 3,
'firstAttributeOnSameLine': true,
'spaceInJSXExpressionContainers': ' ',
'alignWithFirstAttribute': false,
'formatJSXExpressions': false,
'htmlOptions': {
'brace_style': 'collapse',
'indent_char': ' ',
'indent_size': 2,
'max_preserve_newlines': 2,
'preserve_newlines': true
}
}
- } );
? --
+ };
+ var formattedCode = esformatter.format( codeStr, options );
fs.writeFileSync( './result/' + path.basename( file ), formattedCode );
+ var reformattedCode = esformatter.format( formattedCode, options );
+ if (formattedCode !== reformattedCode) {
+ throw new Error( 'Expected ' + file + ' to reformat to the same result' );
+ }
} ); | 9 | 0.214286 | 7 | 2 |
c2d432ea6ede7ba657bbee79eeac1aff7261e5ef | lib/templates/_bower.json | lib/templates/_bower.json | {
"name": "<%= _.slugify(appname) %>",
"version": "0.0.0",
"dependencies": {
"chai": "~1.7.2",
"mocha": "~1.12.0"
},
"devDependencies": {}
}
| {
"name": "<%= _.slugify(appname) %>",
"private": true,
"dependencies": {
"chai": "~1.7.2",
"mocha": "~1.12.0"
},
"devDependencies": {}
}
| Remove version, add private to bower.json template | Remove version, add private to bower.json template
| JSON | bsd-2-clause | yeoman/generator-mocha,yeoman/generator-mocha | json | ## Code Before:
{
"name": "<%= _.slugify(appname) %>",
"version": "0.0.0",
"dependencies": {
"chai": "~1.7.2",
"mocha": "~1.12.0"
},
"devDependencies": {}
}
## Instruction:
Remove version, add private to bower.json template
## Code After:
{
"name": "<%= _.slugify(appname) %>",
"private": true,
"dependencies": {
"chai": "~1.7.2",
"mocha": "~1.12.0"
},
"devDependencies": {}
}
| {
"name": "<%= _.slugify(appname) %>",
- "version": "0.0.0",
+ "private": true,
"dependencies": {
"chai": "~1.7.2",
"mocha": "~1.12.0"
},
"devDependencies": {}
} | 2 | 0.222222 | 1 | 1 |
8b3c15215b5bfa63d382dde90b991db91eec1e65 | appveyor.yml | appveyor.yml | build: false
environment:
global:
BINSTAR_USER: menpo
BINSTAR_KEY:
secure: mw1Fz5a5C0lT4CXzsOCADoo/Xa9YymZI3yjVZNR8f5GwYrVAOC2YXxyEG6NaSWZY
matrix:
- PYTHON_VERSION: 2.7
- PYTHON_VERSION: 3.4
matrix:
fast_finish: true
platform:
- x86
- x64
init:
- ps: Start-FileDownload 'https://raw.githubusercontent.com/menpo/condaci/v0.4.6/condaci.py' C:\\condaci.py; echo "Done"
- cmd: python C:\\condaci.py setup
install:
- cmd: "set tmp_cmd=\"python C:\\condaci.py miniconda_dir\" && FOR /F %i IN (' %tmp_cmd% ') DO SET APPV_MINICONDA_DIR=%i"
- cmd: set APPV_MINICONDA_EXE="%APPV_MINICONDA_DIR%\python.exe"
- cmd: "%APPV_MINICONDA_EXE% C:\\condaci.py build conda"
notifications:
- provider: Slack
auth_token:
secure: Jyd2NTPkBrrwBnl1C0mkNp5sUPGXzKrDgpZVDvPj72OUJtovXsO3795UsvktLucG
channel: general
on_build_status_changed: true
on_build_success: false
on_build_failure: false
| build: false
environment:
global:
BINSTAR_USER: menpo
BINSTAR_KEY:
secure: mw1Fz5a5C0lT4CXzsOCADoo/Xa9YymZI3yjVZNR8f5GwYrVAOC2YXxyEG6NaSWZY
matrix:
- PYTHON_VERSION: 2.7
- PYTHON_VERSION: 3.4
matrix:
fast_finish: true
platform:
- x86
- x64
init:
- ps: Start-FileDownload 'https://raw.githubusercontent.com/menpo/condaci/v0.4.6/condaci.py' C:\\condaci.py; echo "Done"
- cmd: python C:\\condaci.py setup
install:
- cmd: set tmp_cmd=python C:\\condaci.py miniconda_dir
- cmd: "FOR /F %i IN (' %tmp_cmd% ') DO SET APPV_MINICONDA_DIR=%i"
- cmd: set APPV_MINICONDA_EXE="%APPV_MINICONDA_DIR%\python.exe"
- cmd: "%APPV_MINICONDA_EXE% C:\\condaci.py build conda"
notifications:
- provider: Slack
auth_token:
secure: Jyd2NTPkBrrwBnl1C0mkNp5sUPGXzKrDgpZVDvPj72OUJtovXsO3795UsvktLucG
channel: general
on_build_status_changed: true
on_build_success: false
on_build_failure: false
| Split command over two lines | Split command over two lines
| YAML | bsd-3-clause | patricksnape/menpo,menpo/menpo,yuxiang-zhou/menpo,mozata/menpo,menpo/menpo,patricksnape/menpo,yuxiang-zhou/menpo,menpo/menpo,grigorisg9gr/menpo,mozata/menpo,patricksnape/menpo,grigorisg9gr/menpo,mozata/menpo,mozata/menpo,grigorisg9gr/menpo,yuxiang-zhou/menpo | yaml | ## Code Before:
build: false
environment:
global:
BINSTAR_USER: menpo
BINSTAR_KEY:
secure: mw1Fz5a5C0lT4CXzsOCADoo/Xa9YymZI3yjVZNR8f5GwYrVAOC2YXxyEG6NaSWZY
matrix:
- PYTHON_VERSION: 2.7
- PYTHON_VERSION: 3.4
matrix:
fast_finish: true
platform:
- x86
- x64
init:
- ps: Start-FileDownload 'https://raw.githubusercontent.com/menpo/condaci/v0.4.6/condaci.py' C:\\condaci.py; echo "Done"
- cmd: python C:\\condaci.py setup
install:
- cmd: "set tmp_cmd=\"python C:\\condaci.py miniconda_dir\" && FOR /F %i IN (' %tmp_cmd% ') DO SET APPV_MINICONDA_DIR=%i"
- cmd: set APPV_MINICONDA_EXE="%APPV_MINICONDA_DIR%\python.exe"
- cmd: "%APPV_MINICONDA_EXE% C:\\condaci.py build conda"
notifications:
- provider: Slack
auth_token:
secure: Jyd2NTPkBrrwBnl1C0mkNp5sUPGXzKrDgpZVDvPj72OUJtovXsO3795UsvktLucG
channel: general
on_build_status_changed: true
on_build_success: false
on_build_failure: false
## Instruction:
Split command over two lines
## Code After:
build: false
environment:
global:
BINSTAR_USER: menpo
BINSTAR_KEY:
secure: mw1Fz5a5C0lT4CXzsOCADoo/Xa9YymZI3yjVZNR8f5GwYrVAOC2YXxyEG6NaSWZY
matrix:
- PYTHON_VERSION: 2.7
- PYTHON_VERSION: 3.4
matrix:
fast_finish: true
platform:
- x86
- x64
init:
- ps: Start-FileDownload 'https://raw.githubusercontent.com/menpo/condaci/v0.4.6/condaci.py' C:\\condaci.py; echo "Done"
- cmd: python C:\\condaci.py setup
install:
- cmd: set tmp_cmd=python C:\\condaci.py miniconda_dir
- cmd: "FOR /F %i IN (' %tmp_cmd% ') DO SET APPV_MINICONDA_DIR=%i"
- cmd: set APPV_MINICONDA_EXE="%APPV_MINICONDA_DIR%\python.exe"
- cmd: "%APPV_MINICONDA_EXE% C:\\condaci.py build conda"
notifications:
- provider: Slack
auth_token:
secure: Jyd2NTPkBrrwBnl1C0mkNp5sUPGXzKrDgpZVDvPj72OUJtovXsO3795UsvktLucG
channel: general
on_build_status_changed: true
on_build_success: false
on_build_failure: false
| build: false
environment:
global:
BINSTAR_USER: menpo
BINSTAR_KEY:
secure: mw1Fz5a5C0lT4CXzsOCADoo/Xa9YymZI3yjVZNR8f5GwYrVAOC2YXxyEG6NaSWZY
matrix:
- PYTHON_VERSION: 2.7
- PYTHON_VERSION: 3.4
matrix:
fast_finish: true
platform:
- x86
- x64
init:
- ps: Start-FileDownload 'https://raw.githubusercontent.com/menpo/condaci/v0.4.6/condaci.py' C:\\condaci.py; echo "Done"
- cmd: python C:\\condaci.py setup
install:
- - cmd: "set tmp_cmd=\"python C:\\condaci.py miniconda_dir\" && FOR /F %i IN (' %tmp_cmd% ') DO SET APPV_MINICONDA_DIR=%i"
+ - cmd: set tmp_cmd=python C:\\condaci.py miniconda_dir
+ - cmd: "FOR /F %i IN (' %tmp_cmd% ') DO SET APPV_MINICONDA_DIR=%i"
- cmd: set APPV_MINICONDA_EXE="%APPV_MINICONDA_DIR%\python.exe"
- cmd: "%APPV_MINICONDA_EXE% C:\\condaci.py build conda"
notifications:
- provider: Slack
auth_token:
secure: Jyd2NTPkBrrwBnl1C0mkNp5sUPGXzKrDgpZVDvPj72OUJtovXsO3795UsvktLucG
channel: general
on_build_status_changed: true
on_build_success: false
on_build_failure: false
| 3 | 0.083333 | 2 | 1 |
d8b4e55ab22ce4e65a2b64821702f3143ab1105f | elkhound/emitcode.h | elkhound/emitcode.h | // emitcode.h see license.txt for copyright and terms of use
// track state of emitted code so I can emit #line too
#ifndef EMITCODE_H
#define EMITCODE_H
#include <fstream.h> // ofstream
#include "str.h" // stringBuffer
#include "srcloc.h" // SourceLoc
class EmitCode : public stringBuilder {
private: // data
ofstream os; // stream to write to
string fname; // filename for emitting #line
int line; // current line number
public: // funcs
EmitCode(rostring fname);
~EmitCode();
string const &getFname() const { return fname; }
// get current line number; flushes internally
int getLine();
// flush data in stringBuffer to 'os'
void flush();
};
// return a #line directive for the given location
string lineDirective(SourceLoc loc);
// emit a #line directive to restore reporting to the
// EmitCode file itself (the 'sb' argument must be an EmitFile object)
stringBuilder &restoreLine(stringBuilder &sb);
#endif // EMITCODE_H
| // emitcode.h see license.txt for copyright and terms of use
// track state of emitted code so I can emit #line too
#ifndef EMITCODE_H
#define EMITCODE_H
#include "str.h" // stringBuffer
#include "srcloc.h" // SourceLoc
#include "ofstreamts.h" // ofstreamTS
class EmitCode : public stringBuilder {
private: // data
ofstreamTS os; // stream to write to
string fname; // filename for emitting #line
int line; // current line number
public: // funcs
EmitCode(rostring fname);
~EmitCode();
string const &getFname() const { return fname; }
// get current line number; flushes internally
int getLine();
// flush data in stringBuffer to 'os'
void flush();
};
// return a #line directive for the given location
string lineDirective(SourceLoc loc);
// emit a #line directive to restore reporting to the
// EmitCode file itself (the 'sb' argument must be an EmitFile object)
stringBuilder &restoreLine(stringBuilder &sb);
#endif // EMITCODE_H
| Use ofstreamTS to avoid touching the .gen.cc, .gen.h output if unchanged. | Use ofstreamTS to avoid touching the .gen.cc, .gen.h output if unchanged.
| C | bsd-3-clause | angavrilov/olmar,angavrilov/olmar,angavrilov/olmar,angavrilov/olmar | c | ## Code Before:
// emitcode.h see license.txt for copyright and terms of use
// track state of emitted code so I can emit #line too
#ifndef EMITCODE_H
#define EMITCODE_H
#include <fstream.h> // ofstream
#include "str.h" // stringBuffer
#include "srcloc.h" // SourceLoc
class EmitCode : public stringBuilder {
private: // data
ofstream os; // stream to write to
string fname; // filename for emitting #line
int line; // current line number
public: // funcs
EmitCode(rostring fname);
~EmitCode();
string const &getFname() const { return fname; }
// get current line number; flushes internally
int getLine();
// flush data in stringBuffer to 'os'
void flush();
};
// return a #line directive for the given location
string lineDirective(SourceLoc loc);
// emit a #line directive to restore reporting to the
// EmitCode file itself (the 'sb' argument must be an EmitFile object)
stringBuilder &restoreLine(stringBuilder &sb);
#endif // EMITCODE_H
## Instruction:
Use ofstreamTS to avoid touching the .gen.cc, .gen.h output if unchanged.
## Code After:
// emitcode.h see license.txt for copyright and terms of use
// track state of emitted code so I can emit #line too
#ifndef EMITCODE_H
#define EMITCODE_H
#include "str.h" // stringBuffer
#include "srcloc.h" // SourceLoc
#include "ofstreamts.h" // ofstreamTS
class EmitCode : public stringBuilder {
private: // data
ofstreamTS os; // stream to write to
string fname; // filename for emitting #line
int line; // current line number
public: // funcs
EmitCode(rostring fname);
~EmitCode();
string const &getFname() const { return fname; }
// get current line number; flushes internally
int getLine();
// flush data in stringBuffer to 'os'
void flush();
};
// return a #line directive for the given location
string lineDirective(SourceLoc loc);
// emit a #line directive to restore reporting to the
// EmitCode file itself (the 'sb' argument must be an EmitFile object)
stringBuilder &restoreLine(stringBuilder &sb);
#endif // EMITCODE_H
| // emitcode.h see license.txt for copyright and terms of use
// track state of emitted code so I can emit #line too
#ifndef EMITCODE_H
#define EMITCODE_H
+
-
- #include <fstream.h> // ofstream
#include "str.h" // stringBuffer
#include "srcloc.h" // SourceLoc
+ #include "ofstreamts.h" // ofstreamTS
class EmitCode : public stringBuilder {
private: // data
- ofstream os; // stream to write to
? --
+ ofstreamTS os; // stream to write to
? ++
string fname; // filename for emitting #line
int line; // current line number
public: // funcs
EmitCode(rostring fname);
~EmitCode();
string const &getFname() const { return fname; }
// get current line number; flushes internally
int getLine();
// flush data in stringBuffer to 'os'
void flush();
};
// return a #line directive for the given location
- string lineDirective(SourceLoc loc);
? --
+ string lineDirective(SourceLoc loc);
// emit a #line directive to restore reporting to the
// EmitCode file itself (the 'sb' argument must be an EmitFile object)
stringBuilder &restoreLine(stringBuilder &sb);
#endif // EMITCODE_H | 8 | 0.205128 | 4 | 4 |
975eedf7f2e14585d58f879cfd4198e17dcbaef3 | README.md | README.md |
`doubleplus-numbers` provides a [Common Form](https://github.com/commonform) [annotator](https://github.com/commonform/commonform-annotations) to find and identify redundant and repeated number(s) and numeral(s).
```javascript
var assert = require('assert')
var annotator = require('doubleplus-numbers')
assert.deepEqual(
annotator({ content: [ 'Give me two (2) of those and four (4) of the other one.' ] }),
[ { message: '"two (2)" repeats a written number and numeral, which is redundant and error-prone',
level: "info",
path: [ 'content', 0 ],
source: 'doubleplus-numbers',
url: null },
{ message: '"four (4)" repeats a written number and numeral, which is redundant and error-prone',
level: "info",
path: [ 'content', 0 ],
source: 'doubleplus-numbers',
url: null } ])
```
|
`doubleplus-numbers` provides a [Common Form](https://github.com/commonform) [annotator](https://github.com/commonform/commonform-annotations) to find and identify redundant and repeated number(s) and numeral(s).
[](https://travis-ci.org/anseljh/doubleplus-numbers)
```javascript
var assert = require('assert')
var annotator = require('doubleplus-numbers')
assert.deepEqual(
annotator({ content: [ 'Give me two (2) of those and four (4) of the other one.' ] }),
[ { message: '"two (2)" repeats a written number and numeral, which is redundant and error-prone',
level: "info",
path: [ 'content', 0 ],
source: 'doubleplus-numbers',
url: null },
{ message: '"four (4)" repeats a written number and numeral, which is redundant and error-prone',
level: "info",
path: [ 'content', 0 ],
source: 'doubleplus-numbers',
url: null } ])
```
| Add clever build status image :construction: | Add clever build status image :construction:
| Markdown | apache-2.0 | anseljh/doubleplus-numbers,kemitchell/doubleplus-numbers | markdown | ## Code Before:
`doubleplus-numbers` provides a [Common Form](https://github.com/commonform) [annotator](https://github.com/commonform/commonform-annotations) to find and identify redundant and repeated number(s) and numeral(s).
```javascript
var assert = require('assert')
var annotator = require('doubleplus-numbers')
assert.deepEqual(
annotator({ content: [ 'Give me two (2) of those and four (4) of the other one.' ] }),
[ { message: '"two (2)" repeats a written number and numeral, which is redundant and error-prone',
level: "info",
path: [ 'content', 0 ],
source: 'doubleplus-numbers',
url: null },
{ message: '"four (4)" repeats a written number and numeral, which is redundant and error-prone',
level: "info",
path: [ 'content', 0 ],
source: 'doubleplus-numbers',
url: null } ])
```
## Instruction:
Add clever build status image :construction:
## Code After:
`doubleplus-numbers` provides a [Common Form](https://github.com/commonform) [annotator](https://github.com/commonform/commonform-annotations) to find and identify redundant and repeated number(s) and numeral(s).
[](https://travis-ci.org/anseljh/doubleplus-numbers)
```javascript
var assert = require('assert')
var annotator = require('doubleplus-numbers')
assert.deepEqual(
annotator({ content: [ 'Give me two (2) of those and four (4) of the other one.' ] }),
[ { message: '"two (2)" repeats a written number and numeral, which is redundant and error-prone',
level: "info",
path: [ 'content', 0 ],
source: 'doubleplus-numbers',
url: null },
{ message: '"four (4)" repeats a written number and numeral, which is redundant and error-prone',
level: "info",
path: [ 'content', 0 ],
source: 'doubleplus-numbers',
url: null } ])
```
|
`doubleplus-numbers` provides a [Common Form](https://github.com/commonform) [annotator](https://github.com/commonform/commonform-annotations) to find and identify redundant and repeated number(s) and numeral(s).
+
+ [](https://travis-ci.org/anseljh/doubleplus-numbers)
```javascript
var assert = require('assert')
var annotator = require('doubleplus-numbers')
assert.deepEqual(
annotator({ content: [ 'Give me two (2) of those and four (4) of the other one.' ] }),
[ { message: '"two (2)" repeats a written number and numeral, which is redundant and error-prone',
level: "info",
path: [ 'content', 0 ],
source: 'doubleplus-numbers',
url: null },
{ message: '"four (4)" repeats a written number and numeral, which is redundant and error-prone',
level: "info",
path: [ 'content', 0 ],
source: 'doubleplus-numbers',
url: null } ])
``` | 2 | 0.1 | 2 | 0 |
87f890b0e2f6eabe91c3df224a505495869c8c7b | app/helpers/georgia/users_helper.rb | app/helpers/georgia/users_helper.rb | module Georgia
module UsersHelper
def permissions_view
Georgia.permissions.map{|section, actions| permission_table_tag(section, actions)}.join().html_safe
end
def permission_table_tag section, actions
PermissionTablePresenter.new(self, section, actions).to_s
end
end
end | module Georgia
module UsersHelper
def permissions_view
Georgia.permissions.map{|section, actions| permission_table_tag(section, actions)}.join().html_safe
end
def permission_table_tag section, actions
PermissionTablePresenter.new(self, section, actions).to_s
end
def georgia_roles_collection
@georgia_role_collection ||= Georgia::Role.pluck(:name, :id).map{|name, id| [name.titleize, id]}
end
end
end | Add georgia_roles_collection for users form | Add georgia_roles_collection for users form
| Ruby | mit | georgia-cms/georgia,georgia-cms/georgia,georgia-cms/georgia | ruby | ## Code Before:
module Georgia
module UsersHelper
def permissions_view
Georgia.permissions.map{|section, actions| permission_table_tag(section, actions)}.join().html_safe
end
def permission_table_tag section, actions
PermissionTablePresenter.new(self, section, actions).to_s
end
end
end
## Instruction:
Add georgia_roles_collection for users form
## Code After:
module Georgia
module UsersHelper
def permissions_view
Georgia.permissions.map{|section, actions| permission_table_tag(section, actions)}.join().html_safe
end
def permission_table_tag section, actions
PermissionTablePresenter.new(self, section, actions).to_s
end
def georgia_roles_collection
@georgia_role_collection ||= Georgia::Role.pluck(:name, :id).map{|name, id| [name.titleize, id]}
end
end
end | module Georgia
module UsersHelper
def permissions_view
Georgia.permissions.map{|section, actions| permission_table_tag(section, actions)}.join().html_safe
end
def permission_table_tag section, actions
PermissionTablePresenter.new(self, section, actions).to_s
end
+ def georgia_roles_collection
+ @georgia_role_collection ||= Georgia::Role.pluck(:name, :id).map{|name, id| [name.titleize, id]}
+ end
+
end
end | 4 | 0.307692 | 4 | 0 |
0ac774a20f55fe28b97a90fcca590790c298fde1 | usr.bin/ktrace/Makefile | usr.bin/ktrace/Makefile |
PROG= ktrace
SRCS= ktrace.c subr.c
MLINKS= ktrace.1 trace.1 ktrace.1 truss.1
.include <bsd.prog.mk>
|
PROG= ktrace
SRCS= ktrace.c subr.c
MLINKS= ktrace.1 trace.1
.include <bsd.prog.mk>
| Delete truss manpage link. We have now a real truss command. | Delete truss manpage link. We have now a real truss command.
| 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= ktrace
SRCS= ktrace.c subr.c
MLINKS= ktrace.1 trace.1 ktrace.1 truss.1
.include <bsd.prog.mk>
## Instruction:
Delete truss manpage link. We have now a real truss command.
## Code After:
PROG= ktrace
SRCS= ktrace.c subr.c
MLINKS= ktrace.1 trace.1
.include <bsd.prog.mk>
|
PROG= ktrace
SRCS= ktrace.c subr.c
- MLINKS= ktrace.1 trace.1 ktrace.1 truss.1
? ----------------
+ MLINKS= ktrace.1 trace.1
.include <bsd.prog.mk> | 2 | 0.333333 | 1 | 1 |
e3780b2751aac7a1a0c261b4b058aaff855b8e8b | docido_sdk/toolbox/contextlib_ext.py | docido_sdk/toolbox/contextlib_ext.py |
from contextlib import contextmanager
import copy
@contextmanager
def restore(obj, copy_func=copy.deepcopy):
"""Backup an object in a with context and restore it when leaving
the scope.
:param obj: object to backup
:param copy_func: callbable object used to create an object copy.
default is `copy.deepcopy`
"""
backup = copy_func(obj)
try:
yield obj
finally:
obj = backup
|
from contextlib import contextmanager
import copy
@contextmanager
def restore_dict_kv(a_dict, key, copy_func=copy.deepcopy):
"""Backup an object in a with context and restore it when leaving
the scope.
:param a_dict:
associative table
:param: key
key whose value has to be backed up
:param copy_func: callbable object used to create an object copy.
default is `copy.deepcopy`
"""
backup = copy_func(a_dict[key])
try:
yield
finally:
a_dict[key] = backup
| Apply `restore' utility to dictionary only | Apply `restore' utility to dictionary only
| Python | apache-2.0 | cogniteev/docido-python-sdk,LilliJane/docido-python-sdk | python | ## Code Before:
from contextlib import contextmanager
import copy
@contextmanager
def restore(obj, copy_func=copy.deepcopy):
"""Backup an object in a with context and restore it when leaving
the scope.
:param obj: object to backup
:param copy_func: callbable object used to create an object copy.
default is `copy.deepcopy`
"""
backup = copy_func(obj)
try:
yield obj
finally:
obj = backup
## Instruction:
Apply `restore' utility to dictionary only
## Code After:
from contextlib import contextmanager
import copy
@contextmanager
def restore_dict_kv(a_dict, key, copy_func=copy.deepcopy):
"""Backup an object in a with context and restore it when leaving
the scope.
:param a_dict:
associative table
:param: key
key whose value has to be backed up
:param copy_func: callbable object used to create an object copy.
default is `copy.deepcopy`
"""
backup = copy_func(a_dict[key])
try:
yield
finally:
a_dict[key] = backup
|
from contextlib import contextmanager
import copy
@contextmanager
- def restore(obj, copy_func=copy.deepcopy):
? ^^^
+ def restore_dict_kv(a_dict, key, copy_func=copy.deepcopy):
? ++++++++ ^^^^^^^^^^^
"""Backup an object in a with context and restore it when leaving
the scope.
- :param obj: object to backup
+ :param a_dict:
+ associative table
+ :param: key
+ key whose value has to be backed up
:param copy_func: callbable object used to create an object copy.
default is `copy.deepcopy`
"""
- backup = copy_func(obj)
? ^^^
+ backup = copy_func(a_dict[key])
? ^^^^^^^^^^^
try:
- yield obj
? ----
+ yield
finally:
- obj = backup
+ a_dict[key] = backup | 13 | 0.684211 | 8 | 5 |
8effd1e02a9cd3f996dde8551312b1248e1f9979 | scripts/prepare-contracts-package.sh | scripts/prepare-contracts-package.sh | cd "$(git rev-parse --show-toplevel)"
# avoids re-compilation during publishing of both packages
if [[ ! -v ALREADY_COMPILED ]]; then
npm run prepare
fi
cp README.md contracts/
mkdir contracts/build contracts/build/contracts
cp -r build/contracts/*.json contracts/build/contracts
| cd "$(git rev-parse --show-toplevel)"
# avoids re-compilation during publishing of both packages
if [[ ! -v ALREADY_COMPILED ]]; then
npm run prepublish
npm run prepare
npm run prepack
fi
cp README.md contracts/
mkdir contracts/build contracts/build/contracts
cp -r build/contracts/*.json contracts/build/contracts
| Add scripts for when publishing @openzeppelin/contracts directly | Add scripts for when publishing @openzeppelin/contracts directly
(cherry picked from commit a1408a34110d6460b90624fc96fd2a6d01faa384)
| Shell | mit | OpenZeppelin/zeppelin-solidity,OpenZeppelin/zep-solidity,OpenZeppelin/openzeppelin-contracts,OpenZeppelin/zeppelin-solidity,OpenZeppelin/openzeppelin-contracts,OpenZeppelin/zep-solidity,OpenZeppelin/openzeppelin-contracts | shell | ## Code Before:
cd "$(git rev-parse --show-toplevel)"
# avoids re-compilation during publishing of both packages
if [[ ! -v ALREADY_COMPILED ]]; then
npm run prepare
fi
cp README.md contracts/
mkdir contracts/build contracts/build/contracts
cp -r build/contracts/*.json contracts/build/contracts
## Instruction:
Add scripts for when publishing @openzeppelin/contracts directly
(cherry picked from commit a1408a34110d6460b90624fc96fd2a6d01faa384)
## Code After:
cd "$(git rev-parse --show-toplevel)"
# avoids re-compilation during publishing of both packages
if [[ ! -v ALREADY_COMPILED ]]; then
npm run prepublish
npm run prepare
npm run prepack
fi
cp README.md contracts/
mkdir contracts/build contracts/build/contracts
cp -r build/contracts/*.json contracts/build/contracts
| cd "$(git rev-parse --show-toplevel)"
# avoids re-compilation during publishing of both packages
if [[ ! -v ALREADY_COMPILED ]]; then
+ npm run prepublish
npm run prepare
+ npm run prepack
fi
cp README.md contracts/
mkdir contracts/build contracts/build/contracts
cp -r build/contracts/*.json contracts/build/contracts | 2 | 0.2 | 2 | 0 |
061e5af135a6fcce702838af8a2d8c5968bc8e5a | docs/source/installation_guide.rst | docs/source/installation_guide.rst | .. _installation_guide:
Installing ``pyAFQ``
==========================
Installing the release version
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The released version of the software is the one that is officially
supported, and if you are getting started with ``pyAFQ``, this is
probably where you should get started
To install it, in a shell or command line, issue the following::
pip install AFQ
Installing the development version
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The development version is probably less stable, but might include new
features and fixes. There are two ways to install this version. The first
uses ``pip``::
pip install git+https://github.com/yeatmanlab/pyAFQ.git
The other requires that you clone the source code to your machine::
git clone https://github.com/yeatmanlab/pyAFQ.git
Then, change your working directory into the top-level directory of this repo and issue::
pip install .
| .. _installation_guide:
Installing ``pyAFQ``
==========================
The ``pyAFQ`` software works on Python 3.6 and 3.7.
Installing the release version
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The released version of the software is the one that is officially
supported, and if you are getting started with ``pyAFQ``, this is
probably where you should get started
To install it, in a shell or command line, issue the following::
pip install AFQ
Installing the development version
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The development version is probably less stable, but might include new
features and fixes. There are two ways to install this version. The first
uses ``pip``::
pip install git+https://github.com/yeatmanlab/pyAFQ.git
The other requires that you clone the source code to your machine::
git clone https://github.com/yeatmanlab/pyAFQ.git
Then, change your working directory into the top-level directory of this repo and issue::
pip install .
| Add a note that points people to use 3.6 or 3.7. | Add a note that points people to use 3.6 or 3.7.
| reStructuredText | bsd-2-clause | arokem/pyAFQ,arokem/pyAFQ,yeatmanlab/pyAFQ,yeatmanlab/pyAFQ | restructuredtext | ## Code Before:
.. _installation_guide:
Installing ``pyAFQ``
==========================
Installing the release version
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The released version of the software is the one that is officially
supported, and if you are getting started with ``pyAFQ``, this is
probably where you should get started
To install it, in a shell or command line, issue the following::
pip install AFQ
Installing the development version
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The development version is probably less stable, but might include new
features and fixes. There are two ways to install this version. The first
uses ``pip``::
pip install git+https://github.com/yeatmanlab/pyAFQ.git
The other requires that you clone the source code to your machine::
git clone https://github.com/yeatmanlab/pyAFQ.git
Then, change your working directory into the top-level directory of this repo and issue::
pip install .
## Instruction:
Add a note that points people to use 3.6 or 3.7.
## Code After:
.. _installation_guide:
Installing ``pyAFQ``
==========================
The ``pyAFQ`` software works on Python 3.6 and 3.7.
Installing the release version
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The released version of the software is the one that is officially
supported, and if you are getting started with ``pyAFQ``, this is
probably where you should get started
To install it, in a shell or command line, issue the following::
pip install AFQ
Installing the development version
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The development version is probably less stable, but might include new
features and fixes. There are two ways to install this version. The first
uses ``pip``::
pip install git+https://github.com/yeatmanlab/pyAFQ.git
The other requires that you clone the source code to your machine::
git clone https://github.com/yeatmanlab/pyAFQ.git
Then, change your working directory into the top-level directory of this repo and issue::
pip install .
| .. _installation_guide:
Installing ``pyAFQ``
==========================
+
+ The ``pyAFQ`` software works on Python 3.6 and 3.7.
Installing the release version
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The released version of the software is the one that is officially
supported, and if you are getting started with ``pyAFQ``, this is
probably where you should get started
To install it, in a shell or command line, issue the following::
pip install AFQ
Installing the development version
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The development version is probably less stable, but might include new
features and fixes. There are two ways to install this version. The first
uses ``pip``::
pip install git+https://github.com/yeatmanlab/pyAFQ.git
The other requires that you clone the source code to your machine::
git clone https://github.com/yeatmanlab/pyAFQ.git
Then, change your working directory into the top-level directory of this repo and issue::
pip install . | 2 | 0.058824 | 2 | 0 |
77af6e13f5293a446123b5a97f2dc365933a947c | lib/omniauth/strategies/nctu.rb | lib/omniauth/strategies/nctu.rb | require "omniauth-oauth2"
require "oauth2"
module OmniAuth
module Strategies
class Nctu < OmniAuth::Strategies::OAuth2
OAuthUrl = "https://id.nctu.edu.tw"
option :name, "nctu"
option :client_options, {
site: OAuthUrl,
authorize_url: "#{OAuthUrl}/o/authorize/",
token_url: "#{OAuthUrl}/o/token/"
}
uid do
raw_info["username"]
end
info do
{
:email => raw_info["email"],
:image => "http://museum.lib.nctu.edu.tw/share/mark.gif",
:uid => raw_info["username"],
}
end
extra do
{
"raw_info" => raw_info
}
end
def raw_info
access_token.options[:mode] = :header
@raw_info ||= access_token.get("/api/profile/").parsed
end
def callback_url
full_host + script_name + callback_path
end
end
end
end
| require "omniauth-oauth2"
require "oauth2"
module OmniAuth
module Strategies
class Nctu < OmniAuth::Strategies::OAuth2
OAuthUrl = "https://id.nctu.edu.tw"
option :name, "nctu"
option :client_options, {
site: OAuthUrl,
authorize_url: "#{OAuthUrl}/o/authorize/",
token_url: "#{OAuthUrl}/o/token/"
}
uid do
raw_info["username"]
end
info do
{
:email => raw_info["email"],
:name => raw_info["username"],
:image => "http://museum.lib.nctu.edu.tw/share/mark.gif"
}
end
extra do
{
"raw_info" => raw_info
}
end
def raw_info
access_token.options[:mode] = :header
@raw_info ||= access_token.get("/api/profile/").parsed
end
def callback_url
full_host + script_name + callback_path
end
end
end
end
| Add essential fields into info hash | Add essential fields into info hash
| Ruby | mit | deror1869107/omniauth-nctu | ruby | ## Code Before:
require "omniauth-oauth2"
require "oauth2"
module OmniAuth
module Strategies
class Nctu < OmniAuth::Strategies::OAuth2
OAuthUrl = "https://id.nctu.edu.tw"
option :name, "nctu"
option :client_options, {
site: OAuthUrl,
authorize_url: "#{OAuthUrl}/o/authorize/",
token_url: "#{OAuthUrl}/o/token/"
}
uid do
raw_info["username"]
end
info do
{
:email => raw_info["email"],
:image => "http://museum.lib.nctu.edu.tw/share/mark.gif",
:uid => raw_info["username"],
}
end
extra do
{
"raw_info" => raw_info
}
end
def raw_info
access_token.options[:mode] = :header
@raw_info ||= access_token.get("/api/profile/").parsed
end
def callback_url
full_host + script_name + callback_path
end
end
end
end
## Instruction:
Add essential fields into info hash
## Code After:
require "omniauth-oauth2"
require "oauth2"
module OmniAuth
module Strategies
class Nctu < OmniAuth::Strategies::OAuth2
OAuthUrl = "https://id.nctu.edu.tw"
option :name, "nctu"
option :client_options, {
site: OAuthUrl,
authorize_url: "#{OAuthUrl}/o/authorize/",
token_url: "#{OAuthUrl}/o/token/"
}
uid do
raw_info["username"]
end
info do
{
:email => raw_info["email"],
:name => raw_info["username"],
:image => "http://museum.lib.nctu.edu.tw/share/mark.gif"
}
end
extra do
{
"raw_info" => raw_info
}
end
def raw_info
access_token.options[:mode] = :header
@raw_info ||= access_token.get("/api/profile/").parsed
end
def callback_url
full_host + script_name + callback_path
end
end
end
end
| require "omniauth-oauth2"
require "oauth2"
module OmniAuth
module Strategies
class Nctu < OmniAuth::Strategies::OAuth2
OAuthUrl = "https://id.nctu.edu.tw"
option :name, "nctu"
option :client_options, {
site: OAuthUrl,
authorize_url: "#{OAuthUrl}/o/authorize/",
token_url: "#{OAuthUrl}/o/token/"
}
uid do
raw_info["username"]
end
info do
{
:email => raw_info["email"],
+ :name => raw_info["username"],
- :image => "http://museum.lib.nctu.edu.tw/share/mark.gif",
? -
+ :image => "http://museum.lib.nctu.edu.tw/share/mark.gif"
- :uid => raw_info["username"],
}
end
extra do
{
"raw_info" => raw_info
}
end
def raw_info
access_token.options[:mode] = :header
@raw_info ||= access_token.get("/api/profile/").parsed
end
def callback_url
full_host + script_name + callback_path
end
end
end
end
| 4 | 0.085106 | 2 | 2 |
7a552161eab19d24b7b221635e51a915adff0166 | templater.py | templater.py | import string
if __name__ == "__main__":
import sys
template_file = sys.argv[1]
with open(template_file) as f:
data = f.read()
template = string.Template(data)
template_mapping = {}
for item in sys.argv[2:]:
# item is in the following form: KEY=VALUE
print("-> Current replacer %s" % item)
key, value = item.split("=", 1)
template_mapping[key] = value
print("-> Using mapping: %s" % str(template_mapping))
result = template.substitute(template_mapping)
print("-----\n")
print(result)
| import string
import os
if __name__ == "__main__":
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-t", "--template", dest="template_file",
help="Input template file")
(options, args) = parser.parse_args()
if not os.path.isfile(options.template_file):
sys.stderr.write("Invalid input template file")
exit(1)
with open(options.template_file) as f:
data = f.read()
template = string.Template(data)
template_mapping = {}
for item in args:
# item is in the following form: KEY=VALUE
print("-> Current replacer %s" % item)
key, value = item.split("=", 1)
template_mapping[key] = value
print("-> Using mapping: %s" % str(template_mapping))
result = template.substitute(template_mapping)
print("-----\n")
print(result)
| Use OptionParser instead of simple sys.argv. | Use OptionParser instead of simple sys.argv.
| Python | mit | elecro/strep | python | ## Code Before:
import string
if __name__ == "__main__":
import sys
template_file = sys.argv[1]
with open(template_file) as f:
data = f.read()
template = string.Template(data)
template_mapping = {}
for item in sys.argv[2:]:
# item is in the following form: KEY=VALUE
print("-> Current replacer %s" % item)
key, value = item.split("=", 1)
template_mapping[key] = value
print("-> Using mapping: %s" % str(template_mapping))
result = template.substitute(template_mapping)
print("-----\n")
print(result)
## Instruction:
Use OptionParser instead of simple sys.argv.
## Code After:
import string
import os
if __name__ == "__main__":
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-t", "--template", dest="template_file",
help="Input template file")
(options, args) = parser.parse_args()
if not os.path.isfile(options.template_file):
sys.stderr.write("Invalid input template file")
exit(1)
with open(options.template_file) as f:
data = f.read()
template = string.Template(data)
template_mapping = {}
for item in args:
# item is in the following form: KEY=VALUE
print("-> Current replacer %s" % item)
key, value = item.split("=", 1)
template_mapping[key] = value
print("-> Using mapping: %s" % str(template_mapping))
result = template.substitute(template_mapping)
print("-----\n")
print(result)
| import string
+ import os
+
if __name__ == "__main__":
- import sys
+ from optparse import OptionParser
- template_file = sys.argv[1]
+ parser = OptionParser()
+ parser.add_option("-t", "--template", dest="template_file",
+ help="Input template file")
+ (options, args) = parser.parse_args()
+
+ if not os.path.isfile(options.template_file):
+ sys.stderr.write("Invalid input template file")
+ exit(1)
+
- with open(template_file) as f:
+ with open(options.template_file) as f:
? ++++++++
data = f.read()
template = string.Template(data)
template_mapping = {}
- for item in sys.argv[2:]:
? ---- ^^^ --
+ for item in args:
? ^
# item is in the following form: KEY=VALUE
print("-> Current replacer %s" % item)
key, value = item.split("=", 1)
template_mapping[key] = value
print("-> Using mapping: %s" % str(template_mapping))
result = template.substitute(template_mapping)
print("-----\n")
print(result) | 18 | 0.782609 | 14 | 4 |
81ce071a2d4d4f5a0ae63e0507473ceacfb89720 | README.md | README.md | gta5-extended-video-export
|
* [C++ ScriptHook by Alexander Blade](http://www.dev-c.com/gtav/scripthookv/)
## Contributing
You'll need Visual Studio 2015 or higher to open the project file and the [Script Hook V SDK](http://www.dev-c.com/gtav/scripthookv/) extracted into "[/gta5-extended-video-export](/gta5-extended-video-export)".
Contributions to the project are welcome. Please use GitHub [pull requests](https://help.github.com/articles/using-pull-requests/).
| Add instructions to extract the scripthookv sdk in the right place. | Add instructions to extract the scripthookv sdk in the right place.
| Markdown | apache-2.0 | ali-alidoust/gta5-extended-video-export,ali-alidoust/gta5-extended-video-export | markdown | ## Code Before:
gta5-extended-video-export
## Instruction:
Add instructions to extract the scripthookv sdk in the right place.
## Code After:
* [C++ ScriptHook by Alexander Blade](http://www.dev-c.com/gtav/scripthookv/)
## Contributing
You'll need Visual Studio 2015 or higher to open the project file and the [Script Hook V SDK](http://www.dev-c.com/gtav/scripthookv/) extracted into "[/gta5-extended-video-export](/gta5-extended-video-export)".
Contributions to the project are welcome. Please use GitHub [pull requests](https://help.github.com/articles/using-pull-requests/).
| - gta5-extended-video-export
+
+ * [C++ ScriptHook by Alexander Blade](http://www.dev-c.com/gtav/scripthookv/)
+
+ ## Contributing
+
+ You'll need Visual Studio 2015 or higher to open the project file and the [Script Hook V SDK](http://www.dev-c.com/gtav/scripthookv/) extracted into "[/gta5-extended-video-export](/gta5-extended-video-export)".
+
+ Contributions to the project are welcome. Please use GitHub [pull requests](https://help.github.com/articles/using-pull-requests/).
+ | 10 | 10 | 9 | 1 |
d806f447ec9267ff2fd33eaf984cc9f13b895004 | src/GraphQL/project.json | src/GraphQL/project.json | {
"version": "0.12.0-alpha-*",
"description": "GraphQL for .NET",
"authors": [
"Joe McBride"
],
"packOptions": {
"authors": [
"Joe McBride"
],
"tags": [
"GraphQL",
"json",
"api"
],
"projectUrl": "https://github.com/graphql-dotnet/graphql-dotnet",
"licenseUrl": "https://github.com/graphql-dotnet/graphql-dotnet/blob/master/LICENSE.md"
},
"buildOptions": {
"compile": [
"**/*.cs",
"../CommonAssemblyInfo.cs"
]
},
"dependencies": {
"GraphQL-Parser": "1.0.0",
"Newtonsoft.Json": "9.0.1"
},
"frameworks": {
"netstandard1.6": {
"dependencies": {
"NETStandard.Library": "1.6.0"
},
"imports": [
"dnxcore50",
"portable-net45+win8"
]
},
"net451": {
"System.Threading.Tasks": ""
},
"net46": {
"System.Threading.Tasks": ""
},
"net461": {
"System.Threading.Tasks": ""
}
},
"runtimes": {
"win": {}
}
}
| {
"version": "0.12.0-alpha-*",
"description": "GraphQL for .NET",
"authors": [
"Joe McBride"
],
"packOptions": {
"authors": [
"Joe McBride"
],
"tags": [
"GraphQL",
"json",
"api"
],
"projectUrl": "https://github.com/graphql-dotnet/graphql-dotnet",
"licenseUrl": "https://github.com/graphql-dotnet/graphql-dotnet/blob/master/LICENSE.md"
},
"buildOptions": {
"compile": [
"**/*.cs",
"../CommonAssemblyInfo.cs"
]
},
"dependencies": {
"GraphQL-Parser": "1.0.0",
"Newtonsoft.Json": "9.0.1"
},
"frameworks": {
"netstandard1.6": {
"dependencies": {
"NETStandard.Library": "1.6.0"
},
"imports": [
"dnxcore50",
"portable-net45+win8"
]
},
"net45": {
"System.Threading.Tasks": ""
},
"net451": {
"System.Threading.Tasks": ""
},
"net452": {
"System.Threading.Tasks": ""
},
"net46": {
"System.Threading.Tasks": ""
},
"net461": {
"System.Threading.Tasks": ""
}
},
"runtimes": {
"win": {}
}
}
| Add 4.5 and 4.5.2 to the list | Add 4.5 and 4.5.2 to the list
| JSON | mit | graphql-dotnet/graphql-dotnet,plecong/graphql-dotnet,dNetGuru/graphql-dotnet,dNetGuru/graphql-dotnet,joemcbride/graphql-dotnet,alexmcmillan/graphql-dotnet,graphql-dotnet/graphql-dotnet,graphql-dotnet/graphql-dotnet,plecong/graphql-dotnet,joemcbride/graphql-dotnet,alexmcmillan/graphql-dotnet | json | ## Code Before:
{
"version": "0.12.0-alpha-*",
"description": "GraphQL for .NET",
"authors": [
"Joe McBride"
],
"packOptions": {
"authors": [
"Joe McBride"
],
"tags": [
"GraphQL",
"json",
"api"
],
"projectUrl": "https://github.com/graphql-dotnet/graphql-dotnet",
"licenseUrl": "https://github.com/graphql-dotnet/graphql-dotnet/blob/master/LICENSE.md"
},
"buildOptions": {
"compile": [
"**/*.cs",
"../CommonAssemblyInfo.cs"
]
},
"dependencies": {
"GraphQL-Parser": "1.0.0",
"Newtonsoft.Json": "9.0.1"
},
"frameworks": {
"netstandard1.6": {
"dependencies": {
"NETStandard.Library": "1.6.0"
},
"imports": [
"dnxcore50",
"portable-net45+win8"
]
},
"net451": {
"System.Threading.Tasks": ""
},
"net46": {
"System.Threading.Tasks": ""
},
"net461": {
"System.Threading.Tasks": ""
}
},
"runtimes": {
"win": {}
}
}
## Instruction:
Add 4.5 and 4.5.2 to the list
## Code After:
{
"version": "0.12.0-alpha-*",
"description": "GraphQL for .NET",
"authors": [
"Joe McBride"
],
"packOptions": {
"authors": [
"Joe McBride"
],
"tags": [
"GraphQL",
"json",
"api"
],
"projectUrl": "https://github.com/graphql-dotnet/graphql-dotnet",
"licenseUrl": "https://github.com/graphql-dotnet/graphql-dotnet/blob/master/LICENSE.md"
},
"buildOptions": {
"compile": [
"**/*.cs",
"../CommonAssemblyInfo.cs"
]
},
"dependencies": {
"GraphQL-Parser": "1.0.0",
"Newtonsoft.Json": "9.0.1"
},
"frameworks": {
"netstandard1.6": {
"dependencies": {
"NETStandard.Library": "1.6.0"
},
"imports": [
"dnxcore50",
"portable-net45+win8"
]
},
"net45": {
"System.Threading.Tasks": ""
},
"net451": {
"System.Threading.Tasks": ""
},
"net452": {
"System.Threading.Tasks": ""
},
"net46": {
"System.Threading.Tasks": ""
},
"net461": {
"System.Threading.Tasks": ""
}
},
"runtimes": {
"win": {}
}
}
| {
"version": "0.12.0-alpha-*",
"description": "GraphQL for .NET",
"authors": [
"Joe McBride"
],
"packOptions": {
"authors": [
"Joe McBride"
],
"tags": [
"GraphQL",
"json",
"api"
],
"projectUrl": "https://github.com/graphql-dotnet/graphql-dotnet",
"licenseUrl": "https://github.com/graphql-dotnet/graphql-dotnet/blob/master/LICENSE.md"
},
"buildOptions": {
"compile": [
"**/*.cs",
"../CommonAssemblyInfo.cs"
]
},
"dependencies": {
"GraphQL-Parser": "1.0.0",
"Newtonsoft.Json": "9.0.1"
},
"frameworks": {
"netstandard1.6": {
"dependencies": {
"NETStandard.Library": "1.6.0"
},
"imports": [
"dnxcore50",
"portable-net45+win8"
]
},
+ "net45": {
+ "System.Threading.Tasks": ""
+ },
"net451": {
+ "System.Threading.Tasks": ""
+ },
+ "net452": {
"System.Threading.Tasks": ""
},
"net46": {
"System.Threading.Tasks": ""
},
"net461": {
"System.Threading.Tasks": ""
}
},
"runtimes": {
"win": {}
}
} | 6 | 0.105263 | 6 | 0 |
9b35e5a630bac733d23afb34b8565b4da3991746 | src/iframe.html | src/iframe.html | <!DOCTYPE html>
<html>
<head>
<title>WinningJS Mocha Test Runner <iframe></title>
<link rel="stylesheet" href="mocha.css" />
<!-- WinJS references -->
<link href="//Microsoft.WinJS.1.0/css/ui-light.css" rel="stylesheet" />
<script src="//Microsoft.WinJS.1.0/js/base.js"></script>
<script src="//Microsoft.WinJS.1.0/js/ui.js"></script>
<style>
/* Correct conflicts between Mocha and WinJS styles */
body {
box-sizing: border-box;
}
</style>
</head>
<body>
<div id="mocha"></div>
<script src="mocha.js"></script>
</body>
</html> | <!DOCTYPE html>
<html>
<head>
<title>WinningJS Mocha Test Runner <iframe></title>
<link rel="stylesheet" href="mocha.css" />
<script src="//Microsoft.WinJS.1.0/js/base.js"></script>
<script src="//Microsoft.WinJS.1.0/js/ui.js"></script>
</head>
<body>
<div id="mocha"></div>
<script src="mocha.js"></script>
<script>
// Mocha detects us as IE8 and refuses to give us a nice `nextTick` shim.
process.nextTick = setImmediate.bind(window);
// Since Mocha handles uncaught errors (using `window.onerror`), don't let them crash the app.
process.on = function (event, listener) {
if (event === "uncaughtException") {
listener._adapted = function (ev) {
listener(ev.detail);
return true;
};
WinJS.Application.addEventListener("error", listener._adapted);
}
};
process.removeListener = function (event, listener) {
if (event === "uncaughtException") {
WinJS.Application.removeEventListener("error", listener._adapted);
}
};
</script>
</body>
</html>
| Add some `process` shims for IE/WinJS compat. | Add some `process` shims for IE/WinJS compat.
| HTML | mit | YuzuJS/WinningJS-mocha-runner,YuzuJS/WinningJS-mocha-runner | html | ## Code Before:
<!DOCTYPE html>
<html>
<head>
<title>WinningJS Mocha Test Runner <iframe></title>
<link rel="stylesheet" href="mocha.css" />
<!-- WinJS references -->
<link href="//Microsoft.WinJS.1.0/css/ui-light.css" rel="stylesheet" />
<script src="//Microsoft.WinJS.1.0/js/base.js"></script>
<script src="//Microsoft.WinJS.1.0/js/ui.js"></script>
<style>
/* Correct conflicts between Mocha and WinJS styles */
body {
box-sizing: border-box;
}
</style>
</head>
<body>
<div id="mocha"></div>
<script src="mocha.js"></script>
</body>
</html>
## Instruction:
Add some `process` shims for IE/WinJS compat.
## Code After:
<!DOCTYPE html>
<html>
<head>
<title>WinningJS Mocha Test Runner <iframe></title>
<link rel="stylesheet" href="mocha.css" />
<script src="//Microsoft.WinJS.1.0/js/base.js"></script>
<script src="//Microsoft.WinJS.1.0/js/ui.js"></script>
</head>
<body>
<div id="mocha"></div>
<script src="mocha.js"></script>
<script>
// Mocha detects us as IE8 and refuses to give us a nice `nextTick` shim.
process.nextTick = setImmediate.bind(window);
// Since Mocha handles uncaught errors (using `window.onerror`), don't let them crash the app.
process.on = function (event, listener) {
if (event === "uncaughtException") {
listener._adapted = function (ev) {
listener(ev.detail);
return true;
};
WinJS.Application.addEventListener("error", listener._adapted);
}
};
process.removeListener = function (event, listener) {
if (event === "uncaughtException") {
WinJS.Application.removeEventListener("error", listener._adapted);
}
};
</script>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<title>WinningJS Mocha Test Runner <iframe></title>
<link rel="stylesheet" href="mocha.css" />
- <!-- WinJS references -->
- <link href="//Microsoft.WinJS.1.0/css/ui-light.css" rel="stylesheet" />
<script src="//Microsoft.WinJS.1.0/js/base.js"></script>
<script src="//Microsoft.WinJS.1.0/js/ui.js"></script>
-
- <style>
- /* Correct conflicts between Mocha and WinJS styles */
- body {
- box-sizing: border-box;
- }
- </style>
</head>
<body>
<div id="mocha"></div>
<script src="mocha.js"></script>
+ <script>
+ // Mocha detects us as IE8 and refuses to give us a nice `nextTick` shim.
+ process.nextTick = setImmediate.bind(window);
+
+ // Since Mocha handles uncaught errors (using `window.onerror`), don't let them crash the app.
+ process.on = function (event, listener) {
+ if (event === "uncaughtException") {
+ listener._adapted = function (ev) {
+ listener(ev.detail);
+ return true;
+ };
+ WinJS.Application.addEventListener("error", listener._adapted);
+ }
+ };
+ process.removeListener = function (event, listener) {
+ if (event === "uncaughtException") {
+ WinJS.Application.removeEventListener("error", listener._adapted);
+ }
+ };
+ </script>
</body>
</html> | 29 | 1.16 | 20 | 9 |
d42063443ca34b2805c2285027e86d4d59680c89 | app/assets/javascripts/farmbot_app/services/data.js.coffee | app/assets/javascripts/farmbot_app/services/data.js.coffee | data = (DS) ->
deviceMethods = {}
DS.defineResource
name: "device"
endpoint: 'devices',
basePath: '/api',
idAttribute: "_id"
methods: deviceMethods
DS.defineResource
name: "step"
endpoint: 'steps',
basePath: '/api',
idAttribute: "_id"
relations:
belongsTo:
sequence:
localKey: 'sequence_id'
localField: 'sequence'
parent: true
DS.defineResource
name: "sequence"
endpoint: 'sequences',
basePath: '/api',
idAttribute: "_id"
relations:
hasMany:
step:
localField: "steps"
foreignKey: "sequence_id"
DS.defineResource
name: "schedule"
endpoint: 'schedules',
basePath: '/api',
idAttribute: "_id"
# relations:
# hasOne:
# sequence:
# localField: "sequence"
# foreignKey: "sequence_id"
return DS
angular.module("FarmBot").service 'Data', [
'DS',
data
]
| data = (DS) ->
DS.defineResource
name: "device"
endpoint: 'devices',
basePath: '/api',
idAttribute: "_id"
DS.defineResource
name: "step"
endpoint: 'steps',
basePath: '/api',
idAttribute: "_id"
relations:
belongsTo:
sequence:
localKey: 'sequence_id'
localField: 'sequence'
parent: true
DS.defineResource
name: "sequence"
endpoint: 'sequences',
basePath: '/api',
idAttribute: "_id"
relations:
hasMany:
step:
localField: "steps"
foreignKey: "sequence_id"
DS.defineResource
name: "schedule"
endpoint: 'schedules',
basePath: '/api',
idAttribute: "_id"
return DS
angular.module("FarmBot").service 'Data', [
'DS'
data
]
| Remove boilerplate code from JS-Data code | Remove boilerplate code from JS-Data code
| CoffeeScript | mit | donnydevito/farmbot-web-app,FarmBot/Farmbot-Web-API,FarmBot/farmbot-web-app,gabrielburnworth/Farmbot-Web-App,yuvilio/farmbot-web-app,yuvilio/farmbot-web-app,yuvilio/farmbot-web-app,FarmBot/Farmbot-Web-API,RickCarlino/farmbot-web-app,RickCarlino/farmbot-web-app,donnydevito/farmbot-web-app,FarmBot/farmbot-web-app,gabrielburnworth/Farmbot-Web-App,RickCarlino/farmbot-web-app,FarmBot/farmbot-web-app,gabrielburnworth/Farmbot-Web-App,RickCarlino/farmbot-web-app,MrChristofferson/Farmbot-Web-API,donnydevito/farmbot-web-app,FarmBot/Farmbot-Web-API,gabrielburnworth/Farmbot-Web-App,FarmBot/Farmbot-Web-API,MrChristofferson/Farmbot-Web-API,MrChristofferson/Farmbot-Web-API,MrChristofferson/Farmbot-Web-API,gabrielburnworth/Farmbot-Web-App,RickCarlino/farmbot-web-app,FarmBot/Farmbot-Web-API | coffeescript | ## Code Before:
data = (DS) ->
deviceMethods = {}
DS.defineResource
name: "device"
endpoint: 'devices',
basePath: '/api',
idAttribute: "_id"
methods: deviceMethods
DS.defineResource
name: "step"
endpoint: 'steps',
basePath: '/api',
idAttribute: "_id"
relations:
belongsTo:
sequence:
localKey: 'sequence_id'
localField: 'sequence'
parent: true
DS.defineResource
name: "sequence"
endpoint: 'sequences',
basePath: '/api',
idAttribute: "_id"
relations:
hasMany:
step:
localField: "steps"
foreignKey: "sequence_id"
DS.defineResource
name: "schedule"
endpoint: 'schedules',
basePath: '/api',
idAttribute: "_id"
# relations:
# hasOne:
# sequence:
# localField: "sequence"
# foreignKey: "sequence_id"
return DS
angular.module("FarmBot").service 'Data', [
'DS',
data
]
## Instruction:
Remove boilerplate code from JS-Data code
## Code After:
data = (DS) ->
DS.defineResource
name: "device"
endpoint: 'devices',
basePath: '/api',
idAttribute: "_id"
DS.defineResource
name: "step"
endpoint: 'steps',
basePath: '/api',
idAttribute: "_id"
relations:
belongsTo:
sequence:
localKey: 'sequence_id'
localField: 'sequence'
parent: true
DS.defineResource
name: "sequence"
endpoint: 'sequences',
basePath: '/api',
idAttribute: "_id"
relations:
hasMany:
step:
localField: "steps"
foreignKey: "sequence_id"
DS.defineResource
name: "schedule"
endpoint: 'schedules',
basePath: '/api',
idAttribute: "_id"
return DS
angular.module("FarmBot").service 'Data', [
'DS'
data
]
| data = (DS) ->
- deviceMethods = {}
DS.defineResource
name: "device"
endpoint: 'devices',
basePath: '/api',
idAttribute: "_id"
- methods: deviceMethods
DS.defineResource
name: "step"
endpoint: 'steps',
basePath: '/api',
idAttribute: "_id"
relations:
belongsTo:
sequence:
localKey: 'sequence_id'
localField: 'sequence'
parent: true
DS.defineResource
name: "sequence"
endpoint: 'sequences',
basePath: '/api',
idAttribute: "_id"
relations:
hasMany:
step:
localField: "steps"
foreignKey: "sequence_id"
DS.defineResource
name: "schedule"
endpoint: 'schedules',
basePath: '/api',
idAttribute: "_id"
- # relations:
- # hasOne:
- # sequence:
- # localField: "sequence"
- # foreignKey: "sequence_id"
return DS
angular.module("FarmBot").service 'Data', [
- 'DS',
? -
+ 'DS'
data
] | 9 | 0.183673 | 1 | 8 |
df7d65a7aa213834b25f9480d6debc22c6315630 | app/finders/members_finder.rb | app/finders/members_finder.rb | class MembersFinder
attr_reader :project, :current_user, :group
def initialize(project, current_user)
@project = project
@current_user = current_user
@group = project.group
end
def execute
project_members = project.project_members
project_members = project_members.non_invite unless can?(current_user, :admin_project, project)
wheres = ["members.id IN (#{project_members.select(:id).to_sql})"]
if group
# We need `.where.not(user_id: nil)` here otherwise when a group has an
# invitee, it would make the following query return 0 rows since a NULL
# user_id would be present in the subquery
# See http://stackoverflow.com/questions/129077/not-in-clause-and-null-values
non_null_user_ids = project_members.where.not(user_id: nil).select(:user_id)
group_members = GroupMembersFinder.new(group).execute
group_members = group_members.where.not(user_id: non_null_user_ids)
group_members = group_members.non_invite unless can?(current_user, :admin_group, group)
wheres << "members.id IN (#{group_members.select(:id).to_sql})"
end
Member.where(wheres.join(' OR '))
end
def can?(*args)
Ability.allowed?(*args)
end
end
| class MembersFinder
attr_reader :project, :current_user, :group
def initialize(project, current_user)
@project = project
@current_user = current_user
@group = project.group
end
def execute
project_members = project.project_members
project_members = project_members.non_invite unless can?(current_user, :admin_project, project)
if group
group_members = GroupMembersFinder.new(group).execute
group_members = group_members.non_invite unless can?(current_user, :admin_group, group)
union = Gitlab::SQL::Union.new([project_members, group_members], remove_duplicates: false)
# We're interested in a list of members without duplicates by user_id.
# We prefer project members over group members, project members should go first.
#
# We could have used a DISTINCT ON here, but MySQL does not support this.
sql = <<-SQL
SELECT member_numbered.*
FROM (
SELECT
member_union.*,
ROW_NUMBER() OVER (
PARTITION BY user_id ORDER BY CASE WHEN type = 'ProjectMember' THEN 1 WHEN type = 'GroupMember' THEN 2 ELSE 3 END
) AS row_number
FROM (#{union.to_sql}) AS member_union
) AS member_numbered
WHERE row_number = 1
SQL
Member.from("(#{sql}) AS #{Member.table_name}")
else
project_members
end
end
def can?(*args)
Ability.allowed?(*args)
end
end
| Simplify database queries in MembersFinder. | Simplify database queries in MembersFinder.
Closes #41461.
| Ruby | mit | jirutka/gitlabhq,jirutka/gitlabhq,axilleas/gitlabhq,dreampet/gitlab,stoplightio/gitlabhq,axilleas/gitlabhq,jirutka/gitlabhq,axilleas/gitlabhq,iiet/iiet-git,dreampet/gitlab,mmkassem/gitlabhq,stoplightio/gitlabhq,dreampet/gitlab,iiet/iiet-git,stoplightio/gitlabhq,mmkassem/gitlabhq,iiet/iiet-git,jirutka/gitlabhq,dreampet/gitlab,stoplightio/gitlabhq,iiet/iiet-git,axilleas/gitlabhq,mmkassem/gitlabhq,mmkassem/gitlabhq | ruby | ## Code Before:
class MembersFinder
attr_reader :project, :current_user, :group
def initialize(project, current_user)
@project = project
@current_user = current_user
@group = project.group
end
def execute
project_members = project.project_members
project_members = project_members.non_invite unless can?(current_user, :admin_project, project)
wheres = ["members.id IN (#{project_members.select(:id).to_sql})"]
if group
# We need `.where.not(user_id: nil)` here otherwise when a group has an
# invitee, it would make the following query return 0 rows since a NULL
# user_id would be present in the subquery
# See http://stackoverflow.com/questions/129077/not-in-clause-and-null-values
non_null_user_ids = project_members.where.not(user_id: nil).select(:user_id)
group_members = GroupMembersFinder.new(group).execute
group_members = group_members.where.not(user_id: non_null_user_ids)
group_members = group_members.non_invite unless can?(current_user, :admin_group, group)
wheres << "members.id IN (#{group_members.select(:id).to_sql})"
end
Member.where(wheres.join(' OR '))
end
def can?(*args)
Ability.allowed?(*args)
end
end
## Instruction:
Simplify database queries in MembersFinder.
Closes #41461.
## Code After:
class MembersFinder
attr_reader :project, :current_user, :group
def initialize(project, current_user)
@project = project
@current_user = current_user
@group = project.group
end
def execute
project_members = project.project_members
project_members = project_members.non_invite unless can?(current_user, :admin_project, project)
if group
group_members = GroupMembersFinder.new(group).execute
group_members = group_members.non_invite unless can?(current_user, :admin_group, group)
union = Gitlab::SQL::Union.new([project_members, group_members], remove_duplicates: false)
# We're interested in a list of members without duplicates by user_id.
# We prefer project members over group members, project members should go first.
#
# We could have used a DISTINCT ON here, but MySQL does not support this.
sql = <<-SQL
SELECT member_numbered.*
FROM (
SELECT
member_union.*,
ROW_NUMBER() OVER (
PARTITION BY user_id ORDER BY CASE WHEN type = 'ProjectMember' THEN 1 WHEN type = 'GroupMember' THEN 2 ELSE 3 END
) AS row_number
FROM (#{union.to_sql}) AS member_union
) AS member_numbered
WHERE row_number = 1
SQL
Member.from("(#{sql}) AS #{Member.table_name}")
else
project_members
end
end
def can?(*args)
Ability.allowed?(*args)
end
end
| class MembersFinder
attr_reader :project, :current_user, :group
def initialize(project, current_user)
@project = project
@current_user = current_user
@group = project.group
end
def execute
project_members = project.project_members
project_members = project_members.non_invite unless can?(current_user, :admin_project, project)
- wheres = ["members.id IN (#{project_members.select(:id).to_sql})"]
if group
- # We need `.where.not(user_id: nil)` here otherwise when a group has an
- # invitee, it would make the following query return 0 rows since a NULL
- # user_id would be present in the subquery
- # See http://stackoverflow.com/questions/129077/not-in-clause-and-null-values
- non_null_user_ids = project_members.where.not(user_id: nil).select(:user_id)
-
group_members = GroupMembersFinder.new(group).execute
- group_members = group_members.where.not(user_id: non_null_user_ids)
group_members = group_members.non_invite unless can?(current_user, :admin_group, group)
- wheres << "members.id IN (#{group_members.select(:id).to_sql})"
+ union = Gitlab::SQL::Union.new([project_members, group_members], remove_duplicates: false)
+
+ # We're interested in a list of members without duplicates by user_id.
+ # We prefer project members over group members, project members should go first.
+ #
+ # We could have used a DISTINCT ON here, but MySQL does not support this.
+ sql = <<-SQL
+ SELECT member_numbered.*
+ FROM (
+ SELECT
+ member_union.*,
+ ROW_NUMBER() OVER (
+ PARTITION BY user_id ORDER BY CASE WHEN type = 'ProjectMember' THEN 1 WHEN type = 'GroupMember' THEN 2 ELSE 3 END
+ ) AS row_number
+ FROM (#{union.to_sql}) AS member_union
+ ) AS member_numbered
+ WHERE row_number = 1
+ SQL
+
+ Member.from("(#{sql}) AS #{Member.table_name}")
+ else
+ project_members
end
-
- Member.where(wheres.join(' OR '))
end
def can?(*args)
Ability.allowed?(*args)
end
end | 33 | 0.942857 | 22 | 11 |
54cd543118d7b078885c10ef048f7c5d65a96126 | db/migrate/20210125171611_populate_order_tax_totals.rb | db/migrate/20210125171611_populate_order_tax_totals.rb | class PopulateOrderTaxTotals < ActiveRecord::Migration
class Spree::Adjustment < ActiveRecord::Base
scope :tax, -> { where(originator_type: 'Spree::TaxRate') }
scope :additional, -> { where(included: false) }
scope :enterprise_fee, -> { where(originator_type: 'EnterpriseFee') }
scope :shipping, -> { where(originator_type: 'Spree::ShippingMethod') }
end
def up
Spree::Order.where(additional_tax_total: 0, included_tax_total: 0).
find_each(batch_size: 500) do |order|
additional_tax_total = order.all_adjustments.tax.additional.sum(:amount)
included_tax_total = order.line_item_adjustments.tax.sum(:included_tax) +
order.all_adjustments.enterprise_fee.sum(:included_tax) +
order.adjustments.shipping.sum(:included_tax)
order.update_columns(
additional_tax_total: additional_tax_total,
included_tax_total: included_tax_total
)
end
end
end
| class PopulateOrderTaxTotals < ActiveRecord::Migration
def up
# Updates new order tax total fields (additional_tax_total and included_tax_total).
# Sums the relevant values from associated adjustments and updates the two columns.
update_orders
end
def update_orders
sql = <<-SQL
UPDATE spree_orders
SET additional_tax_total = totals.additional,
included_tax_total = totals.included
FROM (
SELECT spree_orders.id AS order_id,
COALESCE(additional_adjustments.sum, 0) AS additional,
COALESCE(included_adjustments.sum, 0) AS included
FROM spree_orders
LEFT JOIN (
SELECT order_id, SUM(amount) AS sum
FROM spree_adjustments
WHERE spree_adjustments.originator_type = 'Spree::TaxRate'
AND spree_adjustments.included IS FALSE
GROUP BY order_id
) additional_adjustments ON spree_orders.id = additional_adjustments.order_id
LEFT JOIN (
SELECT order_id, SUM(included_tax) as sum
FROM spree_adjustments
WHERE spree_adjustments.included_tax IS NOT NULL
AND (
spree_adjustments.originator_type = 'Spree::ShippingMethod'
OR spree_adjustments.originator_type = 'EnterpriseFee'
OR (
spree_adjustments.originator_type = 'Spree::TaxRate'
AND spree_adjustments.adjustable_type = 'Spree::LineItem'
)
OR (
spree_adjustments.originator_type IS NULL
AND spree_adjustments.adjustable_type = 'Spree::Order'
AND spree_adjustments.included IS FALSE
)
)
GROUP BY order_id
) included_adjustments ON spree_orders.id = included_adjustments.order_id
) totals
WHERE totals.order_id = spree_orders.id
SQL
ActiveRecord::Base.connection.execute(sql)
end
end
| Update data migration to use raw SQL | Update data migration to use raw SQL
| Ruby | agpl-3.0 | mkllnk/openfoodnetwork,Matt-Yorkley/openfoodnetwork,Matt-Yorkley/openfoodnetwork,mkllnk/openfoodnetwork,mkllnk/openfoodnetwork,lin-d-hop/openfoodnetwork,openfoodfoundation/openfoodnetwork,lin-d-hop/openfoodnetwork,Matt-Yorkley/openfoodnetwork,lin-d-hop/openfoodnetwork,openfoodfoundation/openfoodnetwork,lin-d-hop/openfoodnetwork,Matt-Yorkley/openfoodnetwork,openfoodfoundation/openfoodnetwork,mkllnk/openfoodnetwork,openfoodfoundation/openfoodnetwork | ruby | ## Code Before:
class PopulateOrderTaxTotals < ActiveRecord::Migration
class Spree::Adjustment < ActiveRecord::Base
scope :tax, -> { where(originator_type: 'Spree::TaxRate') }
scope :additional, -> { where(included: false) }
scope :enterprise_fee, -> { where(originator_type: 'EnterpriseFee') }
scope :shipping, -> { where(originator_type: 'Spree::ShippingMethod') }
end
def up
Spree::Order.where(additional_tax_total: 0, included_tax_total: 0).
find_each(batch_size: 500) do |order|
additional_tax_total = order.all_adjustments.tax.additional.sum(:amount)
included_tax_total = order.line_item_adjustments.tax.sum(:included_tax) +
order.all_adjustments.enterprise_fee.sum(:included_tax) +
order.adjustments.shipping.sum(:included_tax)
order.update_columns(
additional_tax_total: additional_tax_total,
included_tax_total: included_tax_total
)
end
end
end
## Instruction:
Update data migration to use raw SQL
## Code After:
class PopulateOrderTaxTotals < ActiveRecord::Migration
def up
# Updates new order tax total fields (additional_tax_total and included_tax_total).
# Sums the relevant values from associated adjustments and updates the two columns.
update_orders
end
def update_orders
sql = <<-SQL
UPDATE spree_orders
SET additional_tax_total = totals.additional,
included_tax_total = totals.included
FROM (
SELECT spree_orders.id AS order_id,
COALESCE(additional_adjustments.sum, 0) AS additional,
COALESCE(included_adjustments.sum, 0) AS included
FROM spree_orders
LEFT JOIN (
SELECT order_id, SUM(amount) AS sum
FROM spree_adjustments
WHERE spree_adjustments.originator_type = 'Spree::TaxRate'
AND spree_adjustments.included IS FALSE
GROUP BY order_id
) additional_adjustments ON spree_orders.id = additional_adjustments.order_id
LEFT JOIN (
SELECT order_id, SUM(included_tax) as sum
FROM spree_adjustments
WHERE spree_adjustments.included_tax IS NOT NULL
AND (
spree_adjustments.originator_type = 'Spree::ShippingMethod'
OR spree_adjustments.originator_type = 'EnterpriseFee'
OR (
spree_adjustments.originator_type = 'Spree::TaxRate'
AND spree_adjustments.adjustable_type = 'Spree::LineItem'
)
OR (
spree_adjustments.originator_type IS NULL
AND spree_adjustments.adjustable_type = 'Spree::Order'
AND spree_adjustments.included IS FALSE
)
)
GROUP BY order_id
) included_adjustments ON spree_orders.id = included_adjustments.order_id
) totals
WHERE totals.order_id = spree_orders.id
SQL
ActiveRecord::Base.connection.execute(sql)
end
end
| class PopulateOrderTaxTotals < ActiveRecord::Migration
+ def up
+ # Updates new order tax total fields (additional_tax_total and included_tax_total).
+ # Sums the relevant values from associated adjustments and updates the two columns.
+ update_orders
- class Spree::Adjustment < ActiveRecord::Base
- scope :tax, -> { where(originator_type: 'Spree::TaxRate') }
- scope :additional, -> { where(included: false) }
- scope :enterprise_fee, -> { where(originator_type: 'EnterpriseFee') }
- scope :shipping, -> { where(originator_type: 'Spree::ShippingMethod') }
end
- def up
- Spree::Order.where(additional_tax_total: 0, included_tax_total: 0).
- find_each(batch_size: 500) do |order|
+ def update_orders
+ sql = <<-SQL
+ UPDATE spree_orders
+ SET additional_tax_total = totals.additional,
+ included_tax_total = totals.included
+ FROM (
+ SELECT spree_orders.id AS order_id,
+ COALESCE(additional_adjustments.sum, 0) AS additional,
+ COALESCE(included_adjustments.sum, 0) AS included
+ FROM spree_orders
+ LEFT JOIN (
+ SELECT order_id, SUM(amount) AS sum
+ FROM spree_adjustments
+ WHERE spree_adjustments.originator_type = 'Spree::TaxRate'
+ AND spree_adjustments.included IS FALSE
+ GROUP BY order_id
+ ) additional_adjustments ON spree_orders.id = additional_adjustments.order_id
+ LEFT JOIN (
+ SELECT order_id, SUM(included_tax) as sum
+ FROM spree_adjustments
+ WHERE spree_adjustments.included_tax IS NOT NULL
+ AND (
+ spree_adjustments.originator_type = 'Spree::ShippingMethod'
+ OR spree_adjustments.originator_type = 'EnterpriseFee'
+ OR (
+ spree_adjustments.originator_type = 'Spree::TaxRate'
+ AND spree_adjustments.adjustable_type = 'Spree::LineItem'
+ )
+ OR (
+ spree_adjustments.originator_type IS NULL
+ AND spree_adjustments.adjustable_type = 'Spree::Order'
+ AND spree_adjustments.included IS FALSE
+ )
+ )
+ GROUP BY order_id
+ ) included_adjustments ON spree_orders.id = included_adjustments.order_id
+ ) totals
+ WHERE totals.order_id = spree_orders.id
+ SQL
+ ActiveRecord::Base.connection.execute(sql)
- additional_tax_total = order.all_adjustments.tax.additional.sum(:amount)
-
- included_tax_total = order.line_item_adjustments.tax.sum(:included_tax) +
- order.all_adjustments.enterprise_fee.sum(:included_tax) +
- order.adjustments.shipping.sum(:included_tax)
-
- order.update_columns(
- additional_tax_total: additional_tax_total,
- included_tax_total: included_tax_total
- )
- end
end
end | 63 | 2.52 | 44 | 19 |
3c5f428a58f08b2762557c1f64c9200e018ba9d7 | .travis.yml | .travis.yml | env:
_JAVA_OPTIONS="-Xms1G -Xmx4G"
language: java
jdk:
- oraclejdk8
- oraclejdk7
- openjdk7
addons:
apt:
packages:
- oracle-java8-installer
install: true
script:
- mvn clean verify
notifications:
irc: "chat.freenode.net#io7m"
| language: java
jdk:
- oraclejdk9
install: true
script:
- mvn clean verify
- bash <(curl -s https://codecov.io/bash) -f com.io7m.junreachable.core/target/site/jacoco/jacoco.xml
notifications:
irc: "chat.freenode.net#io7m"
| Enable JDK 9, code coverage, etc | Enable JDK 9, code coverage, etc
| YAML | isc | io7m/junreachable | yaml | ## Code Before:
env:
_JAVA_OPTIONS="-Xms1G -Xmx4G"
language: java
jdk:
- oraclejdk8
- oraclejdk7
- openjdk7
addons:
apt:
packages:
- oracle-java8-installer
install: true
script:
- mvn clean verify
notifications:
irc: "chat.freenode.net#io7m"
## Instruction:
Enable JDK 9, code coverage, etc
## Code After:
language: java
jdk:
- oraclejdk9
install: true
script:
- mvn clean verify
- bash <(curl -s https://codecov.io/bash) -f com.io7m.junreachable.core/target/site/jacoco/jacoco.xml
notifications:
irc: "chat.freenode.net#io7m"
| - env:
- _JAVA_OPTIONS="-Xms1G -Xmx4G"
-
language: java
jdk:
- - oraclejdk8
? ^
+ - oraclejdk9
? ^
- - oraclejdk7
- - openjdk7
-
- addons:
- apt:
- packages:
- - oracle-java8-installer
install: true
script:
- mvn clean verify
+ - bash <(curl -s https://codecov.io/bash) -f com.io7m.junreachable.core/target/site/jacoco/jacoco.xml
notifications:
irc: "chat.freenode.net#io7m"
| 13 | 0.565217 | 2 | 11 |
bb6f324a00ce7b135ef20dc2ba39c5d8a2ee8c3b | README.md | README.md | kennethware-2.0
===============
Tools to facilitate rapid course development in Instructure Canvas.
To learn about these tools and how to install them visit: https://usu.instructure.com/courses/305202
Composer
========
Install composer:
curl -sS https://getcomposer.org/installer | php
Run composer to get packages:
php composer.phar install
If you make changes to composer.json:
php composer.phar update
| kennethware-2.0
===============
Tools to facilitate rapid course development in Instructure Canvas.
To learn about these tools and how to install them visit: https://usu.instructure.com/courses/305202
Composer
========
Install composer:
curl -sS https://getcomposer.org/installer | php
Run composer to get packages:
php composer.phar install
If you make changes to composer.json:
php composer.phar update
Environment Vars
================
The database type is the DSN prefix. Use mysql for mysql, sqlite for sqlite, pgsql for postgresql, etc.
Run the following command on a php page to get what is available on your system.
var_dump(PDO::getAvailableDrivers());
export DB_TYPE="put your db type here"
export DB_NAME="put your db name here"
export DB_HOST="put your db host here"
export DB_PORT="put your db port here"
export DB_USER="put your db user here"
export DB_PASS="put your db password here"
export CLIENT_ID="put your canvas id here"
export CLIENT_SECRET="put your canvas secret here"
export ENCRYPTION_KEY="put your encryption key here" #This should be the same as the encryption key used to encrypt the apiToken.
| Add necessary environment variables to the readme. | Add necessary environment variables to the readme.
| Markdown | agpl-3.0 | atomicjolt/kennethware-2.0,atomicjolt/kennethware-2.0,atomicjolt/kennethware-2.0,atomicjolt/kennethware-2.0,atomicjolt/kennethware-2.0 | markdown | ## Code Before:
kennethware-2.0
===============
Tools to facilitate rapid course development in Instructure Canvas.
To learn about these tools and how to install them visit: https://usu.instructure.com/courses/305202
Composer
========
Install composer:
curl -sS https://getcomposer.org/installer | php
Run composer to get packages:
php composer.phar install
If you make changes to composer.json:
php composer.phar update
## Instruction:
Add necessary environment variables to the readme.
## Code After:
kennethware-2.0
===============
Tools to facilitate rapid course development in Instructure Canvas.
To learn about these tools and how to install them visit: https://usu.instructure.com/courses/305202
Composer
========
Install composer:
curl -sS https://getcomposer.org/installer | php
Run composer to get packages:
php composer.phar install
If you make changes to composer.json:
php composer.phar update
Environment Vars
================
The database type is the DSN prefix. Use mysql for mysql, sqlite for sqlite, pgsql for postgresql, etc.
Run the following command on a php page to get what is available on your system.
var_dump(PDO::getAvailableDrivers());
export DB_TYPE="put your db type here"
export DB_NAME="put your db name here"
export DB_HOST="put your db host here"
export DB_PORT="put your db port here"
export DB_USER="put your db user here"
export DB_PASS="put your db password here"
export CLIENT_ID="put your canvas id here"
export CLIENT_SECRET="put your canvas secret here"
export ENCRYPTION_KEY="put your encryption key here" #This should be the same as the encryption key used to encrypt the apiToken.
| kennethware-2.0
===============
Tools to facilitate rapid course development in Instructure Canvas.
To learn about these tools and how to install them visit: https://usu.instructure.com/courses/305202
Composer
========
Install composer:
curl -sS https://getcomposer.org/installer | php
Run composer to get packages:
php composer.phar install
If you make changes to composer.json:
php composer.phar update
+
+ Environment Vars
+ ================
+ The database type is the DSN prefix. Use mysql for mysql, sqlite for sqlite, pgsql for postgresql, etc.
+ Run the following command on a php page to get what is available on your system.
+ var_dump(PDO::getAvailableDrivers());
+
+ export DB_TYPE="put your db type here"
+ export DB_NAME="put your db name here"
+ export DB_HOST="put your db host here"
+ export DB_PORT="put your db port here"
+ export DB_USER="put your db user here"
+ export DB_PASS="put your db password here"
+ export CLIENT_ID="put your canvas id here"
+ export CLIENT_SECRET="put your canvas secret here"
+ export ENCRYPTION_KEY="put your encryption key here" #This should be the same as the encryption key used to encrypt the apiToken. | 16 | 0.941176 | 16 | 0 |
c2366ef6abbe667aeb29371f4b067d54ad8774db | README.md | README.md |
Used by VersionDB to read in a schema.json file.
|
Used by VersionDB to read in a schema.json file.
[](http://travis-ci.org/bryanburgers/versiondb-bundle-file)
| Add Travis CI badge to readme | Add Travis CI badge to readme
| Markdown | mit | bryanburgers/versiondb-bundle-file | markdown | ## Code Before:
Used by VersionDB to read in a schema.json file.
## Instruction:
Add Travis CI badge to readme
## Code After:
Used by VersionDB to read in a schema.json file.
[](http://travis-ci.org/bryanburgers/versiondb-bundle-file)
|
Used by VersionDB to read in a schema.json file.
+
+ [](http://travis-ci.org/bryanburgers/versiondb-bundle-file) | 2 | 1 | 2 | 0 |
8f61bd136740c61e4beac8e86656b1cc5e586a13 | app/views/partials/_item_graph_legend.html.haml | app/views/partials/_item_graph_legend.html.haml | .visualization-graph-legend.panel.panel-default{:class => ("collapsed" if defined? edit)}
.panel-heading
= t '.show'
%button.visualization-graph-legend-collapse-btn{ type: "button" }
%i.glyphicon.glyphicon-triangle-top
.panel-body
.visualization-graph-legend-size
%p.visualization-graph-legend-title{ data: {'node-type': t('common.type'), relations: t('common.number_of_relations')} }
%ul
%li.visualization-graph-legend-lg
%span.visualization-graph-legend-circle
%span.visualization-graph-legend-size-amount
%li.visualization-graph-legend-md
%span.visualization-graph-legend-circle
%span.visualization-graph-legend-size-amount
%li.visualization-graph-legend-sm
%span.visualization-graph-legend-circle
%span.visualization-graph-legend-size-amount
.visualization-graph-legend-color
%p.visualization-graph-legend-title{ data: {'node-type': t('common.type'), relations: t('common.number_of_relations')} }
%ul
%button.visualization-graph-legend-collapse-btn{ type: "button", title: t('.hide'), data: {toggle: "tooltip", placement: "top"} }
%i.glyphicon.glyphicon-triangle-bottom | .visualization-graph-legend.panel.panel-default.collapsed
.panel-heading
= t '.show'
%button.visualization-graph-legend-collapse-btn{ type: "button" }
%i.glyphicon.glyphicon-triangle-top
.panel-body
.visualization-graph-legend-size
%p.visualization-graph-legend-title{ data: {'node-type': t('common.type'), relations: t('common.number_of_relations')} }
%ul
%li.visualization-graph-legend-lg
%span.visualization-graph-legend-circle
%span.visualization-graph-legend-size-amount
%li.visualization-graph-legend-md
%span.visualization-graph-legend-circle
%span.visualization-graph-legend-size-amount
%li.visualization-graph-legend-sm
%span.visualization-graph-legend-circle
%span.visualization-graph-legend-size-amount
.visualization-graph-legend-color
%p.visualization-graph-legend-title{ data: {'node-type': t('common.type'), relations: t('common.number_of_relations')} }
%ul
%button.visualization-graph-legend-collapse-btn{ type: "button", title: t('.hide'), data: {toggle: "tooltip", placement: "top"} }
%i.glyphicon.glyphicon-triangle-bottom | Set visualization-graph-legend collapsed by default | Set visualization-graph-legend collapsed by default
Closes #333
| Haml | agpl-3.0 | civio/onodo,civio/onodo,civio/onodo,civio/onodo | haml | ## Code Before:
.visualization-graph-legend.panel.panel-default{:class => ("collapsed" if defined? edit)}
.panel-heading
= t '.show'
%button.visualization-graph-legend-collapse-btn{ type: "button" }
%i.glyphicon.glyphicon-triangle-top
.panel-body
.visualization-graph-legend-size
%p.visualization-graph-legend-title{ data: {'node-type': t('common.type'), relations: t('common.number_of_relations')} }
%ul
%li.visualization-graph-legend-lg
%span.visualization-graph-legend-circle
%span.visualization-graph-legend-size-amount
%li.visualization-graph-legend-md
%span.visualization-graph-legend-circle
%span.visualization-graph-legend-size-amount
%li.visualization-graph-legend-sm
%span.visualization-graph-legend-circle
%span.visualization-graph-legend-size-amount
.visualization-graph-legend-color
%p.visualization-graph-legend-title{ data: {'node-type': t('common.type'), relations: t('common.number_of_relations')} }
%ul
%button.visualization-graph-legend-collapse-btn{ type: "button", title: t('.hide'), data: {toggle: "tooltip", placement: "top"} }
%i.glyphicon.glyphicon-triangle-bottom
## Instruction:
Set visualization-graph-legend collapsed by default
Closes #333
## Code After:
.visualization-graph-legend.panel.panel-default.collapsed
.panel-heading
= t '.show'
%button.visualization-graph-legend-collapse-btn{ type: "button" }
%i.glyphicon.glyphicon-triangle-top
.panel-body
.visualization-graph-legend-size
%p.visualization-graph-legend-title{ data: {'node-type': t('common.type'), relations: t('common.number_of_relations')} }
%ul
%li.visualization-graph-legend-lg
%span.visualization-graph-legend-circle
%span.visualization-graph-legend-size-amount
%li.visualization-graph-legend-md
%span.visualization-graph-legend-circle
%span.visualization-graph-legend-size-amount
%li.visualization-graph-legend-sm
%span.visualization-graph-legend-circle
%span.visualization-graph-legend-size-amount
.visualization-graph-legend-color
%p.visualization-graph-legend-title{ data: {'node-type': t('common.type'), relations: t('common.number_of_relations')} }
%ul
%button.visualization-graph-legend-collapse-btn{ type: "button", title: t('.hide'), data: {toggle: "tooltip", placement: "top"} }
%i.glyphicon.glyphicon-triangle-bottom | - .visualization-graph-legend.panel.panel-default{:class => ("collapsed" if defined? edit)}
? ^^^^^^^^^^^^^ --------------------
+ .visualization-graph-legend.panel.panel-default.collapsed
? ^
.panel-heading
= t '.show'
%button.visualization-graph-legend-collapse-btn{ type: "button" }
%i.glyphicon.glyphicon-triangle-top
.panel-body
.visualization-graph-legend-size
%p.visualization-graph-legend-title{ data: {'node-type': t('common.type'), relations: t('common.number_of_relations')} }
%ul
%li.visualization-graph-legend-lg
%span.visualization-graph-legend-circle
%span.visualization-graph-legend-size-amount
%li.visualization-graph-legend-md
%span.visualization-graph-legend-circle
%span.visualization-graph-legend-size-amount
%li.visualization-graph-legend-sm
%span.visualization-graph-legend-circle
%span.visualization-graph-legend-size-amount
.visualization-graph-legend-color
%p.visualization-graph-legend-title{ data: {'node-type': t('common.type'), relations: t('common.number_of_relations')} }
%ul
%button.visualization-graph-legend-collapse-btn{ type: "button", title: t('.hide'), data: {toggle: "tooltip", placement: "top"} }
%i.glyphicon.glyphicon-triangle-bottom | 2 | 0.086957 | 1 | 1 |
5b764da559153db751e5fe51a2072cba9694a9f4 | wger/core/templates/tags/render_weight_log.html | wger/core/templates/tags/render_weight_log.html | {% load i18n static wger_extras %}
<div id="svg-{{div_uuid}}"></div>
<div style="overflow-x: auto;" class="weight-chart-table">
<table class="noborder">
<tr>
{% for date, entry_list in log.items %}
<td style="padding: 0em; border-top-width: 0px; vertical-align: top;">
<table class="table-sm">
<thead>
<tr>
<th colspan="3">{{date|date:"d.m.Y"}}</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-right">{% trans "Reps" %}</td>
<td></td>
<td style="padding:0px;">
{% trans_weight_unit 'kg' user %}
</td>
</tr>
{% for entry in entry_list %}
<tr>
<td class="text-right">{{entry.reps}}</td>
<td class="text-center" style="padding:0px;">×</td>
<td style="padding:0px;">{{entry.weight}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</td>
{% endfor %}
</tr>
</table>
</div>
| {% load i18n static wger_extras %}
<div id="svg-{{div_uuid}}"></div>
<div class="table-responsive weight-chart-table">
<table class="noborder">
<tr>
{% for date, entry_list in log.items %}
<td style="padding: 0em; border-top-width: 0px; vertical-align: top;">
<table class="table-sm">
<thead>
<tr>
<th colspan="3">{{date|date:"d.m.Y"}}</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-right">{% trans "Reps" %}</td>
<td></td>
<td style="padding:0px;">
{% trans_weight_unit 'kg' user %}
</td>
</tr>
{% for entry in entry_list %}
<tr>
<td class="text-right">{{entry.reps}}</td>
<td class="text-center" style="padding:0px;">×</td>
<td style="padding:0px;">{{entry.weight}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</td>
{% endfor %}
</tr>
</table>
</div>
| Use CSS class that does the overflow for log entries | Use CSS class that does the overflow for log entries
| HTML | agpl-3.0 | rolandgeider/wger,rolandgeider/wger,wger-project/wger,petervanderdoes/wger,wger-project/wger,petervanderdoes/wger,rolandgeider/wger,petervanderdoes/wger,rolandgeider/wger,wger-project/wger,wger-project/wger,petervanderdoes/wger | html | ## Code Before:
{% load i18n static wger_extras %}
<div id="svg-{{div_uuid}}"></div>
<div style="overflow-x: auto;" class="weight-chart-table">
<table class="noborder">
<tr>
{% for date, entry_list in log.items %}
<td style="padding: 0em; border-top-width: 0px; vertical-align: top;">
<table class="table-sm">
<thead>
<tr>
<th colspan="3">{{date|date:"d.m.Y"}}</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-right">{% trans "Reps" %}</td>
<td></td>
<td style="padding:0px;">
{% trans_weight_unit 'kg' user %}
</td>
</tr>
{% for entry in entry_list %}
<tr>
<td class="text-right">{{entry.reps}}</td>
<td class="text-center" style="padding:0px;">×</td>
<td style="padding:0px;">{{entry.weight}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</td>
{% endfor %}
</tr>
</table>
</div>
## Instruction:
Use CSS class that does the overflow for log entries
## Code After:
{% load i18n static wger_extras %}
<div id="svg-{{div_uuid}}"></div>
<div class="table-responsive weight-chart-table">
<table class="noborder">
<tr>
{% for date, entry_list in log.items %}
<td style="padding: 0em; border-top-width: 0px; vertical-align: top;">
<table class="table-sm">
<thead>
<tr>
<th colspan="3">{{date|date:"d.m.Y"}}</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-right">{% trans "Reps" %}</td>
<td></td>
<td style="padding:0px;">
{% trans_weight_unit 'kg' user %}
</td>
</tr>
{% for entry in entry_list %}
<tr>
<td class="text-right">{{entry.reps}}</td>
<td class="text-center" style="padding:0px;">×</td>
<td style="padding:0px;">{{entry.weight}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</td>
{% endfor %}
</tr>
</table>
</div>
| {% load i18n static wger_extras %}
<div id="svg-{{div_uuid}}"></div>
- <div style="overflow-x: auto;" class="weight-chart-table">
+ <div class="table-responsive weight-chart-table">
<table class="noborder">
<tr>
{% for date, entry_list in log.items %}
<td style="padding: 0em; border-top-width: 0px; vertical-align: top;">
<table class="table-sm">
<thead>
<tr>
<th colspan="3">{{date|date:"d.m.Y"}}</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-right">{% trans "Reps" %}</td>
<td></td>
<td style="padding:0px;">
{% trans_weight_unit 'kg' user %}
</td>
</tr>
{% for entry in entry_list %}
<tr>
<td class="text-right">{{entry.reps}}</td>
<td class="text-center" style="padding:0px;">×</td>
<td style="padding:0px;">{{entry.weight}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</td>
{% endfor %}
</tr>
</table>
</div> | 2 | 0.055556 | 1 | 1 |
a2084c42850a29c417f2a9caf9dc1c56a7945e6b | backend/scripts/create_training_demos.py | backend/scripts/create_training_demos.py | import rethinkdb as r
import os
if __name__ == "__main__":
conn = r.connect('localhost', 30815, db='materialscommons')
apikeys = r.table('users').pluck('apikey', 'id').run(conn)
for k in apikeys:
command = "curl -XPUT http://mctest.localhost/api/v2/users/%s/create_demo_project?apikey=%s" % (
k['id'], k['apikey'])
print command
os.system(command)
| import rethinkdb as r
import os
if __name__ == "__main__":
conn = r.connect('localhost', 30815, db='materialscommons')
apikeys = r.table('users').pluck('apikey', 'id').run(conn)
for k in apikeys:
command = "curl -k -XPUT https://test.materialscommons.org/api/v2/users/%s/create_demo_project?apikey=%s" % (
k['id'], k['apikey'])
print command
os.system(command)
| Change url to test and add -k flag to ignore certificate | Change url to test and add -k flag to ignore certificate
| Python | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | python | ## Code Before:
import rethinkdb as r
import os
if __name__ == "__main__":
conn = r.connect('localhost', 30815, db='materialscommons')
apikeys = r.table('users').pluck('apikey', 'id').run(conn)
for k in apikeys:
command = "curl -XPUT http://mctest.localhost/api/v2/users/%s/create_demo_project?apikey=%s" % (
k['id'], k['apikey'])
print command
os.system(command)
## Instruction:
Change url to test and add -k flag to ignore certificate
## Code After:
import rethinkdb as r
import os
if __name__ == "__main__":
conn = r.connect('localhost', 30815, db='materialscommons')
apikeys = r.table('users').pluck('apikey', 'id').run(conn)
for k in apikeys:
command = "curl -k -XPUT https://test.materialscommons.org/api/v2/users/%s/create_demo_project?apikey=%s" % (
k['id'], k['apikey'])
print command
os.system(command)
| import rethinkdb as r
import os
if __name__ == "__main__":
conn = r.connect('localhost', 30815, db='materialscommons')
apikeys = r.table('users').pluck('apikey', 'id').run(conn)
for k in apikeys:
- command = "curl -XPUT http://mctest.localhost/api/v2/users/%s/create_demo_project?apikey=%s" % (
? -- ^^^ ^ ^
+ command = "curl -k -XPUT https://test.materialscommons.org/api/v2/users/%s/create_demo_project?apikey=%s" % (
? +++ + ^^^^^^ ^^ ++++ ^^^^
k['id'], k['apikey'])
print command
os.system(command) | 2 | 0.181818 | 1 | 1 |
195a02e42fa068758ad80504859c52ed44d5b41a | README.md | README.md |
For having postcode lookup feature in CiviCRM backend and Front end profiles.
### Supported Providers ###
* [AFD](http://www.afd.co.uk)
* [Civipostcode](http://civipostcode.com/)
* [Experian](http://www.qas.co.uk)
* [PostcodeAnywhere](http://www.postcodeanywhere.co.uk/)
### Installation ###
* Install the extension manually in CiviCRM. More details [here](http://wiki.civicrm.org/confluence/display/CRMDOC/Extensions#Extensions-Installinganewextension) about installing extensions in CiviCRM.
* Configure postcode lookup provider details in Administer >> Postcode Lookup(civicrm/postcodelookup/settings?reset=1)
### Usage ###
* For backend, postcode lookup features is automatically enabled for address fields when adding/editing contacts and configuring event location.
* For front end profiles, postcode lookup feature is enabled only if 'Street Address' field of type 'Primary' or 'Billing' is added to the profile. Include 'Supplemental Address 1' and 'Supplemental Address 2' fields in the profile for address lines based on the rules in the Royal Mail programmers guide.
### Support ###
support (at) vedaconsulting.co.uk
|
For having postcode lookup feature in CiviCRM backend and Front end profiles.
### Supported Providers ###
* [AFD](http://www.afd.co.uk)
* [Civipostcode](http://civipostcode.com/)
* [Experian](http://www.qas.co.uk)
* [PostcodeAnywhere](http://www.postcodeanywhere.co.uk/)
### Installation ###
* Install the extension manually in CiviCRM. More details [here](http://wiki.civicrm.org/confluence/display/CRMDOC/Extensions#Extensions-Installinganewextension) about installing extensions in CiviCRM.
* Configure postcode lookup provider details in Administer >> Postcode Lookup(civicrm/postcodelookup/settings?reset=1)
#### Integration with Drupal Webform
This drupal module provides integration with Drupal Webform: https://github.com/compucorp/webform_civicrm_postcode
### Usage ###
* For backend, postcode lookup features is automatically enabled for address fields when adding/editing contacts and configuring event location.
* For front end profiles, postcode lookup feature is enabled only if 'Street Address' field of type 'Primary' or 'Billing' is added to the profile. Include 'Supplemental Address 1' and 'Supplemental Address 2' fields in the profile for address lines based on the rules in the Royal Mail programmers guide.
### Support ###
support (at) vedaconsulting.co.uk
| Add note to readme about drupal webform integration | Add note to readme about drupal webform integration
| Markdown | agpl-3.0 | veda-consulting/uk.co.vedaconsulting.module.civicrmpostcodelookup | markdown | ## Code Before:
For having postcode lookup feature in CiviCRM backend and Front end profiles.
### Supported Providers ###
* [AFD](http://www.afd.co.uk)
* [Civipostcode](http://civipostcode.com/)
* [Experian](http://www.qas.co.uk)
* [PostcodeAnywhere](http://www.postcodeanywhere.co.uk/)
### Installation ###
* Install the extension manually in CiviCRM. More details [here](http://wiki.civicrm.org/confluence/display/CRMDOC/Extensions#Extensions-Installinganewextension) about installing extensions in CiviCRM.
* Configure postcode lookup provider details in Administer >> Postcode Lookup(civicrm/postcodelookup/settings?reset=1)
### Usage ###
* For backend, postcode lookup features is automatically enabled for address fields when adding/editing contacts and configuring event location.
* For front end profiles, postcode lookup feature is enabled only if 'Street Address' field of type 'Primary' or 'Billing' is added to the profile. Include 'Supplemental Address 1' and 'Supplemental Address 2' fields in the profile for address lines based on the rules in the Royal Mail programmers guide.
### Support ###
support (at) vedaconsulting.co.uk
## Instruction:
Add note to readme about drupal webform integration
## Code After:
For having postcode lookup feature in CiviCRM backend and Front end profiles.
### Supported Providers ###
* [AFD](http://www.afd.co.uk)
* [Civipostcode](http://civipostcode.com/)
* [Experian](http://www.qas.co.uk)
* [PostcodeAnywhere](http://www.postcodeanywhere.co.uk/)
### Installation ###
* Install the extension manually in CiviCRM. More details [here](http://wiki.civicrm.org/confluence/display/CRMDOC/Extensions#Extensions-Installinganewextension) about installing extensions in CiviCRM.
* Configure postcode lookup provider details in Administer >> Postcode Lookup(civicrm/postcodelookup/settings?reset=1)
#### Integration with Drupal Webform
This drupal module provides integration with Drupal Webform: https://github.com/compucorp/webform_civicrm_postcode
### Usage ###
* For backend, postcode lookup features is automatically enabled for address fields when adding/editing contacts and configuring event location.
* For front end profiles, postcode lookup feature is enabled only if 'Street Address' field of type 'Primary' or 'Billing' is added to the profile. Include 'Supplemental Address 1' and 'Supplemental Address 2' fields in the profile for address lines based on the rules in the Royal Mail programmers guide.
### Support ###
support (at) vedaconsulting.co.uk
|
For having postcode lookup feature in CiviCRM backend and Front end profiles.
### Supported Providers ###
* [AFD](http://www.afd.co.uk)
* [Civipostcode](http://civipostcode.com/)
* [Experian](http://www.qas.co.uk)
* [PostcodeAnywhere](http://www.postcodeanywhere.co.uk/)
### Installation ###
* Install the extension manually in CiviCRM. More details [here](http://wiki.civicrm.org/confluence/display/CRMDOC/Extensions#Extensions-Installinganewextension) about installing extensions in CiviCRM.
* Configure postcode lookup provider details in Administer >> Postcode Lookup(civicrm/postcodelookup/settings?reset=1)
+ #### Integration with Drupal Webform
+ This drupal module provides integration with Drupal Webform: https://github.com/compucorp/webform_civicrm_postcode
+
### Usage ###
* For backend, postcode lookup features is automatically enabled for address fields when adding/editing contacts and configuring event location.
* For front end profiles, postcode lookup feature is enabled only if 'Street Address' field of type 'Primary' or 'Billing' is added to the profile. Include 'Supplemental Address 1' and 'Supplemental Address 2' fields in the profile for address lines based on the rules in the Royal Mail programmers guide.
### Support ###
support (at) vedaconsulting.co.uk | 3 | 0.130435 | 3 | 0 |
1cc1be133abaa40b27bb84a1a06f495fff5f68da | composer.json | composer.json | {
"name": "laravel/lumen",
"description": "Angular 2. Lumen. Integrated.",
"keywords": ["framework", "laravel", "lumen", "angular2"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/lumen-framework": "5.2.*",
"vlucas/phpdotenv": "~2.2",
"league/flysystem": "^1.0",
"dingo/api": "1.0.x@dev",
"tymon/jwt-auth": "1.0.0-alpha.2",
"barryvdh/laravel-cors": "^0.8.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"phpunit/phpunit": "~4.0"
},
"autoload": {
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/",
"database/"
]
}
}
| {
"name": "laravel/lumen",
"description": "Angular 2. Lumen. Integrated.",
"keywords": ["framework", "laravel", "lumen", "angular2"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/lumen-framework": "5.2.*",
"vlucas/phpdotenv": "~2.2",
"league/flysystem": "^1.0",
"dingo/api": "1.0.x@dev",
"tymon/jwt-auth": "1.0.0-alpha.2",
"barryvdh/laravel-cors": "^0.8.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"phpunit/phpunit": "~4.0"
},
"autoload": {
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/",
"database/"
]
},
"scripts": {
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
]
}
}
| Add post install script to copy .env.example | Add post install script to copy .env.example
| JSON | mit | jaesung2061/anvel,jaesung2061/anvel,jaesung2061/anvel | json | ## Code Before:
{
"name": "laravel/lumen",
"description": "Angular 2. Lumen. Integrated.",
"keywords": ["framework", "laravel", "lumen", "angular2"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/lumen-framework": "5.2.*",
"vlucas/phpdotenv": "~2.2",
"league/flysystem": "^1.0",
"dingo/api": "1.0.x@dev",
"tymon/jwt-auth": "1.0.0-alpha.2",
"barryvdh/laravel-cors": "^0.8.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"phpunit/phpunit": "~4.0"
},
"autoload": {
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/",
"database/"
]
}
}
## Instruction:
Add post install script to copy .env.example
## Code After:
{
"name": "laravel/lumen",
"description": "Angular 2. Lumen. Integrated.",
"keywords": ["framework", "laravel", "lumen", "angular2"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/lumen-framework": "5.2.*",
"vlucas/phpdotenv": "~2.2",
"league/flysystem": "^1.0",
"dingo/api": "1.0.x@dev",
"tymon/jwt-auth": "1.0.0-alpha.2",
"barryvdh/laravel-cors": "^0.8.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"phpunit/phpunit": "~4.0"
},
"autoload": {
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/",
"database/"
]
},
"scripts": {
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
]
}
}
| {
"name": "laravel/lumen",
"description": "Angular 2. Lumen. Integrated.",
"keywords": ["framework", "laravel", "lumen", "angular2"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/lumen-framework": "5.2.*",
"vlucas/phpdotenv": "~2.2",
"league/flysystem": "^1.0",
"dingo/api": "1.0.x@dev",
"tymon/jwt-auth": "1.0.0-alpha.2",
"barryvdh/laravel-cors": "^0.8.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"phpunit/phpunit": "~4.0"
},
"autoload": {
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/",
"database/"
]
+ },
+ "scripts": {
+ "post-root-package-install": [
+ "php -r \"copy('.env.example', '.env');\""
+ ]
}
} | 5 | 0.16129 | 5 | 0 |
f374ac8bb3789ed533a2371eae78a9f98e1def60 | tests/integrations/current/test_read.py | tests/integrations/current/test_read.py | import os
from tests.integrations.base import BaseTest
class TestReadCurrentView(BaseTest):
def test_listdirs(self):
assert os.listdir("%s/current" % self.mount_path) == ['testing', 'me']
| import os
from tests.integrations.base import BaseTest
class TestReadCurrentView(BaseTest):
def test_listdirs(self):
assert os.listdir("%s/current" % self.mount_path) == ['testing', 'me']
def test_read_from_a_file(self):
with open("%s/current/testing" % self.mount_path) as f:
assert f.read() == "just testing around here\n"
| Test file reading for current view | Test file reading for current view
| Python | apache-2.0 | PressLabs/gitfs,ksmaheshkumar/gitfs,bussiere/gitfs,rowhit/gitfs,PressLabs/gitfs | python | ## Code Before:
import os
from tests.integrations.base import BaseTest
class TestReadCurrentView(BaseTest):
def test_listdirs(self):
assert os.listdir("%s/current" % self.mount_path) == ['testing', 'me']
## Instruction:
Test file reading for current view
## Code After:
import os
from tests.integrations.base import BaseTest
class TestReadCurrentView(BaseTest):
def test_listdirs(self):
assert os.listdir("%s/current" % self.mount_path) == ['testing', 'me']
def test_read_from_a_file(self):
with open("%s/current/testing" % self.mount_path) as f:
assert f.read() == "just testing around here\n"
| import os
from tests.integrations.base import BaseTest
class TestReadCurrentView(BaseTest):
def test_listdirs(self):
assert os.listdir("%s/current" % self.mount_path) == ['testing', 'me']
+
+ def test_read_from_a_file(self):
+ with open("%s/current/testing" % self.mount_path) as f:
+ assert f.read() == "just testing around here\n" | 4 | 0.5 | 4 | 0 |
0673f90f67bc7ad35471d1d7b19a1535c7d611d4 | src/compiler/reia_ssa.erl | src/compiler/reia_ssa.erl | -module(reia_ssa).
-export([transform/2]).
-include("reia_nodes.hrl").
-include("reia_compile_options.hrl").
-include("reia_bindings.hrl").
% Lists of expressions
transform(Exprs, Options) ->
{ok, BAExprs} = reia_bindings:transform(Exprs, Options#compile_options.scope),
reia_syntax:map_subtrees(fun transform_node/1, BAExprs).
transform_node(#bindings{node=Node}) ->
reia_syntax:map_subtrees(fun transform_node/1, Node);
transform_node(Node) ->
reia_syntax:map_subtrees(fun transform_node/1, Node). | -module(reia_ssa).
-export([transform/2]).
-include("reia_nodes.hrl").
-include("reia_compile_options.hrl").
-include("reia_bindings.hrl").
% Lists of expressions
transform(Exprs, Options) ->
{ok, BAExprs} = reia_bindings:transform(Exprs, Options#compile_options.scope),
reia_syntax:map_subtrees(fun transform_node/1, BAExprs).
transform_node(#bindings{node=#identifier{line=Line, name=Name}, entries=Bindings}) ->
case dict:find(Name, Bindings) of
{ok, Version} ->
#identifier{line=Line, name=ssa_name(Name, Version)};
error ->
throw({error, {Line, lists:flatten(io_lib:format("unbound variable: '~s'", [Name]))}})
end;
transform_node(#bindings{node=Node}) ->
reia_syntax:map_subtrees(fun transform_node/1, Node);
transform_node(Node) ->
reia_syntax:map_subtrees(fun transform_node/1, Node).
% Generate the SSA name for a given variable, which takes the form name_version
ssa_name(Name, Version) ->
Name2 = lists:flatten(io_lib:format("~s_~w", [Name, Version])),
list_to_atom(Name2). | Append version numbers to the ends of variable names. Hello destructive assignment! | Append version numbers to the ends of variable names. Hello destructive assignment!
| Erlang | mit | tarcieri/reia,beni55/reia,beni55/reia,tarcieri/reia | erlang | ## Code Before:
-module(reia_ssa).
-export([transform/2]).
-include("reia_nodes.hrl").
-include("reia_compile_options.hrl").
-include("reia_bindings.hrl").
% Lists of expressions
transform(Exprs, Options) ->
{ok, BAExprs} = reia_bindings:transform(Exprs, Options#compile_options.scope),
reia_syntax:map_subtrees(fun transform_node/1, BAExprs).
transform_node(#bindings{node=Node}) ->
reia_syntax:map_subtrees(fun transform_node/1, Node);
transform_node(Node) ->
reia_syntax:map_subtrees(fun transform_node/1, Node).
## Instruction:
Append version numbers to the ends of variable names. Hello destructive assignment!
## Code After:
-module(reia_ssa).
-export([transform/2]).
-include("reia_nodes.hrl").
-include("reia_compile_options.hrl").
-include("reia_bindings.hrl").
% Lists of expressions
transform(Exprs, Options) ->
{ok, BAExprs} = reia_bindings:transform(Exprs, Options#compile_options.scope),
reia_syntax:map_subtrees(fun transform_node/1, BAExprs).
transform_node(#bindings{node=#identifier{line=Line, name=Name}, entries=Bindings}) ->
case dict:find(Name, Bindings) of
{ok, Version} ->
#identifier{line=Line, name=ssa_name(Name, Version)};
error ->
throw({error, {Line, lists:flatten(io_lib:format("unbound variable: '~s'", [Name]))}})
end;
transform_node(#bindings{node=Node}) ->
reia_syntax:map_subtrees(fun transform_node/1, Node);
transform_node(Node) ->
reia_syntax:map_subtrees(fun transform_node/1, Node).
% Generate the SSA name for a given variable, which takes the form name_version
ssa_name(Name, Version) ->
Name2 = lists:flatten(io_lib:format("~s_~w", [Name, Version])),
list_to_atom(Name2). | -module(reia_ssa).
-export([transform/2]).
-include("reia_nodes.hrl").
-include("reia_compile_options.hrl").
-include("reia_bindings.hrl").
% Lists of expressions
transform(Exprs, Options) ->
{ok, BAExprs} = reia_bindings:transform(Exprs, Options#compile_options.scope),
reia_syntax:map_subtrees(fun transform_node/1, BAExprs).
+ transform_node(#bindings{node=#identifier{line=Line, name=Name}, entries=Bindings}) ->
+ case dict:find(Name, Bindings) of
+ {ok, Version} ->
+ #identifier{line=Line, name=ssa_name(Name, Version)};
+ error ->
+ throw({error, {Line, lists:flatten(io_lib:format("unbound variable: '~s'", [Name]))}})
+ end;
transform_node(#bindings{node=Node}) ->
reia_syntax:map_subtrees(fun transform_node/1, Node);
transform_node(Node) ->
reia_syntax:map_subtrees(fun transform_node/1, Node).
+
+ % Generate the SSA name for a given variable, which takes the form name_version
+ ssa_name(Name, Version) ->
+ Name2 = lists:flatten(io_lib:format("~s_~w", [Name, Version])),
+ list_to_atom(Name2). | 12 | 0.8 | 12 | 0 |
996f6b8ef739d962f538864d8b08673246335fed | app/views/metrics/overview.html.erb | app/views/metrics/overview.html.erb | <h1>Metrics</h1>
<div class="row">
<div class="span6">
<form class="form-inline" action="" method="post">
<fieldset>
<label for="repository">Repository</label>
<select name="repository">
<% for repository in @repositories %>
<option <%= selected?(repository.name, params[:repository])
%>><%= repository.name %></option>
<% end %>
</select>
<button type="submit" class="btn">Select</button>
</fieldset>
</form>
</div>
</div>
<div class="row center">
<div class="span12 dashboard">
<div class="row">
<div class="span4">
<strong>Completeness</strong>
<div id="completeness-meter" class="metric">
</div>
</div>
<div id="weighted-completeness-meter" class="span4">
<strong>Weighted Completeness</strong>
<div class="metric">
</div>
</div>
<div id="richness-of-information-meter" class="span4">
<strong>Richness of Information</strong>
<div class="metric">
</div>
</div>
</div>
<div class="row">
<div class="span4">
<strong>Accuracy</strong>
<div id="accuracy-meter" class="metric">
</div>
</div>
</div>
</div>
| <h1>Metrics</h1>
<div class="row">
<div class="span6">
<form class="form-inline" action="" method="post">
<fieldset>
<label for="repository">Repository</label>
<select name="repository">
<% for repository in @repositories %>
<option <%= selected?(repository.name, params[:repository])
%>><%= repository.name %></option>
<% end %>
</select>
<!-- <button type="submit" class="btn">Select</button> --!>
</fieldset>
</form>
</div>
</div>
<div class="row center">
<div class="span12 dashboard">
<div class="row">
<div class="span4">
<strong>Completeness</strong>
<div id="completeness-meter" class="metric">
</div>
</div>
<div id="weighted-completeness-meter" class="span4">
<strong>Weighted Completeness</strong>
<div class="metric">
</div>
</div>
<div id="richness-of-information-meter" class="span4">
<strong>Richness of Information</strong>
<div class="metric">
</div>
</div>
</div>
<div class="row">
<div class="span4">
<strong><a href="/metrics/accuracy">Accuracy</a></strong>
<div id="accuracy-meter" class="metric">
</div>
</div>
</div>
</div>
| Remove repository submit button temporarily | Remove repository submit button temporarily
I just noticed that I do not need the repository submit button on the
metrics dashboard. After all the current repository is read dynamically
with JavaScript. I will add it a later point when the metric scores are
loaded from the database.
Signed-off-by: Konrad Reiche <4ff0213f56e2082fcd8c882d04c546881c579ce4@gmail.com>
| HTML+ERB | mit | platzhirsch/metadata-census | html+erb | ## Code Before:
<h1>Metrics</h1>
<div class="row">
<div class="span6">
<form class="form-inline" action="" method="post">
<fieldset>
<label for="repository">Repository</label>
<select name="repository">
<% for repository in @repositories %>
<option <%= selected?(repository.name, params[:repository])
%>><%= repository.name %></option>
<% end %>
</select>
<button type="submit" class="btn">Select</button>
</fieldset>
</form>
</div>
</div>
<div class="row center">
<div class="span12 dashboard">
<div class="row">
<div class="span4">
<strong>Completeness</strong>
<div id="completeness-meter" class="metric">
</div>
</div>
<div id="weighted-completeness-meter" class="span4">
<strong>Weighted Completeness</strong>
<div class="metric">
</div>
</div>
<div id="richness-of-information-meter" class="span4">
<strong>Richness of Information</strong>
<div class="metric">
</div>
</div>
</div>
<div class="row">
<div class="span4">
<strong>Accuracy</strong>
<div id="accuracy-meter" class="metric">
</div>
</div>
</div>
</div>
## Instruction:
Remove repository submit button temporarily
I just noticed that I do not need the repository submit button on the
metrics dashboard. After all the current repository is read dynamically
with JavaScript. I will add it a later point when the metric scores are
loaded from the database.
Signed-off-by: Konrad Reiche <4ff0213f56e2082fcd8c882d04c546881c579ce4@gmail.com>
## Code After:
<h1>Metrics</h1>
<div class="row">
<div class="span6">
<form class="form-inline" action="" method="post">
<fieldset>
<label for="repository">Repository</label>
<select name="repository">
<% for repository in @repositories %>
<option <%= selected?(repository.name, params[:repository])
%>><%= repository.name %></option>
<% end %>
</select>
<!-- <button type="submit" class="btn">Select</button> --!>
</fieldset>
</form>
</div>
</div>
<div class="row center">
<div class="span12 dashboard">
<div class="row">
<div class="span4">
<strong>Completeness</strong>
<div id="completeness-meter" class="metric">
</div>
</div>
<div id="weighted-completeness-meter" class="span4">
<strong>Weighted Completeness</strong>
<div class="metric">
</div>
</div>
<div id="richness-of-information-meter" class="span4">
<strong>Richness of Information</strong>
<div class="metric">
</div>
</div>
</div>
<div class="row">
<div class="span4">
<strong><a href="/metrics/accuracy">Accuracy</a></strong>
<div id="accuracy-meter" class="metric">
</div>
</div>
</div>
</div>
| <h1>Metrics</h1>
<div class="row">
<div class="span6">
<form class="form-inline" action="" method="post">
<fieldset>
<label for="repository">Repository</label>
<select name="repository">
<% for repository in @repositories %>
<option <%= selected?(repository.name, params[:repository])
%>><%= repository.name %></option>
<% end %>
</select>
- <button type="submit" class="btn">Select</button>
+ <!-- <button type="submit" class="btn">Select</button> --!>
? +++++ +++++
</fieldset>
</form>
</div>
</div>
<div class="row center">
<div class="span12 dashboard">
<div class="row">
<div class="span4">
<strong>Completeness</strong>
<div id="completeness-meter" class="metric">
</div>
</div>
<div id="weighted-completeness-meter" class="span4">
<strong>Weighted Completeness</strong>
<div class="metric">
</div>
</div>
<div id="richness-of-information-meter" class="span4">
<strong>Richness of Information</strong>
<div class="metric">
</div>
</div>
</div>
<div class="row">
<div class="span4">
- <strong>Accuracy</strong>
+ <strong><a href="/metrics/accuracy">Accuracy</a></strong>
<div id="accuracy-meter" class="metric">
</div>
</div>
</div>
</div> | 4 | 0.088889 | 2 | 2 |
b6d3c27c4c3405ac1a0d0bcbbf1631a6b210e581 | README.md | README.md | MarkdownCodeBlockWrapper
===========
A simple helper for wrapping Github Flavored Markdown Code Block.
Using GFM code block, fenced code block, it's required to keep typing the little backtick (**`**) six times to wrap the code. And also an optional language identifier for syntax highlighting.
It would be nice if you just need to select the code block, press command shortcut, type the optional syntax highlighting language and done. This helper wraps for you to save the typing on backtick.
| MarkdownCodeBlockWrapper
===========
A simple helper for wrapping Github Flavored Markdown Code Block.
Using GFM code block, fenced code block, it's required to keep typing the little backtick (**`**) six times to wrap the code. And also an optional language identifier for syntax highlighting.
It would be nice if you just need to select the code block, press command shortcut, type the optional syntax highlighting language and done. This helper wraps for you to save the typing on backtick.
_Notes: If you use Command Palette instead of directly using hot-key `ctrl+alt+c` to call up the command, you need to type in `mdcode` instead of full name `Markdown`. Thanks @sambody for reminder._
| Add reminder for using mdcode in command palette | Add reminder for using mdcode in command palette
| Markdown | mit | kenspirit/MarkdownCodeBlockWrapper,kenspirit/MarkdownCodeBlockWrapper | markdown | ## Code Before:
MarkdownCodeBlockWrapper
===========
A simple helper for wrapping Github Flavored Markdown Code Block.
Using GFM code block, fenced code block, it's required to keep typing the little backtick (**`**) six times to wrap the code. And also an optional language identifier for syntax highlighting.
It would be nice if you just need to select the code block, press command shortcut, type the optional syntax highlighting language and done. This helper wraps for you to save the typing on backtick.
## Instruction:
Add reminder for using mdcode in command palette
## Code After:
MarkdownCodeBlockWrapper
===========
A simple helper for wrapping Github Flavored Markdown Code Block.
Using GFM code block, fenced code block, it's required to keep typing the little backtick (**`**) six times to wrap the code. And also an optional language identifier for syntax highlighting.
It would be nice if you just need to select the code block, press command shortcut, type the optional syntax highlighting language and done. This helper wraps for you to save the typing on backtick.
_Notes: If you use Command Palette instead of directly using hot-key `ctrl+alt+c` to call up the command, you need to type in `mdcode` instead of full name `Markdown`. Thanks @sambody for reminder._
| MarkdownCodeBlockWrapper
===========
A simple helper for wrapping Github Flavored Markdown Code Block.
Using GFM code block, fenced code block, it's required to keep typing the little backtick (**`**) six times to wrap the code. And also an optional language identifier for syntax highlighting.
It would be nice if you just need to select the code block, press command shortcut, type the optional syntax highlighting language and done. This helper wraps for you to save the typing on backtick.
+
+ _Notes: If you use Command Palette instead of directly using hot-key `ctrl+alt+c` to call up the command, you need to type in `mdcode` instead of full name `Markdown`. Thanks @sambody for reminder._ | 2 | 0.25 | 2 | 0 |
eab60f42e311a06c380d8fcafb7c799d14195569 | app/views/layouts/application.html.haml | app/views/layouts/application.html.haml | !!! 5
%html
%head
%title Photeasy
= csrf_meta_tags
= stylesheet_link_tag 'main'
= javascript_include_tag 'vendor/requirejs/require', 'data-main' => '/assets/main.js'
= javascript_include_tag '//use.typekit.net/ydd6wgd.js'
:javascript
try{Typekit.load();}catch(e){}
%body
#wrap
%header#header
%section#main
#pages
= yield
%footer#footer
#overlay
= javascript_include_tag "//js.pusher.com/#{ENV['PUSHER_VERSION']}/pusher.min.js"
- if Rails.env.development?
:javascript
// Enable pusher logging - don't include this in production
Pusher.log = function(message) {
if (window.console && window.console.log) window.console.log(message);
};
:javascript
var pusher = new Pusher("#{Pusher.key}");
// var channel = pusher.subscribe('test_channel');
// channel.bind('greet', function(data) {
// alert(data.greeting);
// });
- if current_user.present?
:javascript
window.current_user = #{current_user.as_json} | !!! 5
%html
%head
%title Photeasy
= csrf_meta_tags
= stylesheet_link_tag 'main'
= javascript_include_tag 'vendor/requirejs/require', 'data-main' => '/assets/main.js'
= javascript_include_tag '//use.typekit.net/ydd6wgd.js'
:javascript
try{Typekit.load();}catch(e){}
%body
#wrap
%header#header
%section#main
#pages
= yield
%footer#footer
#overlay
= javascript_include_tag "//js.pusher.com/#{ENV['PUSHER_VERSION']}/pusher.min.js"
- if Rails.env.development?
:javascript
// Enable pusher logging - don't include this in production
Pusher.log = function(message) {
if (window.console && window.console.log) window.console.log(message);
};
:javascript
var pusher = new Pusher("#{Pusher.key}");
// var channel = pusher.subscribe('test_channel');
// channel.bind('greet', function(data) {
// alert(data.greeting);
// });
- if user_signed_in?
:javascript
window.current_user = #{current_user.as_json} | Change user signed in conditional logic. | Change user signed in conditional logic.
| Haml | mit | kevinthompson/photeasy,kevinthompson/photeasy | haml | ## Code Before:
!!! 5
%html
%head
%title Photeasy
= csrf_meta_tags
= stylesheet_link_tag 'main'
= javascript_include_tag 'vendor/requirejs/require', 'data-main' => '/assets/main.js'
= javascript_include_tag '//use.typekit.net/ydd6wgd.js'
:javascript
try{Typekit.load();}catch(e){}
%body
#wrap
%header#header
%section#main
#pages
= yield
%footer#footer
#overlay
= javascript_include_tag "//js.pusher.com/#{ENV['PUSHER_VERSION']}/pusher.min.js"
- if Rails.env.development?
:javascript
// Enable pusher logging - don't include this in production
Pusher.log = function(message) {
if (window.console && window.console.log) window.console.log(message);
};
:javascript
var pusher = new Pusher("#{Pusher.key}");
// var channel = pusher.subscribe('test_channel');
// channel.bind('greet', function(data) {
// alert(data.greeting);
// });
- if current_user.present?
:javascript
window.current_user = #{current_user.as_json}
## Instruction:
Change user signed in conditional logic.
## Code After:
!!! 5
%html
%head
%title Photeasy
= csrf_meta_tags
= stylesheet_link_tag 'main'
= javascript_include_tag 'vendor/requirejs/require', 'data-main' => '/assets/main.js'
= javascript_include_tag '//use.typekit.net/ydd6wgd.js'
:javascript
try{Typekit.load();}catch(e){}
%body
#wrap
%header#header
%section#main
#pages
= yield
%footer#footer
#overlay
= javascript_include_tag "//js.pusher.com/#{ENV['PUSHER_VERSION']}/pusher.min.js"
- if Rails.env.development?
:javascript
// Enable pusher logging - don't include this in production
Pusher.log = function(message) {
if (window.console && window.console.log) window.console.log(message);
};
:javascript
var pusher = new Pusher("#{Pusher.key}");
// var channel = pusher.subscribe('test_channel');
// channel.bind('greet', function(data) {
// alert(data.greeting);
// });
- if user_signed_in?
:javascript
window.current_user = #{current_user.as_json} | !!! 5
%html
%head
%title Photeasy
= csrf_meta_tags
= stylesheet_link_tag 'main'
= javascript_include_tag 'vendor/requirejs/require', 'data-main' => '/assets/main.js'
= javascript_include_tag '//use.typekit.net/ydd6wgd.js'
:javascript
- try{Typekit.load();}catch(e){}
? -
+ try{Typekit.load();}catch(e){}
%body
#wrap
%header#header
%section#main
#pages
= yield
%footer#footer
#overlay
= javascript_include_tag "//js.pusher.com/#{ENV['PUSHER_VERSION']}/pusher.min.js"
- if Rails.env.development?
:javascript
// Enable pusher logging - don't include this in production
Pusher.log = function(message) {
if (window.console && window.console.log) window.console.log(message);
};
:javascript
var pusher = new Pusher("#{Pusher.key}");
// var channel = pusher.subscribe('test_channel');
// channel.bind('greet', function(data) {
// alert(data.greeting);
// });
- - if current_user.present?
+ - if user_signed_in?
:javascript
window.current_user = #{current_user.as_json} | 4 | 0.114286 | 2 | 2 |
7db4b7076444d8356044d0c120d267094b068c4c | circle.yml | circle.yml | test:
override:
- npm run style
- npm run test-ui
- npm run test-lib
post:
- npm run coverage-ui && ./node_modules/.bin/codecov --file=./coverage/json/coverage-final.json
| test:
override:
- nvm use 5 && npm run test-lib
- nvm use 4 && npm run test-lib
- nvm use 0.10 && npm run test-lib
- npm run style
- npm run test-ui
post:
- npm run coverage-ui && ./node_modules/.bin/codecov --file=./coverage/json/coverage-final.json
| Add node versions to CI. | Add node versions to CI.
| YAML | mit | christophercliff/flatmarket,christophercliff/flatmarket | yaml | ## Code Before:
test:
override:
- npm run style
- npm run test-ui
- npm run test-lib
post:
- npm run coverage-ui && ./node_modules/.bin/codecov --file=./coverage/json/coverage-final.json
## Instruction:
Add node versions to CI.
## Code After:
test:
override:
- nvm use 5 && npm run test-lib
- nvm use 4 && npm run test-lib
- nvm use 0.10 && npm run test-lib
- npm run style
- npm run test-ui
post:
- npm run coverage-ui && ./node_modules/.bin/codecov --file=./coverage/json/coverage-final.json
| test:
override:
+ - nvm use 5 && npm run test-lib
+ - nvm use 4 && npm run test-lib
+ - nvm use 0.10 && npm run test-lib
- npm run style
- npm run test-ui
- - npm run test-lib
post:
- npm run coverage-ui && ./node_modules/.bin/codecov --file=./coverage/json/coverage-final.json | 4 | 0.571429 | 3 | 1 |
86406f855555bf31664a3a1160560932c8bb7374 | packages/gtk-webcore/osb-nrcore_svn.bb | packages/gtk-webcore/osb-nrcore_svn.bb | require osb-nrcore.inc
DEFAULT_PREFERENCE = "-1"
PV = "0.5.2+svn${SRCDATE}"
PR = "r0"
SRC_URI = "svn://gtk-webcore.svn.sourceforge.net/svnroot/gtk-webcore/trunk;module=NRCore;proto=https \
file://gcc4-fno-threadsafe-statics-NRCore.patch;patch=1 \
file://build_silence.patch;patch=0;maxdate=20070401"
S = "${WORKDIR}/NRCore"
| require osb-nrcore.inc
DEFAULT_PREFERENCE = "-1"
PV = "0.5.2+svn${SRCDATE}"
PR = "r0"
SRC_URI = "svn://gtk-webcore.svn.sourceforge.net/svnroot/gtk-webcore/trunk;module=NRCore;proto=https \
file://gcc4-fno-threadsafe-statics-NRCore.patch;patch=1 \
file://build_silence.patch;patch=0;maxdate=20070401"
S = "${WORKDIR}/NRCore"
do_stage () {
oe_libinstall -so libgtk_webcore_nrcore ${STAGING_LIBDIR}
oe_libinstall -so -C kwiq libgtk_webcore_nrcore_kwiq_gtk ${STAGING_LIBDIR}
autotools_stage_includes
install -d ${STAGING_INCDIR}/osb/NRCore
for i in ${S}/kwiq/WebCore*.h ${S}/kwiq/KWIQ*.h; do
install -m 0644 $i ${STAGING_INCDIR}/osb/NRCore
done
}
| Update to build latest svn trunk. | osb-nrcore: Update to build latest svn trunk.
| BitBake | mit | KDAB/OpenEmbedded-Archos,libo/openembedded,giobauermeister/openembedded,xifengchuo/openembedded,troth/oe-ts7xxx,openembedded/openembedded,Martix/Eonos,dave-billin/overo-ui-moos-auv,openembedded/openembedded,libo/openembedded,sutajiokousagi/openembedded,hulifox008/openembedded,SIFTeam/openembedded,nx111/openembeded_openpli2.1_nx111,crystalfontz/openembedded,rascalmicro/openembedded-rascal,thebohemian/openembedded,libo/openembedded,scottellis/overo-oe,demsey/openembedded,sledz/oe,xifengchuo/openembedded,bticino/openembedded,demsey/openenigma2,troth/oe-ts7xxx,JrCs/opendreambox,trini/openembedded,buglabs/oe-buglabs,hulifox008/openembedded,JamesAng/goe,SIFTeam/openembedded,thebohemian/openembedded,dave-billin/overo-ui-moos-auv,SIFTeam/openembedded,popazerty/openembedded-cuberevo,sledz/oe,xifengchuo/openembedded,anguslees/openembedded-android,popazerty/openembedded-cuberevo,hulifox008/openembedded,dave-billin/overo-ui-moos-auv,troth/oe-ts7xxx,sledz/oe,John-NY/overo-oe,demsey/openenigma2,dave-billin/overo-ui-moos-auv,hulifox008/openembedded,troth/oe-ts7xxx,thebohemian/openembedded,YtvwlD/od-oe,nx111/openembeded_openpli2.1_nx111,BlackPole/bp-openembedded,yyli/overo-oe,demsey/openembedded,libo/openembedded,YtvwlD/od-oe,rascalmicro/openembedded-rascal,mrchapp/arago-oe-dev,YtvwlD/od-oe,JamesAng/oe,nlebedenco/mini2440,JamesAng/oe,demsey/openembedded,JamesAng/oe,dellysunnymtech/sakoman-oe,crystalfontz/openembedded,anguslees/openembedded-android,crystalfontz/openembedded,BlackPole/bp-openembedded,mrchapp/arago-oe-dev,crystalfontz/openembedded,demsey/openembedded,trini/openembedded,YtvwlD/od-oe,troth/oe-ts7xxx,dellysunnymtech/sakoman-oe,nvl1109/openembeded,John-NY/overo-oe,philb/pbcl-oe-2010,yyli/overo-oe,buglabs/oe-buglabs,buglabs/oe-buglabs,thebohemian/openembedded,SIFTeam/openembedded,mrchapp/arago-oe-dev,xifengchuo/openembedded,mrchapp/arago-oe-dev,BlackPole/bp-openembedded,popazerty/openembedded-cuberevo,JrCs/opendreambox,John-NY/overo-oe,KDAB/OpenEmbedded-Archos,giobauermeister/openembedded,JamesAng/goe,Martix/Eonos,giobauermeister/openembedded,openpli-arm/openembedded,openpli-arm/openembedded,YtvwlD/od-oe,libo/openembedded,sentient-energy/emsw-oe-mirror,scottellis/overo-oe,John-NY/overo-oe,scottellis/overo-oe,nzjrs/overo-openembedded,troth/oe-ts7xxx,demsey/openenigma2,trini/openembedded,dellysunnymtech/sakoman-oe,hulifox008/openembedded,mrchapp/arago-oe-dev,thebohemian/openembedded,demsey/openenigma2,JamesAng/oe,nlebedenco/mini2440,bticino/openembedded,JamesAng/oe,demsey/openembedded,nlebedenco/mini2440,BlackPole/bp-openembedded,BlackPole/bp-openembedded,JrCs/opendreambox,bticino/openembedded,buglabs/oe-buglabs,bticino/openembedded,nlebedenco/mini2440,sampov2/audio-openembedded,xifengchuo/openembedded,Martix/Eonos,dellysunnymtech/sakoman-oe,xifengchuo/openembedded,thebohemian/openembedded,bticino/openembedded,sampov2/audio-openembedded,dellysunnymtech/sakoman-oe,nvl1109/openembeded,JrCs/opendreambox,John-NY/overo-oe,yyli/overo-oe,anguslees/openembedded-android,troth/oe-ts7xxx,sentient-energy/emsw-oe-mirror,JamesAng/oe,nzjrs/overo-openembedded,yyli/overo-oe,yyli/overo-oe,nlebedenco/mini2440,scottellis/overo-oe,Martix/Eonos,philb/pbcl-oe-2010,demsey/openenigma2,popazerty/openembedded-cuberevo,JrCs/opendreambox,anguslees/openembedded-android,sentient-energy/emsw-oe-mirror,JamesAng/goe,anguslees/openembedded-android,nvl1109/openembeded,mrchapp/arago-oe-dev,crystalfontz/openembedded,philb/pbcl-oe-2010,dave-billin/overo-ui-moos-auv,sampov2/audio-openembedded,KDAB/OpenEmbedded-Archos,nzjrs/overo-openembedded,SIFTeam/openembedded,nvl1109/openembeded,trini/openembedded,trini/openembedded,rascalmicro/openembedded-rascal,sledz/oe,BlackPole/bp-openembedded,anguslees/openembedded-android,yyli/overo-oe,xifengchuo/openembedded,JrCs/opendreambox,nvl1109/openembeded,JamesAng/goe,scottellis/overo-oe,KDAB/OpenEmbedded-Archos,JamesAng/goe,rascalmicro/openembedded-rascal,sledz/oe,Martix/Eonos,openembedded/openembedded,openpli-arm/openembedded,JamesAng/goe,sentient-energy/emsw-oe-mirror,nx111/openembeded_openpli2.1_nx111,dave-billin/overo-ui-moos-auv,giobauermeister/openembedded,openpli-arm/openembedded,rascalmicro/openembedded-rascal,xifengchuo/openembedded,sampov2/audio-openembedded,thebohemian/openembedded,KDAB/OpenEmbedded-Archos,openembedded/openembedded,sledz/oe,bticino/openembedded,nx111/openembeded_openpli2.1_nx111,sentient-energy/emsw-oe-mirror,giobauermeister/openembedded,Martix/Eonos,giobauermeister/openembedded,trini/openembedded,popazerty/openembedded-cuberevo,buglabs/oe-buglabs,demsey/openembedded,JamesAng/goe,dave-billin/overo-ui-moos-auv,nzjrs/overo-openembedded,buglabs/oe-buglabs,sampov2/audio-openembedded,demsey/openembedded,KDAB/OpenEmbedded-Archos,popazerty/openembedded-cuberevo,openembedded/openembedded,JrCs/opendreambox,hulifox008/openembedded,giobauermeister/openembedded,sutajiokousagi/openembedded,crystalfontz/openembedded,KDAB/OpenEmbedded-Archos,demsey/openenigma2,rascalmicro/openembedded-rascal,nx111/openembeded_openpli2.1_nx111,openembedded/openembedded,yyli/overo-oe,nzjrs/overo-openembedded,openpli-arm/openembedded,dellysunnymtech/sakoman-oe,mrchapp/arago-oe-dev,openembedded/openembedded,dellysunnymtech/sakoman-oe,buglabs/oe-buglabs,nvl1109/openembeded,scottellis/overo-oe,philb/pbcl-oe-2010,sutajiokousagi/openembedded,openembedded/openembedded,JrCs/opendreambox,openembedded/openembedded,hulifox008/openembedded,JamesAng/oe,nx111/openembeded_openpli2.1_nx111,yyli/overo-oe,sampov2/audio-openembedded,philb/pbcl-oe-2010,dellysunnymtech/sakoman-oe,rascalmicro/openembedded-rascal,libo/openembedded,openpli-arm/openembedded,nvl1109/openembeded,giobauermeister/openembedded,SIFTeam/openembedded,sutajiokousagi/openembedded,Martix/Eonos,sentient-energy/emsw-oe-mirror,bticino/openembedded,anguslees/openembedded-android,sutajiokousagi/openembedded,John-NY/overo-oe,crystalfontz/openembedded,xifengchuo/openembedded,sutajiokousagi/openembedded,BlackPole/bp-openembedded,sentient-energy/emsw-oe-mirror,sledz/oe,philb/pbcl-oe-2010,openpli-arm/openembedded,sampov2/audio-openembedded,demsey/openenigma2,nlebedenco/mini2440,libo/openembedded,nzjrs/overo-openembedded,John-NY/overo-oe,giobauermeister/openembedded,SIFTeam/openembedded,rascalmicro/openembedded-rascal,nzjrs/overo-openembedded,nx111/openembeded_openpli2.1_nx111,philb/pbcl-oe-2010,scottellis/overo-oe,popazerty/openembedded-cuberevo,sutajiokousagi/openembedded,trini/openembedded,YtvwlD/od-oe,openembedded/openembedded,YtvwlD/od-oe,nx111/openembeded_openpli2.1_nx111,JrCs/opendreambox,nlebedenco/mini2440,dellysunnymtech/sakoman-oe,openembedded/openembedded,YtvwlD/od-oe,popazerty/openembedded-cuberevo,buglabs/oe-buglabs | bitbake | ## Code Before:
require osb-nrcore.inc
DEFAULT_PREFERENCE = "-1"
PV = "0.5.2+svn${SRCDATE}"
PR = "r0"
SRC_URI = "svn://gtk-webcore.svn.sourceforge.net/svnroot/gtk-webcore/trunk;module=NRCore;proto=https \
file://gcc4-fno-threadsafe-statics-NRCore.patch;patch=1 \
file://build_silence.patch;patch=0;maxdate=20070401"
S = "${WORKDIR}/NRCore"
## Instruction:
osb-nrcore: Update to build latest svn trunk.
## Code After:
require osb-nrcore.inc
DEFAULT_PREFERENCE = "-1"
PV = "0.5.2+svn${SRCDATE}"
PR = "r0"
SRC_URI = "svn://gtk-webcore.svn.sourceforge.net/svnroot/gtk-webcore/trunk;module=NRCore;proto=https \
file://gcc4-fno-threadsafe-statics-NRCore.patch;patch=1 \
file://build_silence.patch;patch=0;maxdate=20070401"
S = "${WORKDIR}/NRCore"
do_stage () {
oe_libinstall -so libgtk_webcore_nrcore ${STAGING_LIBDIR}
oe_libinstall -so -C kwiq libgtk_webcore_nrcore_kwiq_gtk ${STAGING_LIBDIR}
autotools_stage_includes
install -d ${STAGING_INCDIR}/osb/NRCore
for i in ${S}/kwiq/WebCore*.h ${S}/kwiq/KWIQ*.h; do
install -m 0644 $i ${STAGING_INCDIR}/osb/NRCore
done
}
| require osb-nrcore.inc
DEFAULT_PREFERENCE = "-1"
PV = "0.5.2+svn${SRCDATE}"
PR = "r0"
SRC_URI = "svn://gtk-webcore.svn.sourceforge.net/svnroot/gtk-webcore/trunk;module=NRCore;proto=https \
file://gcc4-fno-threadsafe-statics-NRCore.patch;patch=1 \
file://build_silence.patch;patch=0;maxdate=20070401"
S = "${WORKDIR}/NRCore"
+ do_stage () {
+ oe_libinstall -so libgtk_webcore_nrcore ${STAGING_LIBDIR}
+ oe_libinstall -so -C kwiq libgtk_webcore_nrcore_kwiq_gtk ${STAGING_LIBDIR}
+
+ autotools_stage_includes
+
+ install -d ${STAGING_INCDIR}/osb/NRCore
+ for i in ${S}/kwiq/WebCore*.h ${S}/kwiq/KWIQ*.h; do
+ install -m 0644 $i ${STAGING_INCDIR}/osb/NRCore
+ done
+ } | 11 | 0.846154 | 11 | 0 |
c2108babd382cc0e65c763981a8780eec35ac09b | spec/web/controllers/users/show_spec.rb | spec/web/controllers/users/show_spec.rb | require_relative '../../../../apps/web/controllers/users/show'
RSpec.describe Web::Controllers::Users::Show do
let(:action) { described_class.new }
let(:user) { Fabricate.create(:user, name: 'Anton', login: 'davydovanton') }
let(:params) { { id: user.login } }
after do
TaskRepository.new.clear
UserRepository.new.clear
end
it { expect(action.call(params)).to be_success }
context 'when user not found' do
let(:params) { { id: 'empty' } }
it { expect(action.call(params)).to redirect_to('/') }
end
describe 'expose' do
context '#user' do
it 'returns user by login' do
action.call(params)
expect(action.user).to be_a(User)
expect(action.user.id).to eq user.id
expect(action.user.tasks).to_not be nil
end
end
end
end
| require_relative '../../../../apps/web/controllers/users/show'
RSpec.describe Web::Controllers::Users::Show do
let(:action) { described_class.new }
let(:user) { Fabricate.create(:user, name: 'Anton', login: 'davydovanton') }
let(:params) { { id: user.login } }
before do
TaskRepository.new.clear
UserRepository.new.clear
end
after do
TaskRepository.new.clear
UserRepository.new.clear
end
it { expect(action.call(params)).to be_success }
context 'when user not found' do
let(:params) { { id: 'empty' } }
it { expect(action.call(params)).to redirect_to('/') }
end
describe 'expose' do
context '#user' do
it 'returns user by login' do
action.call(params)
expect(action.user).to be_a(User)
expect(action.user.id).to eq user.id
expect(action.user.tasks).to_not be nil
end
end
end
end
| Drop flaky spec in user show action | Drop flaky spec in user show action
| Ruby | mit | ossboard-org/ossboard,davydovanton/ossboard,davydovanton/ossboard,davydovanton/ossboard,ossboard-org/ossboard,ossboard-org/ossboard | ruby | ## Code Before:
require_relative '../../../../apps/web/controllers/users/show'
RSpec.describe Web::Controllers::Users::Show do
let(:action) { described_class.new }
let(:user) { Fabricate.create(:user, name: 'Anton', login: 'davydovanton') }
let(:params) { { id: user.login } }
after do
TaskRepository.new.clear
UserRepository.new.clear
end
it { expect(action.call(params)).to be_success }
context 'when user not found' do
let(:params) { { id: 'empty' } }
it { expect(action.call(params)).to redirect_to('/') }
end
describe 'expose' do
context '#user' do
it 'returns user by login' do
action.call(params)
expect(action.user).to be_a(User)
expect(action.user.id).to eq user.id
expect(action.user.tasks).to_not be nil
end
end
end
end
## Instruction:
Drop flaky spec in user show action
## Code After:
require_relative '../../../../apps/web/controllers/users/show'
RSpec.describe Web::Controllers::Users::Show do
let(:action) { described_class.new }
let(:user) { Fabricate.create(:user, name: 'Anton', login: 'davydovanton') }
let(:params) { { id: user.login } }
before do
TaskRepository.new.clear
UserRepository.new.clear
end
after do
TaskRepository.new.clear
UserRepository.new.clear
end
it { expect(action.call(params)).to be_success }
context 'when user not found' do
let(:params) { { id: 'empty' } }
it { expect(action.call(params)).to redirect_to('/') }
end
describe 'expose' do
context '#user' do
it 'returns user by login' do
action.call(params)
expect(action.user).to be_a(User)
expect(action.user.id).to eq user.id
expect(action.user.tasks).to_not be nil
end
end
end
end
| require_relative '../../../../apps/web/controllers/users/show'
RSpec.describe Web::Controllers::Users::Show do
let(:action) { described_class.new }
let(:user) { Fabricate.create(:user, name: 'Anton', login: 'davydovanton') }
let(:params) { { id: user.login } }
+
+ before do
+ TaskRepository.new.clear
+ UserRepository.new.clear
+ end
after do
TaskRepository.new.clear
UserRepository.new.clear
end
it { expect(action.call(params)).to be_success }
context 'when user not found' do
let(:params) { { id: 'empty' } }
it { expect(action.call(params)).to redirect_to('/') }
end
describe 'expose' do
context '#user' do
it 'returns user by login' do
action.call(params)
expect(action.user).to be_a(User)
expect(action.user.id).to eq user.id
expect(action.user.tasks).to_not be nil
end
end
end
end | 5 | 0.166667 | 5 | 0 |
0de5fa73f96a1c2f0effaa98670467aa48d75718 | index.jsx | index.jsx | import React, {PropTypes} from 'react';
export const Radio = React.createClass({
displayName: 'Radio',
contextTypes: {
radioGroup: React.PropTypes.object
},
render: function() {
const {name, selectedValue, onChange} = this.context.radioGroup;
const optional = {};
if(selectedValue !== undefined) {
optional.checked = (this.props.value === selectedValue);
}
if(typeof onChange === 'function') {
optional.onChange = onChange.bind(null, this.props.value);
}
return (
<input
{...this.props}
type="radio"
name={name}
{...optional} />
);
}
});
export const RadioGroup = React.createClass({
displayName: 'RadioGroup',
propTypes: {
name: PropTypes.string,
selectedValue: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
PropTypes.bool,
]),
onChange: PropTypes.func,
children: PropTypes.node.isRequired,
Component: PropTypes.oneOfType([
PropTypes.string,
PropTypes.func,
PropTypes.object,
])
},
getDefaultProps: function() {
return {
Component: "div"
};
},
childContextTypes: {
radioGroup: React.PropTypes.object
},
getChildContext: function() {
const {name, selectedValue, onChange} = this.props;
return {
radioGroup: {
name, selectedValue, onChange
}
}
},
render: function() {
const {Component, name, selectedValue, onChange, children, ...rest} = this.props;
return <Component {...rest}>{children}</Component>;
}
});
| import React, {PropTypes} from 'react';
export class Radio extends React.Component {
static displayName = 'Radio';
static contextTypes = {
radioGroup: React.PropTypes.object
};
render() {
const {name, selectedValue, onChange} = this.context.radioGroup;
const optional = {};
if(selectedValue !== undefined) {
optional.checked = (this.props.value === selectedValue);
}
if(typeof onChange === 'function') {
optional.onChange = onChange.bind(null, this.props.value);
}
return (
<input
{...this.props}
type="radio"
name={name}
{...optional} />
);
}
}
export class RadioGroup extends React.Component {
static displayName = 'RadioGroup';
static propTypes = {
name: PropTypes.string,
selectedValue: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
PropTypes.bool,
]),
onChange: PropTypes.func,
children: PropTypes.node.isRequired,
Component: PropTypes.oneOfType([
PropTypes.string,
PropTypes.func,
PropTypes.object,
])
};
static defaultProps = {
Component: "div"
};
static childContextTypes = {
radioGroup: React.PropTypes.object
};
getChildContext() {
const {name, selectedValue, onChange} = this.props;
return {
radioGroup: {
name, selectedValue, onChange
}
}
}
render() {
const {Component, name, selectedValue, onChange, children, ...rest} = this.props;
return <Component {...rest}>{children}</Component>;
}
}
| Convert to es6 class per React 15.5 deprecation warning | Convert to es6 class per React 15.5 deprecation warning
| JSX | mit | chenglou/react-radio-group,chenglou/react-radio-group | jsx | ## Code Before:
import React, {PropTypes} from 'react';
export const Radio = React.createClass({
displayName: 'Radio',
contextTypes: {
radioGroup: React.PropTypes.object
},
render: function() {
const {name, selectedValue, onChange} = this.context.radioGroup;
const optional = {};
if(selectedValue !== undefined) {
optional.checked = (this.props.value === selectedValue);
}
if(typeof onChange === 'function') {
optional.onChange = onChange.bind(null, this.props.value);
}
return (
<input
{...this.props}
type="radio"
name={name}
{...optional} />
);
}
});
export const RadioGroup = React.createClass({
displayName: 'RadioGroup',
propTypes: {
name: PropTypes.string,
selectedValue: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
PropTypes.bool,
]),
onChange: PropTypes.func,
children: PropTypes.node.isRequired,
Component: PropTypes.oneOfType([
PropTypes.string,
PropTypes.func,
PropTypes.object,
])
},
getDefaultProps: function() {
return {
Component: "div"
};
},
childContextTypes: {
radioGroup: React.PropTypes.object
},
getChildContext: function() {
const {name, selectedValue, onChange} = this.props;
return {
radioGroup: {
name, selectedValue, onChange
}
}
},
render: function() {
const {Component, name, selectedValue, onChange, children, ...rest} = this.props;
return <Component {...rest}>{children}</Component>;
}
});
## Instruction:
Convert to es6 class per React 15.5 deprecation warning
## Code After:
import React, {PropTypes} from 'react';
export class Radio extends React.Component {
static displayName = 'Radio';
static contextTypes = {
radioGroup: React.PropTypes.object
};
render() {
const {name, selectedValue, onChange} = this.context.radioGroup;
const optional = {};
if(selectedValue !== undefined) {
optional.checked = (this.props.value === selectedValue);
}
if(typeof onChange === 'function') {
optional.onChange = onChange.bind(null, this.props.value);
}
return (
<input
{...this.props}
type="radio"
name={name}
{...optional} />
);
}
}
export class RadioGroup extends React.Component {
static displayName = 'RadioGroup';
static propTypes = {
name: PropTypes.string,
selectedValue: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
PropTypes.bool,
]),
onChange: PropTypes.func,
children: PropTypes.node.isRequired,
Component: PropTypes.oneOfType([
PropTypes.string,
PropTypes.func,
PropTypes.object,
])
};
static defaultProps = {
Component: "div"
};
static childContextTypes = {
radioGroup: React.PropTypes.object
};
getChildContext() {
const {name, selectedValue, onChange} = this.props;
return {
radioGroup: {
name, selectedValue, onChange
}
}
}
render() {
const {Component, name, selectedValue, onChange, children, ...rest} = this.props;
return <Component {...rest}>{children}</Component>;
}
}
| import React, {PropTypes} from 'react';
- export const Radio = React.createClass({
+ export class Radio extends React.Component {
- displayName: 'Radio',
? ^ ^
+ static displayName = 'Radio';
? +++++++ ^^ ^
- contextTypes: {
? ^
+ static contextTypes = {
? +++++++ ^^
radioGroup: React.PropTypes.object
- },
? ^
+ };
? ^
- render: function() {
+ render() {
const {name, selectedValue, onChange} = this.context.radioGroup;
const optional = {};
if(selectedValue !== undefined) {
optional.checked = (this.props.value === selectedValue);
}
if(typeof onChange === 'function') {
optional.onChange = onChange.bind(null, this.props.value);
}
return (
<input
{...this.props}
type="radio"
name={name}
{...optional} />
);
}
- });
+ }
- export const RadioGroup = React.createClass({
+ export class RadioGroup extends React.Component {
- displayName: 'RadioGroup',
? ^ ^
+ static displayName = 'RadioGroup';
? +++++++ ^^ ^
- propTypes: {
+ static propTypes = {
name: PropTypes.string,
selectedValue: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
PropTypes.bool,
]),
onChange: PropTypes.func,
children: PropTypes.node.isRequired,
Component: PropTypes.oneOfType([
PropTypes.string,
PropTypes.func,
PropTypes.object,
])
- },
? ^
+ };
? ^
+ static defaultProps = {
- getDefaultProps: function() {
- return {
- Component: "div"
? --
+ Component: "div"
- };
? --
+ };
- },
- childContextTypes: {
? ^
+ static childContextTypes = {
? +++++++ ^^
radioGroup: React.PropTypes.object
- },
? ^
+ };
? ^
- getChildContext: function() {
? ----------
+ getChildContext() {
const {name, selectedValue, onChange} = this.props;
return {
radioGroup: {
name, selectedValue, onChange
}
}
- },
? -
+ }
- render: function() {
+ render() {
const {Component, name, selectedValue, onChange, children, ...rest} = this.props;
return <Component {...rest}>{children}</Component>;
}
- });
+ } | 40 | 0.555556 | 19 | 21 |
3c92c01af340cb850bcd0a1f2b8d348b59ad533a | views/ermfooter.html | views/ermfooter.html | <footer class="row footer">
<div class="container">
<p class="footer-text">© 2014-<script type="text/javascript">
document.write(new Date().getFullYear());
</script> University of Southern California | <a href="http://policy.usc.edu/info-privacy/">Privacy Policy</a></p>
</div>
</footer>
| <footer class="row footer">
<div class="container">
<p class="footer-text">© 2014-2017 University of Southern California</p>
</div>
</footer>
| Revert "adding js to auto update year in footer - added privacy policy" | Revert "adding js to auto update year in footer - added privacy policy"
This reverts commit 66bde76a0ac43fecab482222562e27bc8c39cb34.
| HTML | apache-2.0 | informatics-isi-edu/chaise,informatics-isi-edu/chaise,informatics-isi-edu/chaise,informatics-isi-edu/chaise | html | ## Code Before:
<footer class="row footer">
<div class="container">
<p class="footer-text">© 2014-<script type="text/javascript">
document.write(new Date().getFullYear());
</script> University of Southern California | <a href="http://policy.usc.edu/info-privacy/">Privacy Policy</a></p>
</div>
</footer>
## Instruction:
Revert "adding js to auto update year in footer - added privacy policy"
This reverts commit 66bde76a0ac43fecab482222562e27bc8c39cb34.
## Code After:
<footer class="row footer">
<div class="container">
<p class="footer-text">© 2014-2017 University of Southern California</p>
</div>
</footer>
| <footer class="row footer">
<div class="container">
+ <p class="footer-text">© 2014-2017 University of Southern California</p>
- <p class="footer-text">© 2014-<script type="text/javascript">
- document.write(new Date().getFullYear());
- </script> University of Southern California | <a href="http://policy.usc.edu/info-privacy/">Privacy Policy</a></p>
</div>
</footer> | 4 | 0.571429 | 1 | 3 |
a6fff91c97fadbdc1bc7ee7cf59134d371f5afe7 | lib/passport.js | lib/passport.js | let passport = require('passport');
let LocalStrategy = require('passport-local').Strategy;
let bcrypt = require('bcrypt-nodejs');
let _ = require('lodash');
let uuid = require('uuid/v1');
module.exports = (app, db, log) => {
app.use(passport.initialize());
app.use(passport.session());
passport.serializeUser((user, done) => {
done(null, user._id);
});
passport.deserializeUser((id, done) => {
db.get(id).then((user) => {
if (!user || !user.enabled)
done(null, false);
else
done(null, user);
}, (err) => {
if (err.error === 'not_found')
done(null, false);
else{
log.error(err);
done(err, null);
}
});
});
passport.use('login', new LocalStrategy({
passReqToCallback : true,
usernameField: 'email'
}, function (req, email, password, done) {
db.query('users/byEmail', {
key: email,
include_docs: true
}).then(_users => {
let users = _users.rows.map(r => r.doc);
if (!users.length) {
return done(null, false);
}
let user = users[0];
if (!user.enabled || !bcrypt.compareSync(password, user.password)) {
return done(null, false);
}
return done(null, user);
});
}));
return passport;
} | let passport = require('passport');
let LocalStrategy = require('passport-local').Strategy;
let bcrypt = require('bcrypt-nodejs');
let _ = require('lodash');
let uuid = require('uuid/v1');
module.exports = (app, db, log) => {
app.use(passport.initialize());
app.use(passport.session());
passport.serializeUser((user, done) => {
done(null, user._id);
});
passport.deserializeUser((id, done) => {
db.get(id).then((user) => {
if (!user || !user.enabled)
done(null, false);
else{
delete user.password;
done(null, user);
}
}, (err) => {
if (err.error === 'not_found')
done(null, false);
else{
log.error(err);
done(err, null);
}
});
});
passport.use('login', new LocalStrategy({
passReqToCallback : true,
usernameField: 'email'
}, function (req, email, password, done) {
db.query('users/byEmail', {
key: email,
include_docs: true
}).then(_users => {
let users = _users.rows.map(r => r.doc);
if (!users.length) {
return done(null, false);
}
let user = users[0];
if (!user.enabled || !bcrypt.compareSync(password, user.password)) {
return done(null, false);
}
return done(null, user);
});
}));
return passport;
} | Remove user password from req.user | Remove user password from req.user
| JavaScript | mit | dhjohn0/express-yourself,dhjohn0/express-yourself | javascript | ## Code Before:
let passport = require('passport');
let LocalStrategy = require('passport-local').Strategy;
let bcrypt = require('bcrypt-nodejs');
let _ = require('lodash');
let uuid = require('uuid/v1');
module.exports = (app, db, log) => {
app.use(passport.initialize());
app.use(passport.session());
passport.serializeUser((user, done) => {
done(null, user._id);
});
passport.deserializeUser((id, done) => {
db.get(id).then((user) => {
if (!user || !user.enabled)
done(null, false);
else
done(null, user);
}, (err) => {
if (err.error === 'not_found')
done(null, false);
else{
log.error(err);
done(err, null);
}
});
});
passport.use('login', new LocalStrategy({
passReqToCallback : true,
usernameField: 'email'
}, function (req, email, password, done) {
db.query('users/byEmail', {
key: email,
include_docs: true
}).then(_users => {
let users = _users.rows.map(r => r.doc);
if (!users.length) {
return done(null, false);
}
let user = users[0];
if (!user.enabled || !bcrypt.compareSync(password, user.password)) {
return done(null, false);
}
return done(null, user);
});
}));
return passport;
}
## Instruction:
Remove user password from req.user
## Code After:
let passport = require('passport');
let LocalStrategy = require('passport-local').Strategy;
let bcrypt = require('bcrypt-nodejs');
let _ = require('lodash');
let uuid = require('uuid/v1');
module.exports = (app, db, log) => {
app.use(passport.initialize());
app.use(passport.session());
passport.serializeUser((user, done) => {
done(null, user._id);
});
passport.deserializeUser((id, done) => {
db.get(id).then((user) => {
if (!user || !user.enabled)
done(null, false);
else{
delete user.password;
done(null, user);
}
}, (err) => {
if (err.error === 'not_found')
done(null, false);
else{
log.error(err);
done(err, null);
}
});
});
passport.use('login', new LocalStrategy({
passReqToCallback : true,
usernameField: 'email'
}, function (req, email, password, done) {
db.query('users/byEmail', {
key: email,
include_docs: true
}).then(_users => {
let users = _users.rows.map(r => r.doc);
if (!users.length) {
return done(null, false);
}
let user = users[0];
if (!user.enabled || !bcrypt.compareSync(password, user.password)) {
return done(null, false);
}
return done(null, user);
});
}));
return passport;
} | let passport = require('passport');
let LocalStrategy = require('passport-local').Strategy;
let bcrypt = require('bcrypt-nodejs');
let _ = require('lodash');
let uuid = require('uuid/v1');
module.exports = (app, db, log) => {
app.use(passport.initialize());
app.use(passport.session());
passport.serializeUser((user, done) => {
done(null, user._id);
});
passport.deserializeUser((id, done) => {
db.get(id).then((user) => {
if (!user || !user.enabled)
done(null, false);
- else
+ else{
? +
+ delete user.password;
done(null, user);
+ }
}, (err) => {
if (err.error === 'not_found')
done(null, false);
else{
log.error(err);
done(err, null);
}
});
});
passport.use('login', new LocalStrategy({
passReqToCallback : true,
usernameField: 'email'
}, function (req, email, password, done) {
db.query('users/byEmail', {
key: email,
include_docs: true
}).then(_users => {
let users = _users.rows.map(r => r.doc);
if (!users.length) {
return done(null, false);
}
let user = users[0];
if (!user.enabled || !bcrypt.compareSync(password, user.password)) {
return done(null, false);
}
return done(null, user);
});
}));
return passport;
} | 4 | 0.074074 | 3 | 1 |
8e296b6b4cf00be01897562697139e14ed5b984b | .travis.yml | .travis.yml | language: c
os:
- osx
compiler:
- clang
- gcc
before_script:
- brew update
- brew install libarchive
- brew install openssl
- brew install kyua
- autoreconf -i
script:
- ./configure
- make
- make check
| language: c
os:
- osx
compiler:
- clang
- gcc
before_script:
- brew update
- brew install libarchive
- brew install openssl
- brew install kyua
- autoreconf -i
script:
- ./configure
- make
- make dist
- make check
after_failure:
- kyua report --verbose
| Test make dist and report kyua failures if any | Test make dist and report kyua failures if any
| YAML | bsd-2-clause | junovitch/pkg,Open343/pkg,khorben/pkg,skoef/pkg,en90/pkg,Open343/pkg,khorben/pkg,skoef/pkg,en90/pkg,junovitch/pkg,khorben/pkg | yaml | ## Code Before:
language: c
os:
- osx
compiler:
- clang
- gcc
before_script:
- brew update
- brew install libarchive
- brew install openssl
- brew install kyua
- autoreconf -i
script:
- ./configure
- make
- make check
## Instruction:
Test make dist and report kyua failures if any
## Code After:
language: c
os:
- osx
compiler:
- clang
- gcc
before_script:
- brew update
- brew install libarchive
- brew install openssl
- brew install kyua
- autoreconf -i
script:
- ./configure
- make
- make dist
- make check
after_failure:
- kyua report --verbose
| language: c
os:
- osx
compiler:
- clang
- gcc
before_script:
- brew update
- brew install libarchive
- brew install openssl
- brew install kyua
- autoreconf -i
script:
- ./configure
- make
+ - make dist
- make check
+
+ after_failure:
+ - kyua report --verbose | 4 | 0.2 | 4 | 0 |
8c0b8b57ccd3056233c35ccb6baa426a68410abc | spec/factories/comments.rb | spec/factories/comments.rb | FactoryGirl.define do
factory :comment do
user_id { Faker::Number.number(1) }
commentable_id { 1 }
body { Faker::Lorem.sentence }
factory :q_comment do
commentable_type 'Question'
end
factory :a_comment do
commentable_type 'Answer'
end
factory :invalid_comment do
body nil
end
end
end | FactoryGirl.define do
factory :comment do
user_id { Faker::Number.number(1) }
commentable_id { 1 }
body { Faker::Lorem.sentence }
factory :q_comment do
commentable_type 'Question'
end
factory :a_comment do
commentable_type 'Answer'
end
factory :invalid_comment do
body nil
commentable_type 'Answer'
end
end
end | Add commentable_type to invalid_comment factory. | Add commentable_type to invalid_comment factory.
| Ruby | mit | kahdojay/dbc-overflow,PeterJahnes/dbc-overflow,kahdojay/dbc-overflow,kahdojay/dbc-overflow,PeterJahnes/dbc-overflow,PeterJahnes/dbc-overflow | ruby | ## Code Before:
FactoryGirl.define do
factory :comment do
user_id { Faker::Number.number(1) }
commentable_id { 1 }
body { Faker::Lorem.sentence }
factory :q_comment do
commentable_type 'Question'
end
factory :a_comment do
commentable_type 'Answer'
end
factory :invalid_comment do
body nil
end
end
end
## Instruction:
Add commentable_type to invalid_comment factory.
## Code After:
FactoryGirl.define do
factory :comment do
user_id { Faker::Number.number(1) }
commentable_id { 1 }
body { Faker::Lorem.sentence }
factory :q_comment do
commentable_type 'Question'
end
factory :a_comment do
commentable_type 'Answer'
end
factory :invalid_comment do
body nil
commentable_type 'Answer'
end
end
end | FactoryGirl.define do
factory :comment do
user_id { Faker::Number.number(1) }
commentable_id { 1 }
body { Faker::Lorem.sentence }
factory :q_comment do
commentable_type 'Question'
end
factory :a_comment do
commentable_type 'Answer'
end
factory :invalid_comment do
body nil
+ commentable_type 'Answer'
end
end
end | 1 | 0.055556 | 1 | 0 |
3ae739a0f29c4bfe7a43b5d496dee9a276c3ba3c | .gitlab-ci.yml | .gitlab-ci.yml | image: docker
services:
- docker:dind
before_script:
- apk add --no-cache py-pip
- pip install docker-compose
build-debian-files:
stage: build
script:
- source docker-compose/docker-compose.env
- docker-compose -f docker-compose/common.yml -f docker-compose/patched.yml build koha_patched
- docker-compose -f docker-compose/common.yml -f docker-compose/patched.yml up -d --force-recreate --no-deps koha_patched
| image: docker
services:
- docker:dind
before_script:
- apk add --no-cache py-pip
- pip install docker-compose
variables:
KOHA_PATH: $CI_PROJECT_DIR
build-debian-files:
stage: build
script:
- source docker-compose/docker-compose.env
- docker-compose -f docker-compose/common.yml -f docker-compose/patched.yml build koha_patched
- docker-compose -f docker-compose/common.yml -f docker-compose/patched.yml up -d --force-recreate --no-deps koha_patched
| Add project dir to env | Add project dir to env
| YAML | mit | digibib/koha-docker,digibib/koha-salt-docker,digibib/koha-docker,digibib/koha-docker,digibib/koha-salt-docker,digibib/koha-docker,digibib/koha-salt-docker,digibib/koha-docker,digibib/koha-salt-docker,digibib/koha-salt-docker,digibib/koha-docker | yaml | ## Code Before:
image: docker
services:
- docker:dind
before_script:
- apk add --no-cache py-pip
- pip install docker-compose
build-debian-files:
stage: build
script:
- source docker-compose/docker-compose.env
- docker-compose -f docker-compose/common.yml -f docker-compose/patched.yml build koha_patched
- docker-compose -f docker-compose/common.yml -f docker-compose/patched.yml up -d --force-recreate --no-deps koha_patched
## Instruction:
Add project dir to env
## Code After:
image: docker
services:
- docker:dind
before_script:
- apk add --no-cache py-pip
- pip install docker-compose
variables:
KOHA_PATH: $CI_PROJECT_DIR
build-debian-files:
stage: build
script:
- source docker-compose/docker-compose.env
- docker-compose -f docker-compose/common.yml -f docker-compose/patched.yml build koha_patched
- docker-compose -f docker-compose/common.yml -f docker-compose/patched.yml up -d --force-recreate --no-deps koha_patched
| image: docker
services:
- docker:dind
before_script:
- apk add --no-cache py-pip
- pip install docker-compose
+ variables:
+ KOHA_PATH: $CI_PROJECT_DIR
+
build-debian-files:
stage: build
script:
- source docker-compose/docker-compose.env
- docker-compose -f docker-compose/common.yml -f docker-compose/patched.yml build koha_patched
- docker-compose -f docker-compose/common.yml -f docker-compose/patched.yml up -d --force-recreate --no-deps koha_patched | 3 | 0.2 | 3 | 0 |
d5834dd7c6dcf5d6f1690da21ac23455492bafd0 | extra/forestdb/lib/lib-tests.factor | extra/forestdb/lib/lib-tests.factor | ! Copyright (C) 2014 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors alien.c-types alien.data alien.strings
combinators destructors forestdb.ffi fry io.pathnames kernel
libc namespaces sequences tools.test ;
IN: forestdb.lib
CONSTANT: forestdb-test-path "resource:forestdbs/first.fdb"
{ "val123" } [
forestdb-test-path [
"key123" "val123" fdb-set
"key123" fdb-get
] with-forestdb
] unit-test
{ "val12345" } [
forestdb-test-path [
"key123" "val12345" fdb-set
"key123" fdb-get
] with-forestdb
] unit-test
| ! Copyright (C) 2014 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors alien.c-types alien.data alien.strings
combinators destructors forestdb.ffi fry io.files.temp
io.pathnames kernel libc namespaces sequences tools.test ;
IN: forestdb.lib
: forestdb-test-path ( -- path )
"forestdb-test.fdb" temp-file ;
{ "val123" } [
forestdb-test-path [
"key123" "val123" fdb-set
"key123" fdb-get
] with-forestdb
] unit-test
{ "val12345" } [
forestdb-test-path [
"key123" "val12345" fdb-set
"key123" fdb-get
] with-forestdb
] unit-test
| Fix file name for test db. | forestdb.lib: Fix file name for test db.
| Factor | bsd-2-clause | nicolas-p/factor,sarvex/factor-lang,AlexIljin/factor,dch/factor,nicolas-p/factor,slavapestov/factor,mrjbq7/factor,mrjbq7/factor,bjourne/factor,sarvex/factor-lang,bpollack/factor,bpollack/factor,slavapestov/factor,factor/factor,dch/factor,bjourne/factor,AlexIljin/factor,nicolas-p/factor,dch/factor,factor/factor,sarvex/factor-lang,sarvex/factor-lang,sarvex/factor-lang,factor/factor,AlexIljin/factor,slavapestov/factor,mrjbq7/factor,bpollack/factor,nicolas-p/factor,bpollack/factor,nicolas-p/factor,slavapestov/factor,tgunr/factor,bpollack/factor,factor/factor,AlexIljin/factor,mrjbq7/factor,factor/factor,AlexIljin/factor,sarvex/factor-lang,mrjbq7/factor,slavapestov/factor,bjourne/factor,bpollack/factor,bpollack/factor,tgunr/factor,dch/factor,bjourne/factor,tgunr/factor,slavapestov/factor,slavapestov/factor,bjourne/factor,AlexIljin/factor,dch/factor,nicolas-p/factor,dch/factor,tgunr/factor,factor/factor,AlexIljin/factor,tgunr/factor,sarvex/factor-lang,nicolas-p/factor,bjourne/factor,tgunr/factor,bjourne/factor,mrjbq7/factor | factor | ## Code Before:
! Copyright (C) 2014 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors alien.c-types alien.data alien.strings
combinators destructors forestdb.ffi fry io.pathnames kernel
libc namespaces sequences tools.test ;
IN: forestdb.lib
CONSTANT: forestdb-test-path "resource:forestdbs/first.fdb"
{ "val123" } [
forestdb-test-path [
"key123" "val123" fdb-set
"key123" fdb-get
] with-forestdb
] unit-test
{ "val12345" } [
forestdb-test-path [
"key123" "val12345" fdb-set
"key123" fdb-get
] with-forestdb
] unit-test
## Instruction:
forestdb.lib: Fix file name for test db.
## Code After:
! Copyright (C) 2014 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors alien.c-types alien.data alien.strings
combinators destructors forestdb.ffi fry io.files.temp
io.pathnames kernel libc namespaces sequences tools.test ;
IN: forestdb.lib
: forestdb-test-path ( -- path )
"forestdb-test.fdb" temp-file ;
{ "val123" } [
forestdb-test-path [
"key123" "val123" fdb-set
"key123" fdb-get
] with-forestdb
] unit-test
{ "val12345" } [
forestdb-test-path [
"key123" "val12345" fdb-set
"key123" fdb-get
] with-forestdb
] unit-test
| ! Copyright (C) 2014 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors alien.c-types alien.data alien.strings
- combinators destructors forestdb.ffi fry io.pathnames kernel
? ^^^^^^^ ^^ ^^^^
+ combinators destructors forestdb.ffi fry io.files.temp
? ^^^ ^^ ^^
- libc namespaces sequences tools.test ;
+ io.pathnames kernel libc namespaces sequences tools.test ;
? ++++++++++++++++++++
IN: forestdb.lib
- CONSTANT: forestdb-test-path "resource:forestdbs/first.fdb"
+ : forestdb-test-path ( -- path )
+ "forestdb-test.fdb" temp-file ;
{ "val123" } [
forestdb-test-path [
"key123" "val123" fdb-set
"key123" fdb-get
] with-forestdb
] unit-test
{ "val12345" } [
forestdb-test-path [
"key123" "val12345" fdb-set
"key123" fdb-get
] with-forestdb
] unit-test | 7 | 0.318182 | 4 | 3 |
ec79970ddbfa92b0406fa73824a0a882be8cc681 | src/config/quick-set.js | src/config/quick-set.js | export default {
resizers: ['lt', 't', 'rt', 'l', 'r', 'lb', 'b', 'rb'],
axis: [{
value: 'lt',
name: '左上对齐'
},
{
value: 'rt',
name: '右上对齐'
},
{
value: 'lb',
name: '左下对齐'
},
{
value: 'rb',
name: '右下对齐'
}
]
} | export default {
resizers: ['lt', 't', 'rt', 'l', 'r', 'lb', 'b', 'rb'],
axis: [{
value: 'lt',
name: '左上对齐'
},
{
value: 'rt',
name: '右上对齐'
},
{
value: 'lb',
name: '左下对齐'
},
{
value: 'rb',
name: '右下对齐'
}
],
unit: [
{
value: 'px',
name: '像素'
},
{
value: '%',
name: '百分比'
}
]
} | Change quick set panel settings | Change quick set panel settings
| JavaScript | mit | Dafrok/Sanrise,Dafrok/Sanrise | javascript | ## Code Before:
export default {
resizers: ['lt', 't', 'rt', 'l', 'r', 'lb', 'b', 'rb'],
axis: [{
value: 'lt',
name: '左上对齐'
},
{
value: 'rt',
name: '右上对齐'
},
{
value: 'lb',
name: '左下对齐'
},
{
value: 'rb',
name: '右下对齐'
}
]
}
## Instruction:
Change quick set panel settings
## Code After:
export default {
resizers: ['lt', 't', 'rt', 'l', 'r', 'lb', 'b', 'rb'],
axis: [{
value: 'lt',
name: '左上对齐'
},
{
value: 'rt',
name: '右上对齐'
},
{
value: 'lb',
name: '左下对齐'
},
{
value: 'rb',
name: '右下对齐'
}
],
unit: [
{
value: 'px',
name: '像素'
},
{
value: '%',
name: '百分比'
}
]
} | export default {
resizers: ['lt', 't', 'rt', 'l', 'r', 'lb', 'b', 'rb'],
axis: [{
value: 'lt',
name: '左上对齐'
},
{
value: 'rt',
name: '右上对齐'
},
{
value: 'lb',
name: '左下对齐'
},
{
value: 'rb',
name: '右下对齐'
}
+ ],
+ unit: [
+ {
+ value: 'px',
+ name: '像素'
+ },
+ {
+ value: '%',
+ name: '百分比'
+ }
]
} | 10 | 0.5 | 10 | 0 |
6a4a3647799cfe79363c303054a57cb4e9cbb755 | web/app.js | web/app.js | 'use strict'
const express = require('express')
const dotenv = require('dotenv')
const result = dotenv.config()
if (result.error)
dotenv.config({
path: '../.env'
})
const app = express()
const port = process.env.SITE_PORT
app.use(express.static('public'))
app.get('/', (req, res) => {
res.sendFile('index.html')
})
app.listen(port, () => {
console.log('listening on port', port)
}) | 'use strict'
const express = require('express')
const dotenv = require('dotenv')
let result = dotenv.config()
if (result.error) {
result = dotenv.config({
path: '../.env'
})
if (result.error)
throw result.error
}
const app = express()
const port = read_env_var("SITE_PORT")
app.use(express.static('public'))
app.get('/', (req, res) => {
res.sendFile('index.html')
})
app.listen(port, () => {
console.log('listening on port', port)
})
function read_env_var(envvar) {
const val = process.env[envvar]
if (!val)
throw envvar + " must be specified. \
Did you forget to add it to your .env file?"
} | Add error message for undefined envvars | Site: Add error message for undefined envvars
| JavaScript | agpl-3.0 | SirRade/shootr,SirRade/shootr,SirRade/shootr,SirRade/shootr,SirRade/shootr | javascript | ## Code Before:
'use strict'
const express = require('express')
const dotenv = require('dotenv')
const result = dotenv.config()
if (result.error)
dotenv.config({
path: '../.env'
})
const app = express()
const port = process.env.SITE_PORT
app.use(express.static('public'))
app.get('/', (req, res) => {
res.sendFile('index.html')
})
app.listen(port, () => {
console.log('listening on port', port)
})
## Instruction:
Site: Add error message for undefined envvars
## Code After:
'use strict'
const express = require('express')
const dotenv = require('dotenv')
let result = dotenv.config()
if (result.error) {
result = dotenv.config({
path: '../.env'
})
if (result.error)
throw result.error
}
const app = express()
const port = read_env_var("SITE_PORT")
app.use(express.static('public'))
app.get('/', (req, res) => {
res.sendFile('index.html')
})
app.listen(port, () => {
console.log('listening on port', port)
})
function read_env_var(envvar) {
const val = process.env[envvar]
if (!val)
throw envvar + " must be specified. \
Did you forget to add it to your .env file?"
} | 'use strict'
const express = require('express')
const dotenv = require('dotenv')
- const result = dotenv.config()
? ^^^^
+ let result = dotenv.config()
? ^^
- if (result.error)
+ if (result.error) {
? ++
- dotenv.config({
+ result = dotenv.config({
? +++++++++
path: '../.env'
})
+ if (result.error)
+ throw result.error
+ }
const app = express()
- const port = process.env.SITE_PORT
? - -- ^^^ ^
+ const port = read_env_var("SITE_PORT")
? ^^^ ^^^^^^ ++
app.use(express.static('public'))
app.get('/', (req, res) => {
res.sendFile('index.html')
})
app.listen(port, () => {
console.log('listening on port', port)
})
+
+ function read_env_var(envvar) {
+ const val = process.env[envvar]
+ if (!val)
+ throw envvar + " must be specified. \
+ Did you forget to add it to your .env file?"
+ } | 18 | 0.782609 | 14 | 4 |
715790511819ab5810659b8f8f5d06891135d6a0 | .travis.yml | .travis.yml | language:
python
python:
- "2.7"
- "3.3"
- "3.4"
- "3.5"
addons:
postgresql: "9.3"
env:
- DJANGO="Django>=1.6.0,<1.7.0"
PSQL=0
- DJANGO="Django>=1.6.0,<1.7.0"
PSQL=1
- DJANGO="Django>=1.7.0,<1.8.0"
PSQL=0
- DJANGO="Django>=1.7.0,<1.8.0"
PSQL=1
- DJANGO="Django>=1.8.0,<1.9.0"
PSQL=0
- DJANGO="Django>=1.8.0,<1.9.0"
PSQL=1
before_script:
- psql -c 'create database travisci;' -U postgres
install:
- pip install $DJANGO coverage six psycopg2 --quiet
script:
- export DJANGO_SETTINGS_MODULE=settings
- export PYTHONPATH=..:$PYTHONPATH
- cd test_project
- python manage.py test interval test_app
- coverage run --source=../interval manage.py test interval test_app
after_success:
coveralls
| language:
python
python:
- "2.7"
- "3.3"
- "3.4"
- "3.5"
addons:
postgresql: "9.3"
env:
- DJANGO="Django>=1.6.0,<1.7.0"
PSQL=0
- DJANGO="Django>=1.6.0,<1.7.0"
PSQL=1
- DJANGO="Django>=1.7.0,<1.8.0"
PSQL=0
- DJANGO="Django>=1.7.0,<1.8.0"
PSQL=1
- DJANGO="Django>=1.8.0,<1.9.0"
PSQL=0
- DJANGO="Django>=1.8.0,<1.9.0"
PSQL=1
before_script:
- psql -c 'create database travisci;' -U postgres
install:
- pip install $DJANGO coverage six psycopg2 --quiet
script:
- export DJANGO_SETTINGS_MODULE=settings
- export PYTHONPATH=..:$PYTHONPATH
- cd test_project
- python manage.py test interval test_app
- coverage run --source=../interval manage.py test interval test_app
after_success:
coveralls
matrix:
exclude:
- python: "3.5"
env: DJANGO="Django>=1.6.0,<1.7.0"
- python: "3.5"
env: DJANGO="Django>=1.7.0,<1.8.0"
| Exclude unsupported Python 3.5 + Django combinations | Exclude unsupported Python 3.5 + Django combinations | YAML | mit | mpasternak/django-interval-field,mpasternak/django-interval-field | yaml | ## Code Before:
language:
python
python:
- "2.7"
- "3.3"
- "3.4"
- "3.5"
addons:
postgresql: "9.3"
env:
- DJANGO="Django>=1.6.0,<1.7.0"
PSQL=0
- DJANGO="Django>=1.6.0,<1.7.0"
PSQL=1
- DJANGO="Django>=1.7.0,<1.8.0"
PSQL=0
- DJANGO="Django>=1.7.0,<1.8.0"
PSQL=1
- DJANGO="Django>=1.8.0,<1.9.0"
PSQL=0
- DJANGO="Django>=1.8.0,<1.9.0"
PSQL=1
before_script:
- psql -c 'create database travisci;' -U postgres
install:
- pip install $DJANGO coverage six psycopg2 --quiet
script:
- export DJANGO_SETTINGS_MODULE=settings
- export PYTHONPATH=..:$PYTHONPATH
- cd test_project
- python manage.py test interval test_app
- coverage run --source=../interval manage.py test interval test_app
after_success:
coveralls
## Instruction:
Exclude unsupported Python 3.5 + Django combinations
## Code After:
language:
python
python:
- "2.7"
- "3.3"
- "3.4"
- "3.5"
addons:
postgresql: "9.3"
env:
- DJANGO="Django>=1.6.0,<1.7.0"
PSQL=0
- DJANGO="Django>=1.6.0,<1.7.0"
PSQL=1
- DJANGO="Django>=1.7.0,<1.8.0"
PSQL=0
- DJANGO="Django>=1.7.0,<1.8.0"
PSQL=1
- DJANGO="Django>=1.8.0,<1.9.0"
PSQL=0
- DJANGO="Django>=1.8.0,<1.9.0"
PSQL=1
before_script:
- psql -c 'create database travisci;' -U postgres
install:
- pip install $DJANGO coverage six psycopg2 --quiet
script:
- export DJANGO_SETTINGS_MODULE=settings
- export PYTHONPATH=..:$PYTHONPATH
- cd test_project
- python manage.py test interval test_app
- coverage run --source=../interval manage.py test interval test_app
after_success:
coveralls
matrix:
exclude:
- python: "3.5"
env: DJANGO="Django>=1.6.0,<1.7.0"
- python: "3.5"
env: DJANGO="Django>=1.7.0,<1.8.0"
| language:
python
python:
- "2.7"
- "3.3"
- "3.4"
- "3.5"
addons:
postgresql: "9.3"
env:
- DJANGO="Django>=1.6.0,<1.7.0"
PSQL=0
- DJANGO="Django>=1.6.0,<1.7.0"
PSQL=1
- DJANGO="Django>=1.7.0,<1.8.0"
PSQL=0
- DJANGO="Django>=1.7.0,<1.8.0"
PSQL=1
- DJANGO="Django>=1.8.0,<1.9.0"
PSQL=0
- DJANGO="Django>=1.8.0,<1.9.0"
PSQL=1
before_script:
- psql -c 'create database travisci;' -U postgres
install:
- pip install $DJANGO coverage six psycopg2 --quiet
script:
- export DJANGO_SETTINGS_MODULE=settings
- export PYTHONPATH=..:$PYTHONPATH
- cd test_project
- python manage.py test interval test_app
- coverage run --source=../interval manage.py test interval test_app
after_success:
coveralls
+
+ matrix:
+ exclude:
+ - python: "3.5"
+ env: DJANGO="Django>=1.6.0,<1.7.0"
+ - python: "3.5"
+ env: DJANGO="Django>=1.7.0,<1.8.0" | 7 | 0.152174 | 7 | 0 |
0f8e6daf54c8d2bd2f1414ff4c0e09405bbfe882 | taverna-workbench-product/src/main/etc/taverna.bat | taverna-workbench-product/src/main/etc/taverna.bat | @ECHO OFF
REM Taverna startup script
REM distribution directory
set TAVERNA_HOME=%~dp0
REM 300 MB memory, 140 MB for classes
set ARGS=-Xmx300m -XX:MaxPermSize=140m
REM Taverna system properties
set ARGS=%ARGS% "-Dlog4j.configuration=file:///%TAVERNA_HOME%conf/log4j.properties"
set ARGS=%ARGS% "-Djava.util.logging.config.file=%TAVERNA_HOME%conf/logging.properties"
set ARGS=%ARGS% "-Dtaverna.app.startup=%TAVERNA_HOME%."
java %ARGS% -jar "%TAVERNA_HOME%lib\taverna-command-line-0.1.1.jar" %*
| @ECHO OFF
REM Taverna startup script
REM distribution directory
set TAVERNA_HOME=%~dp0
REM 300 MB memory, 140 MB for classes
set ARGS=-Xmx300m -XX:MaxPermSize=140m
REM Taverna system properties
set ARGS=%ARGS% "-Dlog4j.configuration=file:///%TAVERNA_HOME%conf/log4j.properties"
set ARGS=%ARGS% "-Djava.util.logging.config.file=%TAVERNA_HOME%conf/logging.properties"
set ARGS=%ARGS% "-Dtaverna.app.startup=%TAVERNA_HOME%."
java %ARGS% -jar "%TAVERNA_HOME%lib\taverna-workbench-0.1.0-SNAPSHOT.jar" %*
| Correct jar path for windows BAT | Correct jar path for windows BAT
git-svn-id: 69cf1ede49ac15a494fe8ca6de9793745495e813@15218 bf327186-88b3-11dd-a302-d386e5130c1c
| Batchfile | apache-2.0 | apache/incubator-taverna-workbench-product | batchfile | ## Code Before:
@ECHO OFF
REM Taverna startup script
REM distribution directory
set TAVERNA_HOME=%~dp0
REM 300 MB memory, 140 MB for classes
set ARGS=-Xmx300m -XX:MaxPermSize=140m
REM Taverna system properties
set ARGS=%ARGS% "-Dlog4j.configuration=file:///%TAVERNA_HOME%conf/log4j.properties"
set ARGS=%ARGS% "-Djava.util.logging.config.file=%TAVERNA_HOME%conf/logging.properties"
set ARGS=%ARGS% "-Dtaverna.app.startup=%TAVERNA_HOME%."
java %ARGS% -jar "%TAVERNA_HOME%lib\taverna-command-line-0.1.1.jar" %*
## Instruction:
Correct jar path for windows BAT
git-svn-id: 69cf1ede49ac15a494fe8ca6de9793745495e813@15218 bf327186-88b3-11dd-a302-d386e5130c1c
## Code After:
@ECHO OFF
REM Taverna startup script
REM distribution directory
set TAVERNA_HOME=%~dp0
REM 300 MB memory, 140 MB for classes
set ARGS=-Xmx300m -XX:MaxPermSize=140m
REM Taverna system properties
set ARGS=%ARGS% "-Dlog4j.configuration=file:///%TAVERNA_HOME%conf/log4j.properties"
set ARGS=%ARGS% "-Djava.util.logging.config.file=%TAVERNA_HOME%conf/logging.properties"
set ARGS=%ARGS% "-Dtaverna.app.startup=%TAVERNA_HOME%."
java %ARGS% -jar "%TAVERNA_HOME%lib\taverna-workbench-0.1.0-SNAPSHOT.jar" %*
| @ECHO OFF
REM Taverna startup script
REM distribution directory
set TAVERNA_HOME=%~dp0
REM 300 MB memory, 140 MB for classes
set ARGS=-Xmx300m -XX:MaxPermSize=140m
REM Taverna system properties
set ARGS=%ARGS% "-Dlog4j.configuration=file:///%TAVERNA_HOME%conf/log4j.properties"
set ARGS=%ARGS% "-Djava.util.logging.config.file=%TAVERNA_HOME%conf/logging.properties"
set ARGS=%ARGS% "-Dtaverna.app.startup=%TAVERNA_HOME%."
- java %ARGS% -jar "%TAVERNA_HOME%lib\taverna-command-line-0.1.1.jar" %*
? ^^^^^^^^^^^ ^
+ java %ARGS% -jar "%TAVERNA_HOME%lib\taverna-workbench-0.1.0-SNAPSHOT.jar" %*
? +++++++ ^ ^^^^^^^^^^
| 2 | 0.117647 | 1 | 1 |
b2f8787d0308618b98522d464d7d97e4908d8b35 | exclude_list.txt | exclude_list.txt | .DS_Store
.git
Makefile
webpack.config.js
node_modules
parse_cloud
js/main.js | .DS_Store
.git
.gitignore
Makefile
webpack.config.js
node_modules
parse_cloud
js/main.js | Add gitignore to rsync exclude | Add gitignore to rsync exclude
| Text | epl-1.0 | ezmiller/whatishistory | text | ## Code Before:
.DS_Store
.git
Makefile
webpack.config.js
node_modules
parse_cloud
js/main.js
## Instruction:
Add gitignore to rsync exclude
## Code After:
.DS_Store
.git
.gitignore
Makefile
webpack.config.js
node_modules
parse_cloud
js/main.js | .DS_Store
.git
+ .gitignore
Makefile
webpack.config.js
node_modules
parse_cloud
js/main.js | 1 | 0.142857 | 1 | 0 |
1736a8c2fe61d71e41410abbe1a0d60f852ba2e8 | inst/tests/modules/a.r | inst/tests/modules/a.r | double = function (x) x * 2
.modname = module_name()
counter = 1
get_modname = function () .modname
get_modname2 = function () module_name()
get_counter = function () counter
inc = function ()
counter <<- counter + 1
`%or%` = function (a, b)
if (length(a) > 0) a else b
`+.string` = function (a, b)
paste(a, b, sep = '')
which = function () '/a'
encoding_test = function () '☃' # U+2603: SNOWMAN
| double = function (x) x * 2
.modname = module_name()
#' Counter for testing
counter = 1
#' The module’s name
get_modname = function () .modname
#' The module’s name, via a function
get_modname2 = function () module_name()
#' Read the counter
get_counter = function () counter
#' Increment the counter
inc = function ()
counter <<- counter + 1
#' Use \code{a} if it exists, else \code{b}
`%or%` = function (a, b)
if (length(a) > 0) a else b
#' String concatenation
`+.string` = function (a, b)
paste(a, b, sep = '')
which = function () '/a'
encoding_test = function () '☃' # U+2603: SNOWMAN
| Add doc comments to test module for debugging | Add doc comments to test module for debugging
| R | apache-2.0 | klmr/modules,klmr/modules | r | ## Code Before:
double = function (x) x * 2
.modname = module_name()
counter = 1
get_modname = function () .modname
get_modname2 = function () module_name()
get_counter = function () counter
inc = function ()
counter <<- counter + 1
`%or%` = function (a, b)
if (length(a) > 0) a else b
`+.string` = function (a, b)
paste(a, b, sep = '')
which = function () '/a'
encoding_test = function () '☃' # U+2603: SNOWMAN
## Instruction:
Add doc comments to test module for debugging
## Code After:
double = function (x) x * 2
.modname = module_name()
#' Counter for testing
counter = 1
#' The module’s name
get_modname = function () .modname
#' The module’s name, via a function
get_modname2 = function () module_name()
#' Read the counter
get_counter = function () counter
#' Increment the counter
inc = function ()
counter <<- counter + 1
#' Use \code{a} if it exists, else \code{b}
`%or%` = function (a, b)
if (length(a) > 0) a else b
#' String concatenation
`+.string` = function (a, b)
paste(a, b, sep = '')
which = function () '/a'
encoding_test = function () '☃' # U+2603: SNOWMAN
| double = function (x) x * 2
.modname = module_name()
+ #' Counter for testing
counter = 1
+ #' The module’s name
get_modname = function () .modname
+ #' The module’s name, via a function
get_modname2 = function () module_name()
+ #' Read the counter
get_counter = function () counter
+ #' Increment the counter
inc = function ()
counter <<- counter + 1
+ #' Use \code{a} if it exists, else \code{b}
`%or%` = function (a, b)
if (length(a) > 0) a else b
+ #' String concatenation
`+.string` = function (a, b)
paste(a, b, sep = '')
which = function () '/a'
encoding_test = function () '☃' # U+2603: SNOWMAN | 7 | 0.291667 | 7 | 0 |
050359c7399b9e8905d114a2438fa7e374da9811 | tests/collect.test.js | tests/collect.test.js | 'use strict';
(function () {
var expect = require('chai').expect;
var collect = require('../src/collect');
describe('collect.js', function () {
it('should exist', function () {
expect(collect).to.be.ok;
expect(typeof collect).to.equal('function');
});
});
})();
| 'use strict';
(function () {
var expect = require('chai').expect;
var collect = require('../src/collect');
var Jarg = require('../src/jarg');
var Command = require('../src/command');
describe('collect.js', function () {
it('should exist', function () {
expect(collect).to.be.ok;
expect(typeof collect).to.equal('function');
});
it('should return a Jarg instance', function () {
var boundCollect = collect.bind(null, 'node', 'npm', ['install', 'jargs', '--save']);
var result = boundCollect(
Command(
'npm'
)
);
expect(result instanceof Jarg).to.be.true;
});
});
})();
| Test that collect returns a Jarg instance | Test that collect returns a Jarg instance
| JavaScript | mit | JakeSidSmith/jargs | javascript | ## Code Before:
'use strict';
(function () {
var expect = require('chai').expect;
var collect = require('../src/collect');
describe('collect.js', function () {
it('should exist', function () {
expect(collect).to.be.ok;
expect(typeof collect).to.equal('function');
});
});
})();
## Instruction:
Test that collect returns a Jarg instance
## Code After:
'use strict';
(function () {
var expect = require('chai').expect;
var collect = require('../src/collect');
var Jarg = require('../src/jarg');
var Command = require('../src/command');
describe('collect.js', function () {
it('should exist', function () {
expect(collect).to.be.ok;
expect(typeof collect).to.equal('function');
});
it('should return a Jarg instance', function () {
var boundCollect = collect.bind(null, 'node', 'npm', ['install', 'jargs', '--save']);
var result = boundCollect(
Command(
'npm'
)
);
expect(result instanceof Jarg).to.be.true;
});
});
})();
| 'use strict';
(function () {
var expect = require('chai').expect;
var collect = require('../src/collect');
+ var Jarg = require('../src/jarg');
+ var Command = require('../src/command');
describe('collect.js', function () {
it('should exist', function () {
expect(collect).to.be.ok;
expect(typeof collect).to.equal('function');
});
+ it('should return a Jarg instance', function () {
+ var boundCollect = collect.bind(null, 'node', 'npm', ['install', 'jargs', '--save']);
+
+ var result = boundCollect(
+ Command(
+ 'npm'
+ )
+ );
+
+ expect(result instanceof Jarg).to.be.true;
+ });
+
});
})(); | 14 | 0.777778 | 14 | 0 |
c43eca9d029740d877a2e6d3ba7ce7813878e86a | test/representers/api/musical_work_representer_test.rb | test/representers/api/musical_work_representer_test.rb |
require 'test_helper'
require 'musical_work' if !defined?(AudioFile)
describe Api::MusicalWorkRepresenter do
let(:musical_work) { FactoryGirl.create(:musical_work) }
let(:representer) { Api::MusicalWorkRepresenter.new(musical_work) }
let(:json) { JSON.parse(representer.to_json) }
it 'create representer' do
representer.wont_be_nil
end
it 'use representer to create json' do
json['id'].must_equal musical_work.id
end
it 'will have a nested self link' do
self_href = "/api/v1/stories/#{musical_work.story.id}/musical_works/#{musical_work.id}"
json['_links']['self']['href'].must_equal self_href
end
end
|
require 'test_helper'
require 'musical_work' if !defined?(AudioFile)
describe Api::MusicalWorkRepresenter do
let(:musical_work) { FactoryGirl.create(:musical_work) }
let(:representer) { Api::MusicalWorkRepresenter.new(musical_work) }
let(:json) { JSON.parse(representer.to_json) }
it 'create representer' do
representer.wont_be_nil
end
it 'use representer to create json' do
json['id'].must_equal musical_work.id
end
it 'will have a nested self link' do
self_href = "/api/v1/stories/#{musical_work.story.id}/musical_works/#{musical_work.id}"
json['_links']['self']['href'].must_equal self_href
end
it 'serializes the length of the story as duration' do
musical_work.stub(:excerpt_length, 123) do
json['duration'].must_equal 123
end
end
end
| Add testing for musical work duration | Add testing for musical work duration
| Ruby | agpl-3.0 | PRX/cms.prx.org,PRX/cms.prx.org,PRX/cms.prx.org,PRX/cms.prx.org | ruby | ## Code Before:
require 'test_helper'
require 'musical_work' if !defined?(AudioFile)
describe Api::MusicalWorkRepresenter do
let(:musical_work) { FactoryGirl.create(:musical_work) }
let(:representer) { Api::MusicalWorkRepresenter.new(musical_work) }
let(:json) { JSON.parse(representer.to_json) }
it 'create representer' do
representer.wont_be_nil
end
it 'use representer to create json' do
json['id'].must_equal musical_work.id
end
it 'will have a nested self link' do
self_href = "/api/v1/stories/#{musical_work.story.id}/musical_works/#{musical_work.id}"
json['_links']['self']['href'].must_equal self_href
end
end
## Instruction:
Add testing for musical work duration
## Code After:
require 'test_helper'
require 'musical_work' if !defined?(AudioFile)
describe Api::MusicalWorkRepresenter do
let(:musical_work) { FactoryGirl.create(:musical_work) }
let(:representer) { Api::MusicalWorkRepresenter.new(musical_work) }
let(:json) { JSON.parse(representer.to_json) }
it 'create representer' do
representer.wont_be_nil
end
it 'use representer to create json' do
json['id'].must_equal musical_work.id
end
it 'will have a nested self link' do
self_href = "/api/v1/stories/#{musical_work.story.id}/musical_works/#{musical_work.id}"
json['_links']['self']['href'].must_equal self_href
end
it 'serializes the length of the story as duration' do
musical_work.stub(:excerpt_length, 123) do
json['duration'].must_equal 123
end
end
end
|
require 'test_helper'
-
require 'musical_work' if !defined?(AudioFile)
describe Api::MusicalWorkRepresenter do
let(:musical_work) { FactoryGirl.create(:musical_work) }
let(:representer) { Api::MusicalWorkRepresenter.new(musical_work) }
let(:json) { JSON.parse(representer.to_json) }
it 'create representer' do
representer.wont_be_nil
end
it 'use representer to create json' do
json['id'].must_equal musical_work.id
end
+
it 'will have a nested self link' do
self_href = "/api/v1/stories/#{musical_work.story.id}/musical_works/#{musical_work.id}"
json['_links']['self']['href'].must_equal self_href
end
+
+ it 'serializes the length of the story as duration' do
+ musical_work.stub(:excerpt_length, 123) do
+ json['duration'].must_equal 123
+ end
+ end
end | 8 | 0.333333 | 7 | 1 |
43f52a15cd6f3bce3a49cca7594938d0d1c2bcdb | scripts/travis/before_install.sh | scripts/travis/before_install.sh |
set -e
set -o pipefail
if [[ ${PLATFORM} == "android" ]]; then
# Install android ndk
echo "Downloading ndk..."
curl -L https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip -o ndk.zip
echo "Done."
# Extract android ndk
echo "Extracting ndk..."
unzip -qq ndk.zip
echo "Done."
# Update PATH
echo "Updating PATH..."
export ANDROID_NDK_HOME=${PWD}/android-ndk-r13b
export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_NDK_HOME}
echo $PATH
echo "Done."
fi
if [[ ${TRAVIS_OS_NAME} == "osx" ]]; then
# https://github.com/travis-ci/travis-ci/issues/6307
rvm get head
fi
|
set -e
set -o pipefail
if [[ ${PLATFORM} == "android" ]]; then
# Note: the right way to download these packages is through the Android Studio SDK manager,
# these steps should be removed when/if ndk-bundle and cmake become available from the
# command-line SDK update tool.
# Download android ndk
echo "Downloading ndk..."
curl -L https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip -o ndk.zip
echo "Done."
# Extract android ndk
echo "Extracting ndk..."
unzip -qq ndk.zip
echo "Done."
# Update PATH
echo "Updating PATH..."
export ANDROID_NDK_HOME=${PWD}/android-ndk-r13b
export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_NDK_HOME}
echo $PATH
echo "Done."
# Download android cmake package
echo "Downloading android cmake package..."
curl -L https://dl.google.com/android/repository/cmake-3.6.3155560-linux-x86_64.zip -o cmake.zip
echo "Done."
# Extract android cmake package
echo "Extracting android cmake package..."
mkdir -p ${ANDROID_HOME}/cmake
unzip -qq cmake.zip -d ${ANDROID_HOME}/cmake
echo "Done."
fi
if [[ ${TRAVIS_OS_NAME} == "osx" ]]; then
# https://github.com/travis-ci/travis-ci/issues/6307
rvm get head
fi
| Add step to download Android CMake package on Travis | Add step to download Android CMake package on Travis
| Shell | mit | tangrams/tangram-es,quitejonny/tangram-es,cleeus/tangram-es,quitejonny/tangram-es,tangrams/tangram-es,tangrams/tangram-es,quitejonny/tangram-es,tangrams/tangram-es,tangrams/tangram-es,cleeus/tangram-es,cleeus/tangram-es,cleeus/tangram-es,quitejonny/tangram-es,tangrams/tangram-es,cleeus/tangram-es,quitejonny/tangram-es,cleeus/tangram-es,quitejonny/tangram-es,tangrams/tangram-es | shell | ## Code Before:
set -e
set -o pipefail
if [[ ${PLATFORM} == "android" ]]; then
# Install android ndk
echo "Downloading ndk..."
curl -L https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip -o ndk.zip
echo "Done."
# Extract android ndk
echo "Extracting ndk..."
unzip -qq ndk.zip
echo "Done."
# Update PATH
echo "Updating PATH..."
export ANDROID_NDK_HOME=${PWD}/android-ndk-r13b
export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_NDK_HOME}
echo $PATH
echo "Done."
fi
if [[ ${TRAVIS_OS_NAME} == "osx" ]]; then
# https://github.com/travis-ci/travis-ci/issues/6307
rvm get head
fi
## Instruction:
Add step to download Android CMake package on Travis
## Code After:
set -e
set -o pipefail
if [[ ${PLATFORM} == "android" ]]; then
# Note: the right way to download these packages is through the Android Studio SDK manager,
# these steps should be removed when/if ndk-bundle and cmake become available from the
# command-line SDK update tool.
# Download android ndk
echo "Downloading ndk..."
curl -L https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip -o ndk.zip
echo "Done."
# Extract android ndk
echo "Extracting ndk..."
unzip -qq ndk.zip
echo "Done."
# Update PATH
echo "Updating PATH..."
export ANDROID_NDK_HOME=${PWD}/android-ndk-r13b
export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_NDK_HOME}
echo $PATH
echo "Done."
# Download android cmake package
echo "Downloading android cmake package..."
curl -L https://dl.google.com/android/repository/cmake-3.6.3155560-linux-x86_64.zip -o cmake.zip
echo "Done."
# Extract android cmake package
echo "Extracting android cmake package..."
mkdir -p ${ANDROID_HOME}/cmake
unzip -qq cmake.zip -d ${ANDROID_HOME}/cmake
echo "Done."
fi
if [[ ${TRAVIS_OS_NAME} == "osx" ]]; then
# https://github.com/travis-ci/travis-ci/issues/6307
rvm get head
fi
|
set -e
set -o pipefail
if [[ ${PLATFORM} == "android" ]]; then
+ # Note: the right way to download these packages is through the Android Studio SDK manager,
+ # these steps should be removed when/if ndk-bundle and cmake become available from the
+ # command-line SDK update tool.
+
- # Install android ndk
? ^ ^^ ^^
+ # Download android ndk
? ^^^ ^^ ^
echo "Downloading ndk..."
curl -L https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip -o ndk.zip
echo "Done."
# Extract android ndk
echo "Extracting ndk..."
unzip -qq ndk.zip
echo "Done."
# Update PATH
echo "Updating PATH..."
export ANDROID_NDK_HOME=${PWD}/android-ndk-r13b
export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_NDK_HOME}
echo $PATH
echo "Done."
+ # Download android cmake package
+ echo "Downloading android cmake package..."
+ curl -L https://dl.google.com/android/repository/cmake-3.6.3155560-linux-x86_64.zip -o cmake.zip
+ echo "Done."
+
+ # Extract android cmake package
+ echo "Extracting android cmake package..."
+ mkdir -p ${ANDROID_HOME}/cmake
+ unzip -qq cmake.zip -d ${ANDROID_HOME}/cmake
+ echo "Done."
+
fi
if [[ ${TRAVIS_OS_NAME} == "osx" ]]; then
# https://github.com/travis-ci/travis-ci/issues/6307
rvm get head
fi | 17 | 0.548387 | 16 | 1 |
180e659d3eb96d493b28bacce89b11bfc964ce56 | .travis.yml | .travis.yml | language: node_js
node_js: 'stable'
script: npm test
notifications:
email:
on_success: never
| language: node_js
matrix:
include:
- node_js: 'stable'
- node_js: 'node'
env: VERSION=v12.0.0-rc.1
before_install: NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/rc nvm install $VERSION
script: npm test
notifications:
email:
on_success: never
| Test against Node.js v12.0.0-rc.1 on Travis | Test against Node.js v12.0.0-rc.1 on Travis
| YAML | mit | defunctzombie/commonjs-assert | yaml | ## Code Before:
language: node_js
node_js: 'stable'
script: npm test
notifications:
email:
on_success: never
## Instruction:
Test against Node.js v12.0.0-rc.1 on Travis
## Code After:
language: node_js
matrix:
include:
- node_js: 'stable'
- node_js: 'node'
env: VERSION=v12.0.0-rc.1
before_install: NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/rc nvm install $VERSION
script: npm test
notifications:
email:
on_success: never
| language: node_js
+ matrix:
+ include:
- node_js: 'stable'
+ - node_js: 'stable'
? ++++
+ - node_js: 'node'
+ env: VERSION=v12.0.0-rc.1
+ before_install: NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/rc nvm install $VERSION
script: npm test
notifications:
email:
on_success: never | 7 | 1.166667 | 6 | 1 |
652c22f762c67014ef0dda721f716d6366b0d606 | .ci/appveyor/run_with_env.cmd | .ci/appveyor/run_with_env.cmd | @echo off
:: To build extensions for 64 bit Python 3, we need to configure environment
:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
:: MS Windows SDK for Windows 7 and .NET Framework 4
::
:: More details at:
:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows
::
IF "%DISTUTILS_USE_SDK%"=="1" (
IF "%PLATFORM%"=="x64" (
ECHO Configuring environment to build with MSVC on a 64bit architecture
ECHO Using Windows SDK v7.0
"C:\Program Files\Microsoft SDKs\Windows\v7.0\Setup\WindowsSdkVer.exe" -q -version:v7.0
CALL "C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\SetEnv.cmd" /x64 /release
SET MSSdk=1
REM Need the following to allow tox to see the SDK compiler
SET TOX_TESTENV_PASSENV=DISTUTILS_USE_SDK MSSdk INCLUDE LIB
) ELSE (
ECHO Using default MSVC build environment for 32 bit architecture
ECHO Executing: %*
call %* || EXIT 1
)
) ELSE (
ECHO Using default MSVC build environment
)
CALL %*
| @echo off
:: To build extensions for 64 bit Python 3, we need to configure environment
:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
:: MS Windows SDK for Windows 7 and .NET Framework 4
::
:: More details at:
:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows
::
IF "%DISTUTILS_USE_SDK%"=="1" (
SET MAJOR_PYTHON_VERSION="%PYTHON_VERSION:~0,1%"
IF %MAJOR_PYTHON_VERSION% == "2" (
SET WINDOWS_SDK_VERSION="v7.0"
) ELSE IF %MAJOR_PYTHON_VERSION% == "3" (
SET WINDOWS_SDK_VERSION="v7.1"
) ELSE (
ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%"
EXIT 1
)
IF "%PLATFORM%"=="x64" (
ECHO Configuring environment to build with MSVC on a 64bit architecture
ECHO Using Windows SDK %WINDOWS_SDK_VERSION%
"C:\Program Files\Microsoft SDKs\Windows\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION%
CALL "C:\Program Files\Microsoft SDKs\Windows\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release
SET MSSdk=1
REM Need the following to allow tox to see the SDK compiler
SET TOX_TESTENV_PASSENV=DISTUTILS_USE_SDK MSSdk INCLUDE LIB
) ELSE (
ECHO Using default MSVC build environment for 32 bit architecture
ECHO Executing: %*
call %* || EXIT 1
)
) ELSE (
ECHO Using default MSVC build environment
)
CALL %*
| Set SDK version depending on Python 2 or 3. | Set SDK version depending on Python 2 or 3.
| Batchfile | mit | ManuSchmi88/landlab,SiccarPoint/landlab,cmshobe/landlab,landlab/landlab,RondaStrauch/landlab,RondaStrauch/landlab,cmshobe/landlab,Carralex/landlab,laijingtao/landlab,Carralex/landlab,landlab/landlab,amandersillinois/landlab,RondaStrauch/landlab,csherwood-usgs/landlab,landlab/landlab,csherwood-usgs/landlab,SiccarPoint/landlab,Carralex/landlab,ManuSchmi88/landlab,amandersillinois/landlab,ManuSchmi88/landlab,laijingtao/landlab,cmshobe/landlab | batchfile | ## Code Before:
@echo off
:: To build extensions for 64 bit Python 3, we need to configure environment
:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
:: MS Windows SDK for Windows 7 and .NET Framework 4
::
:: More details at:
:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows
::
IF "%DISTUTILS_USE_SDK%"=="1" (
IF "%PLATFORM%"=="x64" (
ECHO Configuring environment to build with MSVC on a 64bit architecture
ECHO Using Windows SDK v7.0
"C:\Program Files\Microsoft SDKs\Windows\v7.0\Setup\WindowsSdkVer.exe" -q -version:v7.0
CALL "C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\SetEnv.cmd" /x64 /release
SET MSSdk=1
REM Need the following to allow tox to see the SDK compiler
SET TOX_TESTENV_PASSENV=DISTUTILS_USE_SDK MSSdk INCLUDE LIB
) ELSE (
ECHO Using default MSVC build environment for 32 bit architecture
ECHO Executing: %*
call %* || EXIT 1
)
) ELSE (
ECHO Using default MSVC build environment
)
CALL %*
## Instruction:
Set SDK version depending on Python 2 or 3.
## Code After:
@echo off
:: To build extensions for 64 bit Python 3, we need to configure environment
:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
:: MS Windows SDK for Windows 7 and .NET Framework 4
::
:: More details at:
:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows
::
IF "%DISTUTILS_USE_SDK%"=="1" (
SET MAJOR_PYTHON_VERSION="%PYTHON_VERSION:~0,1%"
IF %MAJOR_PYTHON_VERSION% == "2" (
SET WINDOWS_SDK_VERSION="v7.0"
) ELSE IF %MAJOR_PYTHON_VERSION% == "3" (
SET WINDOWS_SDK_VERSION="v7.1"
) ELSE (
ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%"
EXIT 1
)
IF "%PLATFORM%"=="x64" (
ECHO Configuring environment to build with MSVC on a 64bit architecture
ECHO Using Windows SDK %WINDOWS_SDK_VERSION%
"C:\Program Files\Microsoft SDKs\Windows\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION%
CALL "C:\Program Files\Microsoft SDKs\Windows\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release
SET MSSdk=1
REM Need the following to allow tox to see the SDK compiler
SET TOX_TESTENV_PASSENV=DISTUTILS_USE_SDK MSSdk INCLUDE LIB
) ELSE (
ECHO Using default MSVC build environment for 32 bit architecture
ECHO Executing: %*
call %* || EXIT 1
)
) ELSE (
ECHO Using default MSVC build environment
)
CALL %*
| @echo off
:: To build extensions for 64 bit Python 3, we need to configure environment
:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
:: MS Windows SDK for Windows 7 and .NET Framework 4
::
:: More details at:
:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows
::
IF "%DISTUTILS_USE_SDK%"=="1" (
+ SET MAJOR_PYTHON_VERSION="%PYTHON_VERSION:~0,1%"
+ IF %MAJOR_PYTHON_VERSION% == "2" (
+ SET WINDOWS_SDK_VERSION="v7.0"
+ ) ELSE IF %MAJOR_PYTHON_VERSION% == "3" (
+ SET WINDOWS_SDK_VERSION="v7.1"
+ ) ELSE (
+ ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%"
+ EXIT 1
+ )
+
IF "%PLATFORM%"=="x64" (
ECHO Configuring environment to build with MSVC on a 64bit architecture
- ECHO Using Windows SDK v7.0
+ ECHO Using Windows SDK %WINDOWS_SDK_VERSION%
- "C:\Program Files\Microsoft SDKs\Windows\v7.0\Setup\WindowsSdkVer.exe" -q -version:v7.0
? ^^^^ ^^^^
+ "C:\Program Files\Microsoft SDKs\Windows\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION%
? ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^
- CALL "C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\SetEnv.cmd" /x64 /release
? ^^^^
+ CALL "C:\Program Files\Microsoft SDKs\Windows\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release
? ^^^^^^^^^^^^^^^^^^^^^
SET MSSdk=1
REM Need the following to allow tox to see the SDK compiler
SET TOX_TESTENV_PASSENV=DISTUTILS_USE_SDK MSSdk INCLUDE LIB
) ELSE (
ECHO Using default MSVC build environment for 32 bit architecture
ECHO Executing: %*
call %* || EXIT 1
)
) ELSE (
ECHO Using default MSVC build environment
)
CALL %* | 16 | 0.592593 | 13 | 3 |
ffd601879a57ee7894790613bcaf6e350428beee | README.md | README.md |
Allows Behat to rewrite Gherkin tags at runtime.
## Documentation
[Official documentation](http://extensions.behat.org/tag-rewriter/index.html)
## Source
[Github](https://github.com/vipsoft/GherkinTagRewriterExtension)
## Copyright
Copyright (c) 2012 Anthon Pang. See LICENSE for details.
## Credits
* Anthon Pang [robocoder](http://github.com/robocoder)
* Konstantin Kudryashov [everzet](http://github.com/everzet) - init.php and build.php
* [Others](https://github.com/vipsoft/GherkinTagRewriterExtension/graphs/contributors)
|
Allows Behat to rewrite Gherkin tags at runtime.
## Documentation
[Official documentation](http://extensions.behat.org/gherkin-tag-rewriter/)
## Source
[Github](https://github.com/vipsoft/GherkinTagRewriterExtension)
## Copyright
Copyright (c) 2012 Anthon Pang. See LICENSE for details.
## Credits
* Anthon Pang [robocoder](http://github.com/robocoder)
* Konstantin Kudryashov [everzet](http://github.com/everzet) - init.php and build.php
* [Others](https://github.com/vipsoft/GherkinTagRewriterExtension/graphs/contributors)
| Fix link to official documentation | Fix link to official documentation
Same as on the other repository. :) | Markdown | mit | vipsoft/GherkinTagRewriterExtension | markdown | ## Code Before:
Allows Behat to rewrite Gherkin tags at runtime.
## Documentation
[Official documentation](http://extensions.behat.org/tag-rewriter/index.html)
## Source
[Github](https://github.com/vipsoft/GherkinTagRewriterExtension)
## Copyright
Copyright (c) 2012 Anthon Pang. See LICENSE for details.
## Credits
* Anthon Pang [robocoder](http://github.com/robocoder)
* Konstantin Kudryashov [everzet](http://github.com/everzet) - init.php and build.php
* [Others](https://github.com/vipsoft/GherkinTagRewriterExtension/graphs/contributors)
## Instruction:
Fix link to official documentation
Same as on the other repository. :)
## Code After:
Allows Behat to rewrite Gherkin tags at runtime.
## Documentation
[Official documentation](http://extensions.behat.org/gherkin-tag-rewriter/)
## Source
[Github](https://github.com/vipsoft/GherkinTagRewriterExtension)
## Copyright
Copyright (c) 2012 Anthon Pang. See LICENSE for details.
## Credits
* Anthon Pang [robocoder](http://github.com/robocoder)
* Konstantin Kudryashov [everzet](http://github.com/everzet) - init.php and build.php
* [Others](https://github.com/vipsoft/GherkinTagRewriterExtension/graphs/contributors)
|
Allows Behat to rewrite Gherkin tags at runtime.
## Documentation
- [Official documentation](http://extensions.behat.org/tag-rewriter/index.html)
? ----------
+ [Official documentation](http://extensions.behat.org/gherkin-tag-rewriter/)
? ++++++++
## Source
[Github](https://github.com/vipsoft/GherkinTagRewriterExtension)
## Copyright
Copyright (c) 2012 Anthon Pang. See LICENSE for details.
## Credits
* Anthon Pang [robocoder](http://github.com/robocoder)
* Konstantin Kudryashov [everzet](http://github.com/everzet) - init.php and build.php
* [Others](https://github.com/vipsoft/GherkinTagRewriterExtension/graphs/contributors) | 2 | 0.1 | 1 | 1 |
67ae4788e71779db07ebd8403933fd626cbb4eea | meta/main.yml | meta/main.yml | ---
galaxy_info:
author: sigio
description: Configure MariaDB 10.x on CentOS/RedHat/Ubuntu with or without a galera cluster, selinux and firewall rules (ufw+firewalld)
license: MIT
min_ansible_version: 2.2
platforms:
- name: EL
versions:
- 6
- 7
- name: Ubuntu
versions:
- 16.04
categories:
- system
| ---
galaxy_info:
author: sigio
description: Configure MariaDB 10.x on CentOS/RedHat/Ubuntu with or without a galera cluster, selinux and firewall rules (ufw+firewalld)
company: Sig-I/O Automatisering
license: MIT
min_ansible_version: 2.2
platforms:
- name: EL
versions:
- 6
- 7
- name: Ubuntu
versions:
- xenial
categories:
- system
| Fix incorrect version in meta.yml | Fix incorrect version in meta.yml
| YAML | mit | sigio/ansible-role-mariadb-galera | yaml | ## Code Before:
---
galaxy_info:
author: sigio
description: Configure MariaDB 10.x on CentOS/RedHat/Ubuntu with or without a galera cluster, selinux and firewall rules (ufw+firewalld)
license: MIT
min_ansible_version: 2.2
platforms:
- name: EL
versions:
- 6
- 7
- name: Ubuntu
versions:
- 16.04
categories:
- system
## Instruction:
Fix incorrect version in meta.yml
## Code After:
---
galaxy_info:
author: sigio
description: Configure MariaDB 10.x on CentOS/RedHat/Ubuntu with or without a galera cluster, selinux and firewall rules (ufw+firewalld)
company: Sig-I/O Automatisering
license: MIT
min_ansible_version: 2.2
platforms:
- name: EL
versions:
- 6
- 7
- name: Ubuntu
versions:
- xenial
categories:
- system
| ---
galaxy_info:
author: sigio
description: Configure MariaDB 10.x on CentOS/RedHat/Ubuntu with or without a galera cluster, selinux and firewall rules (ufw+firewalld)
+ company: Sig-I/O Automatisering
license: MIT
min_ansible_version: 2.2
platforms:
- name: EL
versions:
- 6
- 7
- name: Ubuntu
versions:
- - 16.04
+ - xenial
categories:
- system | 3 | 0.1875 | 2 | 1 |
4386811b865302d9e59ccd74086a973c92cb063c | README.md | README.md | DTiled Allegro Example
===
This is an example of using the
[D Bindings](https://github.com/SiegeLord/DAllegro5) of
[Allegro5](http://sourceforge.net/p/alleg/allegro/ci/5.1/tree/) to render a
[Tiled](mapeditor.org) map using [dtiled](https://github.com/rcorre/dtiled).
| DTiled Allegro Example
===
This is an example of using the
[D Bindings](https://github.com/SiegeLord/DAllegro5) of
[Allegro5](http://sourceforge.net/p/alleg/allegro/ci/5.1/tree/) to render a
[Tiled](mapeditor.org) map using [dtiled](https://github.com/rcorre/dtiled).
The tile sheets used in this example are taken from an old project of mine and
are free to use under [CC0](http://creativecommons.org/publicdomain/zero/1.0/).
They can also be found on
[opengameart](http://opengameart.org/content/rpg-itemterraincharacter-sprites-ice-insignia)
| Update readme with tile sheet info | Update readme with tile sheet info
| Markdown | mit | rcorre/dtiled-example | markdown | ## Code Before:
DTiled Allegro Example
===
This is an example of using the
[D Bindings](https://github.com/SiegeLord/DAllegro5) of
[Allegro5](http://sourceforge.net/p/alleg/allegro/ci/5.1/tree/) to render a
[Tiled](mapeditor.org) map using [dtiled](https://github.com/rcorre/dtiled).
## Instruction:
Update readme with tile sheet info
## Code After:
DTiled Allegro Example
===
This is an example of using the
[D Bindings](https://github.com/SiegeLord/DAllegro5) of
[Allegro5](http://sourceforge.net/p/alleg/allegro/ci/5.1/tree/) to render a
[Tiled](mapeditor.org) map using [dtiled](https://github.com/rcorre/dtiled).
The tile sheets used in this example are taken from an old project of mine and
are free to use under [CC0](http://creativecommons.org/publicdomain/zero/1.0/).
They can also be found on
[opengameart](http://opengameart.org/content/rpg-itemterraincharacter-sprites-ice-insignia)
| DTiled Allegro Example
===
This is an example of using the
[D Bindings](https://github.com/SiegeLord/DAllegro5) of
[Allegro5](http://sourceforge.net/p/alleg/allegro/ci/5.1/tree/) to render a
[Tiled](mapeditor.org) map using [dtiled](https://github.com/rcorre/dtiled).
+
+ The tile sheets used in this example are taken from an old project of mine and
+ are free to use under [CC0](http://creativecommons.org/publicdomain/zero/1.0/).
+ They can also be found on
+ [opengameart](http://opengameart.org/content/rpg-itemterraincharacter-sprites-ice-insignia) | 5 | 0.714286 | 5 | 0 |
1461c05e3fc086e52ce3aba7728850308650253d | .travis.yml | .travis.yml | language: objective-c
osx_image: xcode7.2
before_install:
- gem install cocoapods --no-rdoc --no-ri --no-document --quiet
- pod lib lint --verbose
| language: objective-c
osx_image: xcode7.2
before_install:
- gem install cocoapods --no-rdoc --no-ri --no-document --quiet
- pod install
- pod lib lint --verbose
| Revert "[Travis] pod install is not necessary anymore" | Revert "[Travis] pod install is not necessary anymore"
This reverts commit c9eaaef5250b0e9634a217c69dbc670250d23a83.
| YAML | mit | mrackwitz/MRProgress,zaubara/MRProgress,mrackwitz/MRProgress,zaubara/MRProgress,zaubara/MRProgress | yaml | ## Code Before:
language: objective-c
osx_image: xcode7.2
before_install:
- gem install cocoapods --no-rdoc --no-ri --no-document --quiet
- pod lib lint --verbose
## Instruction:
Revert "[Travis] pod install is not necessary anymore"
This reverts commit c9eaaef5250b0e9634a217c69dbc670250d23a83.
## Code After:
language: objective-c
osx_image: xcode7.2
before_install:
- gem install cocoapods --no-rdoc --no-ri --no-document --quiet
- pod install
- pod lib lint --verbose
| language: objective-c
osx_image: xcode7.2
before_install:
- gem install cocoapods --no-rdoc --no-ri --no-document --quiet
+ - pod install
- pod lib lint --verbose | 1 | 0.166667 | 1 | 0 |
abb10e9cbfe5b28b693e3a138e54be495538ed31 | _examples/routing/fallback-handlers/main.go | _examples/routing/fallback-handlers/main.go | package main
import (
"github.com/kataras/iris"
)
func main() {
app := iris.New()
// this works as expected now,
// will handle *all* expect DELETE requests, even if there is no routes
app.Get("/action/{p}", h)
app.Run(iris.Addr(":8080"), iris.WithoutServerError(iris.ErrServerClosed))
}
func h(ctx iris.Context) {
ctx.Writef("[%s] %s : Parameter = `%s`", ctx.Method(), ctx.Path(), ctx.Params().Get("p"))
}
func fallbackHandler(ctx iris.Context) {
if ctx.Method() == "DELETE" {
ctx.Next()
return
}
ctx.Writef("[%s] %s : From fallback handler", ctx.Method(), ctx.Path())
}
| package main
import (
"github.com/kataras/iris"
)
func main() {
app := iris.New()
// add a fallback handler to process requests that would not be declared in the router.
app.Fallback(fallbackHandler)
// this works as expected now,
// will handle *all* expect DELETE requests, even if there is no routes
app.Get("/action/{p}", h)
app.Run(iris.Addr(":8080"), iris.WithoutServerError(iris.ErrServerClosed))
}
func h(ctx iris.Context) {
ctx.Writef("[%s] %s : Parameter = `%s`", ctx.Method(), ctx.Path(), ctx.Params().Get("p"))
}
func fallbackHandler(ctx iris.Context) {
if ctx.Method() == "DELETE" {
ctx.Next()
return
}
ctx.Writef("[%s] %s : From fallback handler", ctx.Method(), ctx.Path())
}
| Add a missing call for `fallbackHandler` | Add a missing call for `fallbackHandler`
Former-commit-id: a1ce94b39d326657cdbce34276477c34752f0000 | Go | bsd-3-clause | kataras/iris,kataras/iris,kataras/gapi,kataras/iris,kataras/gapi,kataras/iris | go | ## Code Before:
package main
import (
"github.com/kataras/iris"
)
func main() {
app := iris.New()
// this works as expected now,
// will handle *all* expect DELETE requests, even if there is no routes
app.Get("/action/{p}", h)
app.Run(iris.Addr(":8080"), iris.WithoutServerError(iris.ErrServerClosed))
}
func h(ctx iris.Context) {
ctx.Writef("[%s] %s : Parameter = `%s`", ctx.Method(), ctx.Path(), ctx.Params().Get("p"))
}
func fallbackHandler(ctx iris.Context) {
if ctx.Method() == "DELETE" {
ctx.Next()
return
}
ctx.Writef("[%s] %s : From fallback handler", ctx.Method(), ctx.Path())
}
## Instruction:
Add a missing call for `fallbackHandler`
Former-commit-id: a1ce94b39d326657cdbce34276477c34752f0000
## Code After:
package main
import (
"github.com/kataras/iris"
)
func main() {
app := iris.New()
// add a fallback handler to process requests that would not be declared in the router.
app.Fallback(fallbackHandler)
// this works as expected now,
// will handle *all* expect DELETE requests, even if there is no routes
app.Get("/action/{p}", h)
app.Run(iris.Addr(":8080"), iris.WithoutServerError(iris.ErrServerClosed))
}
func h(ctx iris.Context) {
ctx.Writef("[%s] %s : Parameter = `%s`", ctx.Method(), ctx.Path(), ctx.Params().Get("p"))
}
func fallbackHandler(ctx iris.Context) {
if ctx.Method() == "DELETE" {
ctx.Next()
return
}
ctx.Writef("[%s] %s : From fallback handler", ctx.Method(), ctx.Path())
}
| package main
import (
"github.com/kataras/iris"
)
func main() {
app := iris.New()
+
+ // add a fallback handler to process requests that would not be declared in the router.
+ app.Fallback(fallbackHandler)
// this works as expected now,
// will handle *all* expect DELETE requests, even if there is no routes
app.Get("/action/{p}", h)
app.Run(iris.Addr(":8080"), iris.WithoutServerError(iris.ErrServerClosed))
}
func h(ctx iris.Context) {
ctx.Writef("[%s] %s : Parameter = `%s`", ctx.Method(), ctx.Path(), ctx.Params().Get("p"))
}
func fallbackHandler(ctx iris.Context) {
if ctx.Method() == "DELETE" {
ctx.Next()
return
}
ctx.Writef("[%s] %s : From fallback handler", ctx.Method(), ctx.Path())
} | 3 | 0.103448 | 3 | 0 |
7633cace573119797817f928eb9804a0fee4d844 | lib/sculptor/templates/glyptotheque/source/partials/glyptotheque/_nav.slim | lib/sculptor/templates/glyptotheque/source/partials/glyptotheque/_nav.slim | - section ||= '/'
- subpages = resources_for(section, sort_by: :nav_order)
- subpages_count = resources_for(section, exclude_indexes: true).count
- unless subpages.empty?
nav.glypto-nav ng-class="{'s-hidden' : hidden}"
button.nav-toggle ng-click="toggle()"
= link_to 'Glyptotheque', '/', class: '_logo'
ul
- subpages.each do |r|
li(class="#{'s-selected' if r == current_page} #{'_index' if r.directory_index?}")
- if r.directory_index?
= link_to r.url
= (r.data.title || resource_dir(r))
span._count = subpages_count
- else
= link_to (r.data.title || resource_file(r)), r.url
| - section ||= '/'
- subpages = resources_for(section, sort_by: :nav_order)
- unless subpages.empty?
nav.glypto-nav ng-class="{'s-hidden' : hidden}"
button.nav-toggle ng-click="toggle()"
= link_to 'Glyptotheque', '/', class: '_logo'
ul
- subpages.each do |r|
li(class="#{'s-selected' if r == current_page} #{'_index' if r.directory_index?}")
- if r.directory_index?
- subpages_count = resources_for(r.url, exclude_indexes: true).count
= link_to r.url
= (r.data.title || resource_dir(r))
span._count = subpages_count
- else
= link_to (r.data.title || resource_file(r)), r.url
| Fix nav sub pages counts | Fix nav sub pages counts
| Slim | mit | tyom/sculptor,tyom/sculptor | slim | ## Code Before:
- section ||= '/'
- subpages = resources_for(section, sort_by: :nav_order)
- subpages_count = resources_for(section, exclude_indexes: true).count
- unless subpages.empty?
nav.glypto-nav ng-class="{'s-hidden' : hidden}"
button.nav-toggle ng-click="toggle()"
= link_to 'Glyptotheque', '/', class: '_logo'
ul
- subpages.each do |r|
li(class="#{'s-selected' if r == current_page} #{'_index' if r.directory_index?}")
- if r.directory_index?
= link_to r.url
= (r.data.title || resource_dir(r))
span._count = subpages_count
- else
= link_to (r.data.title || resource_file(r)), r.url
## Instruction:
Fix nav sub pages counts
## Code After:
- section ||= '/'
- subpages = resources_for(section, sort_by: :nav_order)
- unless subpages.empty?
nav.glypto-nav ng-class="{'s-hidden' : hidden}"
button.nav-toggle ng-click="toggle()"
= link_to 'Glyptotheque', '/', class: '_logo'
ul
- subpages.each do |r|
li(class="#{'s-selected' if r == current_page} #{'_index' if r.directory_index?}")
- if r.directory_index?
- subpages_count = resources_for(r.url, exclude_indexes: true).count
= link_to r.url
= (r.data.title || resource_dir(r))
span._count = subpages_count
- else
= link_to (r.data.title || resource_file(r)), r.url
| - section ||= '/'
- subpages = resources_for(section, sort_by: :nav_order)
- - subpages_count = resources_for(section, exclude_indexes: true).count
- unless subpages.empty?
nav.glypto-nav ng-class="{'s-hidden' : hidden}"
button.nav-toggle ng-click="toggle()"
= link_to 'Glyptotheque', '/', class: '_logo'
ul
- subpages.each do |r|
li(class="#{'s-selected' if r == current_page} #{'_index' if r.directory_index?}")
- if r.directory_index?
+ - subpages_count = resources_for(r.url, exclude_indexes: true).count
= link_to r.url
= (r.data.title || resource_dir(r))
span._count = subpages_count
- else
= link_to (r.data.title || resource_file(r)), r.url | 2 | 0.117647 | 1 | 1 |
f9189b29045e20ab505639088b0afce8f04ee2ac | exercises/space-age/metadata.yml | exercises/space-age/metadata.yml | ---
blurb: "Write a program that, given an age in seconds, calculates how old someone is in terms of a given planet's solar years."
source: "Partially inspired by Chapter 1 in Chris Pine's online Learn to Program tutorial."
source_url: "http://pine.fm/LearnToProgram/?Chapter=01"
| ---
blurb: "Given an age in seconds, calculate how old someone is in terms of a given planet's solar years."
source: "Partially inspired by Chapter 1 in Chris Pine's online Learn to Program tutorial."
source_url: "http://pine.fm/LearnToProgram/?Chapter=01"
| Remove "write a program" from space-age exercise | Remove "write a program" from space-age exercise
| YAML | mit | rpottsoh/x-common,exercism/x-common,ErikSchierboom/x-common,Vankog/problem-specifications,petertseng/x-common,exercism/x-common,petertseng/x-common,ErikSchierboom/x-common,kgengler/x-common,Vankog/problem-specifications,jmluy/x-common,rpottsoh/x-common,jmluy/x-common,jmluy/x-common,kgengler/x-common | yaml | ## Code Before:
---
blurb: "Write a program that, given an age in seconds, calculates how old someone is in terms of a given planet's solar years."
source: "Partially inspired by Chapter 1 in Chris Pine's online Learn to Program tutorial."
source_url: "http://pine.fm/LearnToProgram/?Chapter=01"
## Instruction:
Remove "write a program" from space-age exercise
## Code After:
---
blurb: "Given an age in seconds, calculate how old someone is in terms of a given planet's solar years."
source: "Partially inspired by Chapter 1 in Chris Pine's online Learn to Program tutorial."
source_url: "http://pine.fm/LearnToProgram/?Chapter=01"
| ---
- blurb: "Write a program that, given an age in seconds, calculates how old someone is in terms of a given planet's solar years."
? ^^^^^^^^^^^^^^^^^^^^^^^ -
+ blurb: "Given an age in seconds, calculate how old someone is in terms of a given planet's solar years."
? ^
source: "Partially inspired by Chapter 1 in Chris Pine's online Learn to Program tutorial."
source_url: "http://pine.fm/LearnToProgram/?Chapter=01" | 2 | 0.5 | 1 | 1 |
9dc54958f150051809ac677555a2eafed658f45f | README.md | README.md | QA Tools for Odoo maintainers
=============================
The goal is to provide helpers to ensure the quality of Odoo addons.
Sample travis configuration file (for version 7.0)
--------------------------------------------------
To setup the TravisCI continuous integration for your project, just copy the
content of the `/sample_files` to your project’s root directory.
If your project depends on other OCA/Github repositories simply add the following under `before_install` section:
install:
- git clone https://github.com/OCA/a_project_x $HOME/a_project_x -b 7.0
- git clone https://github.com/OCA/a_project_y $HOME/a_project_y -b 7.0
And add path to the cloned repositories to the `travis_run_tests` command:
script:
- travis_run_tests 7.0 $HOME/a_project_x $HOME/a_project_y
Sample coveralls configuration file
------------------------------------
You can use the following sample (also available in the travis directory) to
configure the reporting by coveralls.io. Copy it to `.coveragerc` in the root
of your project, and change the include value to match the name of your
project:
[report]
include =
*/OCA/<YOUR_PROJECT_NAME_HERE>/*
omit =
*/tests/*
*__init__.py
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover
# Don't complain about null context checking
if context is None:
| QA Tools for Odoo maintainers
=============================
The goal is to provide helpers to ensure the quality of Odoo addons.
Sample travis configuration file (for version 7.0)
--------------------------------------------------
To setup the TravisCI continuous integration for your project, just copy the
content of the [`/sample_files`](https://github.com/OCA/maintainer-quality-tools/tree/master/sample_files)
to your project’s root directory.
If your project depends on other OCA/Github repositories simply add the following under `before_install` section:
install:
- git clone https://github.com/OCA/a_project_x $HOME/a_project_x -b 7.0
- git clone https://github.com/OCA/a_project_y $HOME/a_project_y -b 7.0
And add path to the cloned repositories to the `travis_run_tests` command:
script:
- travis_run_tests 7.0 $HOME/a_project_x $HOME/a_project_y
Sample coveralls configuration file
------------------------------------
You can use the following sample (also available in the travis directory) to
configure the reporting by coveralls.io. Copy it to `.coveragerc` in the root
of your project, and change the include value to match the name of your
project:
[report]
include =
*/OCA/<YOUR_PROJECT_NAME_HERE>/*
omit =
*/tests/*
*__init__.py
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover
# Don't complain about null context checking
if context is None:
| Add link to samples in readme | Add link to samples in readme
| Markdown | agpl-3.0 | ilyasProgrammer/maintainer-quality-tools,kittiu/maintainer-quality-tools,yvaucher/maintainer-quality-tools,suvit/maintainer-quality-tools,ilyasProgrammer/maintainer-quality-tools,Ehtaga/maintainer-quality-tools,gurneyalex/maintainer-quality-tools,suvit/maintainer-quality-tools,Vauxoo/maintainer-quality-tools,kittiu/maintainer-quality-tools,dreispt/maintainer-quality-tools,OCA/maintainer-quality-tools,vauxoo-dev/maintainer-quality-tools,OCA/maintainer-quality-tools,vauxoo-dev/maintainer-quality-tools,acsone/maintainer-quality-tools,Vauxoo/maintainer-quality-tools,Endika/maintainer-quality-tools,ERP-Ukraine/maintainer-quality-tools,gurneyalex/maintainer-quality-tools,acsone/maintainer-quality-tools,hbrunn/maintainer-quality-tools,ERP-Ukraine/maintainer-quality-tools,savoirfairelinux/maintainer-quality-tools,savoirfairelinux/maintainer-quality-tools,acsone/maintainer-quality-tools,Endika/maintainer-quality-tools,hbrunn/maintainer-quality-tools,gurneyalex/maintainer-quality-tools,ERP-Ukraine/maintainer-quality-tools,yvaucher/maintainer-quality-tools,OCA/maintainer-quality-tools,Ehtaga/maintainer-quality-tools,dreispt/maintainer-quality-tools,dreispt/maintainer-quality-tools,Vauxoo/maintainer-quality-tools | markdown | ## Code Before:
QA Tools for Odoo maintainers
=============================
The goal is to provide helpers to ensure the quality of Odoo addons.
Sample travis configuration file (for version 7.0)
--------------------------------------------------
To setup the TravisCI continuous integration for your project, just copy the
content of the `/sample_files` to your project’s root directory.
If your project depends on other OCA/Github repositories simply add the following under `before_install` section:
install:
- git clone https://github.com/OCA/a_project_x $HOME/a_project_x -b 7.0
- git clone https://github.com/OCA/a_project_y $HOME/a_project_y -b 7.0
And add path to the cloned repositories to the `travis_run_tests` command:
script:
- travis_run_tests 7.0 $HOME/a_project_x $HOME/a_project_y
Sample coveralls configuration file
------------------------------------
You can use the following sample (also available in the travis directory) to
configure the reporting by coveralls.io. Copy it to `.coveragerc` in the root
of your project, and change the include value to match the name of your
project:
[report]
include =
*/OCA/<YOUR_PROJECT_NAME_HERE>/*
omit =
*/tests/*
*__init__.py
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover
# Don't complain about null context checking
if context is None:
## Instruction:
Add link to samples in readme
## Code After:
QA Tools for Odoo maintainers
=============================
The goal is to provide helpers to ensure the quality of Odoo addons.
Sample travis configuration file (for version 7.0)
--------------------------------------------------
To setup the TravisCI continuous integration for your project, just copy the
content of the [`/sample_files`](https://github.com/OCA/maintainer-quality-tools/tree/master/sample_files)
to your project’s root directory.
If your project depends on other OCA/Github repositories simply add the following under `before_install` section:
install:
- git clone https://github.com/OCA/a_project_x $HOME/a_project_x -b 7.0
- git clone https://github.com/OCA/a_project_y $HOME/a_project_y -b 7.0
And add path to the cloned repositories to the `travis_run_tests` command:
script:
- travis_run_tests 7.0 $HOME/a_project_x $HOME/a_project_y
Sample coveralls configuration file
------------------------------------
You can use the following sample (also available in the travis directory) to
configure the reporting by coveralls.io. Copy it to `.coveragerc` in the root
of your project, and change the include value to match the name of your
project:
[report]
include =
*/OCA/<YOUR_PROJECT_NAME_HERE>/*
omit =
*/tests/*
*__init__.py
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover
# Don't complain about null context checking
if context is None:
| QA Tools for Odoo maintainers
=============================
The goal is to provide helpers to ensure the quality of Odoo addons.
Sample travis configuration file (for version 7.0)
--------------------------------------------------
To setup the TravisCI continuous integration for your project, just copy the
- content of the `/sample_files` to your project’s root directory.
+ content of the [`/sample_files`](https://github.com/OCA/maintainer-quality-tools/tree/master/sample_files)
+ to your project’s root directory.
If your project depends on other OCA/Github repositories simply add the following under `before_install` section:
install:
- git clone https://github.com/OCA/a_project_x $HOME/a_project_x -b 7.0
- git clone https://github.com/OCA/a_project_y $HOME/a_project_y -b 7.0
And add path to the cloned repositories to the `travis_run_tests` command:
script:
- travis_run_tests 7.0 $HOME/a_project_x $HOME/a_project_y
Sample coveralls configuration file
------------------------------------
You can use the following sample (also available in the travis directory) to
configure the reporting by coveralls.io. Copy it to `.coveragerc` in the root
of your project, and change the include value to match the name of your
project:
[report]
include =
*/OCA/<YOUR_PROJECT_NAME_HERE>/*
omit =
*/tests/*
*__init__.py
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover
# Don't complain about null context checking
if context is None: | 3 | 0.066667 | 2 | 1 |
027ae8b8029d01622e3a9647f3ec6b1fca4c4d9d | chainerrl/wrappers/__init__.py | chainerrl/wrappers/__init__.py | from chainerrl.wrappers.cast_observation import CastObservation # NOQA
from chainerrl.wrappers.cast_observation import CastObservationToFloat32 # NOQA
from chainerrl.wrappers.randomize_action import RandomizeAction # NOQA
from chainerrl.wrappers.scale_reward import ScaleReward # NOQA
| from chainerrl.wrappers.cast_observation import CastObservation # NOQA
from chainerrl.wrappers.cast_observation import CastObservationToFloat32 # NOQA
from chainerrl.wrappers.randomize_action import RandomizeAction # NOQA
from chainerrl.wrappers.render import Render # NOQA
from chainerrl.wrappers.scale_reward import ScaleReward # NOQA
| Make Render available under chainerrl.wrappers | Make Render available under chainerrl.wrappers
| Python | mit | toslunar/chainerrl,toslunar/chainerrl | python | ## Code Before:
from chainerrl.wrappers.cast_observation import CastObservation # NOQA
from chainerrl.wrappers.cast_observation import CastObservationToFloat32 # NOQA
from chainerrl.wrappers.randomize_action import RandomizeAction # NOQA
from chainerrl.wrappers.scale_reward import ScaleReward # NOQA
## Instruction:
Make Render available under chainerrl.wrappers
## Code After:
from chainerrl.wrappers.cast_observation import CastObservation # NOQA
from chainerrl.wrappers.cast_observation import CastObservationToFloat32 # NOQA
from chainerrl.wrappers.randomize_action import RandomizeAction # NOQA
from chainerrl.wrappers.render import Render # NOQA
from chainerrl.wrappers.scale_reward import ScaleReward # NOQA
| from chainerrl.wrappers.cast_observation import CastObservation # NOQA
from chainerrl.wrappers.cast_observation import CastObservationToFloat32 # NOQA
from chainerrl.wrappers.randomize_action import RandomizeAction # NOQA
+ from chainerrl.wrappers.render import Render # NOQA
+
from chainerrl.wrappers.scale_reward import ScaleReward # NOQA | 2 | 0.333333 | 2 | 0 |
b9b8d77898c81afa5d918cc93c9011ace6f23965 | content_editor/renderer.py | content_editor/renderer.py | from __future__ import absolute_import, unicode_literals
from collections import OrderedDict
from django.db.models import Model
from django.utils.html import conditional_escape, mark_safe
class PluginRenderer(object):
def __init__(self):
self._renderers = OrderedDict(((
Model,
lambda plugin: mark_safe('<!-- %s: %s -->' % (
plugin._meta.label,
plugin,
)),
),))
def register(self, plugin, renderer):
self._renderers[plugin] = renderer
def render(self, contents):
return mark_safe(''.join(
conditional_escape(self.render_content(c)) for c in contents
))
def render_content(self, content):
if content.__class__ not in self._renderers:
for plugin, renderer in reversed( # pragma: no branch
list(self._renderers.items())):
if isinstance(content, plugin):
self.register(content.__class__, renderer)
break
return self._renderers[content.__class__](content)
| from __future__ import absolute_import, unicode_literals
from collections import OrderedDict
from django.db.models import Model
from django.utils.html import conditional_escape, mark_safe
__all__ = ('PluginRenderer',)
class RenderedContents(object):
def __init__(self, contents):
self.contents = contents
def __unicode__(self):
return mark_safe(''.join(self.contents))
def __iter__(self):
return iter(self.contents)
class PluginRenderer(object):
def __init__(self):
self._renderers = OrderedDict(((
Model,
lambda plugin: mark_safe('<!-- %s: %s -->' % (
plugin._meta.label,
plugin,
)),
),))
def register(self, plugin, renderer):
self._renderers[plugin] = renderer
def render(self, contents):
return RenderedContents(
conditional_escape(self.render_content(c)) for c in contents
)
def render_content(self, content):
if content.__class__ not in self._renderers:
for plugin, renderer in reversed( # pragma: no branch
list(self._renderers.items())):
if isinstance(content, plugin):
self.register(content.__class__, renderer)
break
return self._renderers[content.__class__](content)
| Allow iterating over rendered contents | Allow iterating over rendered contents
| Python | bsd-3-clause | matthiask/feincms2-content,matthiask/feincms2-content,matthiask/django-content-editor,matthiask/feincms2-content,matthiask/django-content-editor,matthiask/django-content-editor,matthiask/django-content-editor | python | ## Code Before:
from __future__ import absolute_import, unicode_literals
from collections import OrderedDict
from django.db.models import Model
from django.utils.html import conditional_escape, mark_safe
class PluginRenderer(object):
def __init__(self):
self._renderers = OrderedDict(((
Model,
lambda plugin: mark_safe('<!-- %s: %s -->' % (
plugin._meta.label,
plugin,
)),
),))
def register(self, plugin, renderer):
self._renderers[plugin] = renderer
def render(self, contents):
return mark_safe(''.join(
conditional_escape(self.render_content(c)) for c in contents
))
def render_content(self, content):
if content.__class__ not in self._renderers:
for plugin, renderer in reversed( # pragma: no branch
list(self._renderers.items())):
if isinstance(content, plugin):
self.register(content.__class__, renderer)
break
return self._renderers[content.__class__](content)
## Instruction:
Allow iterating over rendered contents
## Code After:
from __future__ import absolute_import, unicode_literals
from collections import OrderedDict
from django.db.models import Model
from django.utils.html import conditional_escape, mark_safe
__all__ = ('PluginRenderer',)
class RenderedContents(object):
def __init__(self, contents):
self.contents = contents
def __unicode__(self):
return mark_safe(''.join(self.contents))
def __iter__(self):
return iter(self.contents)
class PluginRenderer(object):
def __init__(self):
self._renderers = OrderedDict(((
Model,
lambda plugin: mark_safe('<!-- %s: %s -->' % (
plugin._meta.label,
plugin,
)),
),))
def register(self, plugin, renderer):
self._renderers[plugin] = renderer
def render(self, contents):
return RenderedContents(
conditional_escape(self.render_content(c)) for c in contents
)
def render_content(self, content):
if content.__class__ not in self._renderers:
for plugin, renderer in reversed( # pragma: no branch
list(self._renderers.items())):
if isinstance(content, plugin):
self.register(content.__class__, renderer)
break
return self._renderers[content.__class__](content)
| from __future__ import absolute_import, unicode_literals
from collections import OrderedDict
from django.db.models import Model
from django.utils.html import conditional_escape, mark_safe
+
+
+ __all__ = ('PluginRenderer',)
+
+
+ class RenderedContents(object):
+ def __init__(self, contents):
+ self.contents = contents
+
+ def __unicode__(self):
+ return mark_safe(''.join(self.contents))
+
+ def __iter__(self):
+ return iter(self.contents)
class PluginRenderer(object):
def __init__(self):
self._renderers = OrderedDict(((
Model,
lambda plugin: mark_safe('<!-- %s: %s -->' % (
plugin._meta.label,
plugin,
)),
),))
def register(self, plugin, renderer):
self._renderers[plugin] = renderer
def render(self, contents):
- return mark_safe(''.join(
+ return RenderedContents(
conditional_escape(self.render_content(c)) for c in contents
- ))
? -
+ )
def render_content(self, content):
if content.__class__ not in self._renderers:
for plugin, renderer in reversed( # pragma: no branch
list(self._renderers.items())):
if isinstance(content, plugin):
self.register(content.__class__, renderer)
break
return self._renderers[content.__class__](content) | 18 | 0.529412 | 16 | 2 |
20a2eb50eb95ca1d9bf1b455d07a83ffd8145c58 | Cargo.toml | Cargo.toml | [package]
name = "hematite_server"
version = "0.0.1"
authors = [
"Fenhl <fenhl@fenhl.net>",
"Carlos Cobo <toqueteos@gmail.com>"
]
[[bin]]
name = "hematite_server"
path = "server/main.rs"
doc = false
test = false
bench = false
[lib]
name = "hematite_server"
path = "src/lib.rs"
[dependencies]
byteorder = "*"
flate2 = "*"
json_macros = "*"
num = "*"
num-macros = "*"
regex = "*"
regex_macros = "*"
rustc-serialize = "*"
time = "*"
uuid = "*"
[dependencies.hematite-nbt]
path = "hem-nbt"
| [package]
name = "hematite_server"
version = "0.0.1"
authors = [
"Fenhl <fenhl@fenhl.net>",
"Carlos Cobo <toqueteos@gmail.com>"
]
[[bin]]
name = "hematite_server"
path = "server/main.rs"
doc = false
test = false
bench = false
[lib]
name = "hematite_server"
path = "src/lib.rs"
[dependencies]
byteorder = "*"
flate2 = "*"
json_macros = "*"
num = "*"
#num-macros = "*"
regex = "*"
regex_macros = "*"
rustc-serialize = "*"
time = "*"
uuid = "*"
[dependencies.hematite-nbt]
path = "hem-nbt"
[dependencies.num-macros]
git = "https://github.com/rust-lang/num.git" # crates.io version is outdated
| Update to latest Rust nightly | Update to latest Rust nightly
| TOML | mit | PistonDevelopers/hematite_server,fenhl/hematite_server,toqueteos/hematite_server | toml | ## Code Before:
[package]
name = "hematite_server"
version = "0.0.1"
authors = [
"Fenhl <fenhl@fenhl.net>",
"Carlos Cobo <toqueteos@gmail.com>"
]
[[bin]]
name = "hematite_server"
path = "server/main.rs"
doc = false
test = false
bench = false
[lib]
name = "hematite_server"
path = "src/lib.rs"
[dependencies]
byteorder = "*"
flate2 = "*"
json_macros = "*"
num = "*"
num-macros = "*"
regex = "*"
regex_macros = "*"
rustc-serialize = "*"
time = "*"
uuid = "*"
[dependencies.hematite-nbt]
path = "hem-nbt"
## Instruction:
Update to latest Rust nightly
## Code After:
[package]
name = "hematite_server"
version = "0.0.1"
authors = [
"Fenhl <fenhl@fenhl.net>",
"Carlos Cobo <toqueteos@gmail.com>"
]
[[bin]]
name = "hematite_server"
path = "server/main.rs"
doc = false
test = false
bench = false
[lib]
name = "hematite_server"
path = "src/lib.rs"
[dependencies]
byteorder = "*"
flate2 = "*"
json_macros = "*"
num = "*"
#num-macros = "*"
regex = "*"
regex_macros = "*"
rustc-serialize = "*"
time = "*"
uuid = "*"
[dependencies.hematite-nbt]
path = "hem-nbt"
[dependencies.num-macros]
git = "https://github.com/rust-lang/num.git" # crates.io version is outdated
| [package]
name = "hematite_server"
version = "0.0.1"
authors = [
"Fenhl <fenhl@fenhl.net>",
"Carlos Cobo <toqueteos@gmail.com>"
]
[[bin]]
name = "hematite_server"
path = "server/main.rs"
doc = false
test = false
bench = false
[lib]
name = "hematite_server"
path = "src/lib.rs"
[dependencies]
byteorder = "*"
flate2 = "*"
json_macros = "*"
num = "*"
- num-macros = "*"
+ #num-macros = "*"
? +
regex = "*"
regex_macros = "*"
rustc-serialize = "*"
time = "*"
uuid = "*"
[dependencies.hematite-nbt]
path = "hem-nbt"
+
+ [dependencies.num-macros]
+ git = "https://github.com/rust-lang/num.git" # crates.io version is outdated | 5 | 0.147059 | 4 | 1 |
23324d93317d3fdcfde961f171fc80484237f1b2 | build/template/function-test.blade.php | build/template/function-test.blade.php | {!! '<?'.'php' !!}
use function phln\{{$ns}}\{{$name}};
use const phln\{{$ns}}\{{$name}};
class {{ ucfirst("{$name}Test") }} extends \PHPUnit_Framework_TestCase
{
}
| {!! '<?'.'php' !!}
use const phln\{{$ns}}\{{$name}};
class {{ ucfirst("{$name}Test") }} extends \Phln\Build\PhpUnit\TestCase
{
public function getTestedFn(): string
{
return {{$name}};
}
/** @test */
public function it_works()
{
$this->assertTrue($this->callFn());
}
}
| Update functions unit test template | Update functions unit test template
| PHP | mit | baethon/phln,baethon/phln,baethon/phln | php | ## Code Before:
{!! '<?'.'php' !!}
use function phln\{{$ns}}\{{$name}};
use const phln\{{$ns}}\{{$name}};
class {{ ucfirst("{$name}Test") }} extends \PHPUnit_Framework_TestCase
{
}
## Instruction:
Update functions unit test template
## Code After:
{!! '<?'.'php' !!}
use const phln\{{$ns}}\{{$name}};
class {{ ucfirst("{$name}Test") }} extends \Phln\Build\PhpUnit\TestCase
{
public function getTestedFn(): string
{
return {{$name}};
}
/** @test */
public function it_works()
{
$this->assertTrue($this->callFn());
}
}
| {!! '<?'.'php' !!}
- use function phln\{{$ns}}\{{$name}};
use const phln\{{$ns}}\{{$name}};
- class {{ ucfirst("{$name}Test") }} extends \PHPUnit_Framework_TestCase
? ^ ^^^^^^^^^^^
+ class {{ ucfirst("{$name}Test") }} extends \Phln\Build\PhpUnit\TestCase
? ^^^^^^^^^^ ++ ^
{
+ public function getTestedFn(): string
+ {
+ return {{$name}};
+ }
+
+ /** @test */
+ public function it_works()
+ {
+ $this->assertTrue($this->callFn());
+ }
} | 13 | 1.625 | 11 | 2 |
371b712aaf14578658641081fd7716a291eb2752 | src/index.js | src/index.js | import SexyDropdown from "./components/SexyDropdown.jsx";
import APISearchItems from "./api-search-items";
export {
APISearchItems,
SexyDropdown
}
| import SexyDropdown from "./components/SexyDropdown.jsx";
export {
SexyDropdown
}
| Change data loading. Added ajax load. | Change data loading. Added ajax load.
| JavaScript | mit | Zmoki/react-ui-dropdown | javascript | ## Code Before:
import SexyDropdown from "./components/SexyDropdown.jsx";
import APISearchItems from "./api-search-items";
export {
APISearchItems,
SexyDropdown
}
## Instruction:
Change data loading. Added ajax load.
## Code After:
import SexyDropdown from "./components/SexyDropdown.jsx";
export {
SexyDropdown
}
| import SexyDropdown from "./components/SexyDropdown.jsx";
- import APISearchItems from "./api-search-items";
export {
- APISearchItems,
SexyDropdown
} | 2 | 0.285714 | 0 | 2 |
bcc79588e5e49c928210d6830fbe1a7386fcf5bb | apps/search/tasks.py | apps/search/tasks.py | import logging
from django.conf import settings
from django.db.models.signals import pre_delete
from elasticutils.contrib.django.tasks import index_objects, unindex_objects
from wiki.signals import render_done
def render_done_handler(**kwargs):
if not settings.ES_LIVE_INDEX or 'instance' not in kwargs:
return
instance = kwargs['instance']
try:
index_objects.delay(instance.get_mapping_type(), [instance.id])
except:
logging.error('Search indexing task failed',
exc_info=True)
def pre_delete_handler(**kwargs):
if not settings.ES_LIVE_INDEX or 'instance' not in kwargs:
return
instance = kwargs['instance']
unindex_objects.delay(instance.get_mapping_type(), [instance.id])
def register_live_index(model_cls):
"""Register a model and index for auto indexing."""
uid = str(model_cls) + 'live_indexing'
render_done.connect(render_done_handler, model_cls, dispatch_uid=uid)
pre_delete.connect(pre_delete_handler, model_cls, dispatch_uid=uid)
# Enable this to be used as decorator.
return model_cls
| import logging
import warnings
from django.conf import settings
from django.db.models.signals import pre_delete
# ignore a deprecation warning from elasticutils until the fix is released
# refs https://github.com/mozilla/elasticutils/pull/160
warnings.filterwarnings("ignore",
category=DeprecationWarning,
module='celery.decorators')
from elasticutils.contrib.django.tasks import index_objects, unindex_objects
from wiki.signals import render_done
def render_done_handler(**kwargs):
if not settings.ES_LIVE_INDEX or 'instance' not in kwargs:
return
instance = kwargs['instance']
try:
index_objects.delay(instance.get_mapping_type(), [instance.id])
except:
logging.error('Search indexing task failed',
exc_info=True)
def pre_delete_handler(**kwargs):
if not settings.ES_LIVE_INDEX or 'instance' not in kwargs:
return
instance = kwargs['instance']
unindex_objects.delay(instance.get_mapping_type(), [instance.id])
def register_live_index(model_cls):
"""Register a model and index for auto indexing."""
uid = str(model_cls) + 'live_indexing'
render_done.connect(render_done_handler, model_cls, dispatch_uid=uid)
pre_delete.connect(pre_delete_handler, model_cls, dispatch_uid=uid)
# Enable this to be used as decorator.
return model_cls
| Stop a deprecation warning that is thrown in elasticutils. | Stop a deprecation warning that is thrown in elasticutils.
This is not going to be needed once https://github.com/mozilla/elasticutils/pull/160
has been released.
| Python | mpl-2.0 | jezdez/kuma,whip112/Whip112,FrankBian/kuma,YOTOV-LIMITED/kuma,SphinxKnight/kuma,jgmize/kuma,RanadeepPolavarapu/kuma,ollie314/kuma,nhenezi/kuma,FrankBian/kuma,surajssd/kuma,YOTOV-LIMITED/kuma,yfdyh000/kuma,cindyyu/kuma,SphinxKnight/kuma,openjck/kuma,MenZil/kuma,RanadeepPolavarapu/kuma,yfdyh000/kuma,whip112/Whip112,carnell69/kuma,YOTOV-LIMITED/kuma,ollie314/kuma,RanadeepPolavarapu/kuma,SphinxKnight/kuma,surajssd/kuma,safwanrahman/kuma,utkbansal/kuma,groovecoder/kuma,chirilo/kuma,openjck/kuma,cindyyu/kuma,ronakkhunt/kuma,safwanrahman/kuma,robhudson/kuma,Elchi3/kuma,Elchi3/kuma,biswajitsahu/kuma,robhudson/kuma,yfdyh000/kuma,robhudson/kuma,biswajitsahu/kuma,hoosteeno/kuma,chirilo/kuma,groovecoder/kuma,scrollback/kuma,ronakkhunt/kuma,Elchi3/kuma,davehunt/kuma,ollie314/kuma,jwhitlock/kuma,tximikel/kuma,Elchi3/kuma,carnell69/kuma,hoosteeno/kuma,utkbansal/kuma,davehunt/kuma,anaran/kuma,mastizada/kuma,carnell69/kuma,bluemini/kuma,jwhitlock/kuma,SphinxKnight/kuma,scrollback/kuma,jgmize/kuma,chirilo/kuma,cindyyu/kuma,biswajitsahu/kuma,mozilla/kuma,a2sheppy/kuma,a2sheppy/kuma,nhenezi/kuma,MenZil/kuma,ollie314/kuma,tximikel/kuma,davidyezsetz/kuma,a2sheppy/kuma,surajssd/kuma,davehunt/kuma,yfdyh000/kuma,biswajitsahu/kuma,darkwing/kuma,RanadeepPolavarapu/kuma,tximikel/kuma,jezdez/kuma,bluemini/kuma,whip112/Whip112,surajssd/kuma,nhenezi/kuma,mozilla/kuma,openjck/kuma,nhenezi/kuma,davidyezsetz/kuma,darkwing/kuma,carnell69/kuma,scrollback/kuma,MenZil/kuma,MenZil/kuma,jgmize/kuma,varunkamra/kuma,darkwing/kuma,hoosteeno/kuma,cindyyu/kuma,groovecoder/kuma,YOTOV-LIMITED/kuma,darkwing/kuma,openjck/kuma,groovecoder/kuma,robhudson/kuma,openjck/kuma,ollie314/kuma,utkbansal/kuma,davehunt/kuma,escattone/kuma,groovecoder/kuma,bluemini/kuma,ronakkhunt/kuma,ollie314/kuma,jgmize/kuma,surajssd/kuma,a2sheppy/kuma,hoosteeno/kuma,jezdez/kuma,YOTOV-LIMITED/kuma,jwhitlock/kuma,utkbansal/kuma,a2sheppy/kuma,cindyyu/kuma,varunkamra/kuma,jwhitlock/kuma,jezdez/kuma,varunkamra/kuma,carnell69/kuma,carnell69/kuma,mozilla/kuma,biswajitsahu/kuma,anaran/kuma,yfdyh000/kuma,YOTOV-LIMITED/kuma,escattone/kuma,scrollback/kuma,varunkamra/kuma,utkbansal/kuma,RanadeepPolavarapu/kuma,MenZil/kuma,SphinxKnight/kuma,nhenezi/kuma,davehunt/kuma,whip112/Whip112,hoosteeno/kuma,chirilo/kuma,biswajitsahu/kuma,mastizada/kuma,safwanrahman/kuma,davidyezsetz/kuma,anaran/kuma,Elchi3/kuma,bluemini/kuma,whip112/Whip112,FrankBian/kuma,utkbansal/kuma,varunkamra/kuma,safwanrahman/kuma,ronakkhunt/kuma,tximikel/kuma,ronakkhunt/kuma,davehunt/kuma,tximikel/kuma,anaran/kuma,chirilo/kuma,darkwing/kuma,openjck/kuma,FrankBian/kuma,mastizada/kuma,anaran/kuma,varunkamra/kuma,groovecoder/kuma,davidyezsetz/kuma,SphinxKnight/kuma,bluemini/kuma,anaran/kuma,ronakkhunt/kuma,robhudson/kuma,MenZil/kuma,jezdez/kuma,bluemini/kuma,mozilla/kuma,chirilo/kuma,yfdyh000/kuma,scrollback/kuma,cindyyu/kuma,jgmize/kuma,safwanrahman/kuma,safwanrahman/kuma,whip112/Whip112,darkwing/kuma,jwhitlock/kuma,FrankBian/kuma,jgmize/kuma,davidyezsetz/kuma,RanadeepPolavarapu/kuma,hoosteeno/kuma,mastizada/kuma,surajssd/kuma,mozilla/kuma,escattone/kuma,robhudson/kuma,tximikel/kuma,jezdez/kuma | python | ## Code Before:
import logging
from django.conf import settings
from django.db.models.signals import pre_delete
from elasticutils.contrib.django.tasks import index_objects, unindex_objects
from wiki.signals import render_done
def render_done_handler(**kwargs):
if not settings.ES_LIVE_INDEX or 'instance' not in kwargs:
return
instance = kwargs['instance']
try:
index_objects.delay(instance.get_mapping_type(), [instance.id])
except:
logging.error('Search indexing task failed',
exc_info=True)
def pre_delete_handler(**kwargs):
if not settings.ES_LIVE_INDEX or 'instance' not in kwargs:
return
instance = kwargs['instance']
unindex_objects.delay(instance.get_mapping_type(), [instance.id])
def register_live_index(model_cls):
"""Register a model and index for auto indexing."""
uid = str(model_cls) + 'live_indexing'
render_done.connect(render_done_handler, model_cls, dispatch_uid=uid)
pre_delete.connect(pre_delete_handler, model_cls, dispatch_uid=uid)
# Enable this to be used as decorator.
return model_cls
## Instruction:
Stop a deprecation warning that is thrown in elasticutils.
This is not going to be needed once https://github.com/mozilla/elasticutils/pull/160
has been released.
## Code After:
import logging
import warnings
from django.conf import settings
from django.db.models.signals import pre_delete
# ignore a deprecation warning from elasticutils until the fix is released
# refs https://github.com/mozilla/elasticutils/pull/160
warnings.filterwarnings("ignore",
category=DeprecationWarning,
module='celery.decorators')
from elasticutils.contrib.django.tasks import index_objects, unindex_objects
from wiki.signals import render_done
def render_done_handler(**kwargs):
if not settings.ES_LIVE_INDEX or 'instance' not in kwargs:
return
instance = kwargs['instance']
try:
index_objects.delay(instance.get_mapping_type(), [instance.id])
except:
logging.error('Search indexing task failed',
exc_info=True)
def pre_delete_handler(**kwargs):
if not settings.ES_LIVE_INDEX or 'instance' not in kwargs:
return
instance = kwargs['instance']
unindex_objects.delay(instance.get_mapping_type(), [instance.id])
def register_live_index(model_cls):
"""Register a model and index for auto indexing."""
uid = str(model_cls) + 'live_indexing'
render_done.connect(render_done_handler, model_cls, dispatch_uid=uid)
pre_delete.connect(pre_delete_handler, model_cls, dispatch_uid=uid)
# Enable this to be used as decorator.
return model_cls
| import logging
+ import warnings
from django.conf import settings
from django.db.models.signals import pre_delete
+
+ # ignore a deprecation warning from elasticutils until the fix is released
+ # refs https://github.com/mozilla/elasticutils/pull/160
+ warnings.filterwarnings("ignore",
+ category=DeprecationWarning,
+ module='celery.decorators')
from elasticutils.contrib.django.tasks import index_objects, unindex_objects
from wiki.signals import render_done
def render_done_handler(**kwargs):
if not settings.ES_LIVE_INDEX or 'instance' not in kwargs:
return
instance = kwargs['instance']
try:
index_objects.delay(instance.get_mapping_type(), [instance.id])
except:
logging.error('Search indexing task failed',
exc_info=True)
def pre_delete_handler(**kwargs):
if not settings.ES_LIVE_INDEX or 'instance' not in kwargs:
return
instance = kwargs['instance']
unindex_objects.delay(instance.get_mapping_type(), [instance.id])
def register_live_index(model_cls):
"""Register a model and index for auto indexing."""
uid = str(model_cls) + 'live_indexing'
render_done.connect(render_done_handler, model_cls, dispatch_uid=uid)
pre_delete.connect(pre_delete_handler, model_cls, dispatch_uid=uid)
# Enable this to be used as decorator.
return model_cls | 7 | 0.2 | 7 | 0 |
660bc98d0dc9e97e501727951081495ff2d1b9f4 | .travis.yml | .travis.yml | language: node_js
node_js:
- "node"
before_script:
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
mkdir build;
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./build/cc-test-reporter;
chmod +x ./build/cc-test-reporter;
./build/cc-test-reporter before-build;
fi
script:
- "npm run test-ci"
after_script:
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
cd ./build;
./cc-test-reporter after-build --prefix '..' --exit-code $TRAVIS_TEST_RESULT;
fi
| language: node_js
node_js:
- "node"
before_script:
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
mkdir build;
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./build/cc-test-reporter;
chmod +x ./build/cc-test-reporter;
./build/cc-test-reporter before-build;
fi
script:
- "npm run test-ci"
after_script:
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
cd ./build;
./cc-test-reporter after-build --prefix /home/travis/build/jordansne/ntwitbot --exit-code $TRAVIS_TEST_RESULT;
fi
| Change --prefix dir to absolute path | Change --prefix dir to absolute path
| YAML | mit | jordansne/ntwitbot | yaml | ## Code Before:
language: node_js
node_js:
- "node"
before_script:
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
mkdir build;
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./build/cc-test-reporter;
chmod +x ./build/cc-test-reporter;
./build/cc-test-reporter before-build;
fi
script:
- "npm run test-ci"
after_script:
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
cd ./build;
./cc-test-reporter after-build --prefix '..' --exit-code $TRAVIS_TEST_RESULT;
fi
## Instruction:
Change --prefix dir to absolute path
## Code After:
language: node_js
node_js:
- "node"
before_script:
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
mkdir build;
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./build/cc-test-reporter;
chmod +x ./build/cc-test-reporter;
./build/cc-test-reporter before-build;
fi
script:
- "npm run test-ci"
after_script:
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
cd ./build;
./cc-test-reporter after-build --prefix /home/travis/build/jordansne/ntwitbot --exit-code $TRAVIS_TEST_RESULT;
fi
| language: node_js
node_js:
- "node"
before_script:
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
mkdir build;
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./build/cc-test-reporter;
chmod +x ./build/cc-test-reporter;
./build/cc-test-reporter before-build;
fi
script:
- "npm run test-ci"
after_script:
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
cd ./build;
- ./cc-test-reporter after-build --prefix '..' --exit-code $TRAVIS_TEST_RESULT;
? ^^^^
+ ./cc-test-reporter after-build --prefix /home/travis/build/jordansne/ntwitbot --exit-code $TRAVIS_TEST_RESULT;
? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
fi | 2 | 0.117647 | 1 | 1 |
c843784e404bef4c73082c7201224a10172e2819 | _layouts/redirect.html | _layouts/redirect.html | <html>
<head>
<script>
window.location.replace("/versions/{{ site.default_version }}/{{ page.redirect }}");
</script>
</head>
</html>
| <html>
<head>
<script>
window.location.replace("/versions/{{ site.default_version }}/{{ page.redirect }}" + window.location.hash);
</script>
</head>
</html>
| Make links to docs with anchors working again. | Make links to docs with anchors working again.
This way, we can still use links like:
http://bazel.io/docs/bazel-user-manual.html#sandboxing
--
Change-Id: Id76a9795eaaaa0cd420df83440faada584c8621b
Reviewed-on: https://bazel-review.googlesource.com/c/5950/
MOS_MIGRATED_REVID=132654093
| HTML | apache-2.0 | bazelbuild/bazel-website,davidzchen/bazel-website,bazelbuild/bazel-website,davidzchen/bazel-website,bazelbuild/bazel-website,davidzchen/bazel-website,davidzchen/bazel-website | html | ## Code Before:
<html>
<head>
<script>
window.location.replace("/versions/{{ site.default_version }}/{{ page.redirect }}");
</script>
</head>
</html>
## Instruction:
Make links to docs with anchors working again.
This way, we can still use links like:
http://bazel.io/docs/bazel-user-manual.html#sandboxing
--
Change-Id: Id76a9795eaaaa0cd420df83440faada584c8621b
Reviewed-on: https://bazel-review.googlesource.com/c/5950/
MOS_MIGRATED_REVID=132654093
## Code After:
<html>
<head>
<script>
window.location.replace("/versions/{{ site.default_version }}/{{ page.redirect }}" + window.location.hash);
</script>
</head>
</html>
| <html>
<head>
<script>
- window.location.replace("/versions/{{ site.default_version }}/{{ page.redirect }}");
+ window.location.replace("/versions/{{ site.default_version }}/{{ page.redirect }}" + window.location.hash);
? +++++++++++++++++++++++
</script>
</head>
</html> | 2 | 0.285714 | 1 | 1 |
c3eac4bf993119318f28c4c90d0b66b3d5704574 | json.ts | json.ts | /**
* Wraps parsing of JSON, so that an error is logged, but no exception is thrown
*/
export function safeParseJson (value?: string|false|null) : {[k: string]: any}|null
{
try
{
if (value)
{
const content = value.trim();
return (content !== "")
? JSON.parse(content)
: null;
}
}
catch (e)
{
console.error(`Could not parse JSON content: ${e.message}`, e);
}
return null;
}
/**
* Parses JSON from the given element's content.
*/
export function parseElementAsJson (element: HTMLElement) : {[k: string]: any}|null
{
return safeParseJson(
(element.textContent || "")
.replace(/</g, "<")
.replace(/>/g, ">")
.replace(/&/g, "&")
);
}
| /**
* Wraps parsing of JSON, so that an error is logged, but no exception is thrown
*/
export function safeParseJson<T extends {[k: string]: any}> (value?: string|false|null) : T|null
{
try
{
if (value)
{
const content = value.trim();
return (content !== "")
? JSON.parse(content)
: null;
}
}
catch (e)
{
console.error(`Could not parse JSON content: ${e.message}`, e);
}
return null;
}
/**
* Parses JSON from the given element's content.
*/
export function parseElementAsJson<T extends {[k: string]: any}> (element: HTMLElement) : T|null
{
return safeParseJson(
(element.textContent || "")
.replace(/</g, "<")
.replace(/>/g, ">")
.replace(/&/g, "&")
);
}
| Make JSON method return types generic | Make JSON method return types generic
| TypeScript | bsd-3-clause | Becklyn/mojave,Becklyn/mojave,Becklyn/mojave | typescript | ## Code Before:
/**
* Wraps parsing of JSON, so that an error is logged, but no exception is thrown
*/
export function safeParseJson (value?: string|false|null) : {[k: string]: any}|null
{
try
{
if (value)
{
const content = value.trim();
return (content !== "")
? JSON.parse(content)
: null;
}
}
catch (e)
{
console.error(`Could not parse JSON content: ${e.message}`, e);
}
return null;
}
/**
* Parses JSON from the given element's content.
*/
export function parseElementAsJson (element: HTMLElement) : {[k: string]: any}|null
{
return safeParseJson(
(element.textContent || "")
.replace(/</g, "<")
.replace(/>/g, ">")
.replace(/&/g, "&")
);
}
## Instruction:
Make JSON method return types generic
## Code After:
/**
* Wraps parsing of JSON, so that an error is logged, but no exception is thrown
*/
export function safeParseJson<T extends {[k: string]: any}> (value?: string|false|null) : T|null
{
try
{
if (value)
{
const content = value.trim();
return (content !== "")
? JSON.parse(content)
: null;
}
}
catch (e)
{
console.error(`Could not parse JSON content: ${e.message}`, e);
}
return null;
}
/**
* Parses JSON from the given element's content.
*/
export function parseElementAsJson<T extends {[k: string]: any}> (element: HTMLElement) : T|null
{
return safeParseJson(
(element.textContent || "")
.replace(/</g, "<")
.replace(/>/g, ">")
.replace(/&/g, "&")
);
}
| /**
* Wraps parsing of JSON, so that an error is logged, but no exception is thrown
*/
- export function safeParseJson (value?: string|false|null) : {[k: string]: any}|null
+ export function safeParseJson<T extends {[k: string]: any}> (value?: string|false|null) : T|null
{
try
{
if (value)
{
const content = value.trim();
return (content !== "")
? JSON.parse(content)
: null;
}
}
catch (e)
{
console.error(`Could not parse JSON content: ${e.message}`, e);
}
return null;
}
/**
* Parses JSON from the given element's content.
*/
- export function parseElementAsJson (element: HTMLElement) : {[k: string]: any}|null
+ export function parseElementAsJson<T extends {[k: string]: any}> (element: HTMLElement) : T|null
{
return safeParseJson(
(element.textContent || "")
.replace(/</g, "<")
.replace(/>/g, ">")
.replace(/&/g, "&")
);
} | 4 | 0.114286 | 2 | 2 |
fd2dce157cfc4f04453aaedaea3fac5247fc825c | cmake/add_airframe.cmake | cmake/add_airframe.cmake | function(add_airframe pack_airframe_path)
# Airframe file paths
if($ENV{ROS_HOME})
set(local_airframe_path "$ENV{ROS_HOME}/etc")
else()
set(local_airframe_path "$ENV{HOME}/.ros/etc")
endif()
# aborts if directory where airframe config is put does not exist
if(NOT EXISTS ${local_airframe_path})
message(FATAL_ERROR "PX4 Firmware is REQUIRED.\nInstall and run 'make posix_sitl_default gazebo'.\nIf this persists after installation, make symbolic link from Firmware/ROMFS/px4fmu_common to ~/.ros/etc")
endif()
# get filename
get_filename_component(file_name ${pack_airframe_path} NAME)
# replace airframe number by "airframe_" to obtain target name
string(REGEX REPLACE ^[0-9]+_ "airframe_" target_name ${file_name})
# add target that makes symbolic link
add_custom_target(${target_name} ALL
ln -s -b ${pack_airframe_path} ${local_airframe_path}/init.d-posix/${file_name})
endfunction() | function(add_airframe pack_airframe_path)
# Airframe file paths
if($ENV{ROS_HOME})
set(local_airframe_path "$ENV{ROS_HOME}/etc")
else()
set(local_airframe_path "$ENV{HOME}/.ros/etc")
endif()
# aborts if directory where airframe config is put does not exist
if(NOT EXISTS ${local_airframe_path})
file(MAKE_DIRECTORY ${local_airframe_path}/init.d-posix)
endif()
# get filename
get_filename_component(file_name ${pack_airframe_path} NAME)
# replace airframe number by "airframe_" to obtain target name
string(REGEX REPLACE ^[0-9]+_ "airframe_" target_name ${file_name})
# add target that makes symbolic link
add_custom_target(${target_name} ALL
ln -s -b ${pack_airframe_path} ${local_airframe_path}/init.d-posix/${file_name})
endfunction() | Make directory if not exist | Make directory if not exist
| CMake | mit | uenota/px4_simulation_stack,uenota/px4_simulation_stack,uenota/px4_simulation_stack | cmake | ## Code Before:
function(add_airframe pack_airframe_path)
# Airframe file paths
if($ENV{ROS_HOME})
set(local_airframe_path "$ENV{ROS_HOME}/etc")
else()
set(local_airframe_path "$ENV{HOME}/.ros/etc")
endif()
# aborts if directory where airframe config is put does not exist
if(NOT EXISTS ${local_airframe_path})
message(FATAL_ERROR "PX4 Firmware is REQUIRED.\nInstall and run 'make posix_sitl_default gazebo'.\nIf this persists after installation, make symbolic link from Firmware/ROMFS/px4fmu_common to ~/.ros/etc")
endif()
# get filename
get_filename_component(file_name ${pack_airframe_path} NAME)
# replace airframe number by "airframe_" to obtain target name
string(REGEX REPLACE ^[0-9]+_ "airframe_" target_name ${file_name})
# add target that makes symbolic link
add_custom_target(${target_name} ALL
ln -s -b ${pack_airframe_path} ${local_airframe_path}/init.d-posix/${file_name})
endfunction()
## Instruction:
Make directory if not exist
## Code After:
function(add_airframe pack_airframe_path)
# Airframe file paths
if($ENV{ROS_HOME})
set(local_airframe_path "$ENV{ROS_HOME}/etc")
else()
set(local_airframe_path "$ENV{HOME}/.ros/etc")
endif()
# aborts if directory where airframe config is put does not exist
if(NOT EXISTS ${local_airframe_path})
file(MAKE_DIRECTORY ${local_airframe_path}/init.d-posix)
endif()
# get filename
get_filename_component(file_name ${pack_airframe_path} NAME)
# replace airframe number by "airframe_" to obtain target name
string(REGEX REPLACE ^[0-9]+_ "airframe_" target_name ${file_name})
# add target that makes symbolic link
add_custom_target(${target_name} ALL
ln -s -b ${pack_airframe_path} ${local_airframe_path}/init.d-posix/${file_name})
endfunction() | function(add_airframe pack_airframe_path)
# Airframe file paths
if($ENV{ROS_HOME})
set(local_airframe_path "$ENV{ROS_HOME}/etc")
else()
set(local_airframe_path "$ENV{HOME}/.ros/etc")
endif()
# aborts if directory where airframe config is put does not exist
if(NOT EXISTS ${local_airframe_path})
- message(FATAL_ERROR "PX4 Firmware is REQUIRED.\nInstall and run 'make posix_sitl_default gazebo'.\nIf this persists after installation, make symbolic link from Firmware/ROMFS/px4fmu_common to ~/.ros/etc")
+ file(MAKE_DIRECTORY ${local_airframe_path}/init.d-posix)
endif()
# get filename
get_filename_component(file_name ${pack_airframe_path} NAME)
# replace airframe number by "airframe_" to obtain target name
string(REGEX REPLACE ^[0-9]+_ "airframe_" target_name ${file_name})
# add target that makes symbolic link
add_custom_target(${target_name} ALL
ln -s -b ${pack_airframe_path} ${local_airframe_path}/init.d-posix/${file_name})
endfunction() | 2 | 0.083333 | 1 | 1 |
59fde9ff448e90129be6f90d303c3361fa2eace6 | .travis.yml | .travis.yml | branches:
only:
- master
language: cpp
sudo: true
matrix:
allow_failures:
- os: osx
include:
- language: python
sudo: false
python: 2.7
env: TASKS="clang-format"
os: linux
dist: trusty
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-6.0
packages:
- clang-format-6.0
- compiler: gcc
os: linux
addons:
apt:
sources: ubuntu-toolchain-r-test
packages: g++-4.9
env:
- TASKS="ctest gcc-4.9"
- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
- compiler: gcc
os: linux
addons:
apt:
sources: ubuntu-toolchain-r-test
packages: g++-6
env:
- TASKS="ctest gcc-6.3"
- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
- compiler: clang
os: linux
env: TASKS="ctest clang-3.9"
- os: osx
install:
- . ./scripts/travis/install.sh
script:
- ./scripts/travis/build.sh
| branches:
only:
- master
language: cpp
sudo: true
matrix:
allow_failures:
- os: osx
include:
- language: python
sudo: false
python: 2.7
env: TASKS="clang-format"
os: linux
dist: trusty
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-6.0
packages:
- clang-format-6.0
- compiler: gcc
os: linux
addons:
apt:
sources: ubuntu-toolchain-r-test
packages: g++-4.9
env:
- TASKS="ctest gcc-4.9"
- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
- compiler: gcc
os: linux
addons:
apt:
sources: ubuntu-toolchain-r-test
packages: g++-6
env:
- TASKS="ctest gcc-6.3"
- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
- compiler: clang
os: linux
env: TASKS="ctest clang-3.9"
- os: osx
env: TASKS="Mac clang"
install:
- . ./scripts/travis/install.sh
script:
- ./scripts/travis/build.sh
| Add a TASK marker as suggested by Marcus. | Add a TASK marker as suggested by Marcus.
Signed-off-by: Geoff Hutchison <9cf35bacc9f8512ca007341c9e919cf5dc03e0c7@gmail.com>
| YAML | bsd-3-clause | ghutchis/avogadrolibs,OpenChemistry/avogadrolibs,OpenChemistry/avogadrolibs,OpenChemistry/avogadrolibs,OpenChemistry/avogadrolibs,OpenChemistry/avogadrolibs,ghutchis/avogadrolibs,ghutchis/avogadrolibs,ghutchis/avogadrolibs,ghutchis/avogadrolibs | yaml | ## Code Before:
branches:
only:
- master
language: cpp
sudo: true
matrix:
allow_failures:
- os: osx
include:
- language: python
sudo: false
python: 2.7
env: TASKS="clang-format"
os: linux
dist: trusty
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-6.0
packages:
- clang-format-6.0
- compiler: gcc
os: linux
addons:
apt:
sources: ubuntu-toolchain-r-test
packages: g++-4.9
env:
- TASKS="ctest gcc-4.9"
- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
- compiler: gcc
os: linux
addons:
apt:
sources: ubuntu-toolchain-r-test
packages: g++-6
env:
- TASKS="ctest gcc-6.3"
- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
- compiler: clang
os: linux
env: TASKS="ctest clang-3.9"
- os: osx
install:
- . ./scripts/travis/install.sh
script:
- ./scripts/travis/build.sh
## Instruction:
Add a TASK marker as suggested by Marcus.
Signed-off-by: Geoff Hutchison <9cf35bacc9f8512ca007341c9e919cf5dc03e0c7@gmail.com>
## Code After:
branches:
only:
- master
language: cpp
sudo: true
matrix:
allow_failures:
- os: osx
include:
- language: python
sudo: false
python: 2.7
env: TASKS="clang-format"
os: linux
dist: trusty
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-6.0
packages:
- clang-format-6.0
- compiler: gcc
os: linux
addons:
apt:
sources: ubuntu-toolchain-r-test
packages: g++-4.9
env:
- TASKS="ctest gcc-4.9"
- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
- compiler: gcc
os: linux
addons:
apt:
sources: ubuntu-toolchain-r-test
packages: g++-6
env:
- TASKS="ctest gcc-6.3"
- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
- compiler: clang
os: linux
env: TASKS="ctest clang-3.9"
- os: osx
env: TASKS="Mac clang"
install:
- . ./scripts/travis/install.sh
script:
- ./scripts/travis/build.sh
| branches:
only:
- master
language: cpp
sudo: true
matrix:
allow_failures:
- os: osx
include:
- language: python
sudo: false
python: 2.7
env: TASKS="clang-format"
os: linux
dist: trusty
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-6.0
packages:
- clang-format-6.0
- compiler: gcc
os: linux
addons:
apt:
sources: ubuntu-toolchain-r-test
packages: g++-4.9
env:
- TASKS="ctest gcc-4.9"
- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
- compiler: gcc
os: linux
addons:
apt:
sources: ubuntu-toolchain-r-test
packages: g++-6
env:
- TASKS="ctest gcc-6.3"
- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
- compiler: clang
os: linux
env: TASKS="ctest clang-3.9"
- os: osx
+ env: TASKS="Mac clang"
install:
- . ./scripts/travis/install.sh
script:
- ./scripts/travis/build.sh | 1 | 0.016949 | 1 | 0 |
9c8347f9b7f4c06727b38cd5298f995538fb36e7 | lib/formotion/row_type/activity_view_row.rb | lib/formotion/row_type/activity_view_row.rb | module Formotion
module RowType
class ActivityRow < ObjectRow
def after_build(cell)
super
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator
self.row.text_field.hidden = true
row.value = {items:[row.value]} unless row.value.is_a?(Hash)
row.value = {
excluded: [],
animated: true,
app_activities: nil,
completion: nil
}.merge(row.value)
row.value[:items] = [row.value[:items]] unless row.value[:items].is_a?(Array)
end
def on_select(tableView, tableViewDelegate)
activity_vc = UIActivityViewController.alloc.initWithActivityItems(row.value[:items], applicationActivities:row.value[:app_activities])
activity_vc.modalTransitionStyle = UIModalTransitionStyleCoverVertical
activity_vc.excludedActivityTypes = row.value[:excluded]
row.form.controller.presentViewController(activity_vc, animated:row.value[:animated], completion:row.value[:completion])
end
end
end
end
| motion_require 'object_row'
module Formotion
module RowType
class ActivityRow < ObjectRow
def after_build(cell)
super
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator
self.row.text_field.hidden = true
row.value = {items:[row.value]} unless row.value.is_a?(Hash)
row.value = {
excluded: [],
animated: true,
app_activities: nil,
completion: nil
}.merge(row.value)
row.value[:items] = [row.value[:items]] unless row.value[:items].is_a?(Array)
end
def on_select(tableView, tableViewDelegate)
activity_vc = UIActivityViewController.alloc.initWithActivityItems(row.value[:items], applicationActivities:row.value[:app_activities])
activity_vc.modalTransitionStyle = UIModalTransitionStyleCoverVertical
activity_vc.excludedActivityTypes = row.value[:excluded]
row.form.controller.presentViewController(activity_vc, animated:row.value[:animated], completion:row.value[:completion])
end
end
end
end
| Add missing require statement to activity_row. | Add missing require statement to activity_row.
| Ruby | mit | clayallsopp/formotion,clayallsopp/formotion,iwazer/formotion,iwazer/formotion | ruby | ## Code Before:
module Formotion
module RowType
class ActivityRow < ObjectRow
def after_build(cell)
super
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator
self.row.text_field.hidden = true
row.value = {items:[row.value]} unless row.value.is_a?(Hash)
row.value = {
excluded: [],
animated: true,
app_activities: nil,
completion: nil
}.merge(row.value)
row.value[:items] = [row.value[:items]] unless row.value[:items].is_a?(Array)
end
def on_select(tableView, tableViewDelegate)
activity_vc = UIActivityViewController.alloc.initWithActivityItems(row.value[:items], applicationActivities:row.value[:app_activities])
activity_vc.modalTransitionStyle = UIModalTransitionStyleCoverVertical
activity_vc.excludedActivityTypes = row.value[:excluded]
row.form.controller.presentViewController(activity_vc, animated:row.value[:animated], completion:row.value[:completion])
end
end
end
end
## Instruction:
Add missing require statement to activity_row.
## Code After:
motion_require 'object_row'
module Formotion
module RowType
class ActivityRow < ObjectRow
def after_build(cell)
super
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator
self.row.text_field.hidden = true
row.value = {items:[row.value]} unless row.value.is_a?(Hash)
row.value = {
excluded: [],
animated: true,
app_activities: nil,
completion: nil
}.merge(row.value)
row.value[:items] = [row.value[:items]] unless row.value[:items].is_a?(Array)
end
def on_select(tableView, tableViewDelegate)
activity_vc = UIActivityViewController.alloc.initWithActivityItems(row.value[:items], applicationActivities:row.value[:app_activities])
activity_vc.modalTransitionStyle = UIModalTransitionStyleCoverVertical
activity_vc.excludedActivityTypes = row.value[:excluded]
row.form.controller.presentViewController(activity_vc, animated:row.value[:animated], completion:row.value[:completion])
end
end
end
end
| + motion_require 'object_row'
+
module Formotion
module RowType
class ActivityRow < ObjectRow
def after_build(cell)
super
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator
self.row.text_field.hidden = true
row.value = {items:[row.value]} unless row.value.is_a?(Hash)
row.value = {
excluded: [],
animated: true,
app_activities: nil,
completion: nil
}.merge(row.value)
row.value[:items] = [row.value[:items]] unless row.value[:items].is_a?(Array)
end
def on_select(tableView, tableViewDelegate)
activity_vc = UIActivityViewController.alloc.initWithActivityItems(row.value[:items], applicationActivities:row.value[:app_activities])
activity_vc.modalTransitionStyle = UIModalTransitionStyleCoverVertical
activity_vc.excludedActivityTypes = row.value[:excluded]
row.form.controller.presentViewController(activity_vc, animated:row.value[:animated], completion:row.value[:completion])
end
end
end
end | 2 | 0.0625 | 2 | 0 |
399894f6df296eed4d5e85a17349d5314ac3eb5b | app/views/organizations/_pull_request.html.erb | app/views/organizations/_pull_request.html.erb | <%= link_to pr[:html_url], class: "list-group-item" do %>
<div class="row">
<div class="col-xs-10">
<%= "##{pr[:number]} - #{pr[:title]}" %>
</div>
<div class="col-xs-2">
<%= image_tag pr[:user][:avatar_url], class: "pr-avatar pull-right" %>
</div>
</div>
<% end %>
| <%= link_to pr[:html_url], class: "list-group-item", target: '_blank' do %>
<div class="row">
<div class="col-xs-10">
<%= "##{pr[:number]} - #{pr[:title]}" %>
</div>
<div class="col-xs-2">
<%= image_tag pr[:user][:avatar_url], class: "pr-avatar pull-right" %>
</div>
</div>
<% end %>
| Add target blank to PR links | Add target blank to PR links
| HTML+ERB | mit | IgorMarques/BigBrother,IgorMarques/BigBrother,IgorMarques/BigBrother | html+erb | ## Code Before:
<%= link_to pr[:html_url], class: "list-group-item" do %>
<div class="row">
<div class="col-xs-10">
<%= "##{pr[:number]} - #{pr[:title]}" %>
</div>
<div class="col-xs-2">
<%= image_tag pr[:user][:avatar_url], class: "pr-avatar pull-right" %>
</div>
</div>
<% end %>
## Instruction:
Add target blank to PR links
## Code After:
<%= link_to pr[:html_url], class: "list-group-item", target: '_blank' do %>
<div class="row">
<div class="col-xs-10">
<%= "##{pr[:number]} - #{pr[:title]}" %>
</div>
<div class="col-xs-2">
<%= image_tag pr[:user][:avatar_url], class: "pr-avatar pull-right" %>
</div>
</div>
<% end %>
| - <%= link_to pr[:html_url], class: "list-group-item" do %>
+ <%= link_to pr[:html_url], class: "list-group-item", target: '_blank' do %>
? ++++++++++++++++++
<div class="row">
<div class="col-xs-10">
<%= "##{pr[:number]} - #{pr[:title]}" %>
</div>
<div class="col-xs-2">
<%= image_tag pr[:user][:avatar_url], class: "pr-avatar pull-right" %>
</div>
</div>
<% end %> | 2 | 0.2 | 1 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.