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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
326f9da0f2325da0d7f94e69ee27f3513a2010c5 | src/lt/objs/notifos.cljs | src/lt/objs/notifos.cljs | (ns lt.objs.notifos
(:require [lt.object :as object]
[lt.objs.statusbar :as statusbar]
[lt.objs.command :as cmd]
[lt.util.js :refer [wait]]
[crate.binding :refer [map-bound bound deref?]])
(:require-macros [lt.macros :refer [behavior defui]]))
(def standard-timeout 10000)
(defn working [msg]
(when msg
(set-msg! msg))
(statusbar/loader-inc))
(defn done-working
([]
(statusbar/loader-dec))
([msg]
(set-msg! msg)
(statusbar/loader-dec)))
(defn msg* [m & [opts]]
(let [m (if (string? m)
m
(pr-str m))]
(object/merge! statusbar/statusbar-loader (merge {:message m :class ""} opts))))
(defn set-msg! [msg opts]
(msg* msg opts)
(js/clearTimeout cur-timeout)
(set! cur-timeout (wait standard-timeout #(msg* ""))))
(cmd/command {:command :reset-working
:desc "Statusbar: Reset working indicator"
:exec (fn []
(statusbar/loader-set 0)
)})
| (ns lt.objs.notifos
(:require [lt.object :as object]
[lt.objs.statusbar :as statusbar]
[lt.objs.command :as cmd]
[lt.util.js :refer [wait]]
[crate.binding :refer [map-bound bound deref?]])
(:require-macros [lt.macros :refer [behavior defui]]))
(def standard-timeout 10000)
(defn working [msg]
(when msg
(set-msg! msg))
(statusbar/loader-inc))
(defn done-working
([]
(statusbar/loader-dec))
([msg]
(set-msg! msg)
(statusbar/loader-dec)))
(defn msg* [m & [opts]]
(let [m (if (string? m)
m
(pr-str m))]
(object/merge! statusbar/statusbar-loader (merge {:message m :class ""} opts))))
(defn set-msg!
([msg]
(msg* msg)
(js/clearTimeout cur-timeout)
(set! cur-timeout (wait standard-timeout #(msg* ""))))
([msg opts]
(msg* msg opts)
(js/clearTimeout cur-timeout)
(set! cur-timeout (wait (or (:timeout opts)
standard-timeout) #(msg* "")))))
(cmd/command {:command :reset-working
:desc "Statusbar: Reset working indicator"
:exec (fn []
(statusbar/loader-set 0)
)})
| Extend set-msg! with custom timeout | Extend set-msg! with custom timeout
The function notifos/set-msg! accepts a :timeout key/value pair in the opts map
to set a custom timeout.
| Clojure | mit | nagyistoce/LightTable,pkdevbox/LightTable,brabadu/LightTable,EasonYi/LightTable,Bost/LightTable,masptj/LightTable,0x90sled/LightTable,youprofit/LightTable,masptj/LightTable,rundis/LightTable,craftybones/LightTable,youprofit/LightTable,windyuuy/LightTable,kenny-evitt/LightTable,LightTable/LightTable,rundis/LightTable,Bost/LightTable,rundis/LightTable,mrwizard82d1/LightTable,ashneo76/LightTable,ashneo76/LightTable,Bost/LightTable,kausdev/LightTable,cldwalker/LightTable,fdserr/LightTable,hiredgunhouse/LightTable,youprofit/LightTable,LightTable/LightTable,ohAitch/LightTable,EasonYi/LightTable,fdserr/LightTable,kolya-ay/LightTable,EasonYi/LightTable,justintaft/LightTable,justintaft/LightTable,windyuuy/LightTable,kausdev/LightTable,kenny-evitt/LightTable,pkdevbox/LightTable,mpdatx/LightTable,pkdevbox/LightTable,kolya-ay/LightTable,bruno-oliveira/LightTable,hiredgunhouse/LightTable,LightTable/LightTable,brabadu/LightTable,BenjaminVanRyseghem/LightTable,kolya-ay/LightTable,bruno-oliveira/LightTable,ashneo76/LightTable,hiredgunhouse/LightTable,BenjaminVanRyseghem/LightTable,ohAitch/LightTable,0x90sled/LightTable,0x90sled/LightTable,kenny-evitt/LightTable,brabadu/LightTable,sbauer322/LightTable,ohAitch/LightTable,cldwalker/LightTable,mpdatx/LightTable,BenjaminVanRyseghem/LightTable,mrwizard82d1/LightTable,bruno-oliveira/LightTable,sbauer322/LightTable,mrwizard82d1/LightTable,mpdatx/LightTable,windyuuy/LightTable,kausdev/LightTable,nagyistoce/LightTable,sbauer322/LightTable,fdserr/LightTable,craftybones/LightTable,craftybones/LightTable,nagyistoce/LightTable,masptj/LightTable | clojure | ## Code Before:
(ns lt.objs.notifos
(:require [lt.object :as object]
[lt.objs.statusbar :as statusbar]
[lt.objs.command :as cmd]
[lt.util.js :refer [wait]]
[crate.binding :refer [map-bound bound deref?]])
(:require-macros [lt.macros :refer [behavior defui]]))
(def standard-timeout 10000)
(defn working [msg]
(when msg
(set-msg! msg))
(statusbar/loader-inc))
(defn done-working
([]
(statusbar/loader-dec))
([msg]
(set-msg! msg)
(statusbar/loader-dec)))
(defn msg* [m & [opts]]
(let [m (if (string? m)
m
(pr-str m))]
(object/merge! statusbar/statusbar-loader (merge {:message m :class ""} opts))))
(defn set-msg! [msg opts]
(msg* msg opts)
(js/clearTimeout cur-timeout)
(set! cur-timeout (wait standard-timeout #(msg* ""))))
(cmd/command {:command :reset-working
:desc "Statusbar: Reset working indicator"
:exec (fn []
(statusbar/loader-set 0)
)})
## Instruction:
Extend set-msg! with custom timeout
The function notifos/set-msg! accepts a :timeout key/value pair in the opts map
to set a custom timeout.
## Code After:
(ns lt.objs.notifos
(:require [lt.object :as object]
[lt.objs.statusbar :as statusbar]
[lt.objs.command :as cmd]
[lt.util.js :refer [wait]]
[crate.binding :refer [map-bound bound deref?]])
(:require-macros [lt.macros :refer [behavior defui]]))
(def standard-timeout 10000)
(defn working [msg]
(when msg
(set-msg! msg))
(statusbar/loader-inc))
(defn done-working
([]
(statusbar/loader-dec))
([msg]
(set-msg! msg)
(statusbar/loader-dec)))
(defn msg* [m & [opts]]
(let [m (if (string? m)
m
(pr-str m))]
(object/merge! statusbar/statusbar-loader (merge {:message m :class ""} opts))))
(defn set-msg!
([msg]
(msg* msg)
(js/clearTimeout cur-timeout)
(set! cur-timeout (wait standard-timeout #(msg* ""))))
([msg opts]
(msg* msg opts)
(js/clearTimeout cur-timeout)
(set! cur-timeout (wait (or (:timeout opts)
standard-timeout) #(msg* "")))))
(cmd/command {:command :reset-working
:desc "Statusbar: Reset working indicator"
:exec (fn []
(statusbar/loader-set 0)
)})
| (ns lt.objs.notifos
(:require [lt.object :as object]
[lt.objs.statusbar :as statusbar]
[lt.objs.command :as cmd]
[lt.util.js :refer [wait]]
[crate.binding :refer [map-bound bound deref?]])
(:require-macros [lt.macros :refer [behavior defui]]))
(def standard-timeout 10000)
(defn working [msg]
(when msg
(set-msg! msg))
(statusbar/loader-inc))
(defn done-working
([]
(statusbar/loader-dec))
([msg]
(set-msg! msg)
(statusbar/loader-dec)))
(defn msg* [m & [opts]]
(let [m (if (string? m)
m
(pr-str m))]
(object/merge! statusbar/statusbar-loader (merge {:message m :class ""} opts))))
- (defn set-msg! [msg opts]
+ (defn set-msg!
+ ([msg]
- (msg* msg opts)
? -----
+ (msg* msg)
? +
- (js/clearTimeout cur-timeout)
+ (js/clearTimeout cur-timeout)
? +
- (set! cur-timeout (wait standard-timeout #(msg* ""))))
+ (set! cur-timeout (wait standard-timeout #(msg* ""))))
? +
+ ([msg opts]
+ (msg* msg opts)
+ (js/clearTimeout cur-timeout)
+ (set! cur-timeout (wait (or (:timeout opts)
+ standard-timeout) #(msg* "")))))
(cmd/command {:command :reset-working
:desc "Statusbar: Reset working indicator"
:exec (fn []
(statusbar/loader-set 0)
)}) | 14 | 0.368421 | 10 | 4 |
3341ba14250f086ab11aa55d8d72de14fe95aceb | tests/test_db.py | tests/test_db.py |
import os
import unittest
from flask import Flask
from coaster.utils import buid
from coaster.sqlalchemy import BaseMixin
from nodular.db import db
class User(BaseMixin, db.Model):
__tablename__ = 'user'
userid = db.Column(db.Unicode(22), nullable=False, default=buid, unique=True)
username = db.Column(db.Unicode(250), nullable=True)
app = Flask(__name__, instance_relative_config=True)
app.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get(
'SQLALCHEMY_DATABASE_URI', 'postgresql://postgres@localhost/myapp_test')
app.config['SQLALCHEMY_ECHO'] = False
db.init_app(app)
db.app = app
class TestDatabaseFixture(unittest.TestCase):
def setUp(self):
self.app = app
db.create_all()
self.user1 = User(username=u'user1')
db.session.add(self.user1)
app.testing = True
def tearDown(self):
db.session.rollback()
db.drop_all()
db.session.remove()
|
import os
import unittest
from flask import Flask
from coaster.utils import buid
from coaster.sqlalchemy import BaseMixin
from nodular.db import db
class User(BaseMixin, db.Model):
__tablename__ = 'user'
userid = db.Column(db.Unicode(22), nullable=False, default=buid, unique=True)
username = db.Column(db.Unicode(250), nullable=True)
app = Flask(__name__, instance_relative_config=True)
app.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get(
'SQLALCHEMY_DATABASE_URI', 'postgresql://postgres@localhost/myapp_test')
app.config['SQLALCHEMY_ECHO'] = False
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db.init_app(app)
db.app = app
class TestDatabaseFixture(unittest.TestCase):
def setUp(self):
self.app = app
db.create_all()
self.user1 = User(username=u'user1')
db.session.add(self.user1)
app.testing = True
def tearDown(self):
db.session.rollback()
db.drop_all()
db.session.remove()
| Disable warning for unused feature | Disable warning for unused feature
| Python | bsd-2-clause | hasgeek/nodular,hasgeek/nodular | python | ## Code Before:
import os
import unittest
from flask import Flask
from coaster.utils import buid
from coaster.sqlalchemy import BaseMixin
from nodular.db import db
class User(BaseMixin, db.Model):
__tablename__ = 'user'
userid = db.Column(db.Unicode(22), nullable=False, default=buid, unique=True)
username = db.Column(db.Unicode(250), nullable=True)
app = Flask(__name__, instance_relative_config=True)
app.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get(
'SQLALCHEMY_DATABASE_URI', 'postgresql://postgres@localhost/myapp_test')
app.config['SQLALCHEMY_ECHO'] = False
db.init_app(app)
db.app = app
class TestDatabaseFixture(unittest.TestCase):
def setUp(self):
self.app = app
db.create_all()
self.user1 = User(username=u'user1')
db.session.add(self.user1)
app.testing = True
def tearDown(self):
db.session.rollback()
db.drop_all()
db.session.remove()
## Instruction:
Disable warning for unused feature
## Code After:
import os
import unittest
from flask import Flask
from coaster.utils import buid
from coaster.sqlalchemy import BaseMixin
from nodular.db import db
class User(BaseMixin, db.Model):
__tablename__ = 'user'
userid = db.Column(db.Unicode(22), nullable=False, default=buid, unique=True)
username = db.Column(db.Unicode(250), nullable=True)
app = Flask(__name__, instance_relative_config=True)
app.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get(
'SQLALCHEMY_DATABASE_URI', 'postgresql://postgres@localhost/myapp_test')
app.config['SQLALCHEMY_ECHO'] = False
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db.init_app(app)
db.app = app
class TestDatabaseFixture(unittest.TestCase):
def setUp(self):
self.app = app
db.create_all()
self.user1 = User(username=u'user1')
db.session.add(self.user1)
app.testing = True
def tearDown(self):
db.session.rollback()
db.drop_all()
db.session.remove()
|
import os
import unittest
from flask import Flask
from coaster.utils import buid
from coaster.sqlalchemy import BaseMixin
from nodular.db import db
class User(BaseMixin, db.Model):
__tablename__ = 'user'
userid = db.Column(db.Unicode(22), nullable=False, default=buid, unique=True)
username = db.Column(db.Unicode(250), nullable=True)
app = Flask(__name__, instance_relative_config=True)
app.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get(
'SQLALCHEMY_DATABASE_URI', 'postgresql://postgres@localhost/myapp_test')
app.config['SQLALCHEMY_ECHO'] = False
+ app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db.init_app(app)
db.app = app
class TestDatabaseFixture(unittest.TestCase):
def setUp(self):
self.app = app
db.create_all()
self.user1 = User(username=u'user1')
db.session.add(self.user1)
app.testing = True
def tearDown(self):
db.session.rollback()
db.drop_all()
db.session.remove() | 1 | 0.028571 | 1 | 0 |
19ab8c9935f72a08c65a39da11c1c3e46d1f0a10 | extern/fmtlib/flags.mk | extern/fmtlib/flags.mk | CXXFLAGS_$(d) += \
-I$(SOURCE_ROOT)/extern/fmtlib/fmt/include \
-DFMT_HEADER_ONLY \
-Wno-strict-overflow
| CXXFLAGS_$(d) += \
-I$(SOURCE_ROOT)/extern/fmtlib/fmt/include \
-DFMT_HEADER_ONLY \
-Wno-inline \
-Wno-strict-overflow
| Fix compilation of {fmt} with GCC 12 | Fix compilation of {fmt} with GCC 12
| Makefile | mit | trflynn89/libfly,trflynn89/libfly | makefile | ## Code Before:
CXXFLAGS_$(d) += \
-I$(SOURCE_ROOT)/extern/fmtlib/fmt/include \
-DFMT_HEADER_ONLY \
-Wno-strict-overflow
## Instruction:
Fix compilation of {fmt} with GCC 12
## Code After:
CXXFLAGS_$(d) += \
-I$(SOURCE_ROOT)/extern/fmtlib/fmt/include \
-DFMT_HEADER_ONLY \
-Wno-inline \
-Wno-strict-overflow
| CXXFLAGS_$(d) += \
-I$(SOURCE_ROOT)/extern/fmtlib/fmt/include \
-DFMT_HEADER_ONLY \
+ -Wno-inline \
-Wno-strict-overflow | 1 | 0.25 | 1 | 0 |
ebd48f89095fe959143caf66edd0910ee0dd051c | README.md | README.md | gomol
=====
| gomol
=====
[](https://godoc.org/github.com/aphistic/gomol)
[](https://travis-ci.org/aphistic/gomol)
Gomol (Go Multi-Output Logger) is an MIT-licensed Go logging library. The documentation at this point is thin but will be improving over time.
Features
========
* Multiple outputs at the same time
Installation
============
The recommended way to install is via http://gopkg.in
go get gopkg.in/aphistic/gomol.v0
...
import "gopkg.in/aphistic/gomol.v0"
Gomol can also be installed the standard way as well
go get github.com/aphistic/gomol
...
import "github.com/aphistic/gomol"
Examples
========
For brevity a lot of error checking has been omitted, be sure you do your checks!
This is a super basic example of adding a number of loggers and then logging a few messages:
```go
package main
import (
"github.com/aphistic/gomol"
)
func main() {
gomol.AddLogger(gomol.NewConsoleLogger())
gomol.AddLogger(gomol.NewLogglyLogger("1234"))
gomol.AddLogger(gomol.NewGelfLogger("localhost", 12201))
gomol.SetAttr("facility", "gomol.example")
gomol.SetAttr("another_attr", 1234)
gomol.InitLoggers()
for idx := 1; idx <= 10; idx++ {
gomol.Dbgm(map[string]interface{}{
"msg_attr1": 4321,
}, "Test message %v", idx)
}
gomol.ShutdownLoggers()
}
```
| Add a basic initial readme | Add a basic initial readme
| Markdown | mit | aphistic/gomol | markdown | ## Code Before:
gomol
=====
## Instruction:
Add a basic initial readme
## Code After:
gomol
=====
[](https://godoc.org/github.com/aphistic/gomol)
[](https://travis-ci.org/aphistic/gomol)
Gomol (Go Multi-Output Logger) is an MIT-licensed Go logging library. The documentation at this point is thin but will be improving over time.
Features
========
* Multiple outputs at the same time
Installation
============
The recommended way to install is via http://gopkg.in
go get gopkg.in/aphistic/gomol.v0
...
import "gopkg.in/aphistic/gomol.v0"
Gomol can also be installed the standard way as well
go get github.com/aphistic/gomol
...
import "github.com/aphistic/gomol"
Examples
========
For brevity a lot of error checking has been omitted, be sure you do your checks!
This is a super basic example of adding a number of loggers and then logging a few messages:
```go
package main
import (
"github.com/aphistic/gomol"
)
func main() {
gomol.AddLogger(gomol.NewConsoleLogger())
gomol.AddLogger(gomol.NewLogglyLogger("1234"))
gomol.AddLogger(gomol.NewGelfLogger("localhost", 12201))
gomol.SetAttr("facility", "gomol.example")
gomol.SetAttr("another_attr", 1234)
gomol.InitLoggers()
for idx := 1; idx <= 10; idx++ {
gomol.Dbgm(map[string]interface{}{
"msg_attr1": 4321,
}, "Test message %v", idx)
}
gomol.ShutdownLoggers()
}
```
| gomol
=====
+ [](https://godoc.org/github.com/aphistic/gomol)
+ [](https://travis-ci.org/aphistic/gomol)
+
+ Gomol (Go Multi-Output Logger) is an MIT-licensed Go logging library. The documentation at this point is thin but will be improving over time.
+
+ Features
+ ========
+
+ * Multiple outputs at the same time
+
+ Installation
+ ============
+
+ The recommended way to install is via http://gopkg.in
+
+ go get gopkg.in/aphistic/gomol.v0
+ ...
+ import "gopkg.in/aphistic/gomol.v0"
+
+ Gomol can also be installed the standard way as well
+
+ go get github.com/aphistic/gomol
+ ...
+ import "github.com/aphistic/gomol"
+
+ Examples
+ ========
+
+ For brevity a lot of error checking has been omitted, be sure you do your checks!
+
+ This is a super basic example of adding a number of loggers and then logging a few messages:
+
+ ```go
+ package main
+
+ import (
+ "github.com/aphistic/gomol"
+ )
+
+ func main() {
+ gomol.AddLogger(gomol.NewConsoleLogger())
+ gomol.AddLogger(gomol.NewLogglyLogger("1234"))
+ gomol.AddLogger(gomol.NewGelfLogger("localhost", 12201))
+
+ gomol.SetAttr("facility", "gomol.example")
+ gomol.SetAttr("another_attr", 1234)
+
+ gomol.InitLoggers()
+
+ for idx := 1; idx <= 10; idx++ {
+ gomol.Dbgm(map[string]interface{}{
+ "msg_attr1": 4321,
+ }, "Test message %v", idx)
+ }
+
+ gomol.ShutdownLoggers()
+ }
+ ``` | 58 | 19.333333 | 58 | 0 |
05e3c77e5b236ee6d500d3ed8839c03642afd770 | addon/components/form-button.js | addon/components/form-button.js | import Component from '@glimmer/component';
import { action } from '@ember/object';
export default class FormButtonComponent extends Component {
@action
handleClick() {
if (!this.args.isActing && this.args.onClick) {
return this.args.onClick();
}
}
}
| import Component from '@glimmer/component';
import { action } from '@ember/object';
export default class FormButtonComponent extends Component {
@action
handleClick() {
if (!this.args.isActing && this.args.onClick) {
const ret = this.args.onClick();
if (ret.finally) {
this.isActing = true;
ret.finally(() => (this.isActing = false));
}
return ret;
}
}
}
| Fix simple button isActing state | Fix simple button isActing state
| JavaScript | mit | Foodee/ember-foxy-forms,Foodee/ember-foxy-forms | javascript | ## Code Before:
import Component from '@glimmer/component';
import { action } from '@ember/object';
export default class FormButtonComponent extends Component {
@action
handleClick() {
if (!this.args.isActing && this.args.onClick) {
return this.args.onClick();
}
}
}
## Instruction:
Fix simple button isActing state
## Code After:
import Component from '@glimmer/component';
import { action } from '@ember/object';
export default class FormButtonComponent extends Component {
@action
handleClick() {
if (!this.args.isActing && this.args.onClick) {
const ret = this.args.onClick();
if (ret.finally) {
this.isActing = true;
ret.finally(() => (this.isActing = false));
}
return ret;
}
}
}
| import Component from '@glimmer/component';
import { action } from '@ember/object';
export default class FormButtonComponent extends Component {
@action
handleClick() {
if (!this.args.isActing && this.args.onClick) {
- return this.args.onClick();
? ^^^
+ const ret = this.args.onClick();
? ++++++ ^^
+
+ if (ret.finally) {
+ this.isActing = true;
+ ret.finally(() => (this.isActing = false));
+ }
+ return ret;
}
}
} | 8 | 0.727273 | 7 | 1 |
ead29911b842fd4fafdb83c8395f395c70f083fd | doc/amqp_topic_exchange.md | doc/amqp_topic_exchange.md |
After every update to a content item, a message will be published to RabbitMQ.
It will be published to the `content-store` topic exchange with the routing_key
`format.update_type`. Additional components will likely be added to this over
time, but they will be added to the end of the key so as to not break any
existing bindings.
The message body will be the content item serialised as JSON in the
[output_format](output_examples/generic.json) with the addition of the `update_type` field.
|
After every update to a content item, a message will be published to RabbitMQ.
It will be published to the `published_documents` topic exchange with the routing_key
`format.update_type`. Additional components will likely be added to this over
time, but they will be added to the end of the key so as to not break any
existing bindings.
The message body will be the content item serialised as JSON in the
[output_format](output_examples/generic.json) with the addition of the `update_type` field.
| Correct the exchange name in RabbitMQ docs. | Correct the exchange name in RabbitMQ docs. | Markdown | mit | alphagov/content-store,alphagov/content-store | markdown | ## Code Before:
After every update to a content item, a message will be published to RabbitMQ.
It will be published to the `content-store` topic exchange with the routing_key
`format.update_type`. Additional components will likely be added to this over
time, but they will be added to the end of the key so as to not break any
existing bindings.
The message body will be the content item serialised as JSON in the
[output_format](output_examples/generic.json) with the addition of the `update_type` field.
## Instruction:
Correct the exchange name in RabbitMQ docs.
## Code After:
After every update to a content item, a message will be published to RabbitMQ.
It will be published to the `published_documents` topic exchange with the routing_key
`format.update_type`. Additional components will likely be added to this over
time, but they will be added to the end of the key so as to not break any
existing bindings.
The message body will be the content item serialised as JSON in the
[output_format](output_examples/generic.json) with the addition of the `update_type` field.
|
After every update to a content item, a message will be published to RabbitMQ.
- It will be published to the `content-store` topic exchange with the routing_key
? ^^^ - ----
+ It will be published to the `published_documents` topic exchange with the routing_key
? ++++++++++++ ^^
`format.update_type`. Additional components will likely be added to this over
time, but they will be added to the end of the key so as to not break any
existing bindings.
The message body will be the content item serialised as JSON in the
[output_format](output_examples/generic.json) with the addition of the `update_type` field. | 2 | 0.222222 | 1 | 1 |
c17278929ae25355f6d5ce6bf939105498047246 | .travis.yml | .travis.yml | language: ruby
cache: bundler
matrix:
fast_finish: true
include:
- rvm: 2.1.1
env: RUN=default
- rvm: 1.8.7
env: RUN=rspec
- rvm: 1.9.3
env: RUN=rspec
- rvm: 2.0.0
env: RUN=rspec
- rvm: rbx
env: RUN=rspec
- rvm: jruby
env: RUN=rspec
allow_failures:
- rvm: 1.8.7
- rvm: 1.9.3
- rvm: 2.0.0
- rvm: rbx
- rvm: jruby
before_install:
- git submodule update --init
script:
- "bundle exec rake $RUN"
notifications:
irc: "irc.freenode.org#opal"
| language: ruby
cache: bundler
matrix:
fast_finish: true
include:
- rvm: 2.1.1
env: RUN=default
- rvm: 1.8.7
env: RUN=rspec
- rvm: 1.9.3
env: RUN=rspec
- rvm: 2.0.0
env: RUN=rspec
- rvm: rbx
env: RUN=rspec
- rvm: jruby
env: RUN=rspec
allow_failures:
- rvm: 1.8.7
- rvm: 1.9.3
- rvm: 2.0.0
- rvm: rbx
- rvm: jruby
# Setting TimeZone. We'll need to do this in order to
# have the TZ related failures surface on Travis CI.
# http://stackoverflow.com/a/23374438/601782
before_install:
- git submodule update --init
script:
- "bundle exec rake $RUN"
notifications:
irc: "irc.freenode.org#opal"
| Add a note on how to change TZ settings in TravisCI | Add a note on how to change TZ settings in TravisCI | YAML | mit | opal/opal,gausie/opal,jannishuebl/opal,Mogztter/opal,suyesh/opal,catprintlabs/opal,wied03/opal,jgaskins/opal,jannishuebl/opal,c42engineering/opal,Ajedi32/opal,iliabylich/opal,kachick/opal,Mogztter/opal,iliabylich/opal,gabrielrios/opal,gausie/opal,wied03/opal,bbatsov/opal,Flikofbluelight747/opal,castwide/opal,bbatsov/opal,opal/opal,iliabylich/opal,castwide/opal,Ajedi32/opal,jgaskins/opal,opal/opal,gausie/opal,jannishuebl/opal,domgetter/opal,Ajedi32/opal,catprintlabs/opal,fazibear/opal,merongivian/opal,bbatsov/opal,kachick/opal,suyesh/opal,domgetter/opal,fazibear/opal,kachick/opal,merongivian/opal,gabrielrios/opal,fazibear/opal,wied03/opal,Mogztter/opal,Flikofbluelight747/opal,gabrielrios/opal,c42engineering/opal,suyesh/opal,kachick/opal,jgaskins/opal,catprintlabs/opal,merongivian/opal,castwide/opal,c42engineering/opal,Flikofbluelight747/opal,Mogztter/opal,opal/opal | yaml | ## Code Before:
language: ruby
cache: bundler
matrix:
fast_finish: true
include:
- rvm: 2.1.1
env: RUN=default
- rvm: 1.8.7
env: RUN=rspec
- rvm: 1.9.3
env: RUN=rspec
- rvm: 2.0.0
env: RUN=rspec
- rvm: rbx
env: RUN=rspec
- rvm: jruby
env: RUN=rspec
allow_failures:
- rvm: 1.8.7
- rvm: 1.9.3
- rvm: 2.0.0
- rvm: rbx
- rvm: jruby
before_install:
- git submodule update --init
script:
- "bundle exec rake $RUN"
notifications:
irc: "irc.freenode.org#opal"
## Instruction:
Add a note on how to change TZ settings in TravisCI
## Code After:
language: ruby
cache: bundler
matrix:
fast_finish: true
include:
- rvm: 2.1.1
env: RUN=default
- rvm: 1.8.7
env: RUN=rspec
- rvm: 1.9.3
env: RUN=rspec
- rvm: 2.0.0
env: RUN=rspec
- rvm: rbx
env: RUN=rspec
- rvm: jruby
env: RUN=rspec
allow_failures:
- rvm: 1.8.7
- rvm: 1.9.3
- rvm: 2.0.0
- rvm: rbx
- rvm: jruby
# Setting TimeZone. We'll need to do this in order to
# have the TZ related failures surface on Travis CI.
# http://stackoverflow.com/a/23374438/601782
before_install:
- git submodule update --init
script:
- "bundle exec rake $RUN"
notifications:
irc: "irc.freenode.org#opal"
| language: ruby
cache: bundler
matrix:
fast_finish: true
include:
- rvm: 2.1.1
env: RUN=default
- rvm: 1.8.7
env: RUN=rspec
- rvm: 1.9.3
env: RUN=rspec
- rvm: 2.0.0
env: RUN=rspec
- rvm: rbx
env: RUN=rspec
- rvm: jruby
env: RUN=rspec
allow_failures:
- rvm: 1.8.7
- rvm: 1.9.3
- rvm: 2.0.0
- rvm: rbx
- rvm: jruby
+ # Setting TimeZone. We'll need to do this in order to
+ # have the TZ related failures surface on Travis CI.
+ # http://stackoverflow.com/a/23374438/601782
before_install:
- git submodule update --init
script:
- "bundle exec rake $RUN"
notifications:
irc: "irc.freenode.org#opal" | 3 | 0.073171 | 3 | 0 |
9b0571623a0017f96f9945fe263cd302faa11c2e | sparkback/__init__.py | sparkback/__init__.py | import sys
ticks = ('▁', '▂', '▃', '▄', '▅', '▆', '▇', '█')
def scale_data(d):
data_range = max(d) - min(d)
divider = data_range / (len(ticks) - 1)
min_value = min(d)
scaled = [int(abs(round((i - min_value) / divider))) for i in d]
return scaled
def print_ansi_spark(d):
for i in d:
sys.stdout.write(ticks[i])
print ''
if __name__ == "__main__":
print 'hello world'
| from __future__ import division
import argparse
ticks = ('▁', '▂', '▃', '▄', '▅', '▆', '▇', '█')
def scale_data(data):
m = min(data)
n = (max(data) - m) / (len(ticks) - 1)
print m,n
return [ ticks[int((t - m) / n)] for t in data ]
def print_ansi_spark(d):
print ''.join(d)
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('integers', metavar='N', type=int, nargs='+',
help='an integer for the accumulator')
args = parser.parse_args()
print_ansi_spark(scale_data(args.integers))
| Make division float to fix divide by zero issues | Make division float to fix divide by zero issues
| Python | mit | mmichie/sparkback | python | ## Code Before:
import sys
ticks = ('▁', '▂', '▃', '▄', '▅', '▆', '▇', '█')
def scale_data(d):
data_range = max(d) - min(d)
divider = data_range / (len(ticks) - 1)
min_value = min(d)
scaled = [int(abs(round((i - min_value) / divider))) for i in d]
return scaled
def print_ansi_spark(d):
for i in d:
sys.stdout.write(ticks[i])
print ''
if __name__ == "__main__":
print 'hello world'
## Instruction:
Make division float to fix divide by zero issues
## Code After:
from __future__ import division
import argparse
ticks = ('▁', '▂', '▃', '▄', '▅', '▆', '▇', '█')
def scale_data(data):
m = min(data)
n = (max(data) - m) / (len(ticks) - 1)
print m,n
return [ ticks[int((t - m) / n)] for t in data ]
def print_ansi_spark(d):
print ''.join(d)
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('integers', metavar='N', type=int, nargs='+',
help='an integer for the accumulator')
args = parser.parse_args()
print_ansi_spark(scale_data(args.integers))
| - import sys
+ from __future__ import division
+ import argparse
ticks = ('▁', '▂', '▃', '▄', '▅', '▆', '▇', '█')
- def scale_data(d):
+ def scale_data(data):
? +++
- data_range = max(d) - min(d)
- divider = data_range / (len(ticks) - 1)
+ m = min(data)
+ n = (max(data) - m) / (len(ticks) - 1)
+
+ print m,n
+ return [ ticks[int((t - m) / n)] for t in data ]
- min_value = min(d)
-
- scaled = [int(abs(round((i - min_value) / divider))) for i in d]
-
- return scaled
def print_ansi_spark(d):
- for i in d:
- sys.stdout.write(ticks[i])
- print ''
+ print ''.join(d)
? ++++++++
if __name__ == "__main__":
- print 'hello world'
+ parser = argparse.ArgumentParser(description='Process some integers.')
+ parser.add_argument('integers', metavar='N', type=int, nargs='+',
+ help='an integer for the accumulator')
+ args = parser.parse_args()
+ print_ansi_spark(scale_data(args.integers))
+
+ | 29 | 1.380952 | 16 | 13 |
e898c46d9492888b28184c8b3a80f52074f4fef3 | src/rtmpServer.js | src/rtmpServer.js | const RtmpServer = require('rtmp-server');
const rtmpToHLS = require('./rtmpToHLS');
const { streamKey } = require('../config.json');
const { deleteVideos, log } = require('./utils');
function server(socket) {
const rtmpServer = new RtmpServer();
rtmpServer.listen(1935);
rtmpServer.on('error', (err) => {
log('RTMP server error:', 'yellow');
log(err, 'yellow');
});
rtmpServer.on('client', (client) => {
client.on('connect', () => log(`CONNECT ${client.app}`, 'blue'));
client.on('play', () => log('PLAY ', 'blue'));
client.on('publish', ({ streamName }) => {
if (streamKey !== streamName) {
log('Publishing error: Wrong stream key', 'red');
return;
}
deleteVideos();
rtmpToHLS();
socket.broadcast.emit('restart', {});
socket.broadcast.emit('published', {});
log('PUBLISH', 'blue');
});
client.on('stop', () => {
setTimeout(() => {
deleteVideos();
}, 2000);
socket.broadcast.emit('restart', {});
socket.broadcast.emit('disconeted', {});
log('DISCONNECTED', 'red');
});
});
}
module.exports = server;
| const RtmpServer = require('rtmp-server');
const rtmpToHLS = require('./rtmpToHLS');
const { streamKey } = require('../config.json');
const { deleteVideos, log } = require('./utils');
function server(socket) {
const rtmpServer = new RtmpServer();
rtmpServer.listen(1935);
rtmpServer.on('error', (err) => {
log('RTMP server error:', 'yellow');
log(err, 'yellow');
});
rtmpServer.on('client', (client) => {
client.on('connect', () => log(`CONNECT ${client.app}`, 'blue'));
client.on('play', () => log('PLAY ', 'blue'));
client.on('publish', ({ streamName }) => {
if (streamKey !== streamName) {
log('Publishing error: Wrong stream key', 'red');
return;
}
deleteVideos();
rtmpToHLS();
socket.broadcast.emit('restart', {});
socket.broadcast.emit('published', {});
log('PUBLISH', 'blue');
});
client.on('stop', () => {
socket.broadcast.emit('restart', {});
socket.broadcast.emit('disconeted', {});
log('DISCONNECTED', 'red');
});
});
}
module.exports = server;
| Remove delete from stop to avoid errors | Remove delete from stop to avoid errors
| JavaScript | mit | brunnolou/streaming-room,brunnolou/streaming-room | javascript | ## Code Before:
const RtmpServer = require('rtmp-server');
const rtmpToHLS = require('./rtmpToHLS');
const { streamKey } = require('../config.json');
const { deleteVideos, log } = require('./utils');
function server(socket) {
const rtmpServer = new RtmpServer();
rtmpServer.listen(1935);
rtmpServer.on('error', (err) => {
log('RTMP server error:', 'yellow');
log(err, 'yellow');
});
rtmpServer.on('client', (client) => {
client.on('connect', () => log(`CONNECT ${client.app}`, 'blue'));
client.on('play', () => log('PLAY ', 'blue'));
client.on('publish', ({ streamName }) => {
if (streamKey !== streamName) {
log('Publishing error: Wrong stream key', 'red');
return;
}
deleteVideos();
rtmpToHLS();
socket.broadcast.emit('restart', {});
socket.broadcast.emit('published', {});
log('PUBLISH', 'blue');
});
client.on('stop', () => {
setTimeout(() => {
deleteVideos();
}, 2000);
socket.broadcast.emit('restart', {});
socket.broadcast.emit('disconeted', {});
log('DISCONNECTED', 'red');
});
});
}
module.exports = server;
## Instruction:
Remove delete from stop to avoid errors
## Code After:
const RtmpServer = require('rtmp-server');
const rtmpToHLS = require('./rtmpToHLS');
const { streamKey } = require('../config.json');
const { deleteVideos, log } = require('./utils');
function server(socket) {
const rtmpServer = new RtmpServer();
rtmpServer.listen(1935);
rtmpServer.on('error', (err) => {
log('RTMP server error:', 'yellow');
log(err, 'yellow');
});
rtmpServer.on('client', (client) => {
client.on('connect', () => log(`CONNECT ${client.app}`, 'blue'));
client.on('play', () => log('PLAY ', 'blue'));
client.on('publish', ({ streamName }) => {
if (streamKey !== streamName) {
log('Publishing error: Wrong stream key', 'red');
return;
}
deleteVideos();
rtmpToHLS();
socket.broadcast.emit('restart', {});
socket.broadcast.emit('published', {});
log('PUBLISH', 'blue');
});
client.on('stop', () => {
socket.broadcast.emit('restart', {});
socket.broadcast.emit('disconeted', {});
log('DISCONNECTED', 'red');
});
});
}
module.exports = server;
| const RtmpServer = require('rtmp-server');
const rtmpToHLS = require('./rtmpToHLS');
const { streamKey } = require('../config.json');
const { deleteVideos, log } = require('./utils');
function server(socket) {
const rtmpServer = new RtmpServer();
rtmpServer.listen(1935);
rtmpServer.on('error', (err) => {
log('RTMP server error:', 'yellow');
log(err, 'yellow');
});
rtmpServer.on('client', (client) => {
client.on('connect', () => log(`CONNECT ${client.app}`, 'blue'));
client.on('play', () => log('PLAY ', 'blue'));
client.on('publish', ({ streamName }) => {
if (streamKey !== streamName) {
log('Publishing error: Wrong stream key', 'red');
return;
}
deleteVideos();
rtmpToHLS();
socket.broadcast.emit('restart', {});
socket.broadcast.emit('published', {});
log('PUBLISH', 'blue');
});
client.on('stop', () => {
- setTimeout(() => {
- deleteVideos();
- }, 2000);
socket.broadcast.emit('restart', {});
socket.broadcast.emit('disconeted', {});
log('DISCONNECTED', 'red');
});
});
}
module.exports = server; | 3 | 0.06383 | 0 | 3 |
4c57adf454090ea7c938f9941cb394eaac30c8c2 | spec/spec_helper.rb | spec/spec_helper.rb | ENV["RAILS_ENV"] ||= 'test'
gem 'minitest'
require 'minitest/autorun'
require 'minitest/spec'
require 'action_dispatch/railtie'
require 'biceps'
# Load support files
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
| ENV["RAILS_ENV"] ||= 'test'
gem 'minitest'
require 'minitest/autorun'
require 'minitest/spec'
require 'action_dispatch/railtie'
$:<< 'lib'
require 'biceps'
# Load support files
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
| Add the local lib file to the LOAD_PATH | Add the local lib file to the LOAD_PATH
| Ruby | mit | lyonrb/biceps | ruby | ## Code Before:
ENV["RAILS_ENV"] ||= 'test'
gem 'minitest'
require 'minitest/autorun'
require 'minitest/spec'
require 'action_dispatch/railtie'
require 'biceps'
# Load support files
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
## Instruction:
Add the local lib file to the LOAD_PATH
## Code After:
ENV["RAILS_ENV"] ||= 'test'
gem 'minitest'
require 'minitest/autorun'
require 'minitest/spec'
require 'action_dispatch/railtie'
$:<< 'lib'
require 'biceps'
# Load support files
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
| ENV["RAILS_ENV"] ||= 'test'
gem 'minitest'
require 'minitest/autorun'
require 'minitest/spec'
require 'action_dispatch/railtie'
+ $:<< 'lib'
require 'biceps'
# Load support files
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } | 1 | 0.083333 | 1 | 0 |
2f6d2f0235f89453dc8c40277dea8c6e0db70102 | src/main/webapp/licenses.jsp | src/main/webapp/licenses.jsp | <%@page contentType="text/html;charset=UTF-8" language="java"%>
<%@page import="edu.ucsf.mousedatabase.HTMLGeneration"%>
<%=HTMLGeneration.getPageHeader(null, false,false,"onload=\"setFocus('quickSearchForm', 'searchterms')\"") %>
<%=HTMLGeneration.getNavBar(null, false) %>
<div class="site_container">
<div class="textwrapper">
<h2>Licenses</h2>
The full source of this application is available under the under the AGPL,
and can be found on the project site hosted on Github:
<br>
<a target="_blank" href="http://ucsf-mousedb.github.com/mouseinventory/">ucsf-mousedb.github.com/mouseinventory</a>
<br>
The wood mouse image on the search page is licensed from iStockphoto.
</div>
</div>
| <%@page contentType="text/html;charset=UTF-8" language="java"%>
<%@page import="edu.ucsf.mousedatabase.HTMLGeneration"%>
<%=HTMLGeneration.getPageHeader(null, false,false,"onload=\"setFocus('quickSearchForm', 'searchterms')\"") %>
<%=HTMLGeneration.getNavBar(null, false) %>
<div class="site_container">
<div class="textwrapper">
<h2>Licenses</h2>
The full source of this application is available under the under the AGPL,
and can be found on the project site hosted on Github:
<br>
<a target="_blank" href="http://musIndex.github.com/mouseinventory/">musIndex.github.com/mouseinventory</a>
<br>
The wood mouse image on the search page is licensed from iStockphoto.
</div>
</div>
| Update open source code location | Update open source code location
| Java Server Pages | agpl-3.0 | musIndex/mouseinventory,musIndex/mouseinventory,musIndex/mouseinventory | java-server-pages | ## Code Before:
<%@page contentType="text/html;charset=UTF-8" language="java"%>
<%@page import="edu.ucsf.mousedatabase.HTMLGeneration"%>
<%=HTMLGeneration.getPageHeader(null, false,false,"onload=\"setFocus('quickSearchForm', 'searchterms')\"") %>
<%=HTMLGeneration.getNavBar(null, false) %>
<div class="site_container">
<div class="textwrapper">
<h2>Licenses</h2>
The full source of this application is available under the under the AGPL,
and can be found on the project site hosted on Github:
<br>
<a target="_blank" href="http://ucsf-mousedb.github.com/mouseinventory/">ucsf-mousedb.github.com/mouseinventory</a>
<br>
The wood mouse image on the search page is licensed from iStockphoto.
</div>
</div>
## Instruction:
Update open source code location
## Code After:
<%@page contentType="text/html;charset=UTF-8" language="java"%>
<%@page import="edu.ucsf.mousedatabase.HTMLGeneration"%>
<%=HTMLGeneration.getPageHeader(null, false,false,"onload=\"setFocus('quickSearchForm', 'searchterms')\"") %>
<%=HTMLGeneration.getNavBar(null, false) %>
<div class="site_container">
<div class="textwrapper">
<h2>Licenses</h2>
The full source of this application is available under the under the AGPL,
and can be found on the project site hosted on Github:
<br>
<a target="_blank" href="http://musIndex.github.com/mouseinventory/">musIndex.github.com/mouseinventory</a>
<br>
The wood mouse image on the search page is licensed from iStockphoto.
</div>
</div>
| <%@page contentType="text/html;charset=UTF-8" language="java"%>
<%@page import="edu.ucsf.mousedatabase.HTMLGeneration"%>
<%=HTMLGeneration.getPageHeader(null, false,false,"onload=\"setFocus('quickSearchForm', 'searchterms')\"") %>
<%=HTMLGeneration.getNavBar(null, false) %>
<div class="site_container">
<div class="textwrapper">
<h2>Licenses</h2>
The full source of this application is available under the under the AGPL,
and can be found on the project site hosted on Github:
<br>
- <a target="_blank" href="http://ucsf-mousedb.github.com/mouseinventory/">ucsf-mousedb.github.com/mouseinventory</a>
? ----- - ^^ ----- - ^^
+ <a target="_blank" href="http://musIndex.github.com/mouseinventory/">musIndex.github.com/mouseinventory</a>
? +++ ^ +++ ^
<br>
The wood mouse image on the search page is licensed from iStockphoto.
</div>
</div> | 2 | 0.117647 | 1 | 1 |
5965ed468fc41b60b215f9d124b69df00d2decb3 | lib/main.js | lib/main.js | // Import the page-mod API
var pageMod = require("sdk/page-mod");
// Create a page mod
// It will run a script whenever a ".org" URL is loaded
// The script replaces the page contents with a message
pageMod.PageMod({
include: [/https:\/\/github.com.*\/compare\/.*/, /https:\/\/github.com.*\/commit\/.*/],
contentStyleFile: "./css/main.css"
});
| // Import the page-mod API
var pageMod = require("sdk/page-mod");
// Create a page mod
// It will run a script whenever a ".org" URL is loaded
// The script replaces the page contents with a message
pageMod.PageMod({
include: [
/https:\/\/github.com.*\/compare\/.*/,
/https:\/\/github.com.*\/commit\/.*/,
/https:\/\/github.com.*\/pull\/[0-9]*\/files/
],
contentStyleFile: "./css/main.css"
});
| Add pull request in wide page | Add pull request in wide page
| JavaScript | mit | yoannrenard/wide-github | javascript | ## Code Before:
// Import the page-mod API
var pageMod = require("sdk/page-mod");
// Create a page mod
// It will run a script whenever a ".org" URL is loaded
// The script replaces the page contents with a message
pageMod.PageMod({
include: [/https:\/\/github.com.*\/compare\/.*/, /https:\/\/github.com.*\/commit\/.*/],
contentStyleFile: "./css/main.css"
});
## Instruction:
Add pull request in wide page
## Code After:
// Import the page-mod API
var pageMod = require("sdk/page-mod");
// Create a page mod
// It will run a script whenever a ".org" URL is loaded
// The script replaces the page contents with a message
pageMod.PageMod({
include: [
/https:\/\/github.com.*\/compare\/.*/,
/https:\/\/github.com.*\/commit\/.*/,
/https:\/\/github.com.*\/pull\/[0-9]*\/files/
],
contentStyleFile: "./css/main.css"
});
| // Import the page-mod API
var pageMod = require("sdk/page-mod");
// Create a page mod
// It will run a script whenever a ".org" URL is loaded
// The script replaces the page contents with a message
pageMod.PageMod({
- include: [/https:\/\/github.com.*\/compare\/.*/, /https:\/\/github.com.*\/commit\/.*/],
+ include: [
+ /https:\/\/github.com.*\/compare\/.*/,
+ /https:\/\/github.com.*\/commit\/.*/,
+ /https:\/\/github.com.*\/pull\/[0-9]*\/files/
+ ],
contentStyleFile: "./css/main.css"
}); | 6 | 0.6 | 5 | 1 |
23ed1e4d56e08b4520dc65274d918673fbb0bff0 | examples/bike-super-racer/index.js | examples/bike-super-racer/index.js | import RpmMeter, { PULSE_EVENT } from "spin-bike-rpm-meter";
let rpmMeter = new RpmMeter();
rpmMeter.start().then((stop) => {
console.log(stop);
rpmMeter.on(PULSE_EVENT, (params) => {
console.log(params);
});
}); | import RpmMeter, { PULSE_EVENT } from "spin-bike-rpm-meter";
const rpmMeter = new RpmMeter();
// Start listening to the "pulses". Asks for permission to the microphone. Run start() before
// starting to cycle on the spin bike.
rpmMeter.start().then((stop) => {
console.log('Starting listening to pulses...');
// After each revolution on the bike, a PULSE_EVENT is emitted containing some useful data about it.
rpmMeter.on(PULSE_EVENT, (pulseData) => {
console.log(pulseData);
// This is how the pulseData might look
//pulseData = {
// 'timestamp': 1454060831,
// 'secondsBetweenPulses': 0.8,
// 'rpm': 75
//};
});
// Stop listening to the "pulses" after 10 seconds.
setTimeout(() => {
stop();
console.log('Stopped listening to pulses...');
}, 10000);
}); | Update example with comments, stop after 10 secs | Update example with comments, stop after 10 secs
| JavaScript | mit | lamosty/spin-bike-rpm-meter | javascript | ## Code Before:
import RpmMeter, { PULSE_EVENT } from "spin-bike-rpm-meter";
let rpmMeter = new RpmMeter();
rpmMeter.start().then((stop) => {
console.log(stop);
rpmMeter.on(PULSE_EVENT, (params) => {
console.log(params);
});
});
## Instruction:
Update example with comments, stop after 10 secs
## Code After:
import RpmMeter, { PULSE_EVENT } from "spin-bike-rpm-meter";
const rpmMeter = new RpmMeter();
// Start listening to the "pulses". Asks for permission to the microphone. Run start() before
// starting to cycle on the spin bike.
rpmMeter.start().then((stop) => {
console.log('Starting listening to pulses...');
// After each revolution on the bike, a PULSE_EVENT is emitted containing some useful data about it.
rpmMeter.on(PULSE_EVENT, (pulseData) => {
console.log(pulseData);
// This is how the pulseData might look
//pulseData = {
// 'timestamp': 1454060831,
// 'secondsBetweenPulses': 0.8,
// 'rpm': 75
//};
});
// Stop listening to the "pulses" after 10 seconds.
setTimeout(() => {
stop();
console.log('Stopped listening to pulses...');
}, 10000);
}); | import RpmMeter, { PULSE_EVENT } from "spin-bike-rpm-meter";
- let rpmMeter = new RpmMeter();
? ^^
+ const rpmMeter = new RpmMeter();
? ^^^^
+ // Start listening to the "pulses". Asks for permission to the microphone. Run start() before
+ // starting to cycle on the spin bike.
rpmMeter.start().then((stop) => {
- console.log(stop);
+ console.log('Starting listening to pulses...');
+ // After each revolution on the bike, a PULSE_EVENT is emitted containing some useful data about it.
- rpmMeter.on(PULSE_EVENT, (params) => {
? ^ --
+ rpmMeter.on(PULSE_EVENT, (pulseData) => {
? +++++ ^
- console.log(params);
? ^ --
+ console.log(pulseData);
? +++++ ^
+
+ // This is how the pulseData might look
+ //pulseData = {
+ // 'timestamp': 1454060831,
+ // 'secondsBetweenPulses': 0.8,
+ // 'rpm': 75
+ //};
});
+
+ // Stop listening to the "pulses" after 10 seconds.
+ setTimeout(() => {
+ stop();
+
+ console.log('Stopped listening to pulses...');
+ }, 10000);
}); | 25 | 2.083333 | 21 | 4 |
4d720bed8c8718ba3896c21d5a20c0f19ace2f78 | .travis.yml | .travis.yml | language: shell
os: linux
dist: xenial
git:
depth: false
branches:
only:
- master
- dev
services:
- docker
env:
- DOCKER_COMPOSE_FILE=compose/lts/docker-compose-alpine-fpm.yml
- DOCKER_COMPOSE_FILE=compose/lts/docker-compose-alpine-fpm.yml
- DOCKER_COMPOSE_FILE=compose/latest/docker-compose-alpine-fpm.yml
- DOCKER_COMPOSE_FILE=compose/latest/docker-compose-apache.yml
script: docker-compose -f $DOCKER_COMPOSE_FILE build
deploy:
- provider: script
# on:
# branch: master
script: |
echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USER" --password-stdin &&\
echo "I will deploy using the command: docker-compose -f .$DOCKER_COMPOSE_FILE push" | language: shell
os: linux
dist: xenial
git:
depth: false
branches:
only:
- master
- dev
services:
- docker
env:
- DOCKER_COMPOSE_FILE=compose/lts/docker-compose-alpine-fpm.yml
- DOCKER_COMPOSE_FILE=compose/lts/docker-compose-apache.yml
- DOCKER_COMPOSE_FILE=compose/latest/docker-compose-alpine-fpm.yml
- DOCKER_COMPOSE_FILE=compose/latest/docker-compose-apache.yml
script: docker-compose -f $DOCKER_COMPOSE_FILE build
deploy:
- provider: script
script: |
echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USER" --password-stdin &&\
echo "I will deploy using the command: docker-compose -f .$DOCKER_COMPOSE_FILE push" | Build Apache as well and try to deploy. | Build Apache as well and try to deploy.
| YAML | agpl-3.0 | ellakcy/docker-moodle,ellakcy/docker-moodle | yaml | ## Code Before:
language: shell
os: linux
dist: xenial
git:
depth: false
branches:
only:
- master
- dev
services:
- docker
env:
- DOCKER_COMPOSE_FILE=compose/lts/docker-compose-alpine-fpm.yml
- DOCKER_COMPOSE_FILE=compose/lts/docker-compose-alpine-fpm.yml
- DOCKER_COMPOSE_FILE=compose/latest/docker-compose-alpine-fpm.yml
- DOCKER_COMPOSE_FILE=compose/latest/docker-compose-apache.yml
script: docker-compose -f $DOCKER_COMPOSE_FILE build
deploy:
- provider: script
# on:
# branch: master
script: |
echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USER" --password-stdin &&\
echo "I will deploy using the command: docker-compose -f .$DOCKER_COMPOSE_FILE push"
## Instruction:
Build Apache as well and try to deploy.
## Code After:
language: shell
os: linux
dist: xenial
git:
depth: false
branches:
only:
- master
- dev
services:
- docker
env:
- DOCKER_COMPOSE_FILE=compose/lts/docker-compose-alpine-fpm.yml
- DOCKER_COMPOSE_FILE=compose/lts/docker-compose-apache.yml
- DOCKER_COMPOSE_FILE=compose/latest/docker-compose-alpine-fpm.yml
- DOCKER_COMPOSE_FILE=compose/latest/docker-compose-apache.yml
script: docker-compose -f $DOCKER_COMPOSE_FILE build
deploy:
- provider: script
script: |
echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USER" --password-stdin &&\
echo "I will deploy using the command: docker-compose -f .$DOCKER_COMPOSE_FILE push" | language: shell
os: linux
dist: xenial
git:
depth: false
branches:
only:
- master
- dev
services:
- docker
env:
- DOCKER_COMPOSE_FILE=compose/lts/docker-compose-alpine-fpm.yml
- - DOCKER_COMPOSE_FILE=compose/lts/docker-compose-alpine-fpm.yml
? - ^^ ----
+ - DOCKER_COMPOSE_FILE=compose/lts/docker-compose-apache.yml
? ^^^
- DOCKER_COMPOSE_FILE=compose/latest/docker-compose-alpine-fpm.yml
- DOCKER_COMPOSE_FILE=compose/latest/docker-compose-apache.yml
script: docker-compose -f $DOCKER_COMPOSE_FILE build
deploy:
- provider: script
- # on:
- # branch: master
script: |
echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USER" --password-stdin &&\
echo "I will deploy using the command: docker-compose -f .$DOCKER_COMPOSE_FILE push" | 4 | 0.137931 | 1 | 3 |
a537798572146773a16a84f7ce3181d9492312d6 | README.md | README.md | yelp_bytes
==========
Utilities for dealing with byte strings, invented and maintained by Yelp.
|
yelp_bytes contains several utility functions to help ensure that the data you're using is always either Unicode or byte strings, taking care of the edge cases for you so that you don't have to worry about them. We do all of this by leveraging our [yelp_encodings](https://github.com/Yelp/yelp_encodings) library to handle the encoding and decoding of data to and from Unicode.
## Installation
Installation is easy with ``pip``! The package lives on PyPI so all you have to do is run
```
$ pip install yelp_bytes
```
And you're off!
## Usage
All you need to do is import yelp_bytes into your code.
```
import yelp_bytes
yelp_bytes.to_utf8('Hello world!') # => 'Hello World!'
yelp_bytes.to_bytes('Hello world!') # => 'Hello World!'
yelp_bytes.from_utf8('Hello world!') # => u'Hello World!'
yelp_bytes.from_bytes('Hello world!') # => u'Hello World'
```
You have four functions available to you:
1. ``to_bytes`` encodes to utf-8 bytestrings
2. ``from_bytes`` decodes values to unambiguous unicode characters
3. ``to_utf8`` encodes unicode text to utf-8 bytes
4. ``from_utf8`` decodes utf-8 bytes to unicode text
Check out the source to learn more about the input parameters and return values.
| Update readme with readme with brief intro, installation instructions, and quick usage rundown | Update readme with readme with brief intro, installation instructions, and quick usage rundown
| Markdown | unlicense | Yelp/yelp_bytes | markdown | ## Code Before:
yelp_bytes
==========
Utilities for dealing with byte strings, invented and maintained by Yelp.
## Instruction:
Update readme with readme with brief intro, installation instructions, and quick usage rundown
## Code After:
yelp_bytes contains several utility functions to help ensure that the data you're using is always either Unicode or byte strings, taking care of the edge cases for you so that you don't have to worry about them. We do all of this by leveraging our [yelp_encodings](https://github.com/Yelp/yelp_encodings) library to handle the encoding and decoding of data to and from Unicode.
## Installation
Installation is easy with ``pip``! The package lives on PyPI so all you have to do is run
```
$ pip install yelp_bytes
```
And you're off!
## Usage
All you need to do is import yelp_bytes into your code.
```
import yelp_bytes
yelp_bytes.to_utf8('Hello world!') # => 'Hello World!'
yelp_bytes.to_bytes('Hello world!') # => 'Hello World!'
yelp_bytes.from_utf8('Hello world!') # => u'Hello World!'
yelp_bytes.from_bytes('Hello world!') # => u'Hello World'
```
You have four functions available to you:
1. ``to_bytes`` encodes to utf-8 bytestrings
2. ``from_bytes`` decodes values to unambiguous unicode characters
3. ``to_utf8`` encodes unicode text to utf-8 bytes
4. ``from_utf8`` decodes utf-8 bytes to unicode text
Check out the source to learn more about the input parameters and return values.
| - yelp_bytes
- ==========
- Utilities for dealing with byte strings, invented and maintained by Yelp.
+ yelp_bytes contains several utility functions to help ensure that the data you're using is always either Unicode or byte strings, taking care of the edge cases for you so that you don't have to worry about them. We do all of this by leveraging our [yelp_encodings](https://github.com/Yelp/yelp_encodings) library to handle the encoding and decoding of data to and from Unicode.
+
+ ## Installation
+
+ Installation is easy with ``pip``! The package lives on PyPI so all you have to do is run
+
+ ```
+ $ pip install yelp_bytes
+ ```
+
+ And you're off!
+
+ ## Usage
+
+ All you need to do is import yelp_bytes into your code.
+
+ ```
+ import yelp_bytes
+
+ yelp_bytes.to_utf8('Hello world!') # => 'Hello World!'
+ yelp_bytes.to_bytes('Hello world!') # => 'Hello World!'
+
+ yelp_bytes.from_utf8('Hello world!') # => u'Hello World!'
+ yelp_bytes.from_bytes('Hello world!') # => u'Hello World'
+ ```
+
+ You have four functions available to you:
+
+ 1. ``to_bytes`` encodes to utf-8 bytestrings
+ 2. ``from_bytes`` decodes values to unambiguous unicode characters
+ 3. ``to_utf8`` encodes unicode text to utf-8 bytes
+ 4. ``from_utf8`` decodes utf-8 bytes to unicode text
+
+ Check out the source to learn more about the input parameters and return values. | 37 | 9.25 | 34 | 3 |
9b68d0cb4c53dcf83794a4858c3893ccdbd39045 | src/modules/core/services/sp.service.js | src/modules/core/services/sp.service.js | angular
.module('ngSharepoint')
.provider('$sp', function() {
var siteUrl = '';
var connMode = 'JSOM'; //possible values: JSOM, REST
var token = false;
var autoload = true;
return {
setSiteUrl: function (newUrl) {
siteUrl = newUrl;
},
setConnectionMode: function(newConnMode) { //Only JSOM Supported for now
if (newConnMode === 'JSOM' || newConnMode === 'REST') {
connMode = newConnMode;
}
},
setAccessToken: function(newToken) {
token = newToken;
},
setAutoload: function(newAutoload) {
autoload = newAutoload;
},
$get: function() {
return ({
getSiteUrl: function() {
return siteUrl;
},
getConnectionMode: function() {
return connMode;
},
getAccessToken: function(token) {
return token;
},
getContext: function() {
return new SP.ClientContext(siteUrl);
},
getAutoload: function() {
return autoload;
}
});
}
};
});
| angular
.module('ngSharepoint')
.provider('$sp', $spProvider);
function $spProvider() {
var siteUrl = '';
var connMode = 'JSOM';
var token = false;
var autoload = true;
var provider = {
setSiteUrl: setSiteUrl,
setConnectionMode: setConnectionMode,
setAccessToken: setAccessToken,
setAutoload: setAutoload,
$get: $sp
};
return provider;
function setSiteUrl(newUrl) {
siteUrl = newUrl;
}
function setConnectionMode(newConnMode) { //Only JSOM Supported for now
if (newConnMode === 'JSOM' || newConnMode === 'REST') {
connMode = newConnMode;
}
}
function setAccessToken(newToken) {
token = newToken;
}
function setAutoload(newAutoload) {
autoload = newAutoload;
}
function $sp() {
var service = {
getSiteUrl: getSiteUrl,
getConnectionMode: getConnectionMode,
getAccessToken: getAccessToken,
getContext: getContext,
getAutoload: getAutoload
};
return service;
function getContext() {
return new SP.ClientContext();
}
function getSiteUrl() {
return siteUrl;
}
function getConnectionMode() {
return connMode;
}
function getAccessToken() {
return token;
}
function getAutoload() {
return autoload;
}
}
} | Use named functions for better readability | Use named functions for better readability
| JavaScript | apache-2.0 | maxjoehnk/ngSharepoint | javascript | ## Code Before:
angular
.module('ngSharepoint')
.provider('$sp', function() {
var siteUrl = '';
var connMode = 'JSOM'; //possible values: JSOM, REST
var token = false;
var autoload = true;
return {
setSiteUrl: function (newUrl) {
siteUrl = newUrl;
},
setConnectionMode: function(newConnMode) { //Only JSOM Supported for now
if (newConnMode === 'JSOM' || newConnMode === 'REST') {
connMode = newConnMode;
}
},
setAccessToken: function(newToken) {
token = newToken;
},
setAutoload: function(newAutoload) {
autoload = newAutoload;
},
$get: function() {
return ({
getSiteUrl: function() {
return siteUrl;
},
getConnectionMode: function() {
return connMode;
},
getAccessToken: function(token) {
return token;
},
getContext: function() {
return new SP.ClientContext(siteUrl);
},
getAutoload: function() {
return autoload;
}
});
}
};
});
## Instruction:
Use named functions for better readability
## Code After:
angular
.module('ngSharepoint')
.provider('$sp', $spProvider);
function $spProvider() {
var siteUrl = '';
var connMode = 'JSOM';
var token = false;
var autoload = true;
var provider = {
setSiteUrl: setSiteUrl,
setConnectionMode: setConnectionMode,
setAccessToken: setAccessToken,
setAutoload: setAutoload,
$get: $sp
};
return provider;
function setSiteUrl(newUrl) {
siteUrl = newUrl;
}
function setConnectionMode(newConnMode) { //Only JSOM Supported for now
if (newConnMode === 'JSOM' || newConnMode === 'REST') {
connMode = newConnMode;
}
}
function setAccessToken(newToken) {
token = newToken;
}
function setAutoload(newAutoload) {
autoload = newAutoload;
}
function $sp() {
var service = {
getSiteUrl: getSiteUrl,
getConnectionMode: getConnectionMode,
getAccessToken: getAccessToken,
getContext: getContext,
getAutoload: getAutoload
};
return service;
function getContext() {
return new SP.ClientContext();
}
function getSiteUrl() {
return siteUrl;
}
function getConnectionMode() {
return connMode;
}
function getAccessToken() {
return token;
}
function getAutoload() {
return autoload;
}
}
} | angular
.module('ngSharepoint')
+ .provider('$sp', $spProvider);
- .provider('$sp', function() {
- var siteUrl = '';
- var connMode = 'JSOM'; //possible values: JSOM, REST
- var token = false;
- var autoload = true;
- return {
- setSiteUrl: function (newUrl) {
+ function $spProvider() {
+ var siteUrl = '';
+ var connMode = 'JSOM';
+ var token = false;
+ var autoload = true;
+
+ var provider = {
+ setSiteUrl: setSiteUrl,
+ setConnectionMode: setConnectionMode,
+ setAccessToken: setAccessToken,
+ setAutoload: setAutoload,
+ $get: $sp
+ };
+ return provider;
+
+ function setSiteUrl(newUrl) {
- siteUrl = newUrl;
? --
+ siteUrl = newUrl;
- },
+ }
- setConnectionMode: function(newConnMode) { //Only JSOM Supported for now
? ^^ ----------
+ function setConnectionMode(newConnMode) { //Only JSOM Supported for now
? ^^^^^^^^^
- if (newConnMode === 'JSOM' || newConnMode === 'REST') {
? --
+ if (newConnMode === 'JSOM' || newConnMode === 'REST') {
- connMode = newConnMode;
? --
+ connMode = newConnMode;
- }
? --
+ }
- },
- setAccessToken: function(newToken) {
+ }
+ function setAccessToken(newToken) {
- token = newToken;
? --
+ token = newToken;
- },
- setAutoload: function(newAutoload) {
+ }
+ function setAutoload(newAutoload) {
- autoload = newAutoload;
? --
+ autoload = newAutoload;
+ }
+
+ function $sp() {
+ var service = {
+ getSiteUrl: getSiteUrl,
+ getConnectionMode: getConnectionMode,
+ getAccessToken: getAccessToken,
+ getContext: getContext,
+ getAutoload: getAutoload
- },
- $get: function() {
- return ({
- getSiteUrl: function() {
- return siteUrl;
- },
- getConnectionMode: function() {
- return connMode;
- },
- getAccessToken: function(token) {
- return token;
- },
- getContext: function() {
- return new SP.ClientContext(siteUrl);
- },
- getAutoload: function() {
- return autoload;
- }
- });
- }
};
- });
+ return service;
+
+ function getContext() {
+ return new SP.ClientContext();
+ }
+ function getSiteUrl() {
+ return siteUrl;
+ }
+ function getConnectionMode() {
+ return connMode;
+ }
+ function getAccessToken() {
+ return token;
+ }
+ function getAutoload() {
+ return autoload;
+ }
+ }
+ } | 97 | 2.204545 | 57 | 40 |
e060f9066e15efd5fb8dcf65a7e49f946a966fd6 | assets/css/media-queries/_prefers-color-scheme.scss | assets/css/media-queries/_prefers-color-scheme.scss | @media (prefers-color-scheme: dark) {
body {
background: #2c2a28 !important;
color: $gray-light !important;
blockquote {
color: $gray-light !important;
}
div.highlight {
border: 1px $gray-light solid !important;
}
.language-toggle a {
color: $gray-light !important;
}
.info {
background: #333c44 !important;
}
.warning {
background: #484131 !important;
}
.error {
background: #592e41 !important;
}
}
}
| @media (prefers-color-scheme: dark) {
body {
background: #2c2a28 !important;
color: $gray-light !important;
blockquote {
color: $gray-light !important;
}
div.highlight {
border: 1px $gray-light solid !important;
}
.language-toggle a {
color: $gray-light !important;
}
.info {
background: #333c44 !important;
}
.warning {
background: #484131 !important;
}
.error {
background: #592e41 !important;
}
}
img[src$=".svg"]{
filter: invert(100%);
}
}
| Fix display of LSP images in dark mode | Fix display of LSP images in dark mode
| SCSS | mit | NSHipster/nshipster.com,NSHipster/nshipster.com,NSHipster/nshipster.com | scss | ## Code Before:
@media (prefers-color-scheme: dark) {
body {
background: #2c2a28 !important;
color: $gray-light !important;
blockquote {
color: $gray-light !important;
}
div.highlight {
border: 1px $gray-light solid !important;
}
.language-toggle a {
color: $gray-light !important;
}
.info {
background: #333c44 !important;
}
.warning {
background: #484131 !important;
}
.error {
background: #592e41 !important;
}
}
}
## Instruction:
Fix display of LSP images in dark mode
## Code After:
@media (prefers-color-scheme: dark) {
body {
background: #2c2a28 !important;
color: $gray-light !important;
blockquote {
color: $gray-light !important;
}
div.highlight {
border: 1px $gray-light solid !important;
}
.language-toggle a {
color: $gray-light !important;
}
.info {
background: #333c44 !important;
}
.warning {
background: #484131 !important;
}
.error {
background: #592e41 !important;
}
}
img[src$=".svg"]{
filter: invert(100%);
}
}
| @media (prefers-color-scheme: dark) {
body {
background: #2c2a28 !important;
color: $gray-light !important;
blockquote {
color: $gray-light !important;
}
div.highlight {
border: 1px $gray-light solid !important;
}
.language-toggle a {
color: $gray-light !important;
}
.info {
background: #333c44 !important;
}
.warning {
background: #484131 !important;
}
.error {
background: #592e41 !important;
}
}
+
+ img[src$=".svg"]{
+ filter: invert(100%);
+ }
} | 4 | 0.121212 | 4 | 0 |
9571d462bb90e13af43381e8f477f77f1fd03d63 | app/views/users/dashboard.html.haml | app/views/users/dashboard.html.haml | %h2 User Dashboard
.user-activities
= render "user_activities"
| %h2 User Dashboard
.sort
%button.sort{:href => "#"} Name
%button.sort{:href => "#"} Date
%button.sort{:href => "#"} Venue
.user-activities
= render "user_activities"
| Implement functionality to require users to sign in before saving an event | Implement functionality to require users to sign in before saving an event
| Haml | mit | TerrenceLJones/not-bored-tonight,TerrenceLJones/not-bored-tonight | haml | ## Code Before:
%h2 User Dashboard
.user-activities
= render "user_activities"
## Instruction:
Implement functionality to require users to sign in before saving an event
## Code After:
%h2 User Dashboard
.sort
%button.sort{:href => "#"} Name
%button.sort{:href => "#"} Date
%button.sort{:href => "#"} Venue
.user-activities
= render "user_activities"
| %h2 User Dashboard
+
+ .sort
+ %button.sort{:href => "#"} Name
+ %button.sort{:href => "#"} Date
+ %button.sort{:href => "#"} Venue
+
.user-activities
= render "user_activities" | 6 | 1.5 | 6 | 0 |
2426436d4e8f09da46c41b654a7498428f0e2df5 | resources/style-doc.styl | resources/style-doc.styl | $contentPadding = 10px
$backgroundColor = #f8f8ff
$contentBackground = white
$dividerColor = #ccc
$dividerBorder = 1px solid $dividerColor
body > nav
background $backgroundColor
border $dividerBorder
button[data-tab]
@extend body > nav
padding 0 $contentPadding
line-height 2em
margin-bottom -1px
&.doc-active
font-weight bold
border-bottom-color $contentBackground
background-color $contentBackground
section.doc-tabbed
display none !important
margin $contentPadding
background-color $contentBackground
&.doc-active
display block !important
> p
> pre
float left
clear left
margin 10px 0
line-height 1.3
width 40%
> .style-doc-sample
> .style-doc-highlight
float right
clear right
padding-left 2%
width 58%
> h3
> h4
clear both
code
overflow auto !important
border $dividerBorder !important
pre
display none
.show-code &
display block
.style-doc-highlight
display none
&:after
&:before
content ''
display block
height 1px
margin $contentPadding
border none
background-image linear-gradient(left, #efefef, #ccc 50%, #efefef)
.show-highlights &
display block
| $contentPadding = 10px
$backgroundColor = #f8f8ff
$contentBackground = white
$dividerColor = #ccc
$dividerBorder = 1px solid $dividerColor
body > nav
background $backgroundColor
border $dividerBorder
button[data-tab]
@extend body > nav
padding 0 $contentPadding
line-height 2em
margin-bottom -1px
&.doc-active
font-weight bold
border-bottom-color $contentBackground
background-color $contentBackground
section.doc-tabbed
display none !important
margin $contentPadding
background-color $contentBackground
&.doc-active
display block !important
> p
> pre
float left
clear left
margin 10px 0
line-height 1.3
width 40%
> .style-doc-sample
> .style-doc-highlight
float right
clear right
padding-left 2%
width 58%
> h3
> h4
clear both
@media only screen and (max-width: 480px)
section.doc-tabbed
> p
> pre
> .style-doc-sample
> .style-doc-highlight
float none
width 100%
code
overflow auto !important
border $dividerBorder !important
pre
display none
.show-code &
display block
.style-doc-highlight
display none
&:after
&:before
content ''
display block
height 1px
margin $contentPadding
border none
background-image linear-gradient(left, #efefef, #ccc 50%, #efefef)
.show-highlights &
display block
| Use single column on smaller screen sizes | Use single column on smaller screen sizes | Stylus | mit | kpdecker/lumbar-style-doc | stylus | ## Code Before:
$contentPadding = 10px
$backgroundColor = #f8f8ff
$contentBackground = white
$dividerColor = #ccc
$dividerBorder = 1px solid $dividerColor
body > nav
background $backgroundColor
border $dividerBorder
button[data-tab]
@extend body > nav
padding 0 $contentPadding
line-height 2em
margin-bottom -1px
&.doc-active
font-weight bold
border-bottom-color $contentBackground
background-color $contentBackground
section.doc-tabbed
display none !important
margin $contentPadding
background-color $contentBackground
&.doc-active
display block !important
> p
> pre
float left
clear left
margin 10px 0
line-height 1.3
width 40%
> .style-doc-sample
> .style-doc-highlight
float right
clear right
padding-left 2%
width 58%
> h3
> h4
clear both
code
overflow auto !important
border $dividerBorder !important
pre
display none
.show-code &
display block
.style-doc-highlight
display none
&:after
&:before
content ''
display block
height 1px
margin $contentPadding
border none
background-image linear-gradient(left, #efefef, #ccc 50%, #efefef)
.show-highlights &
display block
## Instruction:
Use single column on smaller screen sizes
## Code After:
$contentPadding = 10px
$backgroundColor = #f8f8ff
$contentBackground = white
$dividerColor = #ccc
$dividerBorder = 1px solid $dividerColor
body > nav
background $backgroundColor
border $dividerBorder
button[data-tab]
@extend body > nav
padding 0 $contentPadding
line-height 2em
margin-bottom -1px
&.doc-active
font-weight bold
border-bottom-color $contentBackground
background-color $contentBackground
section.doc-tabbed
display none !important
margin $contentPadding
background-color $contentBackground
&.doc-active
display block !important
> p
> pre
float left
clear left
margin 10px 0
line-height 1.3
width 40%
> .style-doc-sample
> .style-doc-highlight
float right
clear right
padding-left 2%
width 58%
> h3
> h4
clear both
@media only screen and (max-width: 480px)
section.doc-tabbed
> p
> pre
> .style-doc-sample
> .style-doc-highlight
float none
width 100%
code
overflow auto !important
border $dividerBorder !important
pre
display none
.show-code &
display block
.style-doc-highlight
display none
&:after
&:before
content ''
display block
height 1px
margin $contentPadding
border none
background-image linear-gradient(left, #efefef, #ccc 50%, #efefef)
.show-highlights &
display block
| $contentPadding = 10px
$backgroundColor = #f8f8ff
$contentBackground = white
$dividerColor = #ccc
$dividerBorder = 1px solid $dividerColor
body > nav
background $backgroundColor
border $dividerBorder
button[data-tab]
@extend body > nav
padding 0 $contentPadding
line-height 2em
margin-bottom -1px
&.doc-active
font-weight bold
border-bottom-color $contentBackground
background-color $contentBackground
section.doc-tabbed
display none !important
margin $contentPadding
background-color $contentBackground
&.doc-active
display block !important
> p
> pre
float left
clear left
margin 10px 0
line-height 1.3
width 40%
> .style-doc-sample
> .style-doc-highlight
float right
clear right
padding-left 2%
width 58%
> h3
> h4
clear both
+ @media only screen and (max-width: 480px)
+ section.doc-tabbed
+ > p
+ > pre
+ > .style-doc-sample
+ > .style-doc-highlight
+ float none
+ width 100%
code
overflow auto !important
border $dividerBorder !important
pre
display none
.show-code &
display block
.style-doc-highlight
display none
&:after
&:before
content ''
display block
height 1px
margin $contentPadding
border none
background-image linear-gradient(left, #efefef, #ccc 50%, #efefef)
.show-highlights &
display block | 8 | 0.109589 | 8 | 0 |
3db02fd24ca51f4ac93be2c2fe430f4e1500ecef | lib/gutenberg/book.rb | lib/gutenberg/book.rb | require 'pathname'
require "gutenberg/book/version"
require "gutenberg/book/paragraph"
module Gutenberg
class Book
include Enumerable
def initialize path
file = Pathname.new(path).expand_path
@parts = IO.read(file)
.split(/\r\n\r\n/)
.delete_if(&:empty?)
.map { |part| part.strip.gsub "\r\n", ' ' }
@book_start = @parts.find_index { |s| s.start_with? '*** START' }
@book_end = @parts.find_index { |s| s.start_with? '*** END' }
end
def metainfo
get_metainfo = -> do
metainfo = {}
@parts[0..@book_start].each do |string|
key, value = string.split ': ', 2
metainfo[key] = value unless key.nil? || value.nil?
end
metainfo
end
@metainfo ||= get_metainfo[]
end
def paragraphs
get_paragraphs = -> { @parts[@book_start+1...@book_end] }
@paragraphs ||= get_paragraphs[]
end
def each &b
paragraphs.each &b
end
end
end
| require 'pathname'
require "gutenberg/book/version"
require "gutenberg/book/paragraph"
module Gutenberg
class Book
include Enumerable
def each &b
paragraphs.each &b
end
def initialize parts
@book_start = parts.find_index { |s| s.start_with? '*** START' }
@book_end = parts.find_index { |s| s.start_with? '*** END' }
@parts = parts
end
class << self
def new_from_txt path
file = Pathname.new(path).expand_path
parts = IO.read(file)
.split(/\r\n\r\n/)
.delete_if(&:empty?)
.map { |part| part.strip.gsub "\r\n", ' ' }
new parts
end
def new_from_daybreak path
new (Daybreak::DB.new path)
end
end
def metainfo
get_metainfo = -> do
metainfo = {}
@parts[0..@book_start].each do |string|
key, value = string.split ': ', 2
metainfo[key] = value unless key.nil? || value.nil?
end
metainfo
end
@metainfo ||= get_metainfo[]
end
def paragraphs
get_paragraphs = -> { @parts[@book_start+1...@book_end] }
@paragraphs ||= get_paragraphs[]
end
def save_to file
db = Daybreak::DB.new file
@parts.each { |k, v| db[k] = v }
db.flush; db.close
end
end
end
| Make the Book persistable via Daybreak | Make the Book persistable via Daybreak
| Ruby | mit | ch1c0t/gutenberg-book | ruby | ## Code Before:
require 'pathname'
require "gutenberg/book/version"
require "gutenberg/book/paragraph"
module Gutenberg
class Book
include Enumerable
def initialize path
file = Pathname.new(path).expand_path
@parts = IO.read(file)
.split(/\r\n\r\n/)
.delete_if(&:empty?)
.map { |part| part.strip.gsub "\r\n", ' ' }
@book_start = @parts.find_index { |s| s.start_with? '*** START' }
@book_end = @parts.find_index { |s| s.start_with? '*** END' }
end
def metainfo
get_metainfo = -> do
metainfo = {}
@parts[0..@book_start].each do |string|
key, value = string.split ': ', 2
metainfo[key] = value unless key.nil? || value.nil?
end
metainfo
end
@metainfo ||= get_metainfo[]
end
def paragraphs
get_paragraphs = -> { @parts[@book_start+1...@book_end] }
@paragraphs ||= get_paragraphs[]
end
def each &b
paragraphs.each &b
end
end
end
## Instruction:
Make the Book persistable via Daybreak
## Code After:
require 'pathname'
require "gutenberg/book/version"
require "gutenberg/book/paragraph"
module Gutenberg
class Book
include Enumerable
def each &b
paragraphs.each &b
end
def initialize parts
@book_start = parts.find_index { |s| s.start_with? '*** START' }
@book_end = parts.find_index { |s| s.start_with? '*** END' }
@parts = parts
end
class << self
def new_from_txt path
file = Pathname.new(path).expand_path
parts = IO.read(file)
.split(/\r\n\r\n/)
.delete_if(&:empty?)
.map { |part| part.strip.gsub "\r\n", ' ' }
new parts
end
def new_from_daybreak path
new (Daybreak::DB.new path)
end
end
def metainfo
get_metainfo = -> do
metainfo = {}
@parts[0..@book_start].each do |string|
key, value = string.split ': ', 2
metainfo[key] = value unless key.nil? || value.nil?
end
metainfo
end
@metainfo ||= get_metainfo[]
end
def paragraphs
get_paragraphs = -> { @parts[@book_start+1...@book_end] }
@paragraphs ||= get_paragraphs[]
end
def save_to file
db = Daybreak::DB.new file
@parts.each { |k, v| db[k] = v }
db.flush; db.close
end
end
end
| require 'pathname'
require "gutenberg/book/version"
require "gutenberg/book/paragraph"
module Gutenberg
class Book
include Enumerable
+ def each &b
+ paragraphs.each &b
+ end
- def initialize path
- file = Pathname.new(path).expand_path
- @parts = IO.read(file)
- .split(/\r\n\r\n/)
- .delete_if(&:empty?)
- .map { |part| part.strip.gsub "\r\n", ' ' }
+ def initialize parts
- @book_start = @parts.find_index { |s| s.start_with? '*** START' }
? -
+ @book_start = parts.find_index { |s| s.start_with? '*** START' }
- @book_end = @parts.find_index { |s| s.start_with? '*** END' }
? -
+ @book_end = parts.find_index { |s| s.start_with? '*** END' }
+ @parts = parts
+ end
+
+ class << self
+ def new_from_txt path
+ file = Pathname.new(path).expand_path
+ parts = IO.read(file)
+ .split(/\r\n\r\n/)
+ .delete_if(&:empty?)
+ .map { |part| part.strip.gsub "\r\n", ' ' }
+
+ new parts
+ end
+
+ def new_from_daybreak path
+ new (Daybreak::DB.new path)
+ end
end
def metainfo
get_metainfo = -> do
metainfo = {}
@parts[0..@book_start].each do |string|
key, value = string.split ': ', 2
metainfo[key] = value unless key.nil? || value.nil?
end
metainfo
end
@metainfo ||= get_metainfo[]
end
def paragraphs
get_paragraphs = -> { @parts[@book_start+1...@book_end] }
@paragraphs ||= get_paragraphs[]
end
- def each &b
- paragraphs.each &b
+ def save_to file
+ db = Daybreak::DB.new file
+ @parts.each { |k, v| db[k] = v }
+ db.flush; db.close
end
end
end | 37 | 0.840909 | 27 | 10 |
ef5492b6ab0a57d0d2fa16b853f1d699a4710a90 | README.md | README.md | A client/server interface for remote simulation and local visualization.
Dependencies:
* SDL2 (https://www.libsdl.org/download-2.0.php)
-> tested with version 2.04
* SDL2_net (https://www.libsdl.org/projects/SDL_net/)
-> tested with version 2.01
* CMake 3.10 or higher (cmake.org)
Install:
Create a build directory and use cmake, make and make install (tutorial: https://cmake.org/runningcmake/)
Example:
An example directory is created with a small server/client application (SimpleSim) implementing NetOff. The sources are in the directory test of the source code. The SimpleSim application consists of two parts, the server and the client. The server is executed via `./SimpleSim 4444 whereas 4444` is a arbitrary chosen port. The client is started via `./SimpleSim 4444 localhost`.
This can also be done in one single console as `./SimpleSim 4444 & ./SimpleSim 4444 localhost`.
| A client/server interface for remote simulation and local visualization.
Dependencies:
..* SDL2 (https://www.libsdl.org/download-2.0.php)
-> tested with version 2.04
..* SDL2_net (https://www.libsdl.org/projects/SDL_net/)
-> tested with version 2.01
..* CMake 3.10 or higher (cmake.org)
Install:
Create a build directory and use cmake, make and make install (tutorial: https://cmake.org/runningcmake/)
Example:
An example directory is created with a small server/client application (SimpleSim) implementing NetOff. The sources are in the directory test of the source code. The SimpleSim application consists of two parts, the server and the client. The server is executed via `./SimpleSim 4444 whereas 4444` is a arbitrary chosen port. The client is started via `./SimpleSim 4444 localhost`.
This can also be done in one single console as `./SimpleSim 4444 & ./SimpleSim 4444 localhost`.
| Update on syntax for unordered list | Update on syntax for unordered list
| Markdown | bsd-3-clause | marchartung/NetworkOffloader | markdown | ## Code Before:
A client/server interface for remote simulation and local visualization.
Dependencies:
* SDL2 (https://www.libsdl.org/download-2.0.php)
-> tested with version 2.04
* SDL2_net (https://www.libsdl.org/projects/SDL_net/)
-> tested with version 2.01
* CMake 3.10 or higher (cmake.org)
Install:
Create a build directory and use cmake, make and make install (tutorial: https://cmake.org/runningcmake/)
Example:
An example directory is created with a small server/client application (SimpleSim) implementing NetOff. The sources are in the directory test of the source code. The SimpleSim application consists of two parts, the server and the client. The server is executed via `./SimpleSim 4444 whereas 4444` is a arbitrary chosen port. The client is started via `./SimpleSim 4444 localhost`.
This can also be done in one single console as `./SimpleSim 4444 & ./SimpleSim 4444 localhost`.
## Instruction:
Update on syntax for unordered list
## Code After:
A client/server interface for remote simulation and local visualization.
Dependencies:
..* SDL2 (https://www.libsdl.org/download-2.0.php)
-> tested with version 2.04
..* SDL2_net (https://www.libsdl.org/projects/SDL_net/)
-> tested with version 2.01
..* CMake 3.10 or higher (cmake.org)
Install:
Create a build directory and use cmake, make and make install (tutorial: https://cmake.org/runningcmake/)
Example:
An example directory is created with a small server/client application (SimpleSim) implementing NetOff. The sources are in the directory test of the source code. The SimpleSim application consists of two parts, the server and the client. The server is executed via `./SimpleSim 4444 whereas 4444` is a arbitrary chosen port. The client is started via `./SimpleSim 4444 localhost`.
This can also be done in one single console as `./SimpleSim 4444 & ./SimpleSim 4444 localhost`.
| A client/server interface for remote simulation and local visualization.
Dependencies:
- * SDL2 (https://www.libsdl.org/download-2.0.php)
? ^^^^
+ ..* SDL2 (https://www.libsdl.org/download-2.0.php)
? ^^
-> tested with version 2.04
- * SDL2_net (https://www.libsdl.org/projects/SDL_net/)
? ^^^^
+ ..* SDL2_net (https://www.libsdl.org/projects/SDL_net/)
? ^^
-> tested with version 2.01
- * CMake 3.10 or higher (cmake.org)
? ^^^^
+ ..* CMake 3.10 or higher (cmake.org)
? ^^
Install:
Create a build directory and use cmake, make and make install (tutorial: https://cmake.org/runningcmake/)
Example:
An example directory is created with a small server/client application (SimpleSim) implementing NetOff. The sources are in the directory test of the source code. The SimpleSim application consists of two parts, the server and the client. The server is executed via `./SimpleSim 4444 whereas 4444` is a arbitrary chosen port. The client is started via `./SimpleSim 4444 localhost`.
This can also be done in one single console as `./SimpleSim 4444 & ./SimpleSim 4444 localhost`. | 6 | 0.333333 | 3 | 3 |
b17d91286ac1131c1deda66a88dbc0e628cd81a3 | circle.yml | circle.yml | checkout:
post:
- nvm install && nvm alias default node
dependencies:
pre:
- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
override:
- yarn
test:
override:
- yarn lint
- yarn type-check
- yarn test
deployment:
demo:
branch: master
commands:
- yarn deploy-storybook
npm:
tag: /v[0-9]+(\.[0-9]+)*/
commands:
- npm run prepublishOnly
- npm publish
| checkout:
post:
- nvm install && nvm alias default node
dependencies:
pre:
- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
override:
- yarn
test:
override:
- yarn lint
- yarn type-check
- yarn test
deployment:
demo:
branch: master
commands:
- cp .env.oss .env
- yarn deploy-storybook
npm:
tag: /v[0-9]+(\.[0-9]+)*/
commands:
- npm run prepublishOnly
- npm publish
| Copy .env file for webpack config for storybook | Copy .env file for webpack config for storybook
| YAML | mit | xtina-starr/reaction,xtina-starr/reaction,artsy/reaction,craigspaeth/reaction,craigspaeth/reaction,artsy/reaction,xtina-starr/reaction,craigspaeth/reaction,artsy/reaction,artsy/reaction-force,artsy/reaction-force,xtina-starr/reaction | yaml | ## Code Before:
checkout:
post:
- nvm install && nvm alias default node
dependencies:
pre:
- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
override:
- yarn
test:
override:
- yarn lint
- yarn type-check
- yarn test
deployment:
demo:
branch: master
commands:
- yarn deploy-storybook
npm:
tag: /v[0-9]+(\.[0-9]+)*/
commands:
- npm run prepublishOnly
- npm publish
## Instruction:
Copy .env file for webpack config for storybook
## Code After:
checkout:
post:
- nvm install && nvm alias default node
dependencies:
pre:
- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
override:
- yarn
test:
override:
- yarn lint
- yarn type-check
- yarn test
deployment:
demo:
branch: master
commands:
- cp .env.oss .env
- yarn deploy-storybook
npm:
tag: /v[0-9]+(\.[0-9]+)*/
commands:
- npm run prepublishOnly
- npm publish
| checkout:
post:
- nvm install && nvm alias default node
dependencies:
pre:
- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
override:
- yarn
test:
override:
- yarn lint
- yarn type-check
- yarn test
deployment:
demo:
branch: master
commands:
+ - cp .env.oss .env
- yarn deploy-storybook
npm:
tag: /v[0-9]+(\.[0-9]+)*/
commands:
- npm run prepublishOnly
- npm publish | 1 | 0.038462 | 1 | 0 |
b8a725ad0ed7fdc650caadfb9725be625e9ddba8 | .idea/jsLibraryMappings.xml | .idea/jsLibraryMappings.xml | <?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
<file url="file://$PROJECT_DIR$/.eslintrc" libraries="{ECMAScript 6, HTML5 / EcmaScript 5}" />
<file url="file://$PROJECT_DIR$/node_modules" libraries="{HTML5 / EcmaScript 5, Node.js Core}" />
<file url="file://$PROJECT_DIR$/src" libraries="{ECMAScript 6, HTML5 / EcmaScript 5, Node.js Core}" />
<file url="file://$PROJECT_DIR$/src/example" libraries="{HTML, HTML5 / EcmaScript 5}" />
<excludedPredefinedLibrary name="HTML" />
<excludedPredefinedLibrary name="HTML5 / EcmaScript 5" />
</component>
</project> | <?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
<file url="file://$PROJECT_DIR$" libraries="{mix-n-mock node_modules}" />
<file url="file://$PROJECT_DIR$/.eslintrc" libraries="{ECMAScript 6, HTML5 / EcmaScript 5}" />
<file url="file://$PROJECT_DIR$/node_modules" libraries="{HTML5 / EcmaScript 5, Node.js Core}" />
<file url="file://$PROJECT_DIR$/src" libraries="{ECMAScript 6, HTML5 / EcmaScript 5, Node.js Core}" />
<file url="file://$PROJECT_DIR$/src/example" libraries="{HTML, HTML5 / EcmaScript 5}" />
<excludedPredefinedLibrary name="HTML" />
<excludedPredefinedLibrary name="HTML5 / EcmaScript 5" />
</component>
</project> | Add node lib folder to .idea config | Add node lib folder to .idea config
| XML | apache-2.0 | Seitenbau/mix-n-mock,Seitenbau/mix-n-mock | xml | ## Code Before:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
<file url="file://$PROJECT_DIR$/.eslintrc" libraries="{ECMAScript 6, HTML5 / EcmaScript 5}" />
<file url="file://$PROJECT_DIR$/node_modules" libraries="{HTML5 / EcmaScript 5, Node.js Core}" />
<file url="file://$PROJECT_DIR$/src" libraries="{ECMAScript 6, HTML5 / EcmaScript 5, Node.js Core}" />
<file url="file://$PROJECT_DIR$/src/example" libraries="{HTML, HTML5 / EcmaScript 5}" />
<excludedPredefinedLibrary name="HTML" />
<excludedPredefinedLibrary name="HTML5 / EcmaScript 5" />
</component>
</project>
## Instruction:
Add node lib folder to .idea config
## Code After:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
<file url="file://$PROJECT_DIR$" libraries="{mix-n-mock node_modules}" />
<file url="file://$PROJECT_DIR$/.eslintrc" libraries="{ECMAScript 6, HTML5 / EcmaScript 5}" />
<file url="file://$PROJECT_DIR$/node_modules" libraries="{HTML5 / EcmaScript 5, Node.js Core}" />
<file url="file://$PROJECT_DIR$/src" libraries="{ECMAScript 6, HTML5 / EcmaScript 5, Node.js Core}" />
<file url="file://$PROJECT_DIR$/src/example" libraries="{HTML, HTML5 / EcmaScript 5}" />
<excludedPredefinedLibrary name="HTML" />
<excludedPredefinedLibrary name="HTML5 / EcmaScript 5" />
</component>
</project> | <?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
+ <file url="file://$PROJECT_DIR$" libraries="{mix-n-mock node_modules}" />
<file url="file://$PROJECT_DIR$/.eslintrc" libraries="{ECMAScript 6, HTML5 / EcmaScript 5}" />
<file url="file://$PROJECT_DIR$/node_modules" libraries="{HTML5 / EcmaScript 5, Node.js Core}" />
<file url="file://$PROJECT_DIR$/src" libraries="{ECMAScript 6, HTML5 / EcmaScript 5, Node.js Core}" />
<file url="file://$PROJECT_DIR$/src/example" libraries="{HTML, HTML5 / EcmaScript 5}" />
<excludedPredefinedLibrary name="HTML" />
<excludedPredefinedLibrary name="HTML5 / EcmaScript 5" />
</component>
</project> | 1 | 0.090909 | 1 | 0 |
fab0bb2ebe58a1740cea31442229863e96e6b85a | doc/Completions.md | doc/Completions.md |
This instruction assumes Ubuntu Linux. It will probably work just as well for
other Debian-based distributions and hopefully for others too. The way to
install the completion package will be different though.
1. Make sure you have Bash completion package installed. Use the following
command for Ubuntu:
sudo apt-get install bash-completion
2. Source the `<jagen_dir>/misc/bash_completion` file from the appropriate place
in your profile. Try to add the following line to the
`~/.config/bash_completion` or `~/.bash_completion`, create the file if it
does not exist:
source "<jagen_dir>/misc/bash_completion"
Replace `<jagen_dir>` with the path to Jagen repository. This may be the
location you've checked it out manually or inside the build root you are
working with, something like: `~/work/root-my/.jagen/misc/bash_completion`.
3. Source your profile again, relogin or simply open a new terminal window to
apply the changes.
|
1. Make sure you have Bash completion package installed.
Use the following command on Ubuntu/Debian Linux:
sudo apt-get install bash-completion
2. Source the included `bash_completion` file in your profile.
Add the following line:
source "<jagen_dir>/misc/bash_completion"
either to:
- `~/.bash_completion` file, which should work also on macOS with an older
completion package for Bash 3.2
- `~/.local/share/bash-completion/completions/jagen.bash` file to autoload
the completions as needed, which is a feature of a newer Bash completion
version
Replace the `<jagen_dir>` with the path to the Jagen repository.
3. Source your profile again, relogin or open a new terminal window to apply
the changes.
| Update instructions to install Bash completions | Update instructions to install Bash completions
| Markdown | mit | bazurbat/jagen | markdown | ## Code Before:
This instruction assumes Ubuntu Linux. It will probably work just as well for
other Debian-based distributions and hopefully for others too. The way to
install the completion package will be different though.
1. Make sure you have Bash completion package installed. Use the following
command for Ubuntu:
sudo apt-get install bash-completion
2. Source the `<jagen_dir>/misc/bash_completion` file from the appropriate place
in your profile. Try to add the following line to the
`~/.config/bash_completion` or `~/.bash_completion`, create the file if it
does not exist:
source "<jagen_dir>/misc/bash_completion"
Replace `<jagen_dir>` with the path to Jagen repository. This may be the
location you've checked it out manually or inside the build root you are
working with, something like: `~/work/root-my/.jagen/misc/bash_completion`.
3. Source your profile again, relogin or simply open a new terminal window to
apply the changes.
## Instruction:
Update instructions to install Bash completions
## Code After:
1. Make sure you have Bash completion package installed.
Use the following command on Ubuntu/Debian Linux:
sudo apt-get install bash-completion
2. Source the included `bash_completion` file in your profile.
Add the following line:
source "<jagen_dir>/misc/bash_completion"
either to:
- `~/.bash_completion` file, which should work also on macOS with an older
completion package for Bash 3.2
- `~/.local/share/bash-completion/completions/jagen.bash` file to autoload
the completions as needed, which is a feature of a newer Bash completion
version
Replace the `<jagen_dir>` with the path to the Jagen repository.
3. Source your profile again, relogin or open a new terminal window to apply
the changes.
|
+ 1. Make sure you have Bash completion package installed.
- This instruction assumes Ubuntu Linux. It will probably work just as well for
- other Debian-based distributions and hopefully for others too. The way to
- install the completion package will be different though.
+ Use the following command on Ubuntu/Debian Linux:
- 1. Make sure you have Bash completion package installed. Use the following
- command for Ubuntu:
sudo apt-get install bash-completion
+ 2. Source the included `bash_completion` file in your profile.
- 2. Source the `<jagen_dir>/misc/bash_completion` file from the appropriate place
- in your profile. Try to add the following line to the
- `~/.config/bash_completion` or `~/.bash_completion`, create the file if it
- does not exist:
- source "<jagen_dir>/misc/bash_completion"
+ Add the following line:
+ source "<jagen_dir>/misc/bash_completion"
- Replace `<jagen_dir>` with the path to Jagen repository. This may be the
- location you've checked it out manually or inside the build root you are
- working with, something like: `~/work/root-my/.jagen/misc/bash_completion`.
+ either to:
+
+ - `~/.bash_completion` file, which should work also on macOS with an older
+ completion package for Bash 3.2
+ - `~/.local/share/bash-completion/completions/jagen.bash` file to autoload
+ the completions as needed, which is a feature of a newer Bash completion
+ version
+
+ Replace the `<jagen_dir>` with the path to the Jagen repository.
+
- 3. Source your profile again, relogin or simply open a new terminal window to
? -------
+ 3. Source your profile again, relogin or open a new terminal window to apply
? ++++++
- apply the changes.
? ------
+ the changes. | 32 | 1.391304 | 17 | 15 |
63d4a1e548a290036d9672006ce2c2d661b563ef | .travis.yml | .travis.yml | language: python
python:
- 2.6
- 2.7
- 3.2
- 3.3
- 3.4
- pypy
install:
- pip install flake8==2.1.0 pep8==1.5.6
- python setup.py install
- pip list
- flake8 --version
script:
- python setup.py test -q
- flake8 pyflakes setup.py
matrix:
allow_failures:
- python: pypy
sudo: false
| language: python
python:
- 2.6
- 2.7
- 3.2
- 3.3
- 3.4
- nightly
- pypy
install:
- pip install flake8==2.1.0 pep8==1.5.6
- python setup.py install
- pip list
- flake8 --version
script:
- python setup.py test -q
- flake8 pyflakes setup.py
matrix:
allow_failures:
- python: pypy
sudo: false
| Test "nightly" version of Python | Test "nightly" version of Python
This allows us to test the Python 3.5 related changes I made previously. | YAML | mit | epsy/pyflakes,PyCQA/pyflakes,nikolas/pyflakes,bitglue/pyflakes,pyflakes/pyflakes,jayvdb/pyflakes,asmeurer/pyflakes | yaml | ## Code Before:
language: python
python:
- 2.6
- 2.7
- 3.2
- 3.3
- 3.4
- pypy
install:
- pip install flake8==2.1.0 pep8==1.5.6
- python setup.py install
- pip list
- flake8 --version
script:
- python setup.py test -q
- flake8 pyflakes setup.py
matrix:
allow_failures:
- python: pypy
sudo: false
## Instruction:
Test "nightly" version of Python
This allows us to test the Python 3.5 related changes I made previously.
## Code After:
language: python
python:
- 2.6
- 2.7
- 3.2
- 3.3
- 3.4
- nightly
- pypy
install:
- pip install flake8==2.1.0 pep8==1.5.6
- python setup.py install
- pip list
- flake8 --version
script:
- python setup.py test -q
- flake8 pyflakes setup.py
matrix:
allow_failures:
- python: pypy
sudo: false
| language: python
python:
- 2.6
- 2.7
- 3.2
- 3.3
- 3.4
+ - nightly
- pypy
install:
- pip install flake8==2.1.0 pep8==1.5.6
- python setup.py install
- pip list
- flake8 --version
script:
- python setup.py test -q
- flake8 pyflakes setup.py
matrix:
allow_failures:
- python: pypy
sudo: false | 1 | 0.05 | 1 | 0 |
36a4d570904a4f365fb806db35603a8229f4a7e4 | src/header/Header.css | src/header/Header.css | .MuiAppBar-colorPrimary.header {
background: #fff;
color: #5f6368;
}
.header-title {
font-size: 24px;
font-weight: 300;
margin: 0px 16px 0px 36px;
}
.header-search {
background: #f1f3f4;
border-radius: 5px;
display: flex;
margin: 8px 0px;
padding: 10px;
width: 100%;
}
.header-search.hidden {
visibility: hidden;
}
div.header-search-root {
padding-left: 6px;
width: 100%;
}
.MuiInputBase-input.header-search-input {
font-size: 18px;
color: #80868b;
font-weight: 500;
padding: 2px 4px;
}
.MuiInputBase-input.header-search-input::placeholder {
opacity: 0.75;
}
svg.header-search-icon {
font-size: 26px;
color: #5f6368;
cursor: pointer;
}
svg.header-search-icon:hover {
opacity: 0.8;
}
.auth-button.MuiButton-root {
margin-left: 16px;
min-width: 96px;
} | .MuiAppBar-colorPrimary.header {
background: #fff;
color: #5f6368;
}
.MuiToolbar-root {
justify-content: space-between;
}
.header-title {
font-size: 24px;
font-weight: 300;
margin: 0px 16px 0px 36px;
}
.header-search {
background: #f1f3f4;
border-radius: 5px;
display: flex;
margin: 8px 0px;
max-width: 640px;
padding: 10px;
width: 100%;
}
.header-search.hidden {
visibility: hidden;
}
div.header-search-root {
padding-left: 6px;
width: 100%;
}
.MuiInputBase-input.header-search-input {
font-size: 18px;
color: #80868b;
font-weight: 500;
padding: 2px 4px;
}
.MuiInputBase-input.header-search-input::placeholder {
opacity: 0.75;
}
svg.header-search-icon {
font-size: 26px;
color: #5f6368;
cursor: pointer;
}
svg.header-search-icon:hover {
opacity: 0.8;
}
.auth-button.MuiButton-root {
margin-left: 16px;
min-width: 96px;
} | Set max-width on the search input | Set max-width on the search input
| CSS | apache-2.0 | GoogleCloudPlatform/woolaroo-language-learning-app,GoogleCloudPlatform/woolaroo-language-learning-app,GoogleCloudPlatform/woolaroo-language-learning-app,GoogleCloudPlatform/woolaroo-language-learning-app,GoogleCloudPlatform/woolaroo-language-learning-app | css | ## Code Before:
.MuiAppBar-colorPrimary.header {
background: #fff;
color: #5f6368;
}
.header-title {
font-size: 24px;
font-weight: 300;
margin: 0px 16px 0px 36px;
}
.header-search {
background: #f1f3f4;
border-radius: 5px;
display: flex;
margin: 8px 0px;
padding: 10px;
width: 100%;
}
.header-search.hidden {
visibility: hidden;
}
div.header-search-root {
padding-left: 6px;
width: 100%;
}
.MuiInputBase-input.header-search-input {
font-size: 18px;
color: #80868b;
font-weight: 500;
padding: 2px 4px;
}
.MuiInputBase-input.header-search-input::placeholder {
opacity: 0.75;
}
svg.header-search-icon {
font-size: 26px;
color: #5f6368;
cursor: pointer;
}
svg.header-search-icon:hover {
opacity: 0.8;
}
.auth-button.MuiButton-root {
margin-left: 16px;
min-width: 96px;
}
## Instruction:
Set max-width on the search input
## Code After:
.MuiAppBar-colorPrimary.header {
background: #fff;
color: #5f6368;
}
.MuiToolbar-root {
justify-content: space-between;
}
.header-title {
font-size: 24px;
font-weight: 300;
margin: 0px 16px 0px 36px;
}
.header-search {
background: #f1f3f4;
border-radius: 5px;
display: flex;
margin: 8px 0px;
max-width: 640px;
padding: 10px;
width: 100%;
}
.header-search.hidden {
visibility: hidden;
}
div.header-search-root {
padding-left: 6px;
width: 100%;
}
.MuiInputBase-input.header-search-input {
font-size: 18px;
color: #80868b;
font-weight: 500;
padding: 2px 4px;
}
.MuiInputBase-input.header-search-input::placeholder {
opacity: 0.75;
}
svg.header-search-icon {
font-size: 26px;
color: #5f6368;
cursor: pointer;
}
svg.header-search-icon:hover {
opacity: 0.8;
}
.auth-button.MuiButton-root {
margin-left: 16px;
min-width: 96px;
} | .MuiAppBar-colorPrimary.header {
background: #fff;
color: #5f6368;
+ }
+
+ .MuiToolbar-root {
+ justify-content: space-between;
}
.header-title {
font-size: 24px;
font-weight: 300;
margin: 0px 16px 0px 36px;
}
.header-search {
background: #f1f3f4;
border-radius: 5px;
display: flex;
margin: 8px 0px;
+ max-width: 640px;
padding: 10px;
width: 100%;
}
.header-search.hidden {
visibility: hidden;
}
div.header-search-root {
padding-left: 6px;
width: 100%;
}
.MuiInputBase-input.header-search-input {
font-size: 18px;
color: #80868b;
font-weight: 500;
padding: 2px 4px;
}
.MuiInputBase-input.header-search-input::placeholder {
opacity: 0.75;
}
svg.header-search-icon {
font-size: 26px;
color: #5f6368;
cursor: pointer;
}
svg.header-search-icon:hover {
opacity: 0.8;
}
.auth-button.MuiButton-root {
margin-left: 16px;
min-width: 96px;
} | 5 | 0.092593 | 5 | 0 |
923659a27d4f7f641c665ead3d4f1c93ceb92215 | ccp/ses-ansible/roles/ses/tasks/pre_setup.yml | ccp/ses-ansible/roles/ses/tasks/pre_setup.yml | ---
- name: "Ensure host in /etc/hosts"
lineinfile:
dest: "/etc/hosts"
line: "{{ item }}"
owner: root
group: root
mode: 0644
with_items:
- "{{ ansible_default_ipv4.address }} {{ ansible_hostname }}"
- "::1 {{ ansible_hostname }}"
- name: "Count number of disk devices"
shell: |
lsblk -n -o type | awk 'BEGIN{count=0} $1=="disk" {count++} END{print count}'
register: ses_node_disks_count_result
- name: "Set SES node disk count fact"
set_fact:
ses_node_disks_count: "{{ ses_node_disks_count_result.stdout | int }}"
- name: "Ensure NTP installed"
package:
name: ntp
state: present
- name: Ensure NTP is enabled
service:
name: "ntpd"
state: started
enabled: yes
- name: Ensure SES repos present
zypper_repository:
name: "{{ item.name }}"
repo: "{{ item.repo }}"
with_items:
- name: "SUSE-Enterprise-Storage-{{ ses_version }}-Pool"
repo: "{{ ses_repo_server }}/repos/x86_64/SUSE-Enterprise-Storage-{{ ses_version }}-Pool/"
- name: "SUSE-Enterprise-Storage-{{ ses_version }}-Updates"
repo: "{{ ses_repo_server }}/repos/x86_64/SUSE-Enterprise-Storage-{{ ses_version }}-Updates/"
| ---
- name: "Ensure host in /etc/hosts"
lineinfile:
dest: "/etc/hosts"
line: "{{ item }}"
owner: root
group: root
mode: 0644
with_items:
- "{{ ansible_default_ipv4.address }} {{ ansible_hostname }}"
- "::1 {{ ansible_hostname }}"
- name: "Count number of disk devices"
shell: |
lsblk -n -o type | awk 'BEGIN{count=0} $1=="disk" {count++} END{print count}'
register: ses_node_disks_count_result
- name: "Set SES node disk count fact"
set_fact:
ses_node_disks_count: "{{ ses_node_disks_count_result.stdout | int }}"
- name: "Ensure NTP installed"
package:
name: ntp
state: present
- name: Ensure NTP is enabled
service:
name: "ntpd"
state: started
enabled: yes
- name: Ensure SES repos present
zypper_repository:
name: "{{ item.name }}"
repo: "{{ item.repo }}"
with_items:
- name: "SUSE-Enterprise-Storage-{{ ses_version }}-Pool"
repo: "{{ ses_repo_server }}/repos/x86_64/SUSE-Enterprise-Storage-{{ ses_version }}-Pool/"
- name: "SUSE-Enterprise-Storage-{{ ses_version }}-Updates"
repo: "{{ ses_repo_server }}/repos/x86_64/SUSE-Enterprise-Storage-{{ ses_version }}-Updates/"
| Switch tab for space in ses-ansible role | Switch tab for space in ses-ansible role
travis-ci is failing due to tabs found on the ses-ansible role.
This change switches the tab for space in this role.
| YAML | apache-2.0 | aspiers/automation,gosipyan/automation,SUSE-Cloud/automation,aspiers/automation,gosipyan/automation,SUSE-Cloud/automation,SUSE-Cloud/automation,aspiers/automation,SUSE-Cloud/automation,aspiers/automation,gosipyan/automation,gosipyan/automation | yaml | ## Code Before:
---
- name: "Ensure host in /etc/hosts"
lineinfile:
dest: "/etc/hosts"
line: "{{ item }}"
owner: root
group: root
mode: 0644
with_items:
- "{{ ansible_default_ipv4.address }} {{ ansible_hostname }}"
- "::1 {{ ansible_hostname }}"
- name: "Count number of disk devices"
shell: |
lsblk -n -o type | awk 'BEGIN{count=0} $1=="disk" {count++} END{print count}'
register: ses_node_disks_count_result
- name: "Set SES node disk count fact"
set_fact:
ses_node_disks_count: "{{ ses_node_disks_count_result.stdout | int }}"
- name: "Ensure NTP installed"
package:
name: ntp
state: present
- name: Ensure NTP is enabled
service:
name: "ntpd"
state: started
enabled: yes
- name: Ensure SES repos present
zypper_repository:
name: "{{ item.name }}"
repo: "{{ item.repo }}"
with_items:
- name: "SUSE-Enterprise-Storage-{{ ses_version }}-Pool"
repo: "{{ ses_repo_server }}/repos/x86_64/SUSE-Enterprise-Storage-{{ ses_version }}-Pool/"
- name: "SUSE-Enterprise-Storage-{{ ses_version }}-Updates"
repo: "{{ ses_repo_server }}/repos/x86_64/SUSE-Enterprise-Storage-{{ ses_version }}-Updates/"
## Instruction:
Switch tab for space in ses-ansible role
travis-ci is failing due to tabs found on the ses-ansible role.
This change switches the tab for space in this role.
## Code After:
---
- name: "Ensure host in /etc/hosts"
lineinfile:
dest: "/etc/hosts"
line: "{{ item }}"
owner: root
group: root
mode: 0644
with_items:
- "{{ ansible_default_ipv4.address }} {{ ansible_hostname }}"
- "::1 {{ ansible_hostname }}"
- name: "Count number of disk devices"
shell: |
lsblk -n -o type | awk 'BEGIN{count=0} $1=="disk" {count++} END{print count}'
register: ses_node_disks_count_result
- name: "Set SES node disk count fact"
set_fact:
ses_node_disks_count: "{{ ses_node_disks_count_result.stdout | int }}"
- name: "Ensure NTP installed"
package:
name: ntp
state: present
- name: Ensure NTP is enabled
service:
name: "ntpd"
state: started
enabled: yes
- name: Ensure SES repos present
zypper_repository:
name: "{{ item.name }}"
repo: "{{ item.repo }}"
with_items:
- name: "SUSE-Enterprise-Storage-{{ ses_version }}-Pool"
repo: "{{ ses_repo_server }}/repos/x86_64/SUSE-Enterprise-Storage-{{ ses_version }}-Pool/"
- name: "SUSE-Enterprise-Storage-{{ ses_version }}-Updates"
repo: "{{ ses_repo_server }}/repos/x86_64/SUSE-Enterprise-Storage-{{ ses_version }}-Updates/"
| ---
- name: "Ensure host in /etc/hosts"
lineinfile:
dest: "/etc/hosts"
line: "{{ item }}"
owner: root
group: root
mode: 0644
with_items:
- - "{{ ansible_default_ipv4.address }} {{ ansible_hostname }}"
? ^
+ - "{{ ansible_default_ipv4.address }} {{ ansible_hostname }}"
? ^^^^^^
- - "::1 {{ ansible_hostname }}"
? ^
+ - "::1 {{ ansible_hostname }}"
? ^^^^^
- name: "Count number of disk devices"
shell: |
lsblk -n -o type | awk 'BEGIN{count=0} $1=="disk" {count++} END{print count}'
register: ses_node_disks_count_result
- name: "Set SES node disk count fact"
set_fact:
ses_node_disks_count: "{{ ses_node_disks_count_result.stdout | int }}"
- name: "Ensure NTP installed"
package:
name: ntp
state: present
- name: Ensure NTP is enabled
service:
name: "ntpd"
state: started
enabled: yes
- name: Ensure SES repos present
zypper_repository:
name: "{{ item.name }}"
repo: "{{ item.repo }}"
with_items:
- name: "SUSE-Enterprise-Storage-{{ ses_version }}-Pool"
repo: "{{ ses_repo_server }}/repos/x86_64/SUSE-Enterprise-Storage-{{ ses_version }}-Pool/"
- name: "SUSE-Enterprise-Storage-{{ ses_version }}-Updates"
repo: "{{ ses_repo_server }}/repos/x86_64/SUSE-Enterprise-Storage-{{ ses_version }}-Updates/" | 4 | 0.095238 | 2 | 2 |
839c891342037b2d1426e8b8e4aefba46fb4fcff | spec/geometry/comparison_spec.rb | spec/geometry/comparison_spec.rb | require 'spec_helper'
describe Geometry::Comparison do
describe '#compare_points' do
# it 'should be true when both abscissas and ordinates are equal' do
# compare = Geometry::Comparison.new(1, 1 ,1 ,1)
# expect(compare.compare_points).to eq(true)
# end
it 'should be true when both abscissas and ordinates equal' do
point1 = Geometry::Comparison.new(1, 2)
point2 = Geometry::Comparison.new(1, 2)
expect(point1 == point2).to eq(true)
end
it 'should be false when both abscissas and ordinates are not equal' do
point1 = Geometry::Comparison.new(1, 2)
point2 = Geometry::Comparison.new(1, 3)
expect(point1 == point2).to eq(false)
end
it 'should return true when both the abscissas and ordinates are same point(Reflexive property)'do
point1 = Geometry::Comparison.new(1, 1)
expect(point1 == point1).to eq(true)
end
end
end | require 'spec_helper'
describe Geometry::Comparison do
describe '#compare_points' do
# it 'should be true when both abscissas and ordinates are equal' do
# compare = Geometry::Comparison.new(1, 1 ,1 ,1)
# expect(compare.compare_points).to eq(true)
# end
it 'should be true when both abscissas and ordinates equal' do
point1 = Geometry::Comparison.new(1, 2)
point2 = Geometry::Comparison.new(1, 2)
expect(point1 == point2).to eq(true)
end
it 'should be false when both abscissas and ordinates are not equal' do
point1 = Geometry::Comparison.new(1, 2)
point2 = Geometry::Comparison.new(1, 3)
expect(point1 == point2).to eq(false)
end
it 'should return true when both the abscissas and ordinates are same point(Reflexive property)'do
point1 = Geometry::Comparison.new(1, 1)
expect(point1 == point1).to eq(true)
end
it 'it return true for symmetric property for given two points 'do
point1 = Geometry::Comparison.new(1, 1)
point2 = Geometry::Comparison.new(1, 1)
expect(point1 == point2 && point2 == point1).to eq(true)
end
end
end | Add Test spec for symmetric property for give two points | Add Test spec for symmetric property for give two points
| Ruby | mit | shireeshaps/bootcamp-geometry-problem | ruby | ## Code Before:
require 'spec_helper'
describe Geometry::Comparison do
describe '#compare_points' do
# it 'should be true when both abscissas and ordinates are equal' do
# compare = Geometry::Comparison.new(1, 1 ,1 ,1)
# expect(compare.compare_points).to eq(true)
# end
it 'should be true when both abscissas and ordinates equal' do
point1 = Geometry::Comparison.new(1, 2)
point2 = Geometry::Comparison.new(1, 2)
expect(point1 == point2).to eq(true)
end
it 'should be false when both abscissas and ordinates are not equal' do
point1 = Geometry::Comparison.new(1, 2)
point2 = Geometry::Comparison.new(1, 3)
expect(point1 == point2).to eq(false)
end
it 'should return true when both the abscissas and ordinates are same point(Reflexive property)'do
point1 = Geometry::Comparison.new(1, 1)
expect(point1 == point1).to eq(true)
end
end
end
## Instruction:
Add Test spec for symmetric property for give two points
## Code After:
require 'spec_helper'
describe Geometry::Comparison do
describe '#compare_points' do
# it 'should be true when both abscissas and ordinates are equal' do
# compare = Geometry::Comparison.new(1, 1 ,1 ,1)
# expect(compare.compare_points).to eq(true)
# end
it 'should be true when both abscissas and ordinates equal' do
point1 = Geometry::Comparison.new(1, 2)
point2 = Geometry::Comparison.new(1, 2)
expect(point1 == point2).to eq(true)
end
it 'should be false when both abscissas and ordinates are not equal' do
point1 = Geometry::Comparison.new(1, 2)
point2 = Geometry::Comparison.new(1, 3)
expect(point1 == point2).to eq(false)
end
it 'should return true when both the abscissas and ordinates are same point(Reflexive property)'do
point1 = Geometry::Comparison.new(1, 1)
expect(point1 == point1).to eq(true)
end
it 'it return true for symmetric property for given two points 'do
point1 = Geometry::Comparison.new(1, 1)
point2 = Geometry::Comparison.new(1, 1)
expect(point1 == point2 && point2 == point1).to eq(true)
end
end
end | require 'spec_helper'
describe Geometry::Comparison do
describe '#compare_points' do
# it 'should be true when both abscissas and ordinates are equal' do
# compare = Geometry::Comparison.new(1, 1 ,1 ,1)
# expect(compare.compare_points).to eq(true)
# end
it 'should be true when both abscissas and ordinates equal' do
point1 = Geometry::Comparison.new(1, 2)
point2 = Geometry::Comparison.new(1, 2)
expect(point1 == point2).to eq(true)
end
it 'should be false when both abscissas and ordinates are not equal' do
point1 = Geometry::Comparison.new(1, 2)
point2 = Geometry::Comparison.new(1, 3)
expect(point1 == point2).to eq(false)
end
it 'should return true when both the abscissas and ordinates are same point(Reflexive property)'do
point1 = Geometry::Comparison.new(1, 1)
- expect(point1 == point1).to eq(true)
? --
+ expect(point1 == point1).to eq(true)
+ end
+
+ it 'it return true for symmetric property for given two points 'do
+ point1 = Geometry::Comparison.new(1, 1)
+ point2 = Geometry::Comparison.new(1, 1)
+ expect(point1 == point2 && point2 == point1).to eq(true)
end
end
end | 8 | 0.296296 | 7 | 1 |
af492c593e0a18f72275566d80dc208c08642f46 | _config.yml | _config.yml | title: James R. Castle
description: Physicist, data scientist, software developer, gamer
show_downloads: false
google_analytics:
theme: jekyll-theme-slate
name: James R. Castle
plugins: ['jekyll-github-metadata']
repository: jrcastle/EbyEAnalysis
github_username: jrcastle
linkedin_username: jrcastle90
stackoverflow_username: jrcastle90
email: jrcastle90@gmail.com | title: James R. Castle
description: Physicist, data scientist, software developer, gamer
show_downloads: false
google_analytics:
theme: jekyll-theme-slate
markdown: maruku
name: James R. Castle
plugins: ['jekyll-github-metadata']
repository: jrcastle/EbyEAnalysis
github_username: jrcastle
linkedin_username: jrcastle90
stackoverflow_username: jrcastle90
email: jrcastle90@gmail.com | Fix mathtype error attempt 1 | Fix mathtype error attempt 1
| YAML | cc0-1.0 | jrcastle/jrcastle.github.io,jrcastle/jrcastle.github.io,jrcastle/jrcastle.github.io | yaml | ## Code Before:
title: James R. Castle
description: Physicist, data scientist, software developer, gamer
show_downloads: false
google_analytics:
theme: jekyll-theme-slate
name: James R. Castle
plugins: ['jekyll-github-metadata']
repository: jrcastle/EbyEAnalysis
github_username: jrcastle
linkedin_username: jrcastle90
stackoverflow_username: jrcastle90
email: jrcastle90@gmail.com
## Instruction:
Fix mathtype error attempt 1
## Code After:
title: James R. Castle
description: Physicist, data scientist, software developer, gamer
show_downloads: false
google_analytics:
theme: jekyll-theme-slate
markdown: maruku
name: James R. Castle
plugins: ['jekyll-github-metadata']
repository: jrcastle/EbyEAnalysis
github_username: jrcastle
linkedin_username: jrcastle90
stackoverflow_username: jrcastle90
email: jrcastle90@gmail.com | title: James R. Castle
description: Physicist, data scientist, software developer, gamer
show_downloads: false
google_analytics:
theme: jekyll-theme-slate
+ markdown: maruku
name: James R. Castle
plugins: ['jekyll-github-metadata']
repository: jrcastle/EbyEAnalysis
github_username: jrcastle
linkedin_username: jrcastle90
stackoverflow_username: jrcastle90
email: jrcastle90@gmail.com | 1 | 0.071429 | 1 | 0 |
8b24f2de2817b578fee7b54325f2ee4d4503c106 | CHANGELOG.md | CHANGELOG.md |
* added session to request in session plugin
* lower node.js version requirement
* added request plugin
* POST parameter handling
* request url parsing
|
* added session to request in session plugin
* lower node.js version requirement
* added request plugin
* POST parameter handling
* request url parsing
### 1.0.9 - October 25, 2011
* removed regular expression test causing exception in 0.5.10
* ready for node.js v0.6.0, and verified working on windows | Update to reflect minor changes with 1.0.9 release | Update to reflect minor changes with 1.0.9 release | Markdown | mit | JerrySievert/bricks | markdown | ## Code Before:
* added session to request in session plugin
* lower node.js version requirement
* added request plugin
* POST parameter handling
* request url parsing
## Instruction:
Update to reflect minor changes with 1.0.9 release
## Code After:
* added session to request in session plugin
* lower node.js version requirement
* added request plugin
* POST parameter handling
* request url parsing
### 1.0.9 - October 25, 2011
* removed regular expression test causing exception in 0.5.10
* ready for node.js v0.6.0, and verified working on windows |
* added session to request in session plugin
* lower node.js version requirement
* added request plugin
* POST parameter handling
* request url parsing
-
+
+ ### 1.0.9 - October 25, 2011
+
+ * removed regular expression test causing exception in 0.5.10
+ * ready for node.js v0.6.0, and verified working on windows | 6 | 0.857143 | 5 | 1 |
32f6336f3e7332e974dbecfe969332f83253e27d | README.md | README.md |
A Higher-Order Component for filtering, sorting and grouping in data tables.
Inspired by redux-form. Still a WIP.
## npm scripts
### Dev
```bash
$ npm run dev
```
This runs a development mode server with live reload etc.
Open `http://localhost:8080` in your browser.
### Tests
#### Single Run
```bash
$ npm run test
```
#### Watch Files
```bash
$ npm run test:watch
```
#### Coverage
```bash
$ npm run cover
```
## License
[MIT License][MIT]
[MIT]: ./LICENSE "Mit License"
|
[](https://circleci.com/gh/JamesHageman/redux-datagrid/tree/master)
A Higher-Order Component for filtering, sorting and grouping in data tables.
Inspired by redux-form. Still a WIP.
## npm scripts
### Dev
```bash
$ npm run dev
```
This runs a development mode server with live reload etc.
Open `http://localhost:8080` in your browser.
### Tests
#### Single Run
```bash
$ npm run test
```
#### Watch Files
```bash
$ npm run test:watch
```
#### Coverage
```bash
$ npm run cover
```
## License
[MIT License][MIT]
[MIT]: ./LICENSE "Mit License"
| Add Circle badge to readme | Add Circle badge to readme | Markdown | mit | JamesHageman/redux-datagrid,JamesHageman/redux-datagrid | markdown | ## Code Before:
A Higher-Order Component for filtering, sorting and grouping in data tables.
Inspired by redux-form. Still a WIP.
## npm scripts
### Dev
```bash
$ npm run dev
```
This runs a development mode server with live reload etc.
Open `http://localhost:8080` in your browser.
### Tests
#### Single Run
```bash
$ npm run test
```
#### Watch Files
```bash
$ npm run test:watch
```
#### Coverage
```bash
$ npm run cover
```
## License
[MIT License][MIT]
[MIT]: ./LICENSE "Mit License"
## Instruction:
Add Circle badge to readme
## Code After:
[](https://circleci.com/gh/JamesHageman/redux-datagrid/tree/master)
A Higher-Order Component for filtering, sorting and grouping in data tables.
Inspired by redux-form. Still a WIP.
## npm scripts
### Dev
```bash
$ npm run dev
```
This runs a development mode server with live reload etc.
Open `http://localhost:8080` in your browser.
### Tests
#### Single Run
```bash
$ npm run test
```
#### Watch Files
```bash
$ npm run test:watch
```
#### Coverage
```bash
$ npm run cover
```
## License
[MIT License][MIT]
[MIT]: ./LICENSE "Mit License"
| +
+ [](https://circleci.com/gh/JamesHageman/redux-datagrid/tree/master)
A Higher-Order Component for filtering, sorting and grouping in data tables.
Inspired by redux-form. Still a WIP.
## npm scripts
### Dev
```bash
$ npm run dev
```
This runs a development mode server with live reload etc.
Open `http://localhost:8080` in your browser.
### Tests
#### Single Run
```bash
$ npm run test
```
#### Watch Files
```bash
$ npm run test:watch
```
#### Coverage
```bash
$ npm run cover
```
## License
[MIT License][MIT]
[MIT]: ./LICENSE "Mit License" | 2 | 0.054054 | 2 | 0 |
23e754c5d367272d78135a713f3ee35344e6c1d7 | shell/zsh/.zsh/kbd.zsh | shell/zsh/.zsh/kbd.zsh |
bindkey '\e[D' backward-char
bindkey '\e[C' forward-char
bindkey '\e\e[D' backward-word
bindkey '\e\e[C' forward-word
bindkey '\e[3~' delete-char
bindkey '\e[1~' beginning-of-line
bindkey '\e[4~' end-of-line
# CtrlP from zsh
zsh_ctrlp() {
ctrlp_cmd="CtrlP $1"
if [ -n "$DISPLAY" ] && [ -n "$DEFAULT_X_TERMINAL" ]; then
(unset TMUX; ${DEFAULT_X_TERMINAL} -e tmux -2 new-session "vim -c \"$ctrlp_cmd\"" 2>/dev/null) &
else
</dev/tty vim -c "$ctrlp_cmd"
fi
}
zsh_ctrlp_curdir() {
zsh_ctrlp .
}
zle -N zsh_ctrlp
zle -N zsh_ctrlp_curdir
bindkey "^p" zsh_ctrlp
bindkey "[D" zsh_ctrlp
bindkey "OD" zsh_ctrlp
bindkey "OC" zsh_ctrlp_curdir
bindkey "[C" zsh_ctrlp_curdir
|
bindkey '\e[D' backward-char
bindkey '\e[C' forward-char
bindkey '\e\e[D' backward-word
bindkey '\e\e[C' forward-word
bindkey '\e[3~' delete-char
bindkey '\e[1~' beginning-of-line
bindkey '\e[4~' end-of-line
# CtrlP from zsh
zsh_ctrlp() {
ctrlp_cmd="CtrlP $1"
if [ -n "$DISPLAY" ] && [ -n "$DEFAULT_X_TERMINAL" ]; then
(unset TMUX; ${DEFAULT_X_TERMINAL} -e tmux -2 new-session "vim -c \"$ctrlp_cmd\"" 2>/dev/null) &
else
</dev/tty vim -c "$ctrlp_cmd"
fi
}
zsh_ctrlp_curdir() {
zsh_ctrlp .
}
zle -N zsh_ctrlp
zle -N zsh_ctrlp_curdir
bindkey "^p" zsh_ctrlp
bindkey "OD" zsh_ctrlp
bindkey "OC" zsh_ctrlp_curdir
| Remove wrong bindings for CtrlP | Remove wrong bindings for CtrlP
| Shell | bsd-2-clause | nakal/shell-setup,nakal/shell-setup | shell | ## Code Before:
bindkey '\e[D' backward-char
bindkey '\e[C' forward-char
bindkey '\e\e[D' backward-word
bindkey '\e\e[C' forward-word
bindkey '\e[3~' delete-char
bindkey '\e[1~' beginning-of-line
bindkey '\e[4~' end-of-line
# CtrlP from zsh
zsh_ctrlp() {
ctrlp_cmd="CtrlP $1"
if [ -n "$DISPLAY" ] && [ -n "$DEFAULT_X_TERMINAL" ]; then
(unset TMUX; ${DEFAULT_X_TERMINAL} -e tmux -2 new-session "vim -c \"$ctrlp_cmd\"" 2>/dev/null) &
else
</dev/tty vim -c "$ctrlp_cmd"
fi
}
zsh_ctrlp_curdir() {
zsh_ctrlp .
}
zle -N zsh_ctrlp
zle -N zsh_ctrlp_curdir
bindkey "^p" zsh_ctrlp
bindkey "[D" zsh_ctrlp
bindkey "OD" zsh_ctrlp
bindkey "OC" zsh_ctrlp_curdir
bindkey "[C" zsh_ctrlp_curdir
## Instruction:
Remove wrong bindings for CtrlP
## Code After:
bindkey '\e[D' backward-char
bindkey '\e[C' forward-char
bindkey '\e\e[D' backward-word
bindkey '\e\e[C' forward-word
bindkey '\e[3~' delete-char
bindkey '\e[1~' beginning-of-line
bindkey '\e[4~' end-of-line
# CtrlP from zsh
zsh_ctrlp() {
ctrlp_cmd="CtrlP $1"
if [ -n "$DISPLAY" ] && [ -n "$DEFAULT_X_TERMINAL" ]; then
(unset TMUX; ${DEFAULT_X_TERMINAL} -e tmux -2 new-session "vim -c \"$ctrlp_cmd\"" 2>/dev/null) &
else
</dev/tty vim -c "$ctrlp_cmd"
fi
}
zsh_ctrlp_curdir() {
zsh_ctrlp .
}
zle -N zsh_ctrlp
zle -N zsh_ctrlp_curdir
bindkey "^p" zsh_ctrlp
bindkey "OD" zsh_ctrlp
bindkey "OC" zsh_ctrlp_curdir
|
bindkey '\e[D' backward-char
bindkey '\e[C' forward-char
bindkey '\e\e[D' backward-word
bindkey '\e\e[C' forward-word
bindkey '\e[3~' delete-char
bindkey '\e[1~' beginning-of-line
bindkey '\e[4~' end-of-line
# CtrlP from zsh
zsh_ctrlp() {
ctrlp_cmd="CtrlP $1"
if [ -n "$DISPLAY" ] && [ -n "$DEFAULT_X_TERMINAL" ]; then
(unset TMUX; ${DEFAULT_X_TERMINAL} -e tmux -2 new-session "vim -c \"$ctrlp_cmd\"" 2>/dev/null) &
else
</dev/tty vim -c "$ctrlp_cmd"
fi
}
zsh_ctrlp_curdir() {
zsh_ctrlp .
}
zle -N zsh_ctrlp
zle -N zsh_ctrlp_curdir
bindkey "^p" zsh_ctrlp
- bindkey "[D" zsh_ctrlp
bindkey "OD" zsh_ctrlp
bindkey "OC" zsh_ctrlp_curdir
- bindkey "[C" zsh_ctrlp_curdir | 2 | 0.064516 | 0 | 2 |
c26f27a9c39ef978959cab2b848162450f33bb9b | sitesprocket/templates/Includes/SiteSprocketAdmin_results.ss | sitesprocket/templates/Includes/SiteSprocketAdmin_results.ss | <div class="search-form">$SearchForm</div>
<h3>$Heading</h3>
<% if ProjectResults %>
<div class="projects">
<table class="project_results" cellspacing="0" cellpadding="0">
<% include ProjectResults %>
</table>
</div>
<% else %>
<% _t('SSPAdmin.NOPROJECTS','There are no projects that meet your criteria') %>
<% end_if %> | <div class="search-form">$SearchForm</div>
<h3>$Heading</h3>
<% if ProjectResults %>
<div class="projects">
<table class="project_results" cellspacing="0" cellpadding="0">
<% include ProjectResults %>
</table>
</div>
<% else %>
<p class="no-results"><% _t('SSPAdmin.NOPROJECTS','There are no projects that meet your criteria') %></p>
<% end_if %> | FIX - Added <p> class and tag to style no results message | FIX - Added <p> class and tag to style no results message
| Scheme | bsd-3-clause | tbarho/SiteSprocket,tbarho/SiteSprocket,tbarho/SiteSprocket,tbarho/SiteSprocket | scheme | ## Code Before:
<div class="search-form">$SearchForm</div>
<h3>$Heading</h3>
<% if ProjectResults %>
<div class="projects">
<table class="project_results" cellspacing="0" cellpadding="0">
<% include ProjectResults %>
</table>
</div>
<% else %>
<% _t('SSPAdmin.NOPROJECTS','There are no projects that meet your criteria') %>
<% end_if %>
## Instruction:
FIX - Added <p> class and tag to style no results message
## Code After:
<div class="search-form">$SearchForm</div>
<h3>$Heading</h3>
<% if ProjectResults %>
<div class="projects">
<table class="project_results" cellspacing="0" cellpadding="0">
<% include ProjectResults %>
</table>
</div>
<% else %>
<p class="no-results"><% _t('SSPAdmin.NOPROJECTS','There are no projects that meet your criteria') %></p>
<% end_if %> | <div class="search-form">$SearchForm</div>
<h3>$Heading</h3>
<% if ProjectResults %>
<div class="projects">
<table class="project_results" cellspacing="0" cellpadding="0">
<% include ProjectResults %>
</table>
</div>
<% else %>
- <% _t('SSPAdmin.NOPROJECTS','There are no projects that meet your criteria') %>
+ <p class="no-results"><% _t('SSPAdmin.NOPROJECTS','There are no projects that meet your criteria') %></p>
? ++++++++++++++++++++++ ++++
<% end_if %> | 2 | 0.181818 | 1 | 1 |
25d35e89e2015dfb807d4daf93455416f921bade | bin/perlinfo.json.pl | bin/perlinfo.json.pl |
use strict;
use warnings;
use Config::Perl::V ();
use JSON::PP ();
if ($ENV{GATEWAY_INTERFACE}) {
print "Content-Type: application/json\015\012\015\012"
}
my $config = Config::Perl::V::myconfig();
# If we are fatpacked a CODEREF has been inserted into @INC,
# so we remove it
$config->{inc} = [ grep { ! ref } @{$config->{inc}} ];
print JSON::PP->new->ascii->pretty->encode($config);
|
use strict;
use warnings;
package App::PerlInfoJSON;
our $VERSION = '0.001';
use Config::Perl::V ();
use JSON::PP ();
if ($ENV{GATEWAY_INTERFACE}) {
print "Content-Type: application/json\015\012\015\012"
}
my $config = Config::Perl::V::myconfig();
# If we are fatpacked a CODEREF has been inserted into @INC,
# so we remove it
$config->{inc} = [ grep { ! ref } @{$config->{inc}} ];
# Inject info about ourself
$config->{+__PACKAGE__} = {
version => $VERSION,
};
print JSON::PP->new->ascii->pretty->encode($config);
| Add versionning for the script and in the JSON output | Add versionning for the script and in the JSON output
| Perl | agpl-3.0 | dolmen/perlinfo.json | perl | ## Code Before:
use strict;
use warnings;
use Config::Perl::V ();
use JSON::PP ();
if ($ENV{GATEWAY_INTERFACE}) {
print "Content-Type: application/json\015\012\015\012"
}
my $config = Config::Perl::V::myconfig();
# If we are fatpacked a CODEREF has been inserted into @INC,
# so we remove it
$config->{inc} = [ grep { ! ref } @{$config->{inc}} ];
print JSON::PP->new->ascii->pretty->encode($config);
## Instruction:
Add versionning for the script and in the JSON output
## Code After:
use strict;
use warnings;
package App::PerlInfoJSON;
our $VERSION = '0.001';
use Config::Perl::V ();
use JSON::PP ();
if ($ENV{GATEWAY_INTERFACE}) {
print "Content-Type: application/json\015\012\015\012"
}
my $config = Config::Perl::V::myconfig();
# If we are fatpacked a CODEREF has been inserted into @INC,
# so we remove it
$config->{inc} = [ grep { ! ref } @{$config->{inc}} ];
# Inject info about ourself
$config->{+__PACKAGE__} = {
version => $VERSION,
};
print JSON::PP->new->ascii->pretty->encode($config);
|
use strict;
use warnings;
+
+ package App::PerlInfoJSON;
+ our $VERSION = '0.001';
use Config::Perl::V ();
use JSON::PP ();
if ($ENV{GATEWAY_INTERFACE}) {
print "Content-Type: application/json\015\012\015\012"
}
my $config = Config::Perl::V::myconfig();
# If we are fatpacked a CODEREF has been inserted into @INC,
# so we remove it
$config->{inc} = [ grep { ! ref } @{$config->{inc}} ];
+ # Inject info about ourself
+ $config->{+__PACKAGE__} = {
+ version => $VERSION,
+ };
+
print JSON::PP->new->ascii->pretty->encode($config);
| 8 | 0.421053 | 8 | 0 |
bd18a5bb588bb7c4d6be3a9eb967a09d45d0e30d | Configuration/Caches.yaml | Configuration/Caches.yaml | TYPO3_TypoScript_Content:
# Set up a special cache frontend to store metadata (tags, lifetime) in entries
frontend: MOC\Varnish\Cache\MetadataAwareStringFrontend
Moc_Varnish_Site_Token:
frontend: TYPO3\Flow\Cache\Frontend\StringFrontend
backend: TYPO3\Flow\Cache\Backend\SimpleFileBackend
backendOptions:
cacheDirectory: '%FLOW_PATH_DATA%Persistent/MocVarnishSiteToken'
persistent: true | TYPO3_TypoScript_Content:
# Set up a special cache frontend to store metadata (tags, lifetime) in entries
frontend: MOC\Varnish\Cache\MetadataAwareStringFrontend
Moc_Varnish_Site_Token:
frontend: TYPO3\Flow\Cache\Frontend\StringFrontend
backend: TYPO3\Flow\Cache\Backend\SimpleFileBackend
backendOptions:
cacheDirectory: '%FLOW_PATH_DATA%Persistent/MocVarnishSiteToken'
defaultLifetime: 0
persistent: true
| Set site token cache timeout to infinite | [BUGFIX] Set site token cache timeout to infinite
| YAML | mit | mocdk/MOC.Varnish,mocdk/MOC.Varnish | yaml | ## Code Before:
TYPO3_TypoScript_Content:
# Set up a special cache frontend to store metadata (tags, lifetime) in entries
frontend: MOC\Varnish\Cache\MetadataAwareStringFrontend
Moc_Varnish_Site_Token:
frontend: TYPO3\Flow\Cache\Frontend\StringFrontend
backend: TYPO3\Flow\Cache\Backend\SimpleFileBackend
backendOptions:
cacheDirectory: '%FLOW_PATH_DATA%Persistent/MocVarnishSiteToken'
persistent: true
## Instruction:
[BUGFIX] Set site token cache timeout to infinite
## Code After:
TYPO3_TypoScript_Content:
# Set up a special cache frontend to store metadata (tags, lifetime) in entries
frontend: MOC\Varnish\Cache\MetadataAwareStringFrontend
Moc_Varnish_Site_Token:
frontend: TYPO3\Flow\Cache\Frontend\StringFrontend
backend: TYPO3\Flow\Cache\Backend\SimpleFileBackend
backendOptions:
cacheDirectory: '%FLOW_PATH_DATA%Persistent/MocVarnishSiteToken'
defaultLifetime: 0
persistent: true
| TYPO3_TypoScript_Content:
# Set up a special cache frontend to store metadata (tags, lifetime) in entries
frontend: MOC\Varnish\Cache\MetadataAwareStringFrontend
Moc_Varnish_Site_Token:
frontend: TYPO3\Flow\Cache\Frontend\StringFrontend
backend: TYPO3\Flow\Cache\Backend\SimpleFileBackend
backendOptions:
cacheDirectory: '%FLOW_PATH_DATA%Persistent/MocVarnishSiteToken'
+ defaultLifetime: 0
persistent: true | 1 | 0.1 | 1 | 0 |
55b17598e45b619f45add151a380c037e6d63b04 | run-tests.ps1 | run-tests.ps1 |
$projects = Get-ChildItem .\test | ?{$_.PsIsContainer}
foreach($project in $projects) {
cd test/$project
dnx test
cd ../../
} |
$projects = Get-ChildItem .\test | ?{$_.PsIsContainer}
foreach($project in $projects) {
# Display project name
$project
# Move to the project
cd test/$project
# Run test
dnx test
# Move back to the solution root
cd ../../
} | Update test runner PS script | Update test runner PS script
| PowerShell | mit | justinyoo/Scissorhands.NET,aliencube/Scissorhands.NET,ujuc/Scissorhands.NET,aliencube/Scissorhands.NET,justinyoo/Scissorhands.NET,GetScissorhands/Scissorhands.NET,ujuc/Scissorhands.NET,GetScissorhands/Scissorhands.NET,GetScissorhands/Scissorhands.NET,justinyoo/Scissorhands.NET,ujuc/Scissorhands.NET,aliencube/Scissorhands.NET | powershell | ## Code Before:
$projects = Get-ChildItem .\test | ?{$_.PsIsContainer}
foreach($project in $projects) {
cd test/$project
dnx test
cd ../../
}
## Instruction:
Update test runner PS script
## Code After:
$projects = Get-ChildItem .\test | ?{$_.PsIsContainer}
foreach($project in $projects) {
# Display project name
$project
# Move to the project
cd test/$project
# Run test
dnx test
# Move back to the solution root
cd ../../
} |
$projects = Get-ChildItem .\test | ?{$_.PsIsContainer}
foreach($project in $projects) {
+ # Display project name
+ $project
+
+ # Move to the project
cd test/$project
+
+ # Run test
dnx test
+
+ # Move back to the solution root
cd ../../
} | 8 | 1 | 8 | 0 |
c63176232dede941846ac0560870b165a188e4bc | modules/network/templates/route/if-up.erb | modules/network/templates/route/if-up.erb |
/sbin/ip route add <%= @destination %> via <%= @via %>
|
if ! /sbin/ip ro sh | grep -v -q '${destination} via ${via}'
then
/sbin/ip route add <%= @destination %> via <%= @via %>
fi
| Add route only if needed | Add route only if needed
| HTML+ERB | mit | njam/puppet-packages,ppp0/puppet-packages,ppp0/puppet-packages,ppp0/puppet-packages,njam/puppet-packages,njam/puppet-packages,njam/puppet-packages,ppp0/puppet-packages,cargomedia/puppet-packages,cargomedia/puppet-packages,njam/puppet-packages,cargomedia/puppet-packages,cargomedia/puppet-packages,ppp0/puppet-packages,cargomedia/puppet-packages | html+erb | ## Code Before:
/sbin/ip route add <%= @destination %> via <%= @via %>
## Instruction:
Add route only if needed
## Code After:
if ! /sbin/ip ro sh | grep -v -q '${destination} via ${via}'
then
/sbin/ip route add <%= @destination %> via <%= @via %>
fi
|
+ if ! /sbin/ip ro sh | grep -v -q '${destination} via ${via}'
+ then
- /sbin/ip route add <%= @destination %> via <%= @via %>
+ /sbin/ip route add <%= @destination %> via <%= @via %>
? ++
+ fi | 5 | 2.5 | 4 | 1 |
b1aed31d683bbd74976f429e5773741fa5695254 | src/main/java/openmods/network/targets/SelectChunkWatchers.java | src/main/java/openmods/network/targets/SelectChunkWatchers.java | package openmods.network.targets;
import java.util.Collection;
import java.util.Set;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.WorldServer;
import openmods.network.DimCoord;
import openmods.network.IPacketTargetSelector;
import openmods.utils.NetUtils;
import com.google.common.base.Preconditions;
import cpw.mods.fml.common.network.handshake.NetworkDispatcher;
import cpw.mods.fml.relauncher.Side;
public class SelectChunkWatchers implements IPacketTargetSelector {
public static final IPacketTargetSelector INSTANCE = new SelectChunkWatchers();
@Override
public boolean isAllowedOnSide(Side side) {
return side == Side.SERVER;
}
@Override
public void listDispatchers(Object arg, Collection<NetworkDispatcher> result) {
Preconditions.checkArgument(arg instanceof DimCoord, "Argument must be DimCoord");
DimCoord coord = (DimCoord)arg;
WorldServer server = MinecraftServer.getServer().worldServers[coord.dimension];
Set<EntityPlayerMP> players = NetUtils.getPlayersWatchingBlock(server, coord.x, coord.z);
for (EntityPlayerMP player : players) {
NetworkDispatcher dispatcher = NetUtils.getPlayerDispatcher(player);
result.add(dispatcher);
}
}
}
| package openmods.network.targets;
import java.util.Collection;
import java.util.Set;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.world.WorldServer;
import net.minecraftforge.common.DimensionManager;
import openmods.network.DimCoord;
import openmods.network.IPacketTargetSelector;
import openmods.utils.NetUtils;
import com.google.common.base.Preconditions;
import cpw.mods.fml.common.network.handshake.NetworkDispatcher;
import cpw.mods.fml.relauncher.Side;
public class SelectChunkWatchers implements IPacketTargetSelector {
public static final IPacketTargetSelector INSTANCE = new SelectChunkWatchers();
@Override
public boolean isAllowedOnSide(Side side) {
return side == Side.SERVER;
}
@Override
public void listDispatchers(Object arg, Collection<NetworkDispatcher> result) {
Preconditions.checkArgument(arg instanceof DimCoord, "Argument must be DimCoord");
DimCoord coord = (DimCoord)arg;
WorldServer server = DimensionManager.getWorld(coord.dimension);
Set<EntityPlayerMP> players = NetUtils.getPlayersWatchingBlock(server, coord.x, coord.z);
for (EntityPlayerMP player : players) {
NetworkDispatcher dispatcher = NetUtils.getPlayerDispatcher(player);
result.add(dispatcher);
}
}
}
| Fix invalid method used to get worlds | Fix invalid method used to get worlds
| Java | mit | OpenMods/OpenModsLib,nevercast/OpenModsLib,OpenMods/OpenModsLib | java | ## Code Before:
package openmods.network.targets;
import java.util.Collection;
import java.util.Set;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.WorldServer;
import openmods.network.DimCoord;
import openmods.network.IPacketTargetSelector;
import openmods.utils.NetUtils;
import com.google.common.base.Preconditions;
import cpw.mods.fml.common.network.handshake.NetworkDispatcher;
import cpw.mods.fml.relauncher.Side;
public class SelectChunkWatchers implements IPacketTargetSelector {
public static final IPacketTargetSelector INSTANCE = new SelectChunkWatchers();
@Override
public boolean isAllowedOnSide(Side side) {
return side == Side.SERVER;
}
@Override
public void listDispatchers(Object arg, Collection<NetworkDispatcher> result) {
Preconditions.checkArgument(arg instanceof DimCoord, "Argument must be DimCoord");
DimCoord coord = (DimCoord)arg;
WorldServer server = MinecraftServer.getServer().worldServers[coord.dimension];
Set<EntityPlayerMP> players = NetUtils.getPlayersWatchingBlock(server, coord.x, coord.z);
for (EntityPlayerMP player : players) {
NetworkDispatcher dispatcher = NetUtils.getPlayerDispatcher(player);
result.add(dispatcher);
}
}
}
## Instruction:
Fix invalid method used to get worlds
## Code After:
package openmods.network.targets;
import java.util.Collection;
import java.util.Set;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.world.WorldServer;
import net.minecraftforge.common.DimensionManager;
import openmods.network.DimCoord;
import openmods.network.IPacketTargetSelector;
import openmods.utils.NetUtils;
import com.google.common.base.Preconditions;
import cpw.mods.fml.common.network.handshake.NetworkDispatcher;
import cpw.mods.fml.relauncher.Side;
public class SelectChunkWatchers implements IPacketTargetSelector {
public static final IPacketTargetSelector INSTANCE = new SelectChunkWatchers();
@Override
public boolean isAllowedOnSide(Side side) {
return side == Side.SERVER;
}
@Override
public void listDispatchers(Object arg, Collection<NetworkDispatcher> result) {
Preconditions.checkArgument(arg instanceof DimCoord, "Argument must be DimCoord");
DimCoord coord = (DimCoord)arg;
WorldServer server = DimensionManager.getWorld(coord.dimension);
Set<EntityPlayerMP> players = NetUtils.getPlayersWatchingBlock(server, coord.x, coord.z);
for (EntityPlayerMP player : players) {
NetworkDispatcher dispatcher = NetUtils.getPlayerDispatcher(player);
result.add(dispatcher);
}
}
}
| package openmods.network.targets;
import java.util.Collection;
import java.util.Set;
import net.minecraft.entity.player.EntityPlayerMP;
- import net.minecraft.server.MinecraftServer;
import net.minecraft.world.WorldServer;
+ import net.minecraftforge.common.DimensionManager;
import openmods.network.DimCoord;
import openmods.network.IPacketTargetSelector;
import openmods.utils.NetUtils;
import com.google.common.base.Preconditions;
import cpw.mods.fml.common.network.handshake.NetworkDispatcher;
import cpw.mods.fml.relauncher.Side;
public class SelectChunkWatchers implements IPacketTargetSelector {
public static final IPacketTargetSelector INSTANCE = new SelectChunkWatchers();
@Override
public boolean isAllowedOnSide(Side side) {
return side == Side.SERVER;
}
@Override
public void listDispatchers(Object arg, Collection<NetworkDispatcher> result) {
Preconditions.checkArgument(arg instanceof DimCoord, "Argument must be DimCoord");
DimCoord coord = (DimCoord)arg;
- WorldServer server = MinecraftServer.getServer().worldServers[coord.dimension];
+ WorldServer server = DimensionManager.getWorld(coord.dimension);
Set<EntityPlayerMP> players = NetUtils.getPlayersWatchingBlock(server, coord.x, coord.z);
for (EntityPlayerMP player : players) {
NetworkDispatcher dispatcher = NetUtils.getPlayerDispatcher(player);
result.add(dispatcher);
}
}
} | 4 | 0.095238 | 2 | 2 |
581e68d972080d012297915300768eb536988d01 | api/routehandlers/base.js | api/routehandlers/base.js | var methods = ['GET', 'POST', 'HEAD', 'PUT', 'DEL', 'PATCH', 'OPTS'];
var Base = function(app) {
this.route = null;
this.setup(app);
this.routeSetup(app);
};
Base.prototype = {
setup : function(app) {
throw new Error('Please implement setup');
},
routeSetup: function(app) {
var self = this, supportedMethods = [];
if (self.route) {
methods.forEach(function(method) {
var lMethod = method.toLowerCase();
if (typeof self[method] === 'function') {
app[lMethod](self.route, self[method].bind(self));
supportedMethods.push(method);
} else if (typeof self[lMethod] === 'function') {
app[lMethod](self.route, self[lMethod].bind(self));
supportedMethods.push(method);
}
});
if (supportedMethods.length < 1) {
console.log(self.route, 'specified as route but no match for any method: ', methods.join(', '));
} else {
app['opts'](self.route, function(req, res, next) {
res.header('Allow', supportedMethods.join(', '));
return res.send(200, {});
});
}
}
}
};
module.exports = Base;
| var methods = ['GET', 'POST', 'HEAD', 'PUT', 'DEL', 'PATCH', 'OPTS'];
var Base = function(app) {
this.route = null;
this.setup(app);
this.routeSetup(app);
};
Base.prototype = {
setup : function(app) {
throw new Error('Please implement setup');
},
routeSetup: function(app) {
var self = this, supportedMethods = [];
if (self.route) {
methods.forEach(function(method) {
var lMethod = method.toLowerCase();
if (typeof self[method] === 'function') {
app[lMethod](self.route, self[method].bind(self));
supportedMethods.push(method);
} else if (typeof self[lMethod] === 'function') {
app[lMethod](self.route, self[lMethod].bind(self));
supportedMethods.push(method);
}
});
if (supportedMethods.length < 1) {
console.log(self.route, 'specified as route but no match for any method: ', methods.join(', '));
} else {
if (supportedMethods.indexOf('OPTS') != -1) {
app['opts'](self.route, function(req, res, next) {
res.header('Allow', supportedMethods.join(', '));
return res.send(200, {});
});
}
}
}
}
};
module.exports = Base;
| Create default options response only if there is not one. | Create default options response only if there is not one.
| JavaScript | mit | vanng822/appskeleton,vanng822/appskeleton | javascript | ## Code Before:
var methods = ['GET', 'POST', 'HEAD', 'PUT', 'DEL', 'PATCH', 'OPTS'];
var Base = function(app) {
this.route = null;
this.setup(app);
this.routeSetup(app);
};
Base.prototype = {
setup : function(app) {
throw new Error('Please implement setup');
},
routeSetup: function(app) {
var self = this, supportedMethods = [];
if (self.route) {
methods.forEach(function(method) {
var lMethod = method.toLowerCase();
if (typeof self[method] === 'function') {
app[lMethod](self.route, self[method].bind(self));
supportedMethods.push(method);
} else if (typeof self[lMethod] === 'function') {
app[lMethod](self.route, self[lMethod].bind(self));
supportedMethods.push(method);
}
});
if (supportedMethods.length < 1) {
console.log(self.route, 'specified as route but no match for any method: ', methods.join(', '));
} else {
app['opts'](self.route, function(req, res, next) {
res.header('Allow', supportedMethods.join(', '));
return res.send(200, {});
});
}
}
}
};
module.exports = Base;
## Instruction:
Create default options response only if there is not one.
## Code After:
var methods = ['GET', 'POST', 'HEAD', 'PUT', 'DEL', 'PATCH', 'OPTS'];
var Base = function(app) {
this.route = null;
this.setup(app);
this.routeSetup(app);
};
Base.prototype = {
setup : function(app) {
throw new Error('Please implement setup');
},
routeSetup: function(app) {
var self = this, supportedMethods = [];
if (self.route) {
methods.forEach(function(method) {
var lMethod = method.toLowerCase();
if (typeof self[method] === 'function') {
app[lMethod](self.route, self[method].bind(self));
supportedMethods.push(method);
} else if (typeof self[lMethod] === 'function') {
app[lMethod](self.route, self[lMethod].bind(self));
supportedMethods.push(method);
}
});
if (supportedMethods.length < 1) {
console.log(self.route, 'specified as route but no match for any method: ', methods.join(', '));
} else {
if (supportedMethods.indexOf('OPTS') != -1) {
app['opts'](self.route, function(req, res, next) {
res.header('Allow', supportedMethods.join(', '));
return res.send(200, {});
});
}
}
}
}
};
module.exports = Base;
| var methods = ['GET', 'POST', 'HEAD', 'PUT', 'DEL', 'PATCH', 'OPTS'];
var Base = function(app) {
this.route = null;
this.setup(app);
this.routeSetup(app);
};
Base.prototype = {
setup : function(app) {
throw new Error('Please implement setup');
},
routeSetup: function(app) {
var self = this, supportedMethods = [];
if (self.route) {
methods.forEach(function(method) {
var lMethod = method.toLowerCase();
if (typeof self[method] === 'function') {
app[lMethod](self.route, self[method].bind(self));
supportedMethods.push(method);
} else if (typeof self[lMethod] === 'function') {
app[lMethod](self.route, self[lMethod].bind(self));
supportedMethods.push(method);
}
});
if (supportedMethods.length < 1) {
console.log(self.route, 'specified as route but no match for any method: ', methods.join(', '));
} else {
+ if (supportedMethods.indexOf('OPTS') != -1) {
- app['opts'](self.route, function(req, res, next) {
+ app['opts'](self.route, function(req, res, next) {
? +
- res.header('Allow', supportedMethods.join(', '));
+ res.header('Allow', supportedMethods.join(', '));
? +
- return res.send(200, {});
+ return res.send(200, {});
? +
- });
+ });
? +
+ }
}
}
}
};
module.exports = Base; | 10 | 0.25641 | 6 | 4 |
90a3fdb8fce4a6f7f98d1b969715451236ac9a2d | app/components/AddInput.js | app/components/AddInput.js | // @flow
import React, { Component } from "react";
import { connect } from "react-redux";
import { addTask } from "../actions/task";
import type { actionType } from "../reducers/task";
type Props = {
cancel: () => void,
dispatch: (action: actionType) => void
};
type State = {
pomodoros: number
};
class AddInput extends Component {
props: Props;
state: State;
constructor(props: Props) {
super(props);
this.state = {
pomodoros: 0
};
}
render() {
let task: ?HTMLInputElement;
return (
<form
onSubmit={e => {
e.preventDefault();
if (task && task.value.trim()) {
this.props.dispatch(addTask(task.value.trim(), 1));
task.value = "";
this.props.cancel();
}
}}
>
{/* eslint-disable jsx-a11y/no-autofocus */}
<input
ref={node => {
task = node;
}}
type="text"
autoFocus
placeholder="Task name"
/>;
</form>
);
}
}
/* eslint-disable no-class-assign */
AddInput = connect()(AddInput);
export default AddInput;
| // @flow
import React, { Component } from "react";
import { connect } from "react-redux";
import { addTask } from "../actions/task";
import type { actionType } from "../reducers/task";
type Props = {
cancel: () => void,
dispatch: (action: actionType) => void
};
type State = {
pomodoros: number
};
class AddInput extends Component {
props: Props;
state: State;
constructor(props: Props) {
super(props);
this.state = {
pomodoros: 0
};
}
componentDidMount() {}
componentWillUnmount() {}
addPomodoro() {
this.setState({
pomodoros: this.state.pomodoros + 1
});
}
removePomodoro() {
if (this.state.pomodoros > 0) {
this.setState({
pomodoros: this.state.pomodoros - 1
});
}
}
render() {
let task: ?HTMLInputElement;
return (
<form
onSubmit={e => {
e.preventDefault();
if (task && task.value.trim()) {
this.props.dispatch(addTask(task.value.trim(), 1));
task.value = "";
this.props.cancel();
}
}}
>
{/* eslint-disable jsx-a11y/no-autofocus */}
<input
ref={node => {
task = node;
}}
type="text"
autoFocus
placeholder="Task name"
/>;
</form>
);
}
}
/* eslint-disable no-class-assign */
AddInput = connect()(AddInput);
export default AddInput;
| Add Pomodoro and remove pomodoro functionality | Add Pomodoro and remove pomodoro functionality
| JavaScript | mit | Zyst/Aergia,Zyst/Aergia | javascript | ## Code Before:
// @flow
import React, { Component } from "react";
import { connect } from "react-redux";
import { addTask } from "../actions/task";
import type { actionType } from "../reducers/task";
type Props = {
cancel: () => void,
dispatch: (action: actionType) => void
};
type State = {
pomodoros: number
};
class AddInput extends Component {
props: Props;
state: State;
constructor(props: Props) {
super(props);
this.state = {
pomodoros: 0
};
}
render() {
let task: ?HTMLInputElement;
return (
<form
onSubmit={e => {
e.preventDefault();
if (task && task.value.trim()) {
this.props.dispatch(addTask(task.value.trim(), 1));
task.value = "";
this.props.cancel();
}
}}
>
{/* eslint-disable jsx-a11y/no-autofocus */}
<input
ref={node => {
task = node;
}}
type="text"
autoFocus
placeholder="Task name"
/>;
</form>
);
}
}
/* eslint-disable no-class-assign */
AddInput = connect()(AddInput);
export default AddInput;
## Instruction:
Add Pomodoro and remove pomodoro functionality
## Code After:
// @flow
import React, { Component } from "react";
import { connect } from "react-redux";
import { addTask } from "../actions/task";
import type { actionType } from "../reducers/task";
type Props = {
cancel: () => void,
dispatch: (action: actionType) => void
};
type State = {
pomodoros: number
};
class AddInput extends Component {
props: Props;
state: State;
constructor(props: Props) {
super(props);
this.state = {
pomodoros: 0
};
}
componentDidMount() {}
componentWillUnmount() {}
addPomodoro() {
this.setState({
pomodoros: this.state.pomodoros + 1
});
}
removePomodoro() {
if (this.state.pomodoros > 0) {
this.setState({
pomodoros: this.state.pomodoros - 1
});
}
}
render() {
let task: ?HTMLInputElement;
return (
<form
onSubmit={e => {
e.preventDefault();
if (task && task.value.trim()) {
this.props.dispatch(addTask(task.value.trim(), 1));
task.value = "";
this.props.cancel();
}
}}
>
{/* eslint-disable jsx-a11y/no-autofocus */}
<input
ref={node => {
task = node;
}}
type="text"
autoFocus
placeholder="Task name"
/>;
</form>
);
}
}
/* eslint-disable no-class-assign */
AddInput = connect()(AddInput);
export default AddInput;
| // @flow
import React, { Component } from "react";
import { connect } from "react-redux";
import { addTask } from "../actions/task";
import type { actionType } from "../reducers/task";
type Props = {
cancel: () => void,
dispatch: (action: actionType) => void
};
type State = {
pomodoros: number
};
class AddInput extends Component {
props: Props;
state: State;
constructor(props: Props) {
super(props);
this.state = {
pomodoros: 0
};
}
+ componentDidMount() {}
+
+ componentWillUnmount() {}
+
+ addPomodoro() {
+ this.setState({
+ pomodoros: this.state.pomodoros + 1
+ });
+ }
+
+ removePomodoro() {
+ if (this.state.pomodoros > 0) {
+ this.setState({
+ pomodoros: this.state.pomodoros - 1
+ });
+ }
+ }
+
render() {
let task: ?HTMLInputElement;
+
return (
<form
onSubmit={e => {
e.preventDefault();
if (task && task.value.trim()) {
this.props.dispatch(addTask(task.value.trim(), 1));
task.value = "";
this.props.cancel();
}
}}
>
{/* eslint-disable jsx-a11y/no-autofocus */}
<input
ref={node => {
task = node;
}}
type="text"
autoFocus
placeholder="Task name"
/>;
</form>
);
}
}
/* eslint-disable no-class-assign */
AddInput = connect()(AddInput);
export default AddInput; | 19 | 0.322034 | 19 | 0 |
d0d559fc3cae9961203aff35f9f6a2823199a6e5 | packages/rocketchat-mentions/server.coffee | packages/rocketchat-mentions/server.coffee |
class MentionsServer
constructor: (message) ->
# If message starts with /me, replace it for text formatting
mentions = []
message.msg.replace /(?:^|\s|\n)(?:@)([A-Za-z0-9-_.]+)/g, (match, mention) ->
mentions.push mention
if mentions.length isnt 0
mentions = _.unique mentions
verifiedMentions = []
mentions.forEach (mention) ->
verifiedMention = Meteor.users.findOne({username: mention}, {fields: {_id: 1, username: 1}})
verifiedMentions.push verifiedMention if verifiedMention?
if verifiedMentions.length isnt 0
message.mentions = verifiedMentions
return message
RocketChat.callbacks.add 'beforeSaveMessage', MentionsServer |
class MentionsServer
constructor: (message) ->
# If message starts with /me, replace it for text formatting
mentions = []
message.msg.replace /(?:^|\s|\n)(?:@)([A-Za-z0-9-_.]+)/g, (match, mention) ->
mentions.push mention
if mentions.length isnt 0
mentions = _.unique mentions
verifiedMentions = []
mentions.forEach (mention) ->
if mention is 'all'
verifiedMention =
_id: mention
username: mention
else
verifiedMention = Meteor.users.findOne({username: mention}, {fields: {_id: 1, username: 1}})
verifiedMentions.push verifiedMention if verifiedMention?
if verifiedMentions.length isnt 0
message.mentions = verifiedMentions
return message
RocketChat.callbacks.add 'beforeSaveMessage', MentionsServer | Allow save mentions to 'all' | Allow save mentions to 'all'
| CoffeeScript | mit | tntobias/Rocket.Chat,erikmaarten/Rocket.Chat,pitamar/Rocket.Chat,Deepakkothandan/Rocket.Chat,parkmap/Rocket.Chat,thunderrabbit/Rocket.Chat,Gudii/Rocket.Chat,uniteddiversity/Rocket.Chat,mwharrison/Rocket.Chat,yuyixg/Rocket.Chat,HeapCity/Heap.City,lucasgolino/Rocket.Chat,k0nsl/Rocket.Chat,NMandapaty/Rocket.Chat,AimenJoe/Rocket.Chat,cnash/Rocket.Chat,uniteddiversity/Rocket.Chat,JamesHGreen/Rocket_API,capensisma/Rocket.Chat,mhurwi/Rocket.Chat,psadaic/Rocket.Chat,BHWD/noouchat,ludiculous/Rocket.Chat,umeshrs/rocket-chat,AlecTroemel/Rocket.Chat,bopjesvla/chatmafia,wtsarchive/Rocket.Chat,ealbers/Rocket.Chat,Movile/Rocket.Chat,williamfortunademoraes/Rocket.Chat,nathantreid/Rocket.Chat,kkochubey1/Rocket.Chat,cdwv/Rocket.Chat,matthewshirley/Rocket.Chat,Flitterkill/Rocket.Chat,haoyixin/Rocket.Chat,JamesHGreen/Rocket_API,pkgodara/Rocket.Chat,thebakeryio/Rocket.Chat,ederribeiro/Rocket.Chat,LearnersGuild/Rocket.Chat,erikmaarten/Rocket.Chat,atyenoria/Rocket.Chat,arvi/Rocket.Chat,marzieh312/Rocket.Chat,sikofitt/Rocket.Chat,leohmoraes/Rocket.Chat,gitaboard/Rocket.Chat,soonahn/Rocket.Chat,Dianoga/Rocket.Chat,yuyixg/Rocket.Chat,Codebrahma/Rocket.Chat,PavelVanecek/Rocket.Chat,lonbaker/Rocket.Chat,org100h1/Rocket.Panda,LeonardOliveros/Rocket.Chat,inoio/Rocket.Chat,xasx/Rocket.Chat,nrhubbar/Rocket.Chat,ederribeiro/Rocket.Chat,BorntraegerMarc/Rocket.Chat,mwharrison/Rocket.Chat,LearnersGuild/echo-chat,karlprieb/Rocket.Chat,OtkurBiz/Rocket.Chat,JamesHGreen/Rocket_API,celloudiallo/Rocket.Chat,Jandersolutions/Rocket.Chat,psadaic/Rocket.Chat,mrsimpson/Rocket.Chat,snaiperskaya96/Rocket.Chat,NMandapaty/Rocket.Chat,philosowaffle/rpi-Rocket.Chat,ut7/Rocket.Chat,jeann2013/Rocket.Chat,lukaroski/traden,umeshrs/rocket-chat,intelradoux/Rocket.Chat,webcoding/Rocket.Chat,litewhatever/Rocket.Chat,k0nsl/Rocket.Chat,BorntraegerMarc/Rocket.Chat,liuliming2008/Rocket.Chat,xasx/Rocket.Chat,lucasgolino/Rocket.Chat,j-ew-s/Rocket.Chat,katopz/Rocket.Chat,PavelVanecek/Rocket.Chat,ZBoxApp/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,Movile/Rocket.Chat,dmitrijs-balcers/Rocket.Chat,warcode/Rocket.Chat,abhishekshukla0302/trico,mhurwi/Rocket.Chat,steedos/chat,sunhaolin/Rocket.Chat,abduljanjua/TheHub,Kiran-Rao/Rocket.Chat,tzellman/Rocket.Chat,Sing-Li/Rocket.Chat,rasata/Rocket.Chat,dmitrijs-balcers/Rocket.Chat,xboston/Rocket.Chat,florinnichifiriuc/Rocket.Chat,icaromh/Rocket.Chat,mwharrison/Rocket.Chat,gitaboard/Rocket.Chat,qnib/Rocket.Chat,mccambridge/Rocket.Chat,Maysora/Rocket.Chat,xasx/Rocket.Chat,JisuPark/Rocket.Chat,danielbressan/Rocket.Chat,revspringjake/Rocket.Chat,Jandersolutions/Rocket.Chat,umeshrs/rocket-chat-integration,TribeMedia/Rocket.Chat,wtsarchive/Rocket.Chat,umeshrs/rocket-chat-integration,jeanmatheussouto/Rocket.Chat,Maysora/Rocket.Chat,Gudii/Rocket.Chat,subesokun/Rocket.Chat,Deepakkothandan/Rocket.Chat,intelradoux/Rocket.Chat,fatihwk/Rocket.Chat,jessedhillon/Rocket.Chat,klatys/Rocket.Chat,BHWD/noouchat,wicked539/Rocket.Chat,nishimaki10/Rocket.Chat,florinnichifiriuc/Rocket.Chat,madmanteam/Rocket.Chat,4thParty/Rocket.Chat,freakynit/Rocket.Chat,jbsavoy18/rocketchat-1,ImpressiveSetOfIntelligentStudents/chat,celloudiallo/Rocket.Chat,NMandapaty/Rocket.Chat,jbsavoy18/rocketchat-1,Ninotna/Rocket.Chat,mccambridge/Rocket.Chat,matthewshirley/Rocket.Chat,fduraibi/Rocket.Chat,sunhaolin/Rocket.Chat,xboston/Rocket.Chat,christmo/Rocket.Chat,intelradoux/Rocket.Chat,flaviogrossi/Rocket.Chat,pachox/Rocket.Chat,I-am-Gabi/Rocket.Chat,KyawNaingTun/Rocket.Chat,nrhubbar/Rocket.Chat,parkmap/Rocket.Chat,fduraibi/Rocket.Chat,xasx/Rocket.Chat,anhld/Rocket.Chat,tlongren/Rocket.Chat,Gudii/Rocket.Chat,cnash/Rocket.Chat,ealbers/Rocket.Chat,JamesHGreen/Rocket.Chat,Jandersolutions/Rocket.Chat,AimenJoe/Rocket.Chat,abhishekshukla0302/trico,j-ew-s/Rocket.Chat,jeanmatheussouto/Rocket.Chat,galrotem1993/Rocket.Chat,berndsi/Rocket.Chat,AlecTroemel/Rocket.Chat,cdwv/Rocket.Chat,philosowaffle/rpi-Rocket.Chat,soonahn/Rocket.Chat,ggazzo/Rocket.Chat,snaiperskaya96/Rocket.Chat,inoxth/Rocket.Chat,wtsarchive/Rocket.Chat,steedos/chat,ndarilek/Rocket.Chat,jessedhillon/Rocket.Chat,AlecTroemel/Rocket.Chat,alenodari/Rocket.Chat,rasata/Rocket.Chat,ut7/Rocket.Chat,karlprieb/Rocket.Chat,biomassives/Rocket.Chat,uniteddiversity/Rocket.Chat,snaiperskaya96/Rocket.Chat,christmo/Rocket.Chat,ziedmahdi/Rocket.Chat,acidsound/Rocket.Chat,xboston/Rocket.Chat,OtkurBiz/Rocket.Chat,Ninotna/Rocket.Chat,ahmadassaf/Rocket.Chat,ImpressiveSetOfIntelligentStudents/chat,karlprieb/Rocket.Chat,sikofitt/Rocket.Chat,sscpac/chat-locker,parkmap/Rocket.Chat,org100h1/Rocket.Panda,LeonardOliveros/Rocket.Chat,AimenJoe/Rocket.Chat,mrinaldhar/Rocket.Chat,tlongren/Rocket.Chat,yuyixg/Rocket.Chat,Gromby/Rocket.Chat,slava-sh/Rocket.Chat,danielbressan/Rocket.Chat,madmanteam/Rocket.Chat,abhishekshukla0302/trico,glnarayanan/Rocket.Chat,haoyixin/Rocket.Chat,steedos/chat,ealbers/Rocket.Chat,Achaikos/Rocket.Chat,danielbressan/Rocket.Chat,TribeMedia/Rocket.Chat,litewhatever/Rocket.Chat,lucasgolino/Rocket.Chat,christmo/Rocket.Chat,ImpressiveSetOfIntelligentStudents/chat,acaronmd/Rocket.Chat,subesokun/Rocket.Chat,sargentsurg/Rocket.Chat,callblueday/Rocket.Chat,icaromh/Rocket.Chat,jonathanhartman/Rocket.Chat,acidsound/Rocket.Chat,klatys/Rocket.Chat,marzieh312/Rocket.Chat,xboston/Rocket.Chat,Jandersoft/Rocket.Chat,Kiran-Rao/Rocket.Chat,ggazzo/Rocket.Chat,capensisma/Rocket.Chat,Gudii/Rocket.Chat,JamesHGreen/Rocket.Chat,slava-sh/Rocket.Chat,org100h1/Rocket.Panda,LearnersGuild/Rocket.Chat,k0nsl/Rocket.Chat,leohmoraes/Rocket.Chat,Gyubin/Rocket.Chat,capensisma/Rocket.Chat,ludiculous/Rocket.Chat,adamteece/Rocket.Chat,Gyubin/Rocket.Chat,tradetiger/Rocket.Chat,PavelVanecek/Rocket.Chat,callblueday/Rocket.Chat,jyx140521/Rocket.Chat,JamesHGreen/Rocket.Chat,inoxth/Rocket.Chat,karlprieb/Rocket.Chat,phlkchan/Rocket.Chat,jbsavoy18/rocketchat-1,wtsarchive/Rocket.Chat,PavelVanecek/Rocket.Chat,alexbrazier/Rocket.Chat,Movile/Rocket.Chat,jadeqwang/Rocket.Chat,lukaroski/traden,thunderrabbit/Rocket.Chat,ziedmahdi/Rocket.Chat,TribeMedia/Rocket.Chat,subesokun/Rocket.Chat,Achaikos/Rocket.Chat,wicked539/Rocket.Chat,LearnersGuild/echo-chat,berndsi/Rocket.Chat,acidicX/Rocket.Chat,adamteece/Rocket.Chat,cnash/Rocket.Chat,Kiran-Rao/Rocket.Chat,haoyixin/Rocket.Chat,nabiltntn/Rocket.Chat,jeann2013/Rocket.Chat,ealbers/Rocket.Chat,berndsi/Rocket.Chat,revspringjake/Rocket.Chat,LeonardOliveros/Rocket.Chat,4thParty/Rocket.Chat,ndarilek/Rocket.Chat,Dianoga/Rocket.Chat,jbsavoy18/rocketchat-1,Deepakkothandan/Rocket.Chat,acidicX/Rocket.Chat,LearnersGuild/echo-chat,sunhaolin/Rocket.Chat,org100h1/Rocket.Panda,BorntraegerMarc/Rocket.Chat,alexbrazier/Rocket.Chat,callblueday/Rocket.Chat,rasata/Rocket.Chat,mhurwi/Rocket.Chat,tntobias/Rocket.Chat,AlecTroemel/Rocket.Chat,mitar/Rocket.Chat,callmekatootie/Rocket.Chat,webcoding/Rocket.Chat,mrinaldhar/Rocket.Chat,nathantreid/Rocket.Chat,liemqv/Rocket.Chat,thunderrabbit/Rocket.Chat,OtkurBiz/Rocket.Chat,Ninotna/Rocket.Chat,VoiSmart/Rocket.Chat,erikmaarten/Rocket.Chat,litewhatever/Rocket.Chat,liemqv/Rocket.Chat,LearnersGuild/Rocket.Chat,mwharrison/Rocket.Chat,gitaboard/Rocket.Chat,ImpressiveSetOfIntelligentStudents/chat,apnero/tactixteam,thswave/Rocket.Chat,pachox/Rocket.Chat,lonbaker/Rocket.Chat,fduraibi/Rocket.Chat,igorstajic/Rocket.Chat,coreyaus/Rocket.Chat,nishimaki10/Rocket.Chat,linnovate/hi,abduljanjua/TheHub,Gyubin/Rocket.Chat,4thParty/Rocket.Chat,nrhubbar/Rocket.Chat,glnarayanan/Rocket.Chat,tntobias/Rocket.Chat,bt/Rocket.Chat,VoiSmart/Rocket.Chat,LearnersGuild/echo-chat,biomassives/Rocket.Chat,mitar/Rocket.Chat,sikofitt/Rocket.Chat,kkochubey1/Rocket.Chat,dmitrijs-balcers/Rocket.Chat,jyx140521/Rocket.Chat,arvi/Rocket.Chat,AimenJoe/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,ziedmahdi/Rocket.Chat,cdwv/Rocket.Chat,Dianoga/Rocket.Chat,inoio/Rocket.Chat,snaiperskaya96/Rocket.Chat,coreyaus/Rocket.Chat,freakynit/Rocket.Chat,slava-sh/Rocket.Chat,ZBoxApp/Rocket.Chat,tradetiger/Rocket.Chat,Sing-Li/Rocket.Chat,qnib/Rocket.Chat,wangleihd/Rocket.Chat,acaronmd/Rocket.Chat,ggazzo/Rocket.Chat,phlkchan/Rocket.Chat,amaapp/ama,ZBoxApp/Rocket.Chat,ggazzo/Rocket.Chat,arvi/Rocket.Chat,VoiSmart/Rocket.Chat,TribeMedia/Rocket.Chat,inoxth/Rocket.Chat,ahmadassaf/Rocket.Chat,Flitterkill/Rocket.Chat,wangleihd/Rocket.Chat,icaromh/Rocket.Chat,OtkurBiz/Rocket.Chat,j-ew-s/Rocket.Chat,danielbressan/Rocket.Chat,Codebrahma/Rocket.Chat,umeshrs/rocket-chat-integration,apnero/tactixteam,Jandersoft/Rocket.Chat,wangleihd/Rocket.Chat,timkinnane/Rocket.Chat,alenodari/Rocket.Chat,warcode/Rocket.Chat,tntobias/Rocket.Chat,phlkchan/Rocket.Chat,freakynit/Rocket.Chat,ahmadassaf/Rocket.Chat,abduljanjua/TheHub,tradetiger/Rocket.Chat,atyenoria/Rocket.Chat,tzellman/Rocket.Chat,thswave/Rocket.Chat,marzieh312/Rocket.Chat,williamfortunademoraes/Rocket.Chat,bt/Rocket.Chat,Gyubin/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,cdwv/Rocket.Chat,BHWD/noouchat,wicked539/Rocket.Chat,mitar/Rocket.Chat,JamesHGreen/Rocket_API,acaronmd/Rocket.Chat,psadaic/Rocket.Chat,nathantreid/Rocket.Chat,mrsimpson/Rocket.Chat,himeshp/Rocket.Chat,ederribeiro/Rocket.Chat,Sing-Li/Rocket.Chat,anhld/Rocket.Chat,Gromby/Rocket.Chat,flaviogrossi/Rocket.Chat,nabiltntn/Rocket.Chat,4thParty/Rocket.Chat,leohmoraes/Rocket.Chat,himeshp/Rocket.Chat,williamfortunademoraes/Rocket.Chat,LeonardOliveros/Rocket.Chat,florinnichifiriuc/Rocket.Chat,bt/Rocket.Chat,Maysora/Rocket.Chat,Jandersoft/Rocket.Chat,fduraibi/Rocket.Chat,lukaroski/traden,Abdelhamidhenni/Rocket.Chat,kkochubey1/Rocket.Chat,ut7/Rocket.Chat,mrsimpson/Rocket.Chat,katopz/Rocket.Chat,abhishekshukla0302/trico,Codebrahma/Rocket.Chat,madmanteam/Rocket.Chat,jessedhillon/Rocket.Chat,NMandapaty/Rocket.Chat,acidicX/Rocket.Chat,celloudiallo/Rocket.Chat,Flitterkill/Rocket.Chat,amaapp/ama,liemqv/Rocket.Chat,lonbaker/Rocket.Chat,Achaikos/Rocket.Chat,matthewshirley/Rocket.Chat,timkinnane/Rocket.Chat,sscpac/chat-locker,haoyixin/Rocket.Chat,mhurwi/Rocket.Chat,JamesHGreen/Rocket.Chat,bopjesvla/chatmafia,qnib/Rocket.Chat,nishimaki10/Rocket.Chat,mccambridge/Rocket.Chat,jyx140521/Rocket.Chat,sargentsurg/Rocket.Chat,fatihwk/Rocket.Chat,Deepakkothandan/Rocket.Chat,bopjesvla/chatmafia,Flitterkill/Rocket.Chat,BorntraegerMarc/Rocket.Chat,himeshp/Rocket.Chat,igorstajic/Rocket.Chat,fatihwk/Rocket.Chat,igorstajic/Rocket.Chat,liuliming2008/Rocket.Chat,qnib/Rocket.Chat,anhld/Rocket.Chat,pkgodara/Rocket.Chat,JisuPark/Rocket.Chat,mohamedhagag/Rocket.Chat,mohamedhagag/Rocket.Chat,alenodari/Rocket.Chat,warcode/Rocket.Chat,galrotem1993/Rocket.Chat,biomassives/Rocket.Chat,subesokun/Rocket.Chat,ahmadassaf/Rocket.Chat,thebakeryio/Rocket.Chat,jadeqwang/Rocket.Chat,apnero/tactixteam,intelradoux/Rocket.Chat,acaronmd/Rocket.Chat,steedos/chat,fatihwk/Rocket.Chat,yuyixg/Rocket.Chat,cnash/Rocket.Chat,mrinaldhar/Rocket.Chat,katopz/Rocket.Chat,Dianoga/Rocket.Chat,klatys/Rocket.Chat,jonathanhartman/Rocket.Chat,revspringjake/Rocket.Chat,soonahn/Rocket.Chat,tlongren/Rocket.Chat,mccambridge/Rocket.Chat,thebakeryio/Rocket.Chat,Achaikos/Rocket.Chat,Kiran-Rao/Rocket.Chat,jeanmatheussouto/Rocket.Chat,thswave/Rocket.Chat,umeshrs/rocket-chat,KyawNaingTun/Rocket.Chat,igorstajic/Rocket.Chat,tlongren/Rocket.Chat,I-am-Gabi/Rocket.Chat,amaapp/ama,pitamar/Rocket.Chat,lukaroski/traden,glnarayanan/Rocket.Chat,alexbrazier/Rocket.Chat,webcoding/Rocket.Chat,soonahn/Rocket.Chat,pkgodara/Rocket.Chat,timkinnane/Rocket.Chat,inoxth/Rocket.Chat,jeann2013/Rocket.Chat,acidsound/Rocket.Chat,HeapCity/Heap.City,galrotem1993/Rocket.Chat,pachox/Rocket.Chat,liuliming2008/Rocket.Chat,jadeqwang/Rocket.Chat,HeapCity/Heap.City,bt/Rocket.Chat,linnovate/hi,k0nsl/Rocket.Chat,mrinaldhar/Rocket.Chat,Movile/Rocket.Chat,Abdelhamidhenni/Rocket.Chat,mohamedhagag/Rocket.Chat,wicked539/Rocket.Chat,ludiculous/Rocket.Chat,philosowaffle/rpi-Rocket.Chat,liuliming2008/Rocket.Chat,sscpac/chat-locker,ndarilek/Rocket.Chat,flaviogrossi/Rocket.Chat,flaviogrossi/Rocket.Chat,adamteece/Rocket.Chat,pitamar/Rocket.Chat,Gromby/Rocket.Chat,timkinnane/Rocket.Chat,Abdelhamidhenni/Rocket.Chat,callmekatootie/Rocket.Chat,mitar/Rocket.Chat,Sing-Li/Rocket.Chat,pitamar/Rocket.Chat,I-am-Gabi/Rocket.Chat,nabiltntn/Rocket.Chat,ndarilek/Rocket.Chat,jonathanhartman/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,abduljanjua/TheHub,alexbrazier/Rocket.Chat,litewhatever/Rocket.Chat,amaapp/ama,matthewshirley/Rocket.Chat,callmekatootie/Rocket.Chat,jonathanhartman/Rocket.Chat,sargentsurg/Rocket.Chat,marzieh312/Rocket.Chat,ut7/Rocket.Chat,tzellman/Rocket.Chat,JisuPark/Rocket.Chat,pachox/Rocket.Chat,mrsimpson/Rocket.Chat,KyawNaingTun/Rocket.Chat,nishimaki10/Rocket.Chat,atyenoria/Rocket.Chat,coreyaus/Rocket.Chat,galrotem1993/Rocket.Chat,LearnersGuild/Rocket.Chat,inoio/Rocket.Chat,pkgodara/Rocket.Chat,klatys/Rocket.Chat,ziedmahdi/Rocket.Chat | coffeescript | ## Code Before:
class MentionsServer
constructor: (message) ->
# If message starts with /me, replace it for text formatting
mentions = []
message.msg.replace /(?:^|\s|\n)(?:@)([A-Za-z0-9-_.]+)/g, (match, mention) ->
mentions.push mention
if mentions.length isnt 0
mentions = _.unique mentions
verifiedMentions = []
mentions.forEach (mention) ->
verifiedMention = Meteor.users.findOne({username: mention}, {fields: {_id: 1, username: 1}})
verifiedMentions.push verifiedMention if verifiedMention?
if verifiedMentions.length isnt 0
message.mentions = verifiedMentions
return message
RocketChat.callbacks.add 'beforeSaveMessage', MentionsServer
## Instruction:
Allow save mentions to 'all'
## Code After:
class MentionsServer
constructor: (message) ->
# If message starts with /me, replace it for text formatting
mentions = []
message.msg.replace /(?:^|\s|\n)(?:@)([A-Za-z0-9-_.]+)/g, (match, mention) ->
mentions.push mention
if mentions.length isnt 0
mentions = _.unique mentions
verifiedMentions = []
mentions.forEach (mention) ->
if mention is 'all'
verifiedMention =
_id: mention
username: mention
else
verifiedMention = Meteor.users.findOne({username: mention}, {fields: {_id: 1, username: 1}})
verifiedMentions.push verifiedMention if verifiedMention?
if verifiedMentions.length isnt 0
message.mentions = verifiedMentions
return message
RocketChat.callbacks.add 'beforeSaveMessage', MentionsServer |
class MentionsServer
constructor: (message) ->
# If message starts with /me, replace it for text formatting
mentions = []
message.msg.replace /(?:^|\s|\n)(?:@)([A-Za-z0-9-_.]+)/g, (match, mention) ->
mentions.push mention
if mentions.length isnt 0
mentions = _.unique mentions
verifiedMentions = []
mentions.forEach (mention) ->
+ if mention is 'all'
+ verifiedMention =
+ _id: mention
+ username: mention
+ else
- verifiedMention = Meteor.users.findOne({username: mention}, {fields: {_id: 1, username: 1}})
+ verifiedMention = Meteor.users.findOne({username: mention}, {fields: {_id: 1, username: 1}})
? +
+
verifiedMentions.push verifiedMention if verifiedMention?
if verifiedMentions.length isnt 0
message.mentions = verifiedMentions
return message
RocketChat.callbacks.add 'beforeSaveMessage', MentionsServer | 8 | 0.444444 | 7 | 1 |
5d3e50710c50ba5d8358f01cfc4d6c7797c453e3 | README.md | README.md | A Java client for SeatGeek's Sixpack a/b testing framework https://github.com/seatgeek/sixpack
| [](https://magnum.travis-ci.com/seatgeek/sixpack-java)[](https://coveralls.io/r/seatgeek/sixpack-java?branch=master)
# sixpack-java
A Java client for SeatGeek's Sixpack a/b testing framework https://github.com/seatgeek/sixpack
| Add travis build status and coveralls coverage report to readme. | Add travis build status and coveralls coverage report to readme.
| Markdown | bsd-2-clause | seatgeek/sixpack-java,MaTriXy/sixpack-java,MaTriXy/sixpack-java,seatgeek/sixpack-java | markdown | ## Code Before:
A Java client for SeatGeek's Sixpack a/b testing framework https://github.com/seatgeek/sixpack
## Instruction:
Add travis build status and coveralls coverage report to readme.
## Code After:
[](https://magnum.travis-ci.com/seatgeek/sixpack-java)[](https://coveralls.io/r/seatgeek/sixpack-java?branch=master)
# sixpack-java
A Java client for SeatGeek's Sixpack a/b testing framework https://github.com/seatgeek/sixpack
| + [](https://magnum.travis-ci.com/seatgeek/sixpack-java)[](https://coveralls.io/r/seatgeek/sixpack-java?branch=master)
+
+ # sixpack-java
A Java client for SeatGeek's Sixpack a/b testing framework https://github.com/seatgeek/sixpack | 3 | 3 | 3 | 0 |
914da6b3c4b84310bb92fad661cd3c4c32d14713 | app/assets/javascripts/neighborly/balanced/creditcard/payment.js.coffee | app/assets/javascripts/neighborly/balanced/creditcard/payment.js.coffee | window.NeighborlyBalancedCreditcard = Backbone.View.extend
el: '.neighborly-balanced-creditcard-form'
initialize: ->
_.bindAll(this, 'validate', 'submit')
$(document).foundation('forms')
this.$button = this.$('input[type=submit]')
this.$form = this.$('form')
this.$form.bind('submit', this.submit)
validate: ->
submit: (e)->
e.preventDefault()
| window.NeighborlyBalancedCreditcard = Backbone.View.extend
el: '.neighborly-balanced-creditcard-form'
initialize: ->
_.bindAll(this, 'validate', 'submit')
$(document).foundation('forms')
this.$button = this.$('input[type=submit]')
this.$form = this.$('form')
this.$form.bind('submit', this.submit)
this.$('#payment_use_previously_card').bind('change', this.toggleAddNewCard)
validate: =>
toggleAddNewCard: =>
this.$('.add-new-creditcard-form').toggleClass('hide')
submit: (e)=>
e.preventDefault()
| Add JS toggle to show cards fields when has previously | Add JS toggle to show cards fields when has previously
| CoffeeScript | mit | FromUte/dune-balanced-creditcard,FromUte/dune-balanced-creditcard,FromUte/dune-balanced-creditcard | coffeescript | ## Code Before:
window.NeighborlyBalancedCreditcard = Backbone.View.extend
el: '.neighborly-balanced-creditcard-form'
initialize: ->
_.bindAll(this, 'validate', 'submit')
$(document).foundation('forms')
this.$button = this.$('input[type=submit]')
this.$form = this.$('form')
this.$form.bind('submit', this.submit)
validate: ->
submit: (e)->
e.preventDefault()
## Instruction:
Add JS toggle to show cards fields when has previously
## Code After:
window.NeighborlyBalancedCreditcard = Backbone.View.extend
el: '.neighborly-balanced-creditcard-form'
initialize: ->
_.bindAll(this, 'validate', 'submit')
$(document).foundation('forms')
this.$button = this.$('input[type=submit]')
this.$form = this.$('form')
this.$form.bind('submit', this.submit)
this.$('#payment_use_previously_card').bind('change', this.toggleAddNewCard)
validate: =>
toggleAddNewCard: =>
this.$('.add-new-creditcard-form').toggleClass('hide')
submit: (e)=>
e.preventDefault()
| window.NeighborlyBalancedCreditcard = Backbone.View.extend
el: '.neighborly-balanced-creditcard-form'
initialize: ->
_.bindAll(this, 'validate', 'submit')
$(document).foundation('forms')
this.$button = this.$('input[type=submit]')
this.$form = this.$('form')
this.$form.bind('submit', this.submit)
+ this.$('#payment_use_previously_card').bind('change', this.toggleAddNewCard)
- validate: ->
? ^
+ validate: =>
? ^
+ toggleAddNewCard: =>
+ this.$('.add-new-creditcard-form').toggleClass('hide')
+
- submit: (e)->
? ^
+ submit: (e)=>
? ^
e.preventDefault()
| 8 | 0.5 | 6 | 2 |
1890cfca8065635ced6755524d468614dead23f5 | src/services/GetCharityData.js | src/services/GetCharityData.js | class GetCharityData {
getData(){
var CHARITY_DATA = [
{amount: '41,234', month: 'January', year: '2015', name: 'Charity:Water', description: 'Cool description that was so hard to come up with. Hence I ended up writing some random text that dosent make much text' ,imageSource: 'https://s3.amazonaws.com/moveit-multunus/charity_resources/March2015/GiveIndia_education_march_2015.png'},
{amount: '41,234', month: 'February', year: '2015', name: 'Charity:Water', description: 'Cooler description hat was so hard to come up with. Hence I ended up writing some random text that dosent make much text',imageSource: 'https://s3.amazonaws.com/moveit-multunus/charity_resources/April2015/charity_water+Apr+2015.png'},
{amount: '21,234', month: 'March', year: '2015', name: 'Charity:Water', description: 'Coolest description hat was so hard to come up with. Hence I ended up writing some random text that dosent make much text',imageSource: 'https://s3.amazonaws.com/moveit-multunus/charity_resources/April2015/charity_water+Apr+2015.png'}
];
return CHARITY_DATA ;
}
}
export default new GetCharityData(); | class GetCharityData {
getData(){
var CHARITY_DATA_ARRAY = [];
var spreadsheetID = "1f1tFr7y62QS7IRWOC2nNR5HWsTO99Bna3d0Xv1PTPiY";
var url = "https://spreadsheets.google.com/feeds/list/" + spreadsheetID + "/od6/public/values?alt=json";
fetch(url).then((response) => response.json())
.then((responseText) => {
entry = responseText.feed.entry;
entry.forEach(function(element){
CHARITY_DATA_ARRAY.push({amount: element.gsx$charityamount.$t, month: element.gsx$month.$t, year: element.gsx$year.$t, name: element.gsx$charityname.$t, description: element.gsx$charitydesc.$t, imageSource: element.gsx$charityimage.$t });
});
})
.catch((error) => {
console.warn(error);
});
return CHARITY_DATA_ARRAY;
}
}
export default new GetCharityData();
| Implement service to fetch charity data from spreadsheet | Implement service to fetch charity data from spreadsheet
https://trello.com/c/wjthoHP0/28-user-sbat-view-the-charity-contributions-done-per-month-by-the-company
| JavaScript | mit | multunus/moveit-mobile,multunus/moveit-mobile,multunus/moveit-mobile | javascript | ## Code Before:
class GetCharityData {
getData(){
var CHARITY_DATA = [
{amount: '41,234', month: 'January', year: '2015', name: 'Charity:Water', description: 'Cool description that was so hard to come up with. Hence I ended up writing some random text that dosent make much text' ,imageSource: 'https://s3.amazonaws.com/moveit-multunus/charity_resources/March2015/GiveIndia_education_march_2015.png'},
{amount: '41,234', month: 'February', year: '2015', name: 'Charity:Water', description: 'Cooler description hat was so hard to come up with. Hence I ended up writing some random text that dosent make much text',imageSource: 'https://s3.amazonaws.com/moveit-multunus/charity_resources/April2015/charity_water+Apr+2015.png'},
{amount: '21,234', month: 'March', year: '2015', name: 'Charity:Water', description: 'Coolest description hat was so hard to come up with. Hence I ended up writing some random text that dosent make much text',imageSource: 'https://s3.amazonaws.com/moveit-multunus/charity_resources/April2015/charity_water+Apr+2015.png'}
];
return CHARITY_DATA ;
}
}
export default new GetCharityData();
## Instruction:
Implement service to fetch charity data from spreadsheet
https://trello.com/c/wjthoHP0/28-user-sbat-view-the-charity-contributions-done-per-month-by-the-company
## Code After:
class GetCharityData {
getData(){
var CHARITY_DATA_ARRAY = [];
var spreadsheetID = "1f1tFr7y62QS7IRWOC2nNR5HWsTO99Bna3d0Xv1PTPiY";
var url = "https://spreadsheets.google.com/feeds/list/" + spreadsheetID + "/od6/public/values?alt=json";
fetch(url).then((response) => response.json())
.then((responseText) => {
entry = responseText.feed.entry;
entry.forEach(function(element){
CHARITY_DATA_ARRAY.push({amount: element.gsx$charityamount.$t, month: element.gsx$month.$t, year: element.gsx$year.$t, name: element.gsx$charityname.$t, description: element.gsx$charitydesc.$t, imageSource: element.gsx$charityimage.$t });
});
})
.catch((error) => {
console.warn(error);
});
return CHARITY_DATA_ARRAY;
}
}
export default new GetCharityData();
| class GetCharityData {
- getData(){
? ^
+ getData(){
? ^^
- var CHARITY_DATA = [
- {amount: '41,234', month: 'January', year: '2015', name: 'Charity:Water', description: 'Cool description that was so hard to come up with. Hence I ended up writing some random text that dosent make much text' ,imageSource: 'https://s3.amazonaws.com/moveit-multunus/charity_resources/March2015/GiveIndia_education_march_2015.png'},
- {amount: '41,234', month: 'February', year: '2015', name: 'Charity:Water', description: 'Cooler description hat was so hard to come up with. Hence I ended up writing some random text that dosent make much text',imageSource: 'https://s3.amazonaws.com/moveit-multunus/charity_resources/April2015/charity_water+Apr+2015.png'},
- {amount: '21,234', month: 'March', year: '2015', name: 'Charity:Water', description: 'Coolest description hat was so hard to come up with. Hence I ended up writing some random text that dosent make much text',imageSource: 'https://s3.amazonaws.com/moveit-multunus/charity_resources/April2015/charity_water+Apr+2015.png'}
- ];
+ var CHARITY_DATA_ARRAY = [];
+ var spreadsheetID = "1f1tFr7y62QS7IRWOC2nNR5HWsTO99Bna3d0Xv1PTPiY";
+ var url = "https://spreadsheets.google.com/feeds/list/" + spreadsheetID + "/od6/public/values?alt=json";
+ fetch(url).then((response) => response.json())
+ .then((responseText) => {
+ entry = responseText.feed.entry;
+ entry.forEach(function(element){
+ CHARITY_DATA_ARRAY.push({amount: element.gsx$charityamount.$t, month: element.gsx$month.$t, year: element.gsx$year.$t, name: element.gsx$charityname.$t, description: element.gsx$charitydesc.$t, imageSource: element.gsx$charityimage.$t });
+ });
+ })
+ .catch((error) => {
+ console.warn(error);
+ });
- return CHARITY_DATA ;
? ^^ ^
+ return CHARITY_DATA_ARRAY;
? ^^^^ ^^^^^^
- }
+ }
}
-
export default new GetCharityData(); | 25 | 2.083333 | 16 | 9 |
b9fb61cdc7b591de249eabef01ea52a3a5bd77a9 | lib/module/query_builder.js | lib/module/query_builder.js | Astro.QueryBuilder = function() {
this.selector = {};
this.options = {};
};
_.extend(Astro.QueryBuilder.prototype, {
select: function(selector) {
_.extend(this.selector, selector);
}
});
| Astro.QueryBuilder = function() {
this.selector = {};
this.options = {};
this.collection = null;
};
_.extend(Astro.QueryBuilder.prototype, {
select: function(selector) {
_.extend(this.selector, selector);
},
options: function(options) {
_.extend(this.options, options);
},
find: function() {
return this.collection.find(this.selector, this.options);
},
findOne: function() {
return this.collection.findOne(this.selector, this.options);
},
remove: function() {
return this.collection.remove(this.selector, this.options);
}
});
| Add a few methods to query builder | Add a few methods to query builder
| JavaScript | mit | jagi/meteor-astronomy-query-builder | javascript | ## Code Before:
Astro.QueryBuilder = function() {
this.selector = {};
this.options = {};
};
_.extend(Astro.QueryBuilder.prototype, {
select: function(selector) {
_.extend(this.selector, selector);
}
});
## Instruction:
Add a few methods to query builder
## Code After:
Astro.QueryBuilder = function() {
this.selector = {};
this.options = {};
this.collection = null;
};
_.extend(Astro.QueryBuilder.prototype, {
select: function(selector) {
_.extend(this.selector, selector);
},
options: function(options) {
_.extend(this.options, options);
},
find: function() {
return this.collection.find(this.selector, this.options);
},
findOne: function() {
return this.collection.findOne(this.selector, this.options);
},
remove: function() {
return this.collection.remove(this.selector, this.options);
}
});
| Astro.QueryBuilder = function() {
this.selector = {};
this.options = {};
+ this.collection = null;
};
_.extend(Astro.QueryBuilder.prototype, {
select: function(selector) {
_.extend(this.selector, selector);
+ },
+
+ options: function(options) {
+ _.extend(this.options, options);
+ },
+
+ find: function() {
+ return this.collection.find(this.selector, this.options);
+ },
+
+ findOne: function() {
+ return this.collection.findOne(this.selector, this.options);
+ },
+
+ remove: function() {
+ return this.collection.remove(this.selector, this.options);
}
}); | 17 | 1.7 | 17 | 0 |
ddff43275d41109c2acb07aa6dd52e114bafca11 | content/renderer/scheduler/renderer_scheduler.cc | content/renderer/scheduler/renderer_scheduler.cc | // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/renderer/scheduler/renderer_scheduler.h"
#include "content/renderer/scheduler/null_renderer_scheduler.h"
namespace content {
RendererScheduler::RendererScheduler() {
}
RendererScheduler::~RendererScheduler() {
}
// static
scoped_ptr<RendererScheduler> RendererScheduler::Create() {
// TODO(rmcilroy): Use the RendererSchedulerImpl when the scheduler is enabled
return make_scoped_ptr(new NullRendererScheduler());
}
} // namespace content
| // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/renderer/scheduler/renderer_scheduler.h"
#include "base/command_line.h"
#include "base/message_loop/message_loop_proxy.h"
#include "content/public/common/content_switches.h"
#include "content/renderer/scheduler/null_renderer_scheduler.h"
#include "content/renderer/scheduler/renderer_scheduler_impl.h"
namespace content {
RendererScheduler::RendererScheduler() {
}
RendererScheduler::~RendererScheduler() {
}
// static
scoped_ptr<RendererScheduler> RendererScheduler::Create() {
CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kDisableBlinkScheduler)) {
return make_scoped_ptr(new NullRendererScheduler());
} else {
return make_scoped_ptr(
new RendererSchedulerImpl(base::MessageLoopProxy::current()));
}
}
} // namespace content
| Enable the RendererScheduler by default. | content: Enable the RendererScheduler by default.
BUG=391005
Review URL: https://codereview.chromium.org/704933002
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#303625}
| C++ | bsd-3-clause | TheTypoMaster/chromium-crosswalk,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,Pluto-tv/chromium-crosswalk,dednal/chromium.src,Jonekee/chromium.src,Jonekee/chromium.src,Jonekee/chromium.src,Pluto-tv/chromium-crosswalk,dushu1203/chromium.src,Pluto-tv/chromium-crosswalk,ltilve/chromium,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,markYoungH/chromium.src,dednal/chromium.src,axinging/chromium-crosswalk,dushu1203/chromium.src,axinging/chromium-crosswalk,markYoungH/chromium.src,jaruba/chromium.src,markYoungH/chromium.src,M4sse/chromium.src,dushu1203/chromium.src,fujunwei/chromium-crosswalk,dednal/chromium.src,axinging/chromium-crosswalk,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,Pluto-tv/chromium-crosswalk,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,Fireblend/chromium-crosswalk,ltilve/chromium,Just-D/chromium-1,axinging/chromium-crosswalk,Just-D/chromium-1,M4sse/chromium.src,fujunwei/chromium-crosswalk,chuan9/chromium-crosswalk,dednal/chromium.src,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,ltilve/chromium,TheTypoMaster/chromium-crosswalk,Just-D/chromium-1,jaruba/chromium.src,dushu1203/chromium.src,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,TheTypoMaster/chromium-crosswalk,dednal/chromium.src,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,fujunwei/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,chuan9/chromium-crosswalk,krieger-od/nwjs_chromium.src,mohamed--abdel-maksoud/chromium.src,Chilledheart/chromium,fujunwei/chromium-crosswalk,ltilve/chromium,Just-D/chromium-1,mohamed--abdel-maksoud/chromium.src,ltilve/chromium,Fireblend/chromium-crosswalk,Pluto-tv/chromium-crosswalk,krieger-od/nwjs_chromium.src,Chilledheart/chromium,fujunwei/chromium-crosswalk,Just-D/chromium-1,jaruba/chromium.src,PeterWangIntel/chromium-crosswalk,M4sse/chromium.src,Jonekee/chromium.src,Fireblend/chromium-crosswalk,chuan9/chromium-crosswalk,Fireblend/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,Chilledheart/chromium,Pluto-tv/chromium-crosswalk,dednal/chromium.src,jaruba/chromium.src,PeterWangIntel/chromium-crosswalk,dushu1203/chromium.src,ltilve/chromium,M4sse/chromium.src,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,fujunwei/chromium-crosswalk,markYoungH/chromium.src,M4sse/chromium.src,axinging/chromium-crosswalk,axinging/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,Jonekee/chromium.src,hgl888/chromium-crosswalk,Jonekee/chromium.src,krieger-od/nwjs_chromium.src,Jonekee/chromium.src,markYoungH/chromium.src,chuan9/chromium-crosswalk,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,ltilve/chromium,Jonekee/chromium.src,axinging/chromium-crosswalk,dednal/chromium.src,fujunwei/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,dednal/chromium.src,axinging/chromium-crosswalk,Chilledheart/chromium,mohamed--abdel-maksoud/chromium.src,Chilledheart/chromium,hgl888/chromium-crosswalk,krieger-od/nwjs_chromium.src,Jonekee/chromium.src,Jonekee/chromium.src,jaruba/chromium.src,jaruba/chromium.src,TheTypoMaster/chromium-crosswalk,dednal/chromium.src,M4sse/chromium.src,chuan9/chromium-crosswalk,dushu1203/chromium.src,chuan9/chromium-crosswalk,Pluto-tv/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,Chilledheart/chromium,M4sse/chromium.src,krieger-od/nwjs_chromium.src,axinging/chromium-crosswalk,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,ltilve/chromium,dushu1203/chromium.src,fujunwei/chromium-crosswalk,Fireblend/chromium-crosswalk,Just-D/chromium-1,markYoungH/chromium.src,hgl888/chromium-crosswalk,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,Chilledheart/chromium,hgl888/chromium-crosswalk,dednal/chromium.src,Chilledheart/chromium,jaruba/chromium.src,M4sse/chromium.src,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Chilledheart/chromium,markYoungH/chromium.src,Fireblend/chromium-crosswalk,markYoungH/chromium.src,markYoungH/chromium.src,jaruba/chromium.src,Jonekee/chromium.src,M4sse/chromium.src,chuan9/chromium-crosswalk,Just-D/chromium-1,chuan9/chromium-crosswalk,Just-D/chromium-1,Fireblend/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Fireblend/chromium-crosswalk,dushu1203/chromium.src,PeterWangIntel/chromium-crosswalk,krieger-od/nwjs_chromium.src,ltilve/chromium,chuan9/chromium-crosswalk,M4sse/chromium.src,hgl888/chromium-crosswalk,krieger-od/nwjs_chromium.src,mohamed--abdel-maksoud/chromium.src,fujunwei/chromium-crosswalk,M4sse/chromium.src | c++ | ## Code Before:
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/renderer/scheduler/renderer_scheduler.h"
#include "content/renderer/scheduler/null_renderer_scheduler.h"
namespace content {
RendererScheduler::RendererScheduler() {
}
RendererScheduler::~RendererScheduler() {
}
// static
scoped_ptr<RendererScheduler> RendererScheduler::Create() {
// TODO(rmcilroy): Use the RendererSchedulerImpl when the scheduler is enabled
return make_scoped_ptr(new NullRendererScheduler());
}
} // namespace content
## Instruction:
content: Enable the RendererScheduler by default.
BUG=391005
Review URL: https://codereview.chromium.org/704933002
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#303625}
## Code After:
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/renderer/scheduler/renderer_scheduler.h"
#include "base/command_line.h"
#include "base/message_loop/message_loop_proxy.h"
#include "content/public/common/content_switches.h"
#include "content/renderer/scheduler/null_renderer_scheduler.h"
#include "content/renderer/scheduler/renderer_scheduler_impl.h"
namespace content {
RendererScheduler::RendererScheduler() {
}
RendererScheduler::~RendererScheduler() {
}
// static
scoped_ptr<RendererScheduler> RendererScheduler::Create() {
CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kDisableBlinkScheduler)) {
return make_scoped_ptr(new NullRendererScheduler());
} else {
return make_scoped_ptr(
new RendererSchedulerImpl(base::MessageLoopProxy::current()));
}
}
} // namespace content
| // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/renderer/scheduler/renderer_scheduler.h"
+ #include "base/command_line.h"
+ #include "base/message_loop/message_loop_proxy.h"
+ #include "content/public/common/content_switches.h"
#include "content/renderer/scheduler/null_renderer_scheduler.h"
+ #include "content/renderer/scheduler/renderer_scheduler_impl.h"
namespace content {
RendererScheduler::RendererScheduler() {
}
RendererScheduler::~RendererScheduler() {
}
// static
scoped_ptr<RendererScheduler> RendererScheduler::Create() {
- // TODO(rmcilroy): Use the RendererSchedulerImpl when the scheduler is enabled
+ CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kDisableBlinkScheduler)) {
- return make_scoped_ptr(new NullRendererScheduler());
+ return make_scoped_ptr(new NullRendererScheduler());
? ++
+ } else {
+ return make_scoped_ptr(
+ new RendererSchedulerImpl(base::MessageLoopProxy::current()));
+ }
}
} // namespace content | 13 | 0.565217 | 11 | 2 |
e39127b59dc90b5aa5af6816013b4b01f4db3c73 | js/app.js | js/app.js | App = Ember.Application.create();
App.Router.map(function() {
this.resource('games');
this.resource('players', function() {
this.resource('player', { path: ':player_id' });
});
});
App.PlayersRoute = Ember.Route.extend({
model: function() {
var i = 0;
return $.getJSON('http://localhost:8080/').then(function(data) {
players = data.Players.map(function(player) {
i += 1;
player = {
id: i.toString(),
name: player
};
return player;
});
return players;
});
}
});
App.PlayerRoute = Ember.Route.extend({
model: function(params) {
return players.findBy('id', params.player_id);
}
});
App.PlayerController = Ember.ObjectController.extend({
isEditing: false,
actions: {
edit: function() {
this.set('isEditing', true);
},
doneEditing: function() {
this.set('isEditing', false);
}
}
});
var players = {};
| App = Ember.Application.create();
App.Router.map(function() {
this.resource('games');
this.resource('players', function() {
this.resource('player', { path: ':player_id' });
});
});
App.PlayersRoute = Ember.Route.extend({
model: function() {
var i = 0;
return $.getJSON('http://localhost:8080/players').then(function(data) {
players = data.map(function(player) {
console.log(player);
var p = {};
// Translate from serialized golang public fields
p.id = player.Id.toString();
p.name = player.Name
console.log(p);
return p;
});
return players;
});
}
});
App.PlayerRoute = Ember.Route.extend({
model: function(params) {
return players.findBy('id', params.player_id);
}
});
App.PlayerController = Ember.ObjectController.extend({
isEditing: false,
actions: {
edit: function() {
this.set('isEditing', true);
},
doneEditing: function() {
this.set('isEditing', false);
}
}
});
var players = {};
| Use new player API that describes complete object and is in good namespace | Use new player API that describes complete object and is in good namespace
| JavaScript | mit | rkbodenner/goboard,rkbodenner/goboard,rkbodenner/goboard | javascript | ## Code Before:
App = Ember.Application.create();
App.Router.map(function() {
this.resource('games');
this.resource('players', function() {
this.resource('player', { path: ':player_id' });
});
});
App.PlayersRoute = Ember.Route.extend({
model: function() {
var i = 0;
return $.getJSON('http://localhost:8080/').then(function(data) {
players = data.Players.map(function(player) {
i += 1;
player = {
id: i.toString(),
name: player
};
return player;
});
return players;
});
}
});
App.PlayerRoute = Ember.Route.extend({
model: function(params) {
return players.findBy('id', params.player_id);
}
});
App.PlayerController = Ember.ObjectController.extend({
isEditing: false,
actions: {
edit: function() {
this.set('isEditing', true);
},
doneEditing: function() {
this.set('isEditing', false);
}
}
});
var players = {};
## Instruction:
Use new player API that describes complete object and is in good namespace
## Code After:
App = Ember.Application.create();
App.Router.map(function() {
this.resource('games');
this.resource('players', function() {
this.resource('player', { path: ':player_id' });
});
});
App.PlayersRoute = Ember.Route.extend({
model: function() {
var i = 0;
return $.getJSON('http://localhost:8080/players').then(function(data) {
players = data.map(function(player) {
console.log(player);
var p = {};
// Translate from serialized golang public fields
p.id = player.Id.toString();
p.name = player.Name
console.log(p);
return p;
});
return players;
});
}
});
App.PlayerRoute = Ember.Route.extend({
model: function(params) {
return players.findBy('id', params.player_id);
}
});
App.PlayerController = Ember.ObjectController.extend({
isEditing: false,
actions: {
edit: function() {
this.set('isEditing', true);
},
doneEditing: function() {
this.set('isEditing', false);
}
}
});
var players = {};
| App = Ember.Application.create();
App.Router.map(function() {
this.resource('games');
this.resource('players', function() {
this.resource('player', { path: ':player_id' });
});
});
App.PlayersRoute = Ember.Route.extend({
model: function() {
var i = 0;
- return $.getJSON('http://localhost:8080/').then(function(data) {
+ return $.getJSON('http://localhost:8080/players').then(function(data) {
? +++++++
- players = data.Players.map(function(player) {
? --------
+ players = data.map(function(player) {
- i += 1;
- player = {
- id: i.toString(),
+ console.log(player);
+ var p = {};
+ // Translate from serialized golang public fields
+ p.id = player.Id.toString();
- name: player
? ^^ ^
+ p.name = player.Name
? ^^ ^^ +++++
- };
+ console.log(p);
- return player;
? -----
+ return p;
});
return players;
});
}
});
App.PlayerRoute = Ember.Route.extend({
model: function(params) {
return players.findBy('id', params.player_id);
}
});
App.PlayerController = Ember.ObjectController.extend({
isEditing: false,
actions: {
edit: function() {
this.set('isEditing', true);
},
doneEditing: function() {
this.set('isEditing', false);
}
}
});
var players = {}; | 17 | 0.369565 | 9 | 8 |
aaa0a5cd4e401bde4fb3691dd4e6c70a5c61e031 | include/version.h | include/version.h | /*
* Author: Brendan Le Foll <brendan.le.foll@intel.com>
* Copyright (c) 2014 Intel Corporation.
*
* SPDX-License-Identifier: MIT
*/
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
const char* gVERSION;
const char* gVERSION_SHORT;
#ifdef __cplusplus
}
#endif
| /*
* Author: Brendan Le Foll <brendan.le.foll@intel.com>
* Copyright (c) 2014 Intel Corporation.
*
* SPDX-License-Identifier: MIT
*/
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
extern const char* gVERSION;
extern const char* gVERSION_SHORT;
#ifdef __cplusplus
}
#endif
| Declare gVERSION global as 'extern'. | include: Declare gVERSION global as 'extern'.
Fixes build with '-fno-common'.
Signed-off-by: Thomas Ingleby <bb80a585db4bdbe09547a7483d1a31841fd0e0e8@intel.com>
| C | mit | g-vidal/mraa,g-vidal/mraa,g-vidal/mraa,g-vidal/mraa,g-vidal/mraa | c | ## Code Before:
/*
* Author: Brendan Le Foll <brendan.le.foll@intel.com>
* Copyright (c) 2014 Intel Corporation.
*
* SPDX-License-Identifier: MIT
*/
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
const char* gVERSION;
const char* gVERSION_SHORT;
#ifdef __cplusplus
}
#endif
## Instruction:
include: Declare gVERSION global as 'extern'.
Fixes build with '-fno-common'.
Signed-off-by: Thomas Ingleby <bb80a585db4bdbe09547a7483d1a31841fd0e0e8@intel.com>
## Code After:
/*
* Author: Brendan Le Foll <brendan.le.foll@intel.com>
* Copyright (c) 2014 Intel Corporation.
*
* SPDX-License-Identifier: MIT
*/
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
extern const char* gVERSION;
extern const char* gVERSION_SHORT;
#ifdef __cplusplus
}
#endif
| /*
* Author: Brendan Le Foll <brendan.le.foll@intel.com>
* Copyright (c) 2014 Intel Corporation.
*
* SPDX-License-Identifier: MIT
*/
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
- const char* gVERSION;
+ extern const char* gVERSION;
? +++++++
- const char* gVERSION_SHORT;
+ extern const char* gVERSION_SHORT;
? +++++++
#ifdef __cplusplus
}
#endif | 4 | 0.210526 | 2 | 2 |
cc0389f69d0331eb92baca5133baea32eb96eb97 | components/HorizontalRule.tsx | components/HorizontalRule.tsx | import { Fragment } from "react"
const HorizontalRule = () => (
<Fragment>
<hr></hr>
<style jsx>{`
hr {
margin: 8px 0;
height: 1px;
border: 0;
background-image: linear-gradient(
to left,
rgba(84, 84, 88, 0.35),
rgba(84, 84, 88, 1),
rgba(84, 84, 88, 0.35)
);
}
@media (prefers-color-scheme: light) {
hr {
background-image: linear-gradient(
to left,
rgba(1, 1, 1, 0),
rgba(1, 1, 1, 0.75),
rgba(1, 1, 1, 0)
);
}
}
`}</style>
</Fragment>
)
export default HorizontalRule
| import { Fragment } from "react"
const HorizontalRule = () => (
<Fragment>
<hr></hr>
<style jsx>{`
hr {
margin: 8px 0;
height: 1px;
border: 0;
background-image: linear-gradient(
to left,
rgba(84, 84, 88, 0.35),
rgba(84, 84, 88, 1),
rgba(84, 84, 88, 0.35)
);
}
@media (min-resolution: 2dppx) {
hr {
height: 0.5px;
}
}
@media (min-resolution: 3dppx) {
hr {
height: calc(1/3)px;
}
}
@media (prefers-color-scheme: light) {
hr {
background-image: linear-gradient(
to left,
rgba(1, 1, 1, 0),
rgba(1, 1, 1, 0.75),
rgba(1, 1, 1, 0)
);
}
}
`}</style>
</Fragment>
)
export default HorizontalRule
| Update `HorizonalRule` to be hairline height | Update `HorizonalRule` to be hairline height
| TypeScript | mit | JosephDuffy/josephduffy.co.uk,JosephDuffy/josephduffy.co.uk,JosephDuffy/josephduffy.co.uk | typescript | ## Code Before:
import { Fragment } from "react"
const HorizontalRule = () => (
<Fragment>
<hr></hr>
<style jsx>{`
hr {
margin: 8px 0;
height: 1px;
border: 0;
background-image: linear-gradient(
to left,
rgba(84, 84, 88, 0.35),
rgba(84, 84, 88, 1),
rgba(84, 84, 88, 0.35)
);
}
@media (prefers-color-scheme: light) {
hr {
background-image: linear-gradient(
to left,
rgba(1, 1, 1, 0),
rgba(1, 1, 1, 0.75),
rgba(1, 1, 1, 0)
);
}
}
`}</style>
</Fragment>
)
export default HorizontalRule
## Instruction:
Update `HorizonalRule` to be hairline height
## Code After:
import { Fragment } from "react"
const HorizontalRule = () => (
<Fragment>
<hr></hr>
<style jsx>{`
hr {
margin: 8px 0;
height: 1px;
border: 0;
background-image: linear-gradient(
to left,
rgba(84, 84, 88, 0.35),
rgba(84, 84, 88, 1),
rgba(84, 84, 88, 0.35)
);
}
@media (min-resolution: 2dppx) {
hr {
height: 0.5px;
}
}
@media (min-resolution: 3dppx) {
hr {
height: calc(1/3)px;
}
}
@media (prefers-color-scheme: light) {
hr {
background-image: linear-gradient(
to left,
rgba(1, 1, 1, 0),
rgba(1, 1, 1, 0.75),
rgba(1, 1, 1, 0)
);
}
}
`}</style>
</Fragment>
)
export default HorizontalRule
| import { Fragment } from "react"
const HorizontalRule = () => (
<Fragment>
<hr></hr>
<style jsx>{`
hr {
margin: 8px 0;
height: 1px;
border: 0;
background-image: linear-gradient(
to left,
rgba(84, 84, 88, 0.35),
rgba(84, 84, 88, 1),
rgba(84, 84, 88, 0.35)
);
}
+ @media (min-resolution: 2dppx) {
+ hr {
+ height: 0.5px;
+ }
+ }
+
+ @media (min-resolution: 3dppx) {
+ hr {
+ height: calc(1/3)px;
+ }
+ }
+
@media (prefers-color-scheme: light) {
hr {
background-image: linear-gradient(
to left,
rgba(1, 1, 1, 0),
rgba(1, 1, 1, 0.75),
rgba(1, 1, 1, 0)
);
}
}
`}</style>
</Fragment>
)
export default HorizontalRule | 12 | 0.363636 | 12 | 0 |
b8ed4cca33d3d7991c952b1e0aa8a02b85d7a489 | README.md | README.md | Baseball Workbench is an upcoming Web-based tool for Sabermetrics research.
The software for Baseball Workbench will be open-source, and will integrate with freely available data sources.
The hosted tool will have associated infrastructure costs, but we may look to offset these with sponsors,
ads, or fees at some point.
## Release Date
The "Alpha" version of Baseball Workbench will be released by MLB Opening Day 2017 (April 2).
## Get development updates
If you're a Github user, "Watch" this project to get updates.
You can also join the Google Group:
https://groups.google.com/forum/#!forum/btr-baseball
## Check out the website
This simple site also describes the project, in lieu of the live site due April 2:
http://bryantrobbins.github.io/baseball/
| Baseball Workbench is an upcoming Web-based tool for Sabermetrics research.
The software for Baseball Workbench will be open-source, and will integrate with freely available data sources.
The hosted tool will have associated infrastructure costs, but we may look to offset these with sponsors,
ads, or fees at some point.
## Release Date
The "Alpha" version of Baseball Workbench will be released by MLB Opening Day 2017 (April 2).
## Get development updates
If you're a Github user, you can "Watch" this project to get updates.
You can also check out the content on the [Github Wiki](https://github.com/bryantrobbins/baseball/wiki).
## Check out the website
This simple site also describes the project, in lieu of the live site due April 2:
http://bryantrobbins.github.io/baseball/
| Replace google group link with wiki link | Replace google group link with wiki link
| Markdown | apache-2.0 | bryantrobbins/baseball,bryantrobbins/baseball,bryantrobbins/baseball,bryantrobbins/baseball,bryantrobbins/baseball | markdown | ## Code Before:
Baseball Workbench is an upcoming Web-based tool for Sabermetrics research.
The software for Baseball Workbench will be open-source, and will integrate with freely available data sources.
The hosted tool will have associated infrastructure costs, but we may look to offset these with sponsors,
ads, or fees at some point.
## Release Date
The "Alpha" version of Baseball Workbench will be released by MLB Opening Day 2017 (April 2).
## Get development updates
If you're a Github user, "Watch" this project to get updates.
You can also join the Google Group:
https://groups.google.com/forum/#!forum/btr-baseball
## Check out the website
This simple site also describes the project, in lieu of the live site due April 2:
http://bryantrobbins.github.io/baseball/
## Instruction:
Replace google group link with wiki link
## Code After:
Baseball Workbench is an upcoming Web-based tool for Sabermetrics research.
The software for Baseball Workbench will be open-source, and will integrate with freely available data sources.
The hosted tool will have associated infrastructure costs, but we may look to offset these with sponsors,
ads, or fees at some point.
## Release Date
The "Alpha" version of Baseball Workbench will be released by MLB Opening Day 2017 (April 2).
## Get development updates
If you're a Github user, you can "Watch" this project to get updates.
You can also check out the content on the [Github Wiki](https://github.com/bryantrobbins/baseball/wiki).
## Check out the website
This simple site also describes the project, in lieu of the live site due April 2:
http://bryantrobbins.github.io/baseball/
| Baseball Workbench is an upcoming Web-based tool for Sabermetrics research.
The software for Baseball Workbench will be open-source, and will integrate with freely available data sources.
The hosted tool will have associated infrastructure costs, but we may look to offset these with sponsors,
ads, or fees at some point.
## Release Date
The "Alpha" version of Baseball Workbench will be released by MLB Opening Day 2017 (April 2).
## Get development updates
- If you're a Github user, "Watch" this project to get updates.
+ If you're a Github user, you can "Watch" this project to get updates.
? ++++++++
+ You can also check out the content on the [Github Wiki](https://github.com/bryantrobbins/baseball/wiki).
- You can also join the Google Group:
- https://groups.google.com/forum/#!forum/btr-baseball
## Check out the website
This simple site also describes the project, in lieu of the live site due April 2:
http://bryantrobbins.github.io/baseball/ | 5 | 0.238095 | 2 | 3 |
5bc4f3be26ce421a3fb5a8cda8f99c7e50559442 | src/performance.js | src/performance.js | (function(){
'use strict';
if (document.readyState === 'complete') {
startCollect();
} else {
window.addEventListener('load', startCollect);
}
function startCollect() {
setTimeout(function() {
const l = performance.getEntriesByType('navigation')[0].toJSON();
if (l.duration > 0) {
// we have only 4 chars in our disposal including decimal point
var t = String((l.duration / 1000).toPrecision(3)).substring(0, 4);
chrome.runtime.sendMessage({time: t, timing: l});
}
}, 0);
}
})(); | (function(){
'use strict';
if (document.readyState === 'complete') {
startCollect();
} else {
window.addEventListener('load', startCollect);
}
function startCollect() {
setTimeout(function() {
const l = performance.getEntriesByType('navigation')[0].toJSON();
if (l.duration > 0) {
// we have only 4 chars in our disposal including decimal point
var t = (l.duration / 1000).toFixed(2);
chrome.runtime.sendMessage({time: t, timing: l});
}
}, 0);
}
})(); | Fix rounding in the toolbar | Fix rounding in the toolbar
| JavaScript | mit | alex-vv/chrome-load-timer,alex-vv/chrome-load-timer | javascript | ## Code Before:
(function(){
'use strict';
if (document.readyState === 'complete') {
startCollect();
} else {
window.addEventListener('load', startCollect);
}
function startCollect() {
setTimeout(function() {
const l = performance.getEntriesByType('navigation')[0].toJSON();
if (l.duration > 0) {
// we have only 4 chars in our disposal including decimal point
var t = String((l.duration / 1000).toPrecision(3)).substring(0, 4);
chrome.runtime.sendMessage({time: t, timing: l});
}
}, 0);
}
})();
## Instruction:
Fix rounding in the toolbar
## Code After:
(function(){
'use strict';
if (document.readyState === 'complete') {
startCollect();
} else {
window.addEventListener('load', startCollect);
}
function startCollect() {
setTimeout(function() {
const l = performance.getEntriesByType('navigation')[0].toJSON();
if (l.duration > 0) {
// we have only 4 chars in our disposal including decimal point
var t = (l.duration / 1000).toFixed(2);
chrome.runtime.sendMessage({time: t, timing: l});
}
}, 0);
}
})(); | (function(){
'use strict';
if (document.readyState === 'complete') {
startCollect();
} else {
window.addEventListener('load', startCollect);
}
function startCollect() {
setTimeout(function() {
const l = performance.getEntriesByType('navigation')[0].toJSON();
if (l.duration > 0) {
// we have only 4 chars in our disposal including decimal point
- var t = String((l.duration / 1000).toPrecision(3)).substring(0, 4);
+ var t = (l.duration / 1000).toFixed(2);
chrome.runtime.sendMessage({time: t, timing: l});
}
}, 0);
}
})(); | 2 | 0.1 | 1 | 1 |
34add1d6227afb3a699f1f4176a5970c6f8edd3f | src/jsReload.php | src/jsReload.php | <?php
namespace atk4\ui;
/**
* This class generates action, that will be able to loop-back to the callback method.
*/
class jsReload implements jsExpressionable
{
public $view = null;
public $cb = null;
public function __construct($view)
{
$this->view = $view;
$this->cb = $this->view->add(new Callback('reload'));
$this->cb->set(function () {
echo $this->view->render();
$this->view->app->run_called = true; // prevent shutdown function from triggering.
exit;
});
}
public function jsRender()
{
// Temporarily here
//$r = new jsExpression('document.location=[]', [$this->cb->getURL()]);
// Works but not ideal! Proof of concept!
$r = (new jQuery($this->view))->load($this->cb->getURL());
return $r->jsRender();
}
}
| <?php
namespace atk4\ui;
/**
* This class generates action, that will be able to loop-back to the callback method.
*/
class jsReload implements jsExpressionable
{
public $view = null;
public $cb = null;
public function __construct($view)
{
$this->view = $view;
$this->cb = $this->view->add(new Callback('reload'));
$this->cb->set(function () {
echo $this->view->render();
$this->view->app->run_called = true; // prevent shutdown function from triggering.
exit;
});
}
public function jsRender()
{
$addSpinner = (new jQuery($this->view))->text('')->append("<div class='ui active loader inline'></div>");
$getRequest = (new jQuery())->get($this->cb->getURL(), '', new jsFunction(['data'], [
(new jQuery($this->view))->replaceWith(new jsExpression("data"))
]));
$final = new jsChain();
$final->_constructorArgs = [$addSpinner, $getRequest];
return $final->jsRender();
}
}
| Add functionality in order to reload in-place | Add functionality in order to reload in-place
| PHP | mit | atk4/ui,atk4/ui,atk4/ui | php | ## Code Before:
<?php
namespace atk4\ui;
/**
* This class generates action, that will be able to loop-back to the callback method.
*/
class jsReload implements jsExpressionable
{
public $view = null;
public $cb = null;
public function __construct($view)
{
$this->view = $view;
$this->cb = $this->view->add(new Callback('reload'));
$this->cb->set(function () {
echo $this->view->render();
$this->view->app->run_called = true; // prevent shutdown function from triggering.
exit;
});
}
public function jsRender()
{
// Temporarily here
//$r = new jsExpression('document.location=[]', [$this->cb->getURL()]);
// Works but not ideal! Proof of concept!
$r = (new jQuery($this->view))->load($this->cb->getURL());
return $r->jsRender();
}
}
## Instruction:
Add functionality in order to reload in-place
## Code After:
<?php
namespace atk4\ui;
/**
* This class generates action, that will be able to loop-back to the callback method.
*/
class jsReload implements jsExpressionable
{
public $view = null;
public $cb = null;
public function __construct($view)
{
$this->view = $view;
$this->cb = $this->view->add(new Callback('reload'));
$this->cb->set(function () {
echo $this->view->render();
$this->view->app->run_called = true; // prevent shutdown function from triggering.
exit;
});
}
public function jsRender()
{
$addSpinner = (new jQuery($this->view))->text('')->append("<div class='ui active loader inline'></div>");
$getRequest = (new jQuery())->get($this->cb->getURL(), '', new jsFunction(['data'], [
(new jQuery($this->view))->replaceWith(new jsExpression("data"))
]));
$final = new jsChain();
$final->_constructorArgs = [$addSpinner, $getRequest];
return $final->jsRender();
}
}
| <?php
namespace atk4\ui;
/**
* This class generates action, that will be able to loop-back to the callback method.
*/
class jsReload implements jsExpressionable
{
public $view = null;
public $cb = null;
public function __construct($view)
{
$this->view = $view;
$this->cb = $this->view->add(new Callback('reload'));
$this->cb->set(function () {
echo $this->view->render();
$this->view->app->run_called = true; // prevent shutdown function from triggering.
exit;
});
}
public function jsRender()
{
+ $addSpinner = (new jQuery($this->view))->text('')->append("<div class='ui active loader inline'></div>");
- // Temporarily here
- //$r = new jsExpression('document.location=[]', [$this->cb->getURL()]);
+ $getRequest = (new jQuery())->get($this->cb->getURL(), '', new jsFunction(['data'], [
+ (new jQuery($this->view))->replaceWith(new jsExpression("data"))
+ ]));
- // Works but not ideal! Proof of concept!
- $r = (new jQuery($this->view))->load($this->cb->getURL());
+ $final = new jsChain();
+ $final->_constructorArgs = [$addSpinner, $getRequest];
- return $r->jsRender();
? ^
+ return $final->jsRender();
? ^^^^^
}
} | 12 | 0.315789 | 7 | 5 |
e3b4c84b2a650bd0a8817b6c48d9a95842c2679e | src/oc/storage/db/migrations/1582043152198_bookmarks_cleanup.edn | src/oc/storage/db/migrations/1582043152198_bookmarks_cleanup.edn | (ns oc.storage.db.migrations.bookmarks-cleanup
(:require [rethinkdb.query :as r]
[oc.lib.db.migrations :as m]
[oc.storage.config :as config]
[oc.lib.db.common :as db-common]
[oc.storage.resources.entry :as entry]
[oc.storage.resources.board :as board]))
(defn- delete-follow-ups [conn]
(println "Remove all :follow-ups values from the existing entries.")
(-> (r/table entry/table-name)
(r/replace (r/fn [e]
(r/without e [:follow-ups])))
(r/run conn)))
(defn up [conn]
(delete-follow-ups conn)
(println "Removing follow-ups multi index:")
(println (m/remove-index conn entry/table-name "org-uuid-status-follow-ups-completed?-assignee-user-id-map-multi"))
true) ; return true on success | (ns oc.storage.db.migrations.bookmarks-cleanup
(:require [rethinkdb.query :as r]
[oc.lib.db.migrations :as m]
[oc.storage.config :as config]
[oc.lib.db.common :as db-common]
[oc.storage.resources.entry :as entry]
[oc.storage.resources.board :as board]))
(defn- delete-follow-ups [conn]
(println "Remove all :follow-ups values from the existing entries.")
(println (-> (r/table entry/table-name)
(r/replace (r/fn [e]
(r/without e [:follow-ups])))
(r/run conn))))
(defn up [conn]
(delete-follow-ups conn)
(println "Removing follow-ups multi index:")
(println (m/remove-index conn entry/table-name "org-uuid-status-follow-ups-completed?-assignee-user-id-map-multi"))
true) ; return true on success | Print output of follow-ups property delete query. | Print output of follow-ups property delete query.
| edn | agpl-3.0 | open-company/open-company-storage | edn | ## Code Before:
(ns oc.storage.db.migrations.bookmarks-cleanup
(:require [rethinkdb.query :as r]
[oc.lib.db.migrations :as m]
[oc.storage.config :as config]
[oc.lib.db.common :as db-common]
[oc.storage.resources.entry :as entry]
[oc.storage.resources.board :as board]))
(defn- delete-follow-ups [conn]
(println "Remove all :follow-ups values from the existing entries.")
(-> (r/table entry/table-name)
(r/replace (r/fn [e]
(r/without e [:follow-ups])))
(r/run conn)))
(defn up [conn]
(delete-follow-ups conn)
(println "Removing follow-ups multi index:")
(println (m/remove-index conn entry/table-name "org-uuid-status-follow-ups-completed?-assignee-user-id-map-multi"))
true) ; return true on success
## Instruction:
Print output of follow-ups property delete query.
## Code After:
(ns oc.storage.db.migrations.bookmarks-cleanup
(:require [rethinkdb.query :as r]
[oc.lib.db.migrations :as m]
[oc.storage.config :as config]
[oc.lib.db.common :as db-common]
[oc.storage.resources.entry :as entry]
[oc.storage.resources.board :as board]))
(defn- delete-follow-ups [conn]
(println "Remove all :follow-ups values from the existing entries.")
(println (-> (r/table entry/table-name)
(r/replace (r/fn [e]
(r/without e [:follow-ups])))
(r/run conn))))
(defn up [conn]
(delete-follow-ups conn)
(println "Removing follow-ups multi index:")
(println (m/remove-index conn entry/table-name "org-uuid-status-follow-ups-completed?-assignee-user-id-map-multi"))
true) ; return true on success | (ns oc.storage.db.migrations.bookmarks-cleanup
(:require [rethinkdb.query :as r]
[oc.lib.db.migrations :as m]
[oc.storage.config :as config]
[oc.lib.db.common :as db-common]
[oc.storage.resources.entry :as entry]
[oc.storage.resources.board :as board]))
(defn- delete-follow-ups [conn]
(println "Remove all :follow-ups values from the existing entries.")
- (-> (r/table entry/table-name)
+ (println (-> (r/table entry/table-name)
? +++++++++
- (r/replace (r/fn [e]
+ (r/replace (r/fn [e]
? ++++++++
- (r/without e [:follow-ups])))
+ (r/without e [:follow-ups])))
? ++++++++
- (r/run conn)))
+ (r/run conn))))
? ++++++++ +
(defn up [conn]
(delete-follow-ups conn)
(println "Removing follow-ups multi index:")
(println (m/remove-index conn entry/table-name "org-uuid-status-follow-ups-completed?-assignee-user-id-map-multi"))
true) ; return true on success | 8 | 0.4 | 4 | 4 |
8a6dd20e8f7edd34974f10a7fc8daa4be4766a7b | src/services/player.service.ts | src/services/player.service.ts | import {Injectable} from "@angular/core";
import {Player} from "../models/player.model";
import {Headers, Http} from "@angular/http";
@Injectable()
export class PlayerService{
player1: Player;
player2: Player;
constructor(private http: Http){};
getPlayers(){
let url = 'http://localhost:4000/players';
return this.http.get(url)
.map(res => res.json());
}
setPlayer1(player1: Player){
this.player1 = player1;
}
setPlayer2(player2: Player){
this.player2 = player2;
}
getPlayer1(){
return this.player1;
}
getPlayer2(){
return this.player2;
}
savePlayer(player: Player){
let headers = new Headers();
headers.append('Content-Type', 'application/json');
let url = 'http://localhost:4000/players/savePlayer';
return this.http.post(url, JSON.stringify(player), {headers: headers})
.map(res => res.json());
}
addNewPlayer(name: string){
let nameObject = {name: name};
let headers = new Headers();
headers.append('Content-Type', 'application/json');
let url = 'http://localhost:4000/players/addPlayer';
return this.http.post(url, JSON.stringify(nameObject), {headers: headers})
.map(res => res.json());
}
}
| import {Injectable} from "@angular/core";
import {Player} from "../models/player.model";
import {Headers, Http} from "@angular/http";
@Injectable()
export class PlayerService{
player1: Player;
player2: Player;
API_URL = 'http://192.168.1.3:4000';
constructor(private http: Http){};
getPlayers(){
let url = this.API_URL + '/players';
return this.http.get(url)
.map(res => res.json());
}
setPlayer1(player1: Player){
this.player1 = player1;
}
setPlayer2(player2: Player){
this.player2 = player2;
}
getPlayer1(){
return this.player1;
}
getPlayer2(){
return this.player2;
}
savePlayer(player: Player){
let headers = new Headers();
headers.append('Content-Type', 'application/json');
let url = this.API_URL + '/players/savePlayer';
return this.http.post(url, JSON.stringify(player), {headers: headers})
.map(res => res.json());
}
addNewPlayer(name: string){
let nameObject = {name: name};
let headers = new Headers();
headers.append('Content-Type', 'application/json');
let url = this.API_URL + '/players/addPlayer';
return this.http.post(url, JSON.stringify(nameObject), {headers: headers})
.map(res => res.json());
}
}
| Refactor url address to a single variable | Refactor url address to a single variable
| TypeScript | mit | casperchia/foosmate,casperchia/foosmate,casperchia/foosmate | typescript | ## Code Before:
import {Injectable} from "@angular/core";
import {Player} from "../models/player.model";
import {Headers, Http} from "@angular/http";
@Injectable()
export class PlayerService{
player1: Player;
player2: Player;
constructor(private http: Http){};
getPlayers(){
let url = 'http://localhost:4000/players';
return this.http.get(url)
.map(res => res.json());
}
setPlayer1(player1: Player){
this.player1 = player1;
}
setPlayer2(player2: Player){
this.player2 = player2;
}
getPlayer1(){
return this.player1;
}
getPlayer2(){
return this.player2;
}
savePlayer(player: Player){
let headers = new Headers();
headers.append('Content-Type', 'application/json');
let url = 'http://localhost:4000/players/savePlayer';
return this.http.post(url, JSON.stringify(player), {headers: headers})
.map(res => res.json());
}
addNewPlayer(name: string){
let nameObject = {name: name};
let headers = new Headers();
headers.append('Content-Type', 'application/json');
let url = 'http://localhost:4000/players/addPlayer';
return this.http.post(url, JSON.stringify(nameObject), {headers: headers})
.map(res => res.json());
}
}
## Instruction:
Refactor url address to a single variable
## Code After:
import {Injectable} from "@angular/core";
import {Player} from "../models/player.model";
import {Headers, Http} from "@angular/http";
@Injectable()
export class PlayerService{
player1: Player;
player2: Player;
API_URL = 'http://192.168.1.3:4000';
constructor(private http: Http){};
getPlayers(){
let url = this.API_URL + '/players';
return this.http.get(url)
.map(res => res.json());
}
setPlayer1(player1: Player){
this.player1 = player1;
}
setPlayer2(player2: Player){
this.player2 = player2;
}
getPlayer1(){
return this.player1;
}
getPlayer2(){
return this.player2;
}
savePlayer(player: Player){
let headers = new Headers();
headers.append('Content-Type', 'application/json');
let url = this.API_URL + '/players/savePlayer';
return this.http.post(url, JSON.stringify(player), {headers: headers})
.map(res => res.json());
}
addNewPlayer(name: string){
let nameObject = {name: name};
let headers = new Headers();
headers.append('Content-Type', 'application/json');
let url = this.API_URL + '/players/addPlayer';
return this.http.post(url, JSON.stringify(nameObject), {headers: headers})
.map(res => res.json());
}
}
| import {Injectable} from "@angular/core";
import {Player} from "../models/player.model";
import {Headers, Http} from "@angular/http";
@Injectable()
export class PlayerService{
player1: Player;
player2: Player;
-
+ API_URL = 'http://192.168.1.3:4000';
constructor(private http: Http){};
getPlayers(){
- let url = 'http://localhost:4000/players';
+ let url = this.API_URL + '/players';
return this.http.get(url)
.map(res => res.json());
}
setPlayer1(player1: Player){
this.player1 = player1;
}
setPlayer2(player2: Player){
this.player2 = player2;
}
getPlayer1(){
return this.player1;
}
getPlayer2(){
return this.player2;
}
savePlayer(player: Player){
let headers = new Headers();
headers.append('Content-Type', 'application/json');
- let url = 'http://localhost:4000/players/savePlayer';
+ let url = this.API_URL + '/players/savePlayer';
return this.http.post(url, JSON.stringify(player), {headers: headers})
.map(res => res.json());
}
addNewPlayer(name: string){
let nameObject = {name: name};
let headers = new Headers();
headers.append('Content-Type', 'application/json');
- let url = 'http://localhost:4000/players/addPlayer';
+ let url = this.API_URL + '/players/addPlayer';
return this.http.post(url, JSON.stringify(nameObject), {headers: headers})
.map(res => res.json());
}
} | 8 | 0.156863 | 4 | 4 |
eed22f7ee7c4e8aa71ddbdcaf538c8ff9f2a7fbb | .travis.yml | .travis.yml | language: ruby
rvm:
- 2.4.1
- 2.3.3
- 2.2.6
- 2.1.10
cache: bundler
install: bundle install
script:
- bundle exec rubocop
- bundle exec rspec
matrix:
allow_failures:
- rvm: 2.1.10 | language: ruby
rvm:
- 2.4.2
- 2.3.5
- 2.2.8
cache: bundler
install: bundle install
script:
- bundle exec rubocop
- bundle exec rspec
| Update latest Ruby versions on Travis | Update latest Ruby versions on Travis
| YAML | mit | picandocodigo/administrate-field-paperclip,picandocodigo/administrate-field-paperclip | yaml | ## Code Before:
language: ruby
rvm:
- 2.4.1
- 2.3.3
- 2.2.6
- 2.1.10
cache: bundler
install: bundle install
script:
- bundle exec rubocop
- bundle exec rspec
matrix:
allow_failures:
- rvm: 2.1.10
## Instruction:
Update latest Ruby versions on Travis
## Code After:
language: ruby
rvm:
- 2.4.2
- 2.3.5
- 2.2.8
cache: bundler
install: bundle install
script:
- bundle exec rubocop
- bundle exec rspec
| language: ruby
rvm:
- - 2.4.1
? ^
+ - 2.4.2
? ^
- - 2.3.3
? ^
+ - 2.3.5
? ^
- - 2.2.6
? ^
+ - 2.2.8
? ^
- - 2.1.10
cache: bundler
install: bundle install
script:
- bundle exec rubocop
- bundle exec rspec
- matrix:
- allow_failures:
- - rvm: 2.1.10 | 10 | 0.714286 | 3 | 7 |
349daf37c3777d949654cec2286edecf0fb70edf | mandelbrot/README.md | mandelbrot/README.md |
This is an image-parallel Mandelbrot renderer written with Charm++. Each chare is responsible
for a tile in the image, so the rendering can be distributed image-parallel across the processes.
## Arguments
- `--tile W H` specify the width and height of each tile.
- `--img W H` specify the width and height of the image in tiles.
- `--samples N` specify the number of subsamples to take for each pixel
## Multithreading Notes
To run with 1 threaded process per node you can also pass the `+ppn M` argument, specifying each node has M
cores. So for example on an 8 core machine running this mandelbrot example:
```
./charmrun ./mandelbrot.out +p 8 +ppn 8
```
Now Charm++ will run 8 processes in total with 8 lightweight thread "processes" per node, so the result
is one process with 8 threads used to compute the Mandelbrot set.
## Example
Here's the result from the default tile and image size parameters with 16 samples per pixel.

|
This is an image-parallel Mandelbrot renderer written with Charm++. Each chare is responsible
for a tile in the image, so the rendering can be distributed image-parallel across the processes.
## Arguments
- `--tile W H` specify the width and height of each tile.
- `--img W H` specify the width and height of the image in tiles.
- `--samples N` specify the number of subsamples to take for each pixel along each axis. The
actual number of samples taken will be the square of this value.
## Multithreading Notes
To run with 1 threaded process per node you can also pass the `+ppn M` argument, specifying each node has M
cores. So for example on an 8 core machine running this mandelbrot example:
```
./charmrun ./mandelbrot.out +p 8 +ppn 8
```
Now Charm++ will run 8 processes in total with 8 lightweight thread "processes" per node, so the result
is one process with 8 threads used to compute the Mandelbrot set.
## Example
Here's the result from the default tile and image size parameters with 16 samples per pixel.

| Update doc on samples argument | Update doc on samples argument
| Markdown | mit | Twinklebear/Charm-experiments,Twinklebear/Charm-experiments,Twinklebear/Charm-experiments | markdown | ## Code Before:
This is an image-parallel Mandelbrot renderer written with Charm++. Each chare is responsible
for a tile in the image, so the rendering can be distributed image-parallel across the processes.
## Arguments
- `--tile W H` specify the width and height of each tile.
- `--img W H` specify the width and height of the image in tiles.
- `--samples N` specify the number of subsamples to take for each pixel
## Multithreading Notes
To run with 1 threaded process per node you can also pass the `+ppn M` argument, specifying each node has M
cores. So for example on an 8 core machine running this mandelbrot example:
```
./charmrun ./mandelbrot.out +p 8 +ppn 8
```
Now Charm++ will run 8 processes in total with 8 lightweight thread "processes" per node, so the result
is one process with 8 threads used to compute the Mandelbrot set.
## Example
Here's the result from the default tile and image size parameters with 16 samples per pixel.

## Instruction:
Update doc on samples argument
## Code After:
This is an image-parallel Mandelbrot renderer written with Charm++. Each chare is responsible
for a tile in the image, so the rendering can be distributed image-parallel across the processes.
## Arguments
- `--tile W H` specify the width and height of each tile.
- `--img W H` specify the width and height of the image in tiles.
- `--samples N` specify the number of subsamples to take for each pixel along each axis. The
actual number of samples taken will be the square of this value.
## Multithreading Notes
To run with 1 threaded process per node you can also pass the `+ppn M` argument, specifying each node has M
cores. So for example on an 8 core machine running this mandelbrot example:
```
./charmrun ./mandelbrot.out +p 8 +ppn 8
```
Now Charm++ will run 8 processes in total with 8 lightweight thread "processes" per node, so the result
is one process with 8 threads used to compute the Mandelbrot set.
## Example
Here's the result from the default tile and image size parameters with 16 samples per pixel.

|
This is an image-parallel Mandelbrot renderer written with Charm++. Each chare is responsible
for a tile in the image, so the rendering can be distributed image-parallel across the processes.
## Arguments
- `--tile W H` specify the width and height of each tile.
- `--img W H` specify the width and height of the image in tiles.
- - `--samples N` specify the number of subsamples to take for each pixel
+ - `--samples N` specify the number of subsamples to take for each pixel along each axis. The
? +++++++++++++++++++++
+ actual number of samples taken will be the square of this value.
## Multithreading Notes
To run with 1 threaded process per node you can also pass the `+ppn M` argument, specifying each node has M
cores. So for example on an 8 core machine running this mandelbrot example:
```
./charmrun ./mandelbrot.out +p 8 +ppn 8
```
Now Charm++ will run 8 processes in total with 8 lightweight thread "processes" per node, so the result
is one process with 8 threads used to compute the Mandelbrot set.
## Example
Here's the result from the default tile and image size parameters with 16 samples per pixel.

| 3 | 0.107143 | 2 | 1 |
71f8eb8fbe9471c222c4aae35d61f852a55491b1 | testapp/app/controllers/users_controller.rb | testapp/app/controllers/users_controller.rb | class UsersController < ApplicationController
def index
User.create! :name => "Frank" unless User.first
redirect_to User.first
end
def show
@user = User.find params[:id]
respond_to do |type|
type.html
type.js {render :json => @user}
end
end
def update
@user = User.find params[:id]
if @user.update_attributes!(params[:user])
flash[:notice] = 'Person was successfully updated.'
format.html {redirect_to( @person )}
format.json {render :nothing => true}
# format.js # update.js.erb
else
format.html {render :action => :edit} # edit.html.erb
format.json {render :nothing => true}
format.js {render :action => :edit} # edit.js.erb
end
end
end | class UsersController < ApplicationController
def index
User.create! :name => "Frank" unless User.first
redirect_to User.first
end
def show
@user = User.find params[:id]
respond_to do |type|
type.html
type.json {render :json => @user}
end
end
def update
@user = User.find params[:id]
if @user.update_attributes!(params[:user])
flash[:notice] = 'Person was successfully updated.'
respond_to do |format|
format.html { redirect_to( @person ) }
format.json { render :nothing => true }
end
else
respond_to do |format|
format.html { render :action => :edit } # edit.html.erb
format.json { render :nothing => true }
end
end
end
end | Fix the UsersController in the testapp | Fix the UsersController in the testapp
| Ruby | mit | janv/rest_in_place,1uptalent/rest_in_place,1uptalent/rest_in_place,nberger/rest_in_place,janv/rest_in_place,janv/rest_in_place,nberger/rest_in_place | ruby | ## Code Before:
class UsersController < ApplicationController
def index
User.create! :name => "Frank" unless User.first
redirect_to User.first
end
def show
@user = User.find params[:id]
respond_to do |type|
type.html
type.js {render :json => @user}
end
end
def update
@user = User.find params[:id]
if @user.update_attributes!(params[:user])
flash[:notice] = 'Person was successfully updated.'
format.html {redirect_to( @person )}
format.json {render :nothing => true}
# format.js # update.js.erb
else
format.html {render :action => :edit} # edit.html.erb
format.json {render :nothing => true}
format.js {render :action => :edit} # edit.js.erb
end
end
end
## Instruction:
Fix the UsersController in the testapp
## Code After:
class UsersController < ApplicationController
def index
User.create! :name => "Frank" unless User.first
redirect_to User.first
end
def show
@user = User.find params[:id]
respond_to do |type|
type.html
type.json {render :json => @user}
end
end
def update
@user = User.find params[:id]
if @user.update_attributes!(params[:user])
flash[:notice] = 'Person was successfully updated.'
respond_to do |format|
format.html { redirect_to( @person ) }
format.json { render :nothing => true }
end
else
respond_to do |format|
format.html { render :action => :edit } # edit.html.erb
format.json { render :nothing => true }
end
end
end
end | class UsersController < ApplicationController
def index
User.create! :name => "Frank" unless User.first
redirect_to User.first
end
def show
@user = User.find params[:id]
respond_to do |type|
type.html
- type.js {render :json => @user}
+ type.json {render :json => @user}
? ++
end
end
def update
@user = User.find params[:id]
if @user.update_attributes!(params[:user])
- flash[:notice] = 'Person was successfully updated.'
? -
+ flash[:notice] = 'Person was successfully updated.'
+ respond_to do |format|
- format.html {redirect_to( @person )}
+ format.html { redirect_to( @person ) }
? + + ++
- format.json {render :nothing => true}
+ format.json { render :nothing => true }
? + + + +
- # format.js # update.js.erb
+ end
else
+ respond_to do |format|
- format.html {render :action => :edit} # edit.html.erb
+ format.html { render :action => :edit } # edit.html.erb
? ++ + + +
- format.json {render :nothing => true}
+ format.json { render :nothing => true }
? ++ + + +
- format.js {render :action => :edit} # edit.js.erb
+ end
end
end
end | 18 | 0.62069 | 10 | 8 |
3c4ab7694ea2a244e651a22ad7db51c15efb70b0 | .travis.yml | .travis.yml | language: python
python:
- 2.7
- 3.2
- 3.3
# command to run tests
script:
- python setup.py ptr
| language: python
python:
- 2.7
# disable 3.2 tests until Jinja is fixed (https://github.com/mitsuhiko/jinja2/pull/248)
# 3.2
- 3.3
# command to run tests
script:
- python setup.py ptr
| Disable tests on 3.2 until Jinja supports it | Disable tests on 3.2 until Jinja supports it
| YAML | mit | yougov/pmxbot,yougov/pmxbot,yougov/pmxbot | yaml | ## Code Before:
language: python
python:
- 2.7
- 3.2
- 3.3
# command to run tests
script:
- python setup.py ptr
## Instruction:
Disable tests on 3.2 until Jinja supports it
## Code After:
language: python
python:
- 2.7
# disable 3.2 tests until Jinja is fixed (https://github.com/mitsuhiko/jinja2/pull/248)
# 3.2
- 3.3
# command to run tests
script:
- python setup.py ptr
| language: python
python:
- 2.7
+ # disable 3.2 tests until Jinja is fixed (https://github.com/mitsuhiko/jinja2/pull/248)
- - 3.2
? ^
+ # 3.2
? ^
- 3.3
# command to run tests
script:
- python setup.py ptr | 3 | 0.375 | 2 | 1 |
0453806963d3424a888c6800bcef29b04887c47e | src/main/java/de/schlegel11/eventdispatcher/EventListenerWrapper.java | src/main/java/de/schlegel11/eventdispatcher/EventListenerWrapper.java | package de.schlegel11.eventdispatcher;
import java.util.EventListener;
import java.util.Objects;
/**
* Created by schlegel11 on 05.11.14.
*/
final class EventListenerWrapper {
public final static int INFINITE_CALLS = -1;
private final EventListener listener;
private final int maxCalls;
private int currentCalls;
public EventListenerWrapper(EventListener listener, int maxCalls) {
this.listener = listener;
this.maxCalls = maxCalls;
}
public EventListener getListener() {
return listener;
}
public int getMaxCalls() {
return maxCalls;
}
public int getCurrentCalls() {
return currentCalls;
}
public void addCurrentCalls(int currentCalls) {
this.currentCalls += currentCalls;
}
@Override
public int hashCode() {
return Objects.hash(listener);
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
final EventListenerWrapper other = (EventListenerWrapper) obj;
return Objects.equals(this.listener, other.listener);
}
}
| package de.schlegel11.eventdispatcher;
import java.util.EventListener;
import java.util.Objects;
/**
* Created by schlegel11 on 05.11.14.
*/
final class EventListenerWrapper {
public static final EventListenerWrapper DUMMY_ELW = new EventListenerWrapper();
public final static int INFINITE_CALLS = -1;
private final EventListener listener;
private final int maxCalls;
private int currentCalls;
public EventListenerWrapper(final EventListener listener, final int maxCalls) {
this.listener = listener;
this.maxCalls = maxCalls;
}
private EventListenerWrapper() {
this(null, 0);
}
public EventListener getListener() {
return listener;
}
public int getMaxCalls() {
return maxCalls;
}
public int getCurrentCalls() {
return currentCalls;
}
public void addCurrentCalls(final int currentCalls) {
this.currentCalls += currentCalls;
}
@Override
public int hashCode() {
return Objects.hash(listener);
}
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
final EventListenerWrapper other = (EventListenerWrapper) obj;
return Objects.equals(this.listener, other.listener);
}
}
| Add final modifier to method arguments. Add dummy object which represents an empty elw. | Add final modifier to method arguments.
Add dummy object which represents an empty elw.
| Java | mit | schlegel11/EventDispatcher | java | ## Code Before:
package de.schlegel11.eventdispatcher;
import java.util.EventListener;
import java.util.Objects;
/**
* Created by schlegel11 on 05.11.14.
*/
final class EventListenerWrapper {
public final static int INFINITE_CALLS = -1;
private final EventListener listener;
private final int maxCalls;
private int currentCalls;
public EventListenerWrapper(EventListener listener, int maxCalls) {
this.listener = listener;
this.maxCalls = maxCalls;
}
public EventListener getListener() {
return listener;
}
public int getMaxCalls() {
return maxCalls;
}
public int getCurrentCalls() {
return currentCalls;
}
public void addCurrentCalls(int currentCalls) {
this.currentCalls += currentCalls;
}
@Override
public int hashCode() {
return Objects.hash(listener);
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
final EventListenerWrapper other = (EventListenerWrapper) obj;
return Objects.equals(this.listener, other.listener);
}
}
## Instruction:
Add final modifier to method arguments.
Add dummy object which represents an empty elw.
## Code After:
package de.schlegel11.eventdispatcher;
import java.util.EventListener;
import java.util.Objects;
/**
* Created by schlegel11 on 05.11.14.
*/
final class EventListenerWrapper {
public static final EventListenerWrapper DUMMY_ELW = new EventListenerWrapper();
public final static int INFINITE_CALLS = -1;
private final EventListener listener;
private final int maxCalls;
private int currentCalls;
public EventListenerWrapper(final EventListener listener, final int maxCalls) {
this.listener = listener;
this.maxCalls = maxCalls;
}
private EventListenerWrapper() {
this(null, 0);
}
public EventListener getListener() {
return listener;
}
public int getMaxCalls() {
return maxCalls;
}
public int getCurrentCalls() {
return currentCalls;
}
public void addCurrentCalls(final int currentCalls) {
this.currentCalls += currentCalls;
}
@Override
public int hashCode() {
return Objects.hash(listener);
}
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
final EventListenerWrapper other = (EventListenerWrapper) obj;
return Objects.equals(this.listener, other.listener);
}
}
| package de.schlegel11.eventdispatcher;
import java.util.EventListener;
import java.util.Objects;
/**
* Created by schlegel11 on 05.11.14.
*/
final class EventListenerWrapper {
+ public static final EventListenerWrapper DUMMY_ELW = new EventListenerWrapper();
public final static int INFINITE_CALLS = -1;
private final EventListener listener;
private final int maxCalls;
private int currentCalls;
- public EventListenerWrapper(EventListener listener, int maxCalls) {
+ public EventListenerWrapper(final EventListener listener, final int maxCalls) {
? ++++++ ++++++
this.listener = listener;
this.maxCalls = maxCalls;
+ }
+
+ private EventListenerWrapper() {
+ this(null, 0);
}
public EventListener getListener() {
return listener;
}
public int getMaxCalls() {
return maxCalls;
}
public int getCurrentCalls() {
return currentCalls;
}
- public void addCurrentCalls(int currentCalls) {
+ public void addCurrentCalls(final int currentCalls) {
? ++++++
this.currentCalls += currentCalls;
}
@Override
public int hashCode() {
return Objects.hash(listener);
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
? ++++++
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
final EventListenerWrapper other = (EventListenerWrapper) obj;
return Objects.equals(this.listener, other.listener);
}
} | 11 | 0.207547 | 8 | 3 |
34e324c499b5fa0a420809fe3f407ddace522c2e | app/partials/partial1.html | app/partials/partial1.html | <div class="row">
<div class="columns" data-ng-controller="TodoCtrl">
<h1>To Do</h1>
<form data-ng-submit="addTask()">
<div class="row collapse">
<div class="small-10 columns">
<input type="text" data-ng-model="taskText" size="30"
placeholder="Add a new task."/>
</div>
<div class="small-2 columns">
<input class="button postfix" type="submit" value="Add"/>
</div>
</div>
</form>
<ul class="no-bullet">
<li data-ng-repeat="task in tasks">
<label class="done-{{task.done}}">
<input type="checkbox"
data-ng-model="task.done"
ng-change="update(task)"/>
{{task.text}}
</label>
</li>
</ul>
<form data-ng-submit="purge()">
<input class="button" type="submit" value="Clear Done"/>
</form>
</div>
</div>
| <div class="row">
<div class="columns" data-ng-controller="TodoCtrl">
<h1>To Do</h1>
<form data-ng-submit="addTask()">
<div class="row collapse">
<div class="small-10 columns">
<input type="text" data-ng-model="taskText" size="30"
placeholder="Add a new task."/>
</div>
<div class="small-2 columns">
<input class="button postfix" type="submit" value="Add"/>
</div>
</div>
</form>
<ul class="no-bullet">
<li data-ng-repeat="task in tasks">
<label class="done-{{task.done}}">
<input type="checkbox"
data-ng-model="task.done"
ng-change="update(task)"/>
{{task.text}}
</label>
</li>
</ul>
<p data-ng-hide="tasks.length">You do not have anything to do!</p>
<form data-ng-submit="purge()">
<input class="button" type="submit" value="Clear Done"/>
</form>
</div>
</div>
| Add text to display if there are no tasks. | Add text to display if there are no tasks.
| HTML | mit | a1russell/todo-list-angularjs | html | ## Code Before:
<div class="row">
<div class="columns" data-ng-controller="TodoCtrl">
<h1>To Do</h1>
<form data-ng-submit="addTask()">
<div class="row collapse">
<div class="small-10 columns">
<input type="text" data-ng-model="taskText" size="30"
placeholder="Add a new task."/>
</div>
<div class="small-2 columns">
<input class="button postfix" type="submit" value="Add"/>
</div>
</div>
</form>
<ul class="no-bullet">
<li data-ng-repeat="task in tasks">
<label class="done-{{task.done}}">
<input type="checkbox"
data-ng-model="task.done"
ng-change="update(task)"/>
{{task.text}}
</label>
</li>
</ul>
<form data-ng-submit="purge()">
<input class="button" type="submit" value="Clear Done"/>
</form>
</div>
</div>
## Instruction:
Add text to display if there are no tasks.
## Code After:
<div class="row">
<div class="columns" data-ng-controller="TodoCtrl">
<h1>To Do</h1>
<form data-ng-submit="addTask()">
<div class="row collapse">
<div class="small-10 columns">
<input type="text" data-ng-model="taskText" size="30"
placeholder="Add a new task."/>
</div>
<div class="small-2 columns">
<input class="button postfix" type="submit" value="Add"/>
</div>
</div>
</form>
<ul class="no-bullet">
<li data-ng-repeat="task in tasks">
<label class="done-{{task.done}}">
<input type="checkbox"
data-ng-model="task.done"
ng-change="update(task)"/>
{{task.text}}
</label>
</li>
</ul>
<p data-ng-hide="tasks.length">You do not have anything to do!</p>
<form data-ng-submit="purge()">
<input class="button" type="submit" value="Clear Done"/>
</form>
</div>
</div>
| <div class="row">
<div class="columns" data-ng-controller="TodoCtrl">
<h1>To Do</h1>
<form data-ng-submit="addTask()">
<div class="row collapse">
<div class="small-10 columns">
<input type="text" data-ng-model="taskText" size="30"
placeholder="Add a new task."/>
</div>
<div class="small-2 columns">
<input class="button postfix" type="submit" value="Add"/>
</div>
</div>
</form>
<ul class="no-bullet">
<li data-ng-repeat="task in tasks">
<label class="done-{{task.done}}">
<input type="checkbox"
data-ng-model="task.done"
ng-change="update(task)"/>
{{task.text}}
</label>
</li>
</ul>
+ <p data-ng-hide="tasks.length">You do not have anything to do!</p>
<form data-ng-submit="purge()">
<input class="button" type="submit" value="Clear Done"/>
</form>
</div>
</div> | 1 | 0.034483 | 1 | 0 |
2f2abbc51ef5895fb869937db826823fb5c24e5f | src/main/java/org/jabref/gui/errorconsole/ErrorConsole.css | src/main/java/org/jabref/gui/errorconsole/ErrorConsole.css | .list-content {
-fx-padding: 10px;
}
.info-section {
-fx-padding: 10px;
-fx-background-color: -fx-background;
}
.info-section .glyph-icon {
-fx-font-size: 24.0;
-fx-fill: -jr-icon
}
.exception .glyph-icon {
-fx-font-size: 18.0;
-fx-fill: -jr-error;
}
.log .glyph-icon {
-fx-font-size: 18.0;
-fx-fill: -jr-info;
}
.custom-buttons {
-fx-padding: 5px;
}
| .list-content {
-fx-padding: 10px;
}
.info-section {
-fx-padding: 10px;
-fx-background-color: -fx-background;
}
.info-section .glyph-icon {
-fx-font-size: 24.0;
}
.exception .glyph-icon {
-fx-font-size: 18.0;
-fx-fill: -jr-error;
}
.log .glyph-icon {
-fx-font-size: 18.0;
-fx-fill: -jr-info;
}
.custom-buttons {
-fx-padding: 5px;
}
| Fix css warning in error console | Fix css warning in error console
| CSS | mit | tobiasdiez/jabref,tobiasdiez/jabref,Siedlerchr/jabref,Siedlerchr/jabref,sauliusg/jabref,JabRef/jabref,zellerdev/jabref,sauliusg/jabref,JabRef/jabref,Siedlerchr/jabref,tobiasdiez/jabref,JabRef/jabref,sauliusg/jabref,Siedlerchr/jabref,zellerdev/jabref,zellerdev/jabref,zellerdev/jabref,zellerdev/jabref,JabRef/jabref,tobiasdiez/jabref,sauliusg/jabref | css | ## Code Before:
.list-content {
-fx-padding: 10px;
}
.info-section {
-fx-padding: 10px;
-fx-background-color: -fx-background;
}
.info-section .glyph-icon {
-fx-font-size: 24.0;
-fx-fill: -jr-icon
}
.exception .glyph-icon {
-fx-font-size: 18.0;
-fx-fill: -jr-error;
}
.log .glyph-icon {
-fx-font-size: 18.0;
-fx-fill: -jr-info;
}
.custom-buttons {
-fx-padding: 5px;
}
## Instruction:
Fix css warning in error console
## Code After:
.list-content {
-fx-padding: 10px;
}
.info-section {
-fx-padding: 10px;
-fx-background-color: -fx-background;
}
.info-section .glyph-icon {
-fx-font-size: 24.0;
}
.exception .glyph-icon {
-fx-font-size: 18.0;
-fx-fill: -jr-error;
}
.log .glyph-icon {
-fx-font-size: 18.0;
-fx-fill: -jr-info;
}
.custom-buttons {
-fx-padding: 5px;
}
| .list-content {
-fx-padding: 10px;
}
.info-section {
-fx-padding: 10px;
-fx-background-color: -fx-background;
}
.info-section .glyph-icon {
-fx-font-size: 24.0;
- -fx-fill: -jr-icon
}
.exception .glyph-icon {
-fx-font-size: 18.0;
-fx-fill: -jr-error;
}
-
.log .glyph-icon {
-fx-font-size: 18.0;
-fx-fill: -jr-info;
}
.custom-buttons {
-fx-padding: 5px;
} | 2 | 0.071429 | 0 | 2 |
697c3eb341b1d415b82038e0ec7a8c9d493b079f | lib/stmt/supervisor_permission.go | lib/stmt/supervisor_permission.go | /*-
* Copyright (c) 2016, 1&1 Internet SE
* All rights reserved
*/
package stmt
const LoadPermissions = `
SELECT permission_id,
permission_name
FROM soma.permissions;`
// vim: ts=4 sw=4 sts=4 noet fenc=utf-8 ffs=unix
| /*-
* Copyright (c) 2016, 1&1 Internet SE
* All rights reserved
*/
package stmt
const LoadPermissions = `
SELECT permission_id,
permission_name
FROM soma.permissions;`
const AddPermissionCategory = `
INSERT INTO soma.permission_types (
permission_type,
created_by
)
SELECT $1::varchar,
$2::uuid
WHERE NOT EXISTS (
SELECT permission_type
FROM soma.permission_types
WHERE permission_type = $1::varchar
);`
const DeletePermissionCategory = `
DELETE FROM soma.permission_types
WHERE permission_type = $1::varchar;`
const ListPermissionCategory = `
SELECT spt.permission_type
FROM soma.permission_types spt:`
const ShowPermissionCategory = `
SELECT spt.permission_type,
iu.user_uid,
spt.created_by
FROM soma.permission_types spt
JOIN inventory.users iu
ON spt.created_by = iu.user_id
WHERE spt.permission_type = $1::varchar;`
// vim: ts=4 sw=4 sts=4 noet fenc=utf-8 ffs=unix
| Add SQL statements for PermissionCategory | Add SQL statements for PermissionCategory
| Go | bsd-2-clause | 1and1/soma | go | ## Code Before:
/*-
* Copyright (c) 2016, 1&1 Internet SE
* All rights reserved
*/
package stmt
const LoadPermissions = `
SELECT permission_id,
permission_name
FROM soma.permissions;`
// vim: ts=4 sw=4 sts=4 noet fenc=utf-8 ffs=unix
## Instruction:
Add SQL statements for PermissionCategory
## Code After:
/*-
* Copyright (c) 2016, 1&1 Internet SE
* All rights reserved
*/
package stmt
const LoadPermissions = `
SELECT permission_id,
permission_name
FROM soma.permissions;`
const AddPermissionCategory = `
INSERT INTO soma.permission_types (
permission_type,
created_by
)
SELECT $1::varchar,
$2::uuid
WHERE NOT EXISTS (
SELECT permission_type
FROM soma.permission_types
WHERE permission_type = $1::varchar
);`
const DeletePermissionCategory = `
DELETE FROM soma.permission_types
WHERE permission_type = $1::varchar;`
const ListPermissionCategory = `
SELECT spt.permission_type
FROM soma.permission_types spt:`
const ShowPermissionCategory = `
SELECT spt.permission_type,
iu.user_uid,
spt.created_by
FROM soma.permission_types spt
JOIN inventory.users iu
ON spt.created_by = iu.user_id
WHERE spt.permission_type = $1::varchar;`
// vim: ts=4 sw=4 sts=4 noet fenc=utf-8 ffs=unix
| /*-
* Copyright (c) 2016, 1&1 Internet SE
* All rights reserved
*/
package stmt
const LoadPermissions = `
SELECT permission_id,
permission_name
FROM soma.permissions;`
+ const AddPermissionCategory = `
+ INSERT INTO soma.permission_types (
+ permission_type,
+ created_by
+ )
+ SELECT $1::varchar,
+ $2::uuid
+ WHERE NOT EXISTS (
+ SELECT permission_type
+ FROM soma.permission_types
+ WHERE permission_type = $1::varchar
+ );`
+
+ const DeletePermissionCategory = `
+ DELETE FROM soma.permission_types
+ WHERE permission_type = $1::varchar;`
+
+ const ListPermissionCategory = `
+ SELECT spt.permission_type
+ FROM soma.permission_types spt:`
+
+ const ShowPermissionCategory = `
+ SELECT spt.permission_type,
+ iu.user_uid,
+ spt.created_by
+ FROM soma.permission_types spt
+ JOIN inventory.users iu
+ ON spt.created_by = iu.user_id
+ WHERE spt.permission_type = $1::varchar;`
+
// vim: ts=4 sw=4 sts=4 noet fenc=utf-8 ffs=unix | 30 | 2.307692 | 30 | 0 |
03e86ad7cd1f223a6ad3c1008e6e45ee92b065a7 | doc/update-gh-pages.sh | doc/update-gh-pages.sh | cd `dirname "$0"`
cd ..
echo "Running doxygen"
doxygen
echo "Re-cloning doc/gh-pages"
rm -Rf doc/gh-pages
git clone git@github.com:xi-project/xi-test-selenium.git -b gh-pages doc/gh-pages
echo "Copying API docs over to gh-pages"
cp -r doc/api/html/* doc/gh-pages
cd doc/gh-pages
git add -A
git status
git commit -m "Update API reference."
echo
echo
echo "Now please check that the latest commit in doc/gh-pages looks ok"
echo "and then git push it."
echo "You may remove doc/gh-pages afterwards"
echo
| cd `dirname "$0"`
cd ..
rm -Rf doc/api
echo "Running doxygen"
doxygen
echo "Re-cloning doc/gh-pages"
rm -Rf doc/gh-pages
git clone git@github.com:xi-project/xi-test-selenium.git -b gh-pages doc/gh-pages
echo "Copying API docs over to gh-pages"
cp -r doc/api/html/* doc/gh-pages
cd doc/gh-pages
git add -A
git status
git commit -m "Update API reference."
echo
echo
echo "Now please check that the latest commit in doc/gh-pages looks ok"
echo "and then git push it."
echo "You may remove doc/gh-pages afterwards"
echo
| Clean up old api doc files when updating gh-pages. | Clean up old api doc files when updating gh-pages.
| Shell | bsd-3-clause | xi-project/xi-test-selenium,xi-project/xi-test-selenium | shell | ## Code Before:
cd `dirname "$0"`
cd ..
echo "Running doxygen"
doxygen
echo "Re-cloning doc/gh-pages"
rm -Rf doc/gh-pages
git clone git@github.com:xi-project/xi-test-selenium.git -b gh-pages doc/gh-pages
echo "Copying API docs over to gh-pages"
cp -r doc/api/html/* doc/gh-pages
cd doc/gh-pages
git add -A
git status
git commit -m "Update API reference."
echo
echo
echo "Now please check that the latest commit in doc/gh-pages looks ok"
echo "and then git push it."
echo "You may remove doc/gh-pages afterwards"
echo
## Instruction:
Clean up old api doc files when updating gh-pages.
## Code After:
cd `dirname "$0"`
cd ..
rm -Rf doc/api
echo "Running doxygen"
doxygen
echo "Re-cloning doc/gh-pages"
rm -Rf doc/gh-pages
git clone git@github.com:xi-project/xi-test-selenium.git -b gh-pages doc/gh-pages
echo "Copying API docs over to gh-pages"
cp -r doc/api/html/* doc/gh-pages
cd doc/gh-pages
git add -A
git status
git commit -m "Update API reference."
echo
echo
echo "Now please check that the latest commit in doc/gh-pages looks ok"
echo "and then git push it."
echo "You may remove doc/gh-pages afterwards"
echo
| cd `dirname "$0"`
cd ..
+
+ rm -Rf doc/api
echo "Running doxygen"
doxygen
echo "Re-cloning doc/gh-pages"
rm -Rf doc/gh-pages
git clone git@github.com:xi-project/xi-test-selenium.git -b gh-pages doc/gh-pages
echo "Copying API docs over to gh-pages"
cp -r doc/api/html/* doc/gh-pages
cd doc/gh-pages
git add -A
git status
git commit -m "Update API reference."
echo
echo
echo "Now please check that the latest commit in doc/gh-pages looks ok"
echo "and then git push it."
echo "You may remove doc/gh-pages afterwards"
echo
| 2 | 0.083333 | 2 | 0 |
e8827112ae1a597df6925b4b5fdcf803b710ce42 | packages/codemirror-extension/schema/commands.json | packages/codemirror-extension/schema/commands.json | {
"jupyter.lab.setting-icon-class": "jp-TextEditorIcon",
"jupyter.lab.setting-icon-label": "CodeMirror",
"title": "CodeMirror",
"description": "Text editor settings for all CodeMirror editors.",
"properties": {
"keyMap": { "type": "string", "title": "Key Map", "default": "default" },
"theme": { "type": "string", "title": "Theme", "default": "default" }
},
"type": "object"
}
| {
"jupyter.lab.setting-icon-class": "jp-TextEditorIcon",
"jupyter.lab.setting-icon-label": "CodeMirror",
"title": "CodeMirror",
"description": "Text editor settings for all CodeMirror editors.",
"properties": {
"keyMap": {
"default": "default",
"description": "The keymap CodeMirror uses.",
"title": "Key Map",
"type": "string"
},
"theme": {
"default": "default",
"description": "The CodeMirror theme.",
"title": "Theme",
"type": "string"
}
},
"type": "object"
}
| Add descriptions for CodeMirror schema properties. | Add descriptions for CodeMirror schema properties.
| JSON | bsd-3-clause | jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab | json | ## Code Before:
{
"jupyter.lab.setting-icon-class": "jp-TextEditorIcon",
"jupyter.lab.setting-icon-label": "CodeMirror",
"title": "CodeMirror",
"description": "Text editor settings for all CodeMirror editors.",
"properties": {
"keyMap": { "type": "string", "title": "Key Map", "default": "default" },
"theme": { "type": "string", "title": "Theme", "default": "default" }
},
"type": "object"
}
## Instruction:
Add descriptions for CodeMirror schema properties.
## Code After:
{
"jupyter.lab.setting-icon-class": "jp-TextEditorIcon",
"jupyter.lab.setting-icon-label": "CodeMirror",
"title": "CodeMirror",
"description": "Text editor settings for all CodeMirror editors.",
"properties": {
"keyMap": {
"default": "default",
"description": "The keymap CodeMirror uses.",
"title": "Key Map",
"type": "string"
},
"theme": {
"default": "default",
"description": "The CodeMirror theme.",
"title": "Theme",
"type": "string"
}
},
"type": "object"
}
| {
"jupyter.lab.setting-icon-class": "jp-TextEditorIcon",
"jupyter.lab.setting-icon-label": "CodeMirror",
"title": "CodeMirror",
"description": "Text editor settings for all CodeMirror editors.",
"properties": {
- "keyMap": { "type": "string", "title": "Key Map", "default": "default" },
- "theme": { "type": "string", "title": "Theme", "default": "default" }
+ "keyMap": {
+ "default": "default",
+ "description": "The keymap CodeMirror uses.",
+ "title": "Key Map",
+ "type": "string"
+ },
+ "theme": {
+ "default": "default",
+ "description": "The CodeMirror theme.",
+ "title": "Theme",
+ "type": "string"
+ }
},
"type": "object"
} | 14 | 1.272727 | 12 | 2 |
94123219bfd5f9e688764a2125d36f206bf89704 | src/include/libpq/be-fsstubs.h | src/include/libpq/be-fsstubs.h | /*-------------------------------------------------------------------------
*
* be-fsstubs.h--
*
*
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: be-fsstubs.h,v 1.1 1996/08/28 07:22:56 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef BE_FSSTUBS_H
#define BE_FSSTUBS_H
extern Oid lo_import(text *filename);
extern int4 lo_export(Oid lobjId, text *filename);
extern Oid lo_creat(int mode);
extern int lo_open(Oid lobjId, int mode);
extern int lo_close(int fd);
extern int lo_read(int fd, char *buf, int len);
extern int lo_write(int fd, char *buf, int len);
extern int lo_lseek(int fd, int offset, int whence);
extern int lo_tell(int fd);
extern int lo_unlink(Oid lobjId);
extern struct varlena *LOread(int fd, int len);
extern int LOwrite(int fd, struct varlena *wbuf);
#endif /* BE_FSSTUBS_H */
| /*-------------------------------------------------------------------------
*
* be-fsstubs.h--
*
*
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: be-fsstubs.h,v 1.2 1997/05/06 07:14:34 thomas Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef BE_FSSTUBS_H
#define BE_FSSTUBS_H
/* Redefine names LOread() and LOwrite() to be lowercase to allow calling
* using the new v6.1 case-insensitive SQL parser. Define macros to allow
* the existing code to stay the same. - tgl 97/05/03
*/
#define LOread(f,l) loread(f,l)
#define LOwrite(f,b) lowrite(f,b)
extern Oid lo_import(text *filename);
extern int4 lo_export(Oid lobjId, text *filename);
extern Oid lo_creat(int mode);
extern int lo_open(Oid lobjId, int mode);
extern int lo_close(int fd);
extern int lo_read(int fd, char *buf, int len);
extern int lo_write(int fd, char *buf, int len);
extern int lo_lseek(int fd, int offset, int whence);
extern int lo_tell(int fd);
extern int lo_unlink(Oid lobjId);
extern struct varlena *loread(int fd, int len);
extern int lowrite(int fd, struct varlena *wbuf);
#endif /* BE_FSSTUBS_H */
| Rename LOread() and LOwrite() to be lower case to allow use in case-insensitive SQL. Define LOread() and LOwrite() as macros to avoid having to update calls everywhere. | Rename LOread() and LOwrite() to be lower case to allow use
in case-insensitive SQL. Define LOread() and LOwrite() as macros
to avoid having to update calls everywhere.
| C | mpl-2.0 | kmjungersen/PostgresXL,Quikling/gpdb,xuegang/gpdb,cjcjameson/gpdb,Chibin/gpdb,cjcjameson/gpdb,0x0FFF/gpdb,royc1/gpdb,randomtask1155/gpdb,0x0FFF/gpdb,zeroae/postgres-xl,janebeckman/gpdb,50wu/gpdb,jmcatamney/gpdb,edespino/gpdb,randomtask1155/gpdb,rvs/gpdb,royc1/gpdb,0x0FFF/gpdb,randomtask1155/gpdb,lintzc/gpdb,postmind-net/postgres-xl,rvs/gpdb,zeroae/postgres-xl,xinzweb/gpdb,tpostgres-projects/tPostgres,CraigHarris/gpdb,janebeckman/gpdb,foyzur/gpdb,rubikloud/gpdb,atris/gpdb,kmjungersen/PostgresXL,zaksoup/gpdb,ashwinstar/gpdb,tangp3/gpdb,pavanvd/postgres-xl,foyzur/gpdb,tpostgres-projects/tPostgres,jmcatamney/gpdb,kaknikhil/gpdb,lisakowen/gpdb,janebeckman/gpdb,foyzur/gpdb,Chibin/gpdb,chrishajas/gpdb,jmcatamney/gpdb,rvs/gpdb,zaksoup/gpdb,royc1/gpdb,jmcatamney/gpdb,rvs/gpdb,Quikling/gpdb,jmcatamney/gpdb,ovr/postgres-xl,Quikling/gpdb,CraigHarris/gpdb,chrishajas/gpdb,yazun/postgres-xl,Postgres-XL/Postgres-XL,zeroae/postgres-xl,janebeckman/gpdb,janebeckman/gpdb,lpetrov-pivotal/gpdb,lpetrov-pivotal/gpdb,postmind-net/postgres-xl,ahachete/gpdb,atris/gpdb,rubikloud/gpdb,lintzc/gpdb,techdragon/Postgres-XL,kmjungersen/PostgresXL,randomtask1155/gpdb,yazun/postgres-xl,edespino/gpdb,kaknikhil/gpdb,xinzweb/gpdb,lpetrov-pivotal/gpdb,rvs/gpdb,Chibin/gpdb,ashwinstar/gpdb,Chibin/gpdb,kaknikhil/gpdb,kaknikhil/gpdb,zeroae/postgres-xl,lintzc/gpdb,tpostgres-projects/tPostgres,ashwinstar/gpdb,lpetrov-pivotal/gpdb,atris/gpdb,50wu/gpdb,cjcjameson/gpdb,greenplum-db/gpdb,royc1/gpdb,foyzur/gpdb,ahachete/gpdb,chrishajas/gpdb,Quikling/gpdb,rubikloud/gpdb,chrishajas/gpdb,yuanzhao/gpdb,CraigHarris/gpdb,Chibin/gpdb,edespino/gpdb,greenplum-db/gpdb,techdragon/Postgres-XL,oberstet/postgres-xl,zaksoup/gpdb,edespino/gpdb,ovr/postgres-xl,tangp3/gpdb,Quikling/gpdb,chrishajas/gpdb,tangp3/gpdb,50wu/gpdb,atris/gpdb,CraigHarris/gpdb,postmind-net/postgres-xl,chrishajas/gpdb,yazun/postgres-xl,adam8157/gpdb,yuanzhao/gpdb,tpostgres-projects/tPostgres,lintzc/gpdb,Chibin/gpdb,rvs/gpdb,zaksoup/gpdb,lisakowen/gpdb,50wu/gpdb,janebeckman/gpdb,yuanzhao/gpdb,jmcatamney/gpdb,cjcjameson/gpdb,rubikloud/gpdb,ahachete/gpdb,50wu/gpdb,royc1/gpdb,xuegang/gpdb,snaga/postgres-xl,ashwinstar/gpdb,chrishajas/gpdb,adam8157/gpdb,kmjungersen/PostgresXL,0x0FFF/gpdb,foyzur/gpdb,rvs/gpdb,pavanvd/postgres-xl,Quikling/gpdb,arcivanov/postgres-xl,ashwinstar/gpdb,edespino/gpdb,adam8157/gpdb,zeroae/postgres-xl,cjcjameson/gpdb,edespino/gpdb,lisakowen/gpdb,atris/gpdb,snaga/postgres-xl,yuanzhao/gpdb,CraigHarris/gpdb,zaksoup/gpdb,ashwinstar/gpdb,lintzc/gpdb,rvs/gpdb,kaknikhil/gpdb,cjcjameson/gpdb,atris/gpdb,kaknikhil/gpdb,techdragon/Postgres-XL,jmcatamney/gpdb,adam8157/gpdb,xuegang/gpdb,royc1/gpdb,rubikloud/gpdb,ashwinstar/gpdb,lpetrov-pivotal/gpdb,edespino/gpdb,rubikloud/gpdb,foyzur/gpdb,0x0FFF/gpdb,arcivanov/postgres-xl,atris/gpdb,xinzweb/gpdb,kaknikhil/gpdb,adam8157/gpdb,Chibin/gpdb,cjcjameson/gpdb,tpostgres-projects/tPostgres,ahachete/gpdb,greenplum-db/gpdb,yazun/postgres-xl,Quikling/gpdb,postmind-net/postgres-xl,randomtask1155/gpdb,zaksoup/gpdb,ahachete/gpdb,postmind-net/postgres-xl,pavanvd/postgres-xl,lisakowen/gpdb,foyzur/gpdb,pavanvd/postgres-xl,Chibin/gpdb,janebeckman/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,0x0FFF/gpdb,oberstet/postgres-xl,greenplum-db/gpdb,Chibin/gpdb,lisakowen/gpdb,50wu/gpdb,rvs/gpdb,randomtask1155/gpdb,chrishajas/gpdb,rvs/gpdb,edespino/gpdb,xinzweb/gpdb,cjcjameson/gpdb,ahachete/gpdb,CraigHarris/gpdb,cjcjameson/gpdb,lintzc/gpdb,snaga/postgres-xl,lintzc/gpdb,janebeckman/gpdb,cjcjameson/gpdb,techdragon/Postgres-XL,CraigHarris/gpdb,arcivanov/postgres-xl,royc1/gpdb,oberstet/postgres-xl,ahachete/gpdb,yuanzhao/gpdb,greenplum-db/gpdb,edespino/gpdb,yazun/postgres-xl,rubikloud/gpdb,oberstet/postgres-xl,yuanzhao/gpdb,adam8157/gpdb,kaknikhil/gpdb,snaga/postgres-xl,CraigHarris/gpdb,edespino/gpdb,atris/gpdb,lisakowen/gpdb,0x0FFF/gpdb,Quikling/gpdb,ashwinstar/gpdb,lpetrov-pivotal/gpdb,xinzweb/gpdb,Quikling/gpdb,randomtask1155/gpdb,lintzc/gpdb,yuanzhao/gpdb,kaknikhil/gpdb,ovr/postgres-xl,xuegang/gpdb,janebeckman/gpdb,lpetrov-pivotal/gpdb,tangp3/gpdb,ahachete/gpdb,kaknikhil/gpdb,Chibin/gpdb,lpetrov-pivotal/gpdb,rubikloud/gpdb,Postgres-XL/Postgres-XL,yuanzhao/gpdb,xinzweb/gpdb,ovr/postgres-xl,pavanvd/postgres-xl,adam8157/gpdb,yuanzhao/gpdb,ovr/postgres-xl,oberstet/postgres-xl,xuegang/gpdb,arcivanov/postgres-xl,snaga/postgres-xl,xinzweb/gpdb,lintzc/gpdb,arcivanov/postgres-xl,arcivanov/postgres-xl,jmcatamney/gpdb,xuegang/gpdb,Postgres-XL/Postgres-XL,randomtask1155/gpdb,50wu/gpdb,zaksoup/gpdb,zaksoup/gpdb,Quikling/gpdb,Postgres-XL/Postgres-XL,xuegang/gpdb,50wu/gpdb,tangp3/gpdb,techdragon/Postgres-XL,xuegang/gpdb,xuegang/gpdb,foyzur/gpdb,lisakowen/gpdb,tangp3/gpdb,tangp3/gpdb,kmjungersen/PostgresXL,royc1/gpdb,CraigHarris/gpdb,0x0FFF/gpdb,adam8157/gpdb,Postgres-XL/Postgres-XL,xinzweb/gpdb,janebeckman/gpdb,lisakowen/gpdb,greenplum-db/gpdb,yuanzhao/gpdb,tangp3/gpdb | c | ## Code Before:
/*-------------------------------------------------------------------------
*
* be-fsstubs.h--
*
*
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: be-fsstubs.h,v 1.1 1996/08/28 07:22:56 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef BE_FSSTUBS_H
#define BE_FSSTUBS_H
extern Oid lo_import(text *filename);
extern int4 lo_export(Oid lobjId, text *filename);
extern Oid lo_creat(int mode);
extern int lo_open(Oid lobjId, int mode);
extern int lo_close(int fd);
extern int lo_read(int fd, char *buf, int len);
extern int lo_write(int fd, char *buf, int len);
extern int lo_lseek(int fd, int offset, int whence);
extern int lo_tell(int fd);
extern int lo_unlink(Oid lobjId);
extern struct varlena *LOread(int fd, int len);
extern int LOwrite(int fd, struct varlena *wbuf);
#endif /* BE_FSSTUBS_H */
## Instruction:
Rename LOread() and LOwrite() to be lower case to allow use
in case-insensitive SQL. Define LOread() and LOwrite() as macros
to avoid having to update calls everywhere.
## Code After:
/*-------------------------------------------------------------------------
*
* be-fsstubs.h--
*
*
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: be-fsstubs.h,v 1.2 1997/05/06 07:14:34 thomas Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef BE_FSSTUBS_H
#define BE_FSSTUBS_H
/* Redefine names LOread() and LOwrite() to be lowercase to allow calling
* using the new v6.1 case-insensitive SQL parser. Define macros to allow
* the existing code to stay the same. - tgl 97/05/03
*/
#define LOread(f,l) loread(f,l)
#define LOwrite(f,b) lowrite(f,b)
extern Oid lo_import(text *filename);
extern int4 lo_export(Oid lobjId, text *filename);
extern Oid lo_creat(int mode);
extern int lo_open(Oid lobjId, int mode);
extern int lo_close(int fd);
extern int lo_read(int fd, char *buf, int len);
extern int lo_write(int fd, char *buf, int len);
extern int lo_lseek(int fd, int offset, int whence);
extern int lo_tell(int fd);
extern int lo_unlink(Oid lobjId);
extern struct varlena *loread(int fd, int len);
extern int lowrite(int fd, struct varlena *wbuf);
#endif /* BE_FSSTUBS_H */
| /*-------------------------------------------------------------------------
*
* be-fsstubs.h--
*
*
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: be-fsstubs.h,v 1.1 1996/08/28 07:22:56 scrappy Exp $
? ^ ^ ^ ^^ ^^ ^^ ------
+ * $Id: be-fsstubs.h,v 1.2 1997/05/06 07:14:34 thomas Exp $
? ^ ^ ^ ^^ ^^ ^^ +++++
*
*-------------------------------------------------------------------------
*/
#ifndef BE_FSSTUBS_H
#define BE_FSSTUBS_H
+
+ /* Redefine names LOread() and LOwrite() to be lowercase to allow calling
+ * using the new v6.1 case-insensitive SQL parser. Define macros to allow
+ * the existing code to stay the same. - tgl 97/05/03
+ */
+
+ #define LOread(f,l) loread(f,l)
+ #define LOwrite(f,b) lowrite(f,b)
extern Oid lo_import(text *filename);
extern int4 lo_export(Oid lobjId, text *filename);
extern Oid lo_creat(int mode);
extern int lo_open(Oid lobjId, int mode);
extern int lo_close(int fd);
extern int lo_read(int fd, char *buf, int len);
extern int lo_write(int fd, char *buf, int len);
extern int lo_lseek(int fd, int offset, int whence);
extern int lo_tell(int fd);
extern int lo_unlink(Oid lobjId);
- extern struct varlena *LOread(int fd, int len);
? ^^
+ extern struct varlena *loread(int fd, int len);
? ^^
- extern int LOwrite(int fd, struct varlena *wbuf);
? ^^
+ extern int lowrite(int fd, struct varlena *wbuf);
? ^^
-
+
#endif /* BE_FSSTUBS_H */ | 16 | 0.5 | 12 | 4 |
74e00f0326f651f07bf27b15c43bd009cfe5a324 | README.md | README.md | [](./CHANGELOG.md)
[](./LICENSE)
[](https://travis-ci.org/elliptical/tcm)
[](https://coveralls.io/github/elliptical/tcm?branch=develop)
# tcm (Test Case Meta)
This is primarily an excercise in Python metaprogramming which also lets me see GitHub, CI tools, and PyPI in action.
Things to develop:
- a class method decorator to hold a table of arguments
- a metaclass to automatically generate multiple test methods out of each decorated sample method
Tools to use:
- `tox` to test the code with different Python versions
- `pylint` and `flake8` to keep individual commits clean
- `coverall` to ensure 100% code coverage
| [](./CHANGELOG.md)
[](./LICENSE)
[](https://travis-ci.com/elliptical/tcm)
[](https://coveralls.io/github/elliptical/tcm?branch=develop)
# tcm (Test Case Meta)
This is primarily an excercise in Python metaprogramming which also lets me see GitHub, CI tools, and PyPI in action.
Things to develop:
- a class method decorator to hold a table of arguments
- a metaclass to automatically generate multiple test methods out of each decorated sample method
Tools to use:
- `tox` to test the code with different Python versions
- `pylint` and `flake8` to keep individual commits clean
- `coverall` to ensure 100% code coverage
| Switch from travis-ci.org to travis-ci.com | Switch from travis-ci.org to travis-ci.com
| Markdown | mit | elliptical/tcm | markdown | ## Code Before:
[](./CHANGELOG.md)
[](./LICENSE)
[](https://travis-ci.org/elliptical/tcm)
[](https://coveralls.io/github/elliptical/tcm?branch=develop)
# tcm (Test Case Meta)
This is primarily an excercise in Python metaprogramming which also lets me see GitHub, CI tools, and PyPI in action.
Things to develop:
- a class method decorator to hold a table of arguments
- a metaclass to automatically generate multiple test methods out of each decorated sample method
Tools to use:
- `tox` to test the code with different Python versions
- `pylint` and `flake8` to keep individual commits clean
- `coverall` to ensure 100% code coverage
## Instruction:
Switch from travis-ci.org to travis-ci.com
## Code After:
[](./CHANGELOG.md)
[](./LICENSE)
[](https://travis-ci.com/elliptical/tcm)
[](https://coveralls.io/github/elliptical/tcm?branch=develop)
# tcm (Test Case Meta)
This is primarily an excercise in Python metaprogramming which also lets me see GitHub, CI tools, and PyPI in action.
Things to develop:
- a class method decorator to hold a table of arguments
- a metaclass to automatically generate multiple test methods out of each decorated sample method
Tools to use:
- `tox` to test the code with different Python versions
- `pylint` and `flake8` to keep individual commits clean
- `coverall` to ensure 100% code coverage
| [](./CHANGELOG.md)
[](./LICENSE)
- [](https://travis-ci.org/elliptical/tcm)
? ^^ --------------- ^^
+ [](https://travis-ci.com/elliptical/tcm)
? + ^ + ^
[](https://coveralls.io/github/elliptical/tcm?branch=develop)
# tcm (Test Case Meta)
This is primarily an excercise in Python metaprogramming which also lets me see GitHub, CI tools, and PyPI in action.
Things to develop:
- a class method decorator to hold a table of arguments
- a metaclass to automatically generate multiple test methods out of each decorated sample method
Tools to use:
- `tox` to test the code with different Python versions
- `pylint` and `flake8` to keep individual commits clean
- `coverall` to ensure 100% code coverage | 2 | 0.111111 | 1 | 1 |
4356f072c00bfec83db55004d9b47861efc59dc1 | app/views/teams/index.html.erb | app/views/teams/index.html.erb | <% @page_title = "Teams" %>
<% cache cache_key do %>
<h2><%= RacingAssociation.current.short_name %>-registered teams in Oregon and SW Washington.</h2>
<p>A list of <%= link_to "clubs rides", "http://#{RacingAssociation.current.static_host}/teams/rides.html", class: "obvious" %> is available if you're looking for a group ride.</p>
<h3>Teams</h3>
<%= table id: "teams", collection: @teams, columns: 4 do %>
<tr>
<th>Name</th>
<% unless mobile_request? %>
<th>Sponsors</th>
<th>Contact</th>
<% end %>
<th>Results</th>
</tr>
<%= render partial: "team", collection: @teams.sort_by(&:downcased_name) %>
<% end -%>
<% end -%>
<ul class="page-links">
<li><%= link_to "Excel", { format: :xlsx }, download: "teams.xlsx" %></li>
</ul>
| <% @page_title = "Teams" %>
<% cache cache_key do %>
<h2><%= RacingAssociation.current.short_name %>-registered teams in Oregon and SW Washington.</h2>
<p>A list of <%= link_to "clubs rides", "club_rides", class: "obvious" %> is available if you're looking for a group ride.</p>
<h3>Teams</h3>
<%= table id: "teams", collection: @teams, columns: 4 do %>
<tr>
<th>Name</th>
<% unless mobile_request? %>
<th>Sponsors</th>
<th>Contact</th>
<% end %>
<th>Results</th>
</tr>
<%= render partial: "team", collection: @teams.sort_by(&:downcased_name) %>
<% end -%>
<% end -%>
<ul class="page-links">
<li><%= link_to "Excel", { format: :xlsx }, download: "teams.xlsx" %></li>
</ul>
| Update team rides link to dynamic page | Update team rides link to dynamic page
| HTML+ERB | mit | scottwillson/racing_on_rails,scottwillson/racing_on_rails,scottwillson/racing_on_rails,scottwillson/racing_on_rails | html+erb | ## Code Before:
<% @page_title = "Teams" %>
<% cache cache_key do %>
<h2><%= RacingAssociation.current.short_name %>-registered teams in Oregon and SW Washington.</h2>
<p>A list of <%= link_to "clubs rides", "http://#{RacingAssociation.current.static_host}/teams/rides.html", class: "obvious" %> is available if you're looking for a group ride.</p>
<h3>Teams</h3>
<%= table id: "teams", collection: @teams, columns: 4 do %>
<tr>
<th>Name</th>
<% unless mobile_request? %>
<th>Sponsors</th>
<th>Contact</th>
<% end %>
<th>Results</th>
</tr>
<%= render partial: "team", collection: @teams.sort_by(&:downcased_name) %>
<% end -%>
<% end -%>
<ul class="page-links">
<li><%= link_to "Excel", { format: :xlsx }, download: "teams.xlsx" %></li>
</ul>
## Instruction:
Update team rides link to dynamic page
## Code After:
<% @page_title = "Teams" %>
<% cache cache_key do %>
<h2><%= RacingAssociation.current.short_name %>-registered teams in Oregon and SW Washington.</h2>
<p>A list of <%= link_to "clubs rides", "club_rides", class: "obvious" %> is available if you're looking for a group ride.</p>
<h3>Teams</h3>
<%= table id: "teams", collection: @teams, columns: 4 do %>
<tr>
<th>Name</th>
<% unless mobile_request? %>
<th>Sponsors</th>
<th>Contact</th>
<% end %>
<th>Results</th>
</tr>
<%= render partial: "team", collection: @teams.sort_by(&:downcased_name) %>
<% end -%>
<% end -%>
<ul class="page-links">
<li><%= link_to "Excel", { format: :xlsx }, download: "teams.xlsx" %></li>
</ul>
| <% @page_title = "Teams" %>
<% cache cache_key do %>
<h2><%= RacingAssociation.current.short_name %>-registered teams in Oregon and SW Washington.</h2>
- <p>A list of <%= link_to "clubs rides", "http://#{RacingAssociation.current.static_host}/teams/rides.html", class: "obvious" %> is available if you're looking for a group ride.</p>
? ----------- ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ ------------ -----
+ <p>A list of <%= link_to "clubs rides", "club_rides", class: "obvious" %> is available if you're looking for a group ride.</p>
? ^ ^
<h3>Teams</h3>
<%= table id: "teams", collection: @teams, columns: 4 do %>
<tr>
<th>Name</th>
<% unless mobile_request? %>
<th>Sponsors</th>
<th>Contact</th>
<% end %>
<th>Results</th>
</tr>
<%= render partial: "team", collection: @teams.sort_by(&:downcased_name) %>
<% end -%>
<% end -%>
<ul class="page-links">
<li><%= link_to "Excel", { format: :xlsx }, download: "teams.xlsx" %></li>
</ul> | 2 | 0.083333 | 1 | 1 |
c0b001d77525c19f3d0310eb1d35b2654e22addd | roles/sshd/tasks/main.yml | roles/sshd/tasks/main.yml | ---
- name: Ensure latest SSH server and client are installed
apt:
pkg: "{{ item }}"
state: latest
update_cache: true
cache_valid_time: "{{ apt_cache_valid_time }}"
with_items:
- openssh-server
- openssh-client
notify: restart ssh
- name: Create a secure sshd_config
template:
src: "{{ sshd_config }}"
dest: /etc/ssh/sshd_config
mode: 0600
validate: '/usr/sbin/sshd -T -f %s'
notify: restart ssh
- name: Create a secure ssh_config
template:
src: "{{ ssh_config }}"
dest: /etc/ssh/ssh_config
mode: 0644
| ---
- name: Ensure latest SSH server and client are installed
apt:
pkg: "{{ item }}"
state: latest
update_cache: true
cache_valid_time: "{{ apt_cache_valid_time }}"
with_items:
- openssh-server
- openssh-client
notify: restart ssh
- name: Create a secure sshd_config
template:
src: "{{ sshd_config }}"
dest: /etc/ssh/sshd_config
mode: 0600
validate: '/usr/sbin/sshd -T -f %s'
notify: restart ssh
- name: Create a secure ssh_config
template:
src: "{{ ssh_config }}"
dest: /etc/ssh/ssh_config
mode: 0644
- name: Remove Diffie-Hellman moduli of size < 2000
lineinfile:
backup: yes
dest: /etc/ssh/moduli
regexp: ^(\d+\s){4}1
state: absent
| Remove insecure lines from moduli file | Remove insecure lines from moduli file
| YAML | mit | cimocimocimo/cimo-wordpress-server,newtonne/trellis,kalenjohnson/trellis,kalenjohnson/trellis,roots/bedrock-ansible,newtonne/trellis,NicBeltramelli/trellis,NicBeltramelli/trellis,fullyint/trellis,proteusthemes/pt-ops,proteusthemes/pt-ops,partounian/trellis,roots/bedrock-ansible,proteusthemes/pt-ops,alan-c/trellis,partounian/trellis,roots/trellis,fullyint/trellis,cimocimocimo/cimo-wordpress-server,fullyint/trellis,buluma/trellis,kalenjohnson/trellis,mAAdhaTTah/bedrock-ansible,mAAdhaTTah/bedrock-ansible,buluma/trellis,newtonne/trellis,buluma/trellis,NicBeltramelli/trellis,alan-c/trellis,mAAdhaTTah/bedrock-ansible,jeffstieler/bedrock-ansible,cimocimocimo/cimo-wordpress-server,kalenjohnson/trellis,cimocimocimo/cimo-wordpress-server,partounian/trellis,Twansparant/trellis-db-sync,pressbooks/trellis,jeffstieler/bedrock-ansible,pressbooks/trellis,jeffstieler/bedrock-ansible,fullyint/trellis,Twansparant/trellis-db-sync,Twansparant/trellis-db-sync,roots/trellis,partounian/trellis,mAAdhaTTah/bedrock-ansible,buluma/trellis,NicBeltramelli/trellis,Twansparant/trellis-db-sync | yaml | ## Code Before:
---
- name: Ensure latest SSH server and client are installed
apt:
pkg: "{{ item }}"
state: latest
update_cache: true
cache_valid_time: "{{ apt_cache_valid_time }}"
with_items:
- openssh-server
- openssh-client
notify: restart ssh
- name: Create a secure sshd_config
template:
src: "{{ sshd_config }}"
dest: /etc/ssh/sshd_config
mode: 0600
validate: '/usr/sbin/sshd -T -f %s'
notify: restart ssh
- name: Create a secure ssh_config
template:
src: "{{ ssh_config }}"
dest: /etc/ssh/ssh_config
mode: 0644
## Instruction:
Remove insecure lines from moduli file
## Code After:
---
- name: Ensure latest SSH server and client are installed
apt:
pkg: "{{ item }}"
state: latest
update_cache: true
cache_valid_time: "{{ apt_cache_valid_time }}"
with_items:
- openssh-server
- openssh-client
notify: restart ssh
- name: Create a secure sshd_config
template:
src: "{{ sshd_config }}"
dest: /etc/ssh/sshd_config
mode: 0600
validate: '/usr/sbin/sshd -T -f %s'
notify: restart ssh
- name: Create a secure ssh_config
template:
src: "{{ ssh_config }}"
dest: /etc/ssh/ssh_config
mode: 0644
- name: Remove Diffie-Hellman moduli of size < 2000
lineinfile:
backup: yes
dest: /etc/ssh/moduli
regexp: ^(\d+\s){4}1
state: absent
| ---
- name: Ensure latest SSH server and client are installed
apt:
pkg: "{{ item }}"
state: latest
update_cache: true
cache_valid_time: "{{ apt_cache_valid_time }}"
with_items:
- openssh-server
- openssh-client
notify: restart ssh
- name: Create a secure sshd_config
template:
src: "{{ sshd_config }}"
dest: /etc/ssh/sshd_config
mode: 0600
validate: '/usr/sbin/sshd -T -f %s'
notify: restart ssh
- name: Create a secure ssh_config
template:
src: "{{ ssh_config }}"
dest: /etc/ssh/ssh_config
mode: 0644
+
+ - name: Remove Diffie-Hellman moduli of size < 2000
+ lineinfile:
+ backup: yes
+ dest: /etc/ssh/moduli
+ regexp: ^(\d+\s){4}1
+ state: absent | 7 | 0.28 | 7 | 0 |
14563e2049333c5157ca31077ce50548eed78c3d | download-logos.sh | download-logos.sh |
URL="http://www.zettix.com/Graphics/timetunnel/timetunnel-4.22.tar.gz"
INSTALL="$HOME/.local/share/icons/xscreensaver/timetunnel"
if ! test -d "${INSTALL}"
then
mkdir -p "${INSTALL}"
fi
# Check if any of the images are missing.
if test -f "${INSTALL}/tardis.xpm" && test -f "${INSTALL}/whohead1.xpm" && test -f "${INSTALL}/whologo.xpm"
then
echo "Already installed images in ${INSTALL}"
else
wget --output-document="/tmp/timetunnel-4.22.tar.gz" "${URL}"
tar --ungzip --extract --file "/tmp/timetunnel-4.22.tar.gz" --directory "/tmp/"
mkdir --parents "${INSTALL}"
cp '/tmp/xscreensaver-4.22/hacks/images/'{tardis.xpm,whohead1.xpm,whologo.xpm} "${INSTALL}"
echo "Copied images to ${INSTALL}"
fi
|
URL="http://www.zettix.com/Graphics/timetunnel/timetunnel-4.22.tar.gz"
INSTALL="$HOME/.local/share/icons/xscreensaver/timetunnel"
if ! test -d "${INSTALL}"
then
mkdir -p "${INSTALL}"
fi
# Check if any of the images are missing.
if test -f "${INSTALL}/tardis.xpm" && test -f "${INSTALL}/whohead1.xpm" && test -f "${INSTALL}/whologo.xpm"
then
echo "Already installed images in ${INSTALL}"
exit 1
fi
wget --output-document="/tmp/timetunnel-4.22.tar.gz" "${URL}"
tar --ungzip --extract --file "/tmp/timetunnel-4.22.tar.gz" --directory "/tmp/"
mkdir --parents "${INSTALL}"
cp '/tmp/xscreensaver-4.22/hacks/images/'{tardis.xpm,whohead1.xpm,whologo.xpm} "${INSTALL}"
echo "Copied images to ${INSTALL}"
| Check and bailout instead of conditional. | Check and bailout instead of conditional.
| Shell | mit | nbeaver/timetunnel-logos | shell | ## Code Before:
URL="http://www.zettix.com/Graphics/timetunnel/timetunnel-4.22.tar.gz"
INSTALL="$HOME/.local/share/icons/xscreensaver/timetunnel"
if ! test -d "${INSTALL}"
then
mkdir -p "${INSTALL}"
fi
# Check if any of the images are missing.
if test -f "${INSTALL}/tardis.xpm" && test -f "${INSTALL}/whohead1.xpm" && test -f "${INSTALL}/whologo.xpm"
then
echo "Already installed images in ${INSTALL}"
else
wget --output-document="/tmp/timetunnel-4.22.tar.gz" "${URL}"
tar --ungzip --extract --file "/tmp/timetunnel-4.22.tar.gz" --directory "/tmp/"
mkdir --parents "${INSTALL}"
cp '/tmp/xscreensaver-4.22/hacks/images/'{tardis.xpm,whohead1.xpm,whologo.xpm} "${INSTALL}"
echo "Copied images to ${INSTALL}"
fi
## Instruction:
Check and bailout instead of conditional.
## Code After:
URL="http://www.zettix.com/Graphics/timetunnel/timetunnel-4.22.tar.gz"
INSTALL="$HOME/.local/share/icons/xscreensaver/timetunnel"
if ! test -d "${INSTALL}"
then
mkdir -p "${INSTALL}"
fi
# Check if any of the images are missing.
if test -f "${INSTALL}/tardis.xpm" && test -f "${INSTALL}/whohead1.xpm" && test -f "${INSTALL}/whologo.xpm"
then
echo "Already installed images in ${INSTALL}"
exit 1
fi
wget --output-document="/tmp/timetunnel-4.22.tar.gz" "${URL}"
tar --ungzip --extract --file "/tmp/timetunnel-4.22.tar.gz" --directory "/tmp/"
mkdir --parents "${INSTALL}"
cp '/tmp/xscreensaver-4.22/hacks/images/'{tardis.xpm,whohead1.xpm,whologo.xpm} "${INSTALL}"
echo "Copied images to ${INSTALL}"
|
URL="http://www.zettix.com/Graphics/timetunnel/timetunnel-4.22.tar.gz"
INSTALL="$HOME/.local/share/icons/xscreensaver/timetunnel"
if ! test -d "${INSTALL}"
then
mkdir -p "${INSTALL}"
fi
# Check if any of the images are missing.
if test -f "${INSTALL}/tardis.xpm" && test -f "${INSTALL}/whohead1.xpm" && test -f "${INSTALL}/whologo.xpm"
then
echo "Already installed images in ${INSTALL}"
+ exit 1
- else
- wget --output-document="/tmp/timetunnel-4.22.tar.gz" "${URL}"
- tar --ungzip --extract --file "/tmp/timetunnel-4.22.tar.gz" --directory "/tmp/"
- mkdir --parents "${INSTALL}"
- cp '/tmp/xscreensaver-4.22/hacks/images/'{tardis.xpm,whohead1.xpm,whologo.xpm} "${INSTALL}"
- echo "Copied images to ${INSTALL}"
fi
+
+ wget --output-document="/tmp/timetunnel-4.22.tar.gz" "${URL}"
+ tar --ungzip --extract --file "/tmp/timetunnel-4.22.tar.gz" --directory "/tmp/"
+ mkdir --parents "${INSTALL}"
+ cp '/tmp/xscreensaver-4.22/hacks/images/'{tardis.xpm,whohead1.xpm,whologo.xpm} "${INSTALL}"
+ echo "Copied images to ${INSTALL}" | 13 | 0.722222 | 7 | 6 |
dd58dbbbdb9b3a9479fa5db38a4e4038a6514fef | configReader.py | configReader.py | class ConfigReader():
def __init__(self):
self.keys={}
#Read Keys from file
def readKeys(self):
keysFile=open("config.txt","r")
fileLines=keysFile.readlines()
keysFile.close()
self.keys.clear()
for item in fileLines:
#If last char is \n
if (item[-1]=='\n'):
item=item[:-1]
#If a commented line
if (item[0]=='#'):
pass
#If a new line is the first char
elif (item[0]=='\n'):
pass
else:
#Get Position of equal sign
pos=item.index('=')
#Name of the key is [0:pos], Value of the key is [pos+1:-1] (Stripping the \n char at the end)
self.keys[item[0:pos]]=item[pos+1:]
#Return the keys
def getKeys(self):
return self.keys
| class ConfigReader():
def __init__(self):
self.keys={}
#Read Keys from file
def readKeys(self):
keysFile=open("config.txt","r")
fileLines=keysFile.readlines()
keysFile.close()
self.keys.clear()
for item in fileLines:
#If last char is \n
if (item[-1]=='\n'):
item=item[:-1]
#If a commented line
if (item[0]=='#'):
continue
#If a new line is the first char
elif (item[0]=='\n'):
continue
else:
#Get Position of equal sign
pos=item.index('=')
#Name of the key is [0:pos], Value of the key is [pos+1:-1] (Stripping the \n char at the end)
self.keys[item[0:pos]]=item[pos+1:]
#Return the keys
def getKeys(self):
return self.keys
| Change 'pass' statements to 'continue' statements. | Change 'pass' statements to 'continue' statements. | Python | mit | ollien/PyConfigReader | python | ## Code Before:
class ConfigReader():
def __init__(self):
self.keys={}
#Read Keys from file
def readKeys(self):
keysFile=open("config.txt","r")
fileLines=keysFile.readlines()
keysFile.close()
self.keys.clear()
for item in fileLines:
#If last char is \n
if (item[-1]=='\n'):
item=item[:-1]
#If a commented line
if (item[0]=='#'):
pass
#If a new line is the first char
elif (item[0]=='\n'):
pass
else:
#Get Position of equal sign
pos=item.index('=')
#Name of the key is [0:pos], Value of the key is [pos+1:-1] (Stripping the \n char at the end)
self.keys[item[0:pos]]=item[pos+1:]
#Return the keys
def getKeys(self):
return self.keys
## Instruction:
Change 'pass' statements to 'continue' statements.
## Code After:
class ConfigReader():
def __init__(self):
self.keys={}
#Read Keys from file
def readKeys(self):
keysFile=open("config.txt","r")
fileLines=keysFile.readlines()
keysFile.close()
self.keys.clear()
for item in fileLines:
#If last char is \n
if (item[-1]=='\n'):
item=item[:-1]
#If a commented line
if (item[0]=='#'):
continue
#If a new line is the first char
elif (item[0]=='\n'):
continue
else:
#Get Position of equal sign
pos=item.index('=')
#Name of the key is [0:pos], Value of the key is [pos+1:-1] (Stripping the \n char at the end)
self.keys[item[0:pos]]=item[pos+1:]
#Return the keys
def getKeys(self):
return self.keys
| class ConfigReader():
def __init__(self):
self.keys={}
#Read Keys from file
def readKeys(self):
keysFile=open("config.txt","r")
fileLines=keysFile.readlines()
keysFile.close()
self.keys.clear()
for item in fileLines:
#If last char is \n
if (item[-1]=='\n'):
item=item[:-1]
#If a commented line
if (item[0]=='#'):
- pass
+ continue
#If a new line is the first char
elif (item[0]=='\n'):
- pass
+ continue
else:
#Get Position of equal sign
pos=item.index('=')
#Name of the key is [0:pos], Value of the key is [pos+1:-1] (Stripping the \n char at the end)
self.keys[item[0:pos]]=item[pos+1:]
#Return the keys
def getKeys(self):
return self.keys
| 4 | 0.133333 | 2 | 2 |
f830c8fa57b004f8297cd3caecead3f60c07f503 | autoroll/config/catapult-chromium.json | autoroll/config/catapult-chromium.json | {
"childName": "Catapult",
"gerritURL": "https://chromium-review.googlesource.com",
"maxRollFrequency": "0m",
"notifiers": [
{
"filter": "info",
"chat": {
"room": "speed-operations"
}
}
],
"parentName": "Chromium",
"parentWaterfall": "https://build.chromium.org",
"sheriff": ["sullivan@chromium.org"],
"depsRepoManager": {
"childBranch": "master",
"childPath": "src/third_party/catapult",
"includeLog": true,
"parentBranch": "master",
"parentRepo": "https://chromium.googlesource.com/chromium/src.git",
"strategy": "batch"
}
}
| {
"childName": "Catapult",
"gerritURL": "https://chromium-review.googlesource.com",
"maxRollFrequency": "0m",
"notifiers": [
{
"filter": "info",
"chat": {
"room": "speed-operations"
},
"subject": "Catapult into Chromium AutoRoller"
}
],
"parentName": "Chromium",
"parentWaterfall": "https://build.chromium.org",
"sheriff": ["sullivan@chromium.org"],
"depsRepoManager": {
"childBranch": "master",
"childPath": "src/third_party/catapult",
"includeLog": true,
"parentBranch": "master",
"parentRepo": "https://chromium.googlesource.com/chromium/src.git",
"strategy": "batch"
}
}
| Send all notifications to one chat thread | [autoroll] Catapult->Chromium: Send all notifications to one chat thread
Bug: skia:
Change-Id: I806876746962520b93183eaa36dd38366aca9380
Reviewed-on: https://skia-review.googlesource.com/125865
Reviewed-by: Eric Boren <0e499112533c8544f0505ea0d08394fb5ad7d8fa@google.com>
Commit-Queue: Eric Boren <0e499112533c8544f0505ea0d08394fb5ad7d8fa@google.com>
| JSON | bsd-3-clause | google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot | json | ## Code Before:
{
"childName": "Catapult",
"gerritURL": "https://chromium-review.googlesource.com",
"maxRollFrequency": "0m",
"notifiers": [
{
"filter": "info",
"chat": {
"room": "speed-operations"
}
}
],
"parentName": "Chromium",
"parentWaterfall": "https://build.chromium.org",
"sheriff": ["sullivan@chromium.org"],
"depsRepoManager": {
"childBranch": "master",
"childPath": "src/third_party/catapult",
"includeLog": true,
"parentBranch": "master",
"parentRepo": "https://chromium.googlesource.com/chromium/src.git",
"strategy": "batch"
}
}
## Instruction:
[autoroll] Catapult->Chromium: Send all notifications to one chat thread
Bug: skia:
Change-Id: I806876746962520b93183eaa36dd38366aca9380
Reviewed-on: https://skia-review.googlesource.com/125865
Reviewed-by: Eric Boren <0e499112533c8544f0505ea0d08394fb5ad7d8fa@google.com>
Commit-Queue: Eric Boren <0e499112533c8544f0505ea0d08394fb5ad7d8fa@google.com>
## Code After:
{
"childName": "Catapult",
"gerritURL": "https://chromium-review.googlesource.com",
"maxRollFrequency": "0m",
"notifiers": [
{
"filter": "info",
"chat": {
"room": "speed-operations"
},
"subject": "Catapult into Chromium AutoRoller"
}
],
"parentName": "Chromium",
"parentWaterfall": "https://build.chromium.org",
"sheriff": ["sullivan@chromium.org"],
"depsRepoManager": {
"childBranch": "master",
"childPath": "src/third_party/catapult",
"includeLog": true,
"parentBranch": "master",
"parentRepo": "https://chromium.googlesource.com/chromium/src.git",
"strategy": "batch"
}
}
| {
"childName": "Catapult",
"gerritURL": "https://chromium-review.googlesource.com",
"maxRollFrequency": "0m",
"notifiers": [
{
"filter": "info",
"chat": {
"room": "speed-operations"
- }
+ },
? +
+ "subject": "Catapult into Chromium AutoRoller"
}
],
"parentName": "Chromium",
"parentWaterfall": "https://build.chromium.org",
"sheriff": ["sullivan@chromium.org"],
"depsRepoManager": {
"childBranch": "master",
"childPath": "src/third_party/catapult",
"includeLog": true,
"parentBranch": "master",
"parentRepo": "https://chromium.googlesource.com/chromium/src.git",
"strategy": "batch"
}
} | 3 | 0.125 | 2 | 1 |
65d96f196b6bc1a593f3785c2c6be428bd64cb57 | seaweed-banking-account-updater/database/connection.go | seaweed-banking-account-updater/database/connection.go | package database
import (
"log"
"github.com/ChristianNorbertBraun/seaweed-banking/seaweed-banking-account-updater/config"
mgo "gopkg.in/mgo.v2"
)
var session *mgo.Session
// Configure establish connection to mongodb
func Configure() {
s, err := mgo.Dial(config.Configuration.Db.URL)
if err != nil {
log.Fatal("Could not connect to mongodb: ", err)
}
session = s
log.Print("Connected to mongodb: ", config.Configuration.Db.URL)
}
| package database
import (
"log"
weedharvester "github.com/ChristianNorbertBraun/Weedharvester"
"github.com/ChristianNorbertBraun/seaweed-banking/seaweed-banking-account-updater/config"
mgo "gopkg.in/mgo.v2"
)
var session *mgo.Session
var filer weedharvester.Filer
// Configure establish connection to mongodb
func Configure() {
configureMongodb()
configureSeaweedFiler()
}
func configureMongodb() {
s, err := mgo.Dial(config.Configuration.Db.URL)
if err != nil {
log.Fatal("Could not connect to mongodb: ", err)
}
session = s
log.Print("Connected to mongodb: ", config.Configuration.Db.URL)
}
func configureSeaweedFiler() {
fil := weedharvester.NewFiler(config.Configuration.Seaweed.FilerURL)
if err := fil.Ping(); err != nil {
log.Fatal("Could not connect to filer: ", config.Configuration.Seaweed.FilerURL)
}
filer = fil
log.Print("Connected to seaweed filer at: ", config.Configuration.Seaweed.FilerURL)
}
| Add configuration for filer to account-updater | Add configuration for filer to account-updater
| Go | mit | ChristianNorbertBraun/seaweed-banking,ChristianNorbertBraun/seaweed-banking | go | ## Code Before:
package database
import (
"log"
"github.com/ChristianNorbertBraun/seaweed-banking/seaweed-banking-account-updater/config"
mgo "gopkg.in/mgo.v2"
)
var session *mgo.Session
// Configure establish connection to mongodb
func Configure() {
s, err := mgo.Dial(config.Configuration.Db.URL)
if err != nil {
log.Fatal("Could not connect to mongodb: ", err)
}
session = s
log.Print("Connected to mongodb: ", config.Configuration.Db.URL)
}
## Instruction:
Add configuration for filer to account-updater
## Code After:
package database
import (
"log"
weedharvester "github.com/ChristianNorbertBraun/Weedharvester"
"github.com/ChristianNorbertBraun/seaweed-banking/seaweed-banking-account-updater/config"
mgo "gopkg.in/mgo.v2"
)
var session *mgo.Session
var filer weedharvester.Filer
// Configure establish connection to mongodb
func Configure() {
configureMongodb()
configureSeaweedFiler()
}
func configureMongodb() {
s, err := mgo.Dial(config.Configuration.Db.URL)
if err != nil {
log.Fatal("Could not connect to mongodb: ", err)
}
session = s
log.Print("Connected to mongodb: ", config.Configuration.Db.URL)
}
func configureSeaweedFiler() {
fil := weedharvester.NewFiler(config.Configuration.Seaweed.FilerURL)
if err := fil.Ping(); err != nil {
log.Fatal("Could not connect to filer: ", config.Configuration.Seaweed.FilerURL)
}
filer = fil
log.Print("Connected to seaweed filer at: ", config.Configuration.Seaweed.FilerURL)
}
| package database
import (
"log"
+ weedharvester "github.com/ChristianNorbertBraun/Weedharvester"
"github.com/ChristianNorbertBraun/seaweed-banking/seaweed-banking-account-updater/config"
mgo "gopkg.in/mgo.v2"
)
var session *mgo.Session
+ var filer weedharvester.Filer
// Configure establish connection to mongodb
func Configure() {
+ configureMongodb()
+ configureSeaweedFiler()
+ }
+
+ func configureMongodb() {
s, err := mgo.Dial(config.Configuration.Db.URL)
if err != nil {
log.Fatal("Could not connect to mongodb: ", err)
}
session = s
log.Print("Connected to mongodb: ", config.Configuration.Db.URL)
}
+
+ func configureSeaweedFiler() {
+ fil := weedharvester.NewFiler(config.Configuration.Seaweed.FilerURL)
+
+ if err := fil.Ping(); err != nil {
+ log.Fatal("Could not connect to filer: ", config.Configuration.Seaweed.FilerURL)
+ }
+
+ filer = fil
+ log.Print("Connected to seaweed filer at: ", config.Configuration.Seaweed.FilerURL)
+ } | 18 | 0.857143 | 18 | 0 |
ad80e71346ace739cb338634f1a5c84e81e84dad | examples/index.md | examples/index.md | ---
layout: page
title: "JSON API: Examples"
---
Examples are excellent learning aids. The following projects implementing JSON
API are divided into server- and client-side. The server-side is further
divided by implementation language. If you'd like your project listed, [send a
Pull Request](https://github.com/json-api/json-api).
## Client
* [ember-data](https://github.com/emberjs/data) is one of the original exemplar
implementations. There is a [custom adapter](https://github.com/daliwali/ember-json-api) to support json-api.
## Server
### PHP
* [FriendsOfSymfony / FOSRestBundle](https://github.com/FriendsOfSymfony/FOSRestBundle/issues/452)
### Node.js
* [Fortune.js](http://fortunejs.com) is a framework built to implement json-api.
### Ruby
* [ActiveModel::Serializers](https://github.com/rails-api/active_model_serializers)
is one of the original exemplar implementations, but is slightly out of date at
the moment.
* [The rabl wiki](https://github.com/nesquena/rabl/wiki/Conforming-to-jsonapi.org-format)
has page describing how to emit conformant JSON.
* [RestPack::Serializer](https://github.com/RestPack/restpack_serializer) implements the read elements of json-api. It also supports paging and side-loading.
| ---
layout: page
title: "JSON API: Examples"
---
Examples are excellent learning aids. The following projects implementing JSON
API are divided into server- and client-side. The server-side is further
divided by implementation language. If you'd like your project listed, [send a
Pull Request](https://github.com/json-api/json-api).
## Client
* [ember-data](https://github.com/emberjs/data) is one of the original exemplar
implementations. There is a [custom adapter](https://github.com/daliwali/ember-json-api) to support json-api.
## Server
### PHP
* [FriendsOfSymfony / FOSRestBundle](https://github.com/FriendsOfSymfony/FOSRestBundle/issues/452)
### Node.js
* [Fortune.js](http://fortunejs.com) is a framework built to implement json-api.
### Ruby
* [ActiveModel::Serializers](https://github.com/rails-api/active_model_serializers)
is one of the original exemplar implementations, but is slightly out of date at
the moment.
* [The rabl wiki](https://github.com/nesquena/rabl/wiki/Conforming-to-jsonapi.org-format)
has page describing how to emit conformant JSON.
* [RestPack::Serializer](https://github.com/RestPack/restpack_serializer) implements the read elements of json-api. It also supports paging and side-loading.
## Messages
* [RestPack::Serializer provides examples](http://restpack-serializer-sample.herokuapp.com/) which demonstrate sample responses.
| Add link to RestPack examples | Add link to RestPack examples | Markdown | cc0-1.0 | redaktor/json-api,greyhwndz/json-api,redaktor/json-api,equivalent/json-api,json-api/json-api,Volcanoscar/json-api,ashleygwilliams/json-api,cesarmarinhorj/json-api,csantero/json-api,eneuhauser/json-api,kjwierenga/json-api,jamesdixon/json-api,jede/json-api,cesarmarinhorj/json-api,bf4/json-api,erickt/json-api,wvteijlingen/json-api,dieface/json-api,jerel/json-api,benoittgt/json-api,bf4/json-api,beauby/json-api,dongguangming/json-api,csantero/json-api,jede/json-api,jerel/json-api,erickt/json-api,json-api/json-api,json-api/json-api,ashleygwilliams/json-api,json-api/json-api,eneuhauser/json-api,janusnic/json-api-1,dieface/json-api,beauby/json-api,janusnic/json-api-1,json-api/json-api,csantero/json-api,jede/json-api,benoittgt/json-api,RavelLaw/json-api,benoittgt/json-api,RavelLaw/json-api,wvteijlingen/json-api,RavelLaw/json-api,nonsensery/json-api,cesarmarinhorj/json-api,Volcanoscar/json-api,kjwierenga/json-api,jamesdixon/json-api,Volcanoscar/json-api,janusnic/json-api-1,greyhwndz/json-api,nonsensery/json-api,nonsensery/json-api,dongguangming/json-api,eneuhauser/json-api,beauby/json-api,jerel/json-api,redaktor/json-api,ashleygwilliams/json-api,dieface/json-api,dongguangming/json-api,kjwierenga/json-api,erickt/json-api,sloria/json-api,bf4/json-api,wvteijlingen/json-api,RavelLaw/json-api,jamesdixon/json-api,greyhwndz/json-api,sloria/json-api,equivalent/json-api,RavelLaw/json-api,sloria/json-api,equivalent/json-api | markdown | ## Code Before:
---
layout: page
title: "JSON API: Examples"
---
Examples are excellent learning aids. The following projects implementing JSON
API are divided into server- and client-side. The server-side is further
divided by implementation language. If you'd like your project listed, [send a
Pull Request](https://github.com/json-api/json-api).
## Client
* [ember-data](https://github.com/emberjs/data) is one of the original exemplar
implementations. There is a [custom adapter](https://github.com/daliwali/ember-json-api) to support json-api.
## Server
### PHP
* [FriendsOfSymfony / FOSRestBundle](https://github.com/FriendsOfSymfony/FOSRestBundle/issues/452)
### Node.js
* [Fortune.js](http://fortunejs.com) is a framework built to implement json-api.
### Ruby
* [ActiveModel::Serializers](https://github.com/rails-api/active_model_serializers)
is one of the original exemplar implementations, but is slightly out of date at
the moment.
* [The rabl wiki](https://github.com/nesquena/rabl/wiki/Conforming-to-jsonapi.org-format)
has page describing how to emit conformant JSON.
* [RestPack::Serializer](https://github.com/RestPack/restpack_serializer) implements the read elements of json-api. It also supports paging and side-loading.
## Instruction:
Add link to RestPack examples
## Code After:
---
layout: page
title: "JSON API: Examples"
---
Examples are excellent learning aids. The following projects implementing JSON
API are divided into server- and client-side. The server-side is further
divided by implementation language. If you'd like your project listed, [send a
Pull Request](https://github.com/json-api/json-api).
## Client
* [ember-data](https://github.com/emberjs/data) is one of the original exemplar
implementations. There is a [custom adapter](https://github.com/daliwali/ember-json-api) to support json-api.
## Server
### PHP
* [FriendsOfSymfony / FOSRestBundle](https://github.com/FriendsOfSymfony/FOSRestBundle/issues/452)
### Node.js
* [Fortune.js](http://fortunejs.com) is a framework built to implement json-api.
### Ruby
* [ActiveModel::Serializers](https://github.com/rails-api/active_model_serializers)
is one of the original exemplar implementations, but is slightly out of date at
the moment.
* [The rabl wiki](https://github.com/nesquena/rabl/wiki/Conforming-to-jsonapi.org-format)
has page describing how to emit conformant JSON.
* [RestPack::Serializer](https://github.com/RestPack/restpack_serializer) implements the read elements of json-api. It also supports paging and side-loading.
## Messages
* [RestPack::Serializer provides examples](http://restpack-serializer-sample.herokuapp.com/) which demonstrate sample responses.
| ---
layout: page
title: "JSON API: Examples"
---
Examples are excellent learning aids. The following projects implementing JSON
API are divided into server- and client-side. The server-side is further
divided by implementation language. If you'd like your project listed, [send a
Pull Request](https://github.com/json-api/json-api).
## Client
* [ember-data](https://github.com/emberjs/data) is one of the original exemplar
implementations. There is a [custom adapter](https://github.com/daliwali/ember-json-api) to support json-api.
## Server
### PHP
* [FriendsOfSymfony / FOSRestBundle](https://github.com/FriendsOfSymfony/FOSRestBundle/issues/452)
### Node.js
* [Fortune.js](http://fortunejs.com) is a framework built to implement json-api.
### Ruby
* [ActiveModel::Serializers](https://github.com/rails-api/active_model_serializers)
is one of the original exemplar implementations, but is slightly out of date at
the moment.
* [The rabl wiki](https://github.com/nesquena/rabl/wiki/Conforming-to-jsonapi.org-format)
has page describing how to emit conformant JSON.
* [RestPack::Serializer](https://github.com/RestPack/restpack_serializer) implements the read elements of json-api. It also supports paging and side-loading.
+
+ ## Messages
+
+ * [RestPack::Serializer provides examples](http://restpack-serializer-sample.herokuapp.com/) which demonstrate sample responses. | 4 | 0.114286 | 4 | 0 |
b33da306a3f3876ffca9d6f1bee33d6db3141fc0 | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/preferences/messages.properties | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/preferences/messages.properties | SREsPreferencePage_0=Add, remove, or edit SRE definitions. By default, the checked SRE is used for running SARL projects.
SREsPreferencePage_1=Installed SREs:
SREsPreferencePage_10=Reset
SREsPreferencePage_2=Name
SREsPreferencePage_3=Location
SREsPreferencePage_4=Add...
SREsPreferencePage_5=Edit...
SREsPreferencePage_6=Duplicate...
SREsPreferencePage_7=Remove
SREsPreferencePage_8=You must specify a default SRE.
SREsPreferencePage_9=Internal Error: {0}
SarlEditorPreferencePage_0=Formatting on paste actions
SarlEditorPreferencePage_1=Show codemining annotations
| SREsPreferencePage_0=Add, remove, or edit SRE definitions. By default, the checked SRE is used for running SARL projects.
SREsPreferencePage_1=Installed SREs:
SREsPreferencePage_10=Reset
SREsPreferencePage_2=Name
SREsPreferencePage_3=Location
SREsPreferencePage_4=Add...
SREsPreferencePage_5=Edit...
SREsPreferencePage_6=Duplicate...
SREsPreferencePage_7=Remove
SREsPreferencePage_8=You must specify a default SRE.
SREsPreferencePage_9=Internal Error: {0}
SarlEditorPreferencePage_0=Auto formatting of the inserted code on paste actions
SarlEditorPreferencePage_1=Show implicit SARL code in the editors (codemining)
| Change the label of the "code mining" option in the SARL preferences. | [eclipse] Change the label of the "code mining" option in the SARL preferences.
see #1041
Signed-off-by: Stéphane Galland <23860b554af9116d4237121086bd6767cdd4ff4b@arakhne.org>
| INI | apache-2.0 | sarl/sarl,sarl/sarl,sarl/sarl,sarl/sarl,sarl/sarl,sarl/sarl | ini | ## Code Before:
SREsPreferencePage_0=Add, remove, or edit SRE definitions. By default, the checked SRE is used for running SARL projects.
SREsPreferencePage_1=Installed SREs:
SREsPreferencePage_10=Reset
SREsPreferencePage_2=Name
SREsPreferencePage_3=Location
SREsPreferencePage_4=Add...
SREsPreferencePage_5=Edit...
SREsPreferencePage_6=Duplicate...
SREsPreferencePage_7=Remove
SREsPreferencePage_8=You must specify a default SRE.
SREsPreferencePage_9=Internal Error: {0}
SarlEditorPreferencePage_0=Formatting on paste actions
SarlEditorPreferencePage_1=Show codemining annotations
## Instruction:
[eclipse] Change the label of the "code mining" option in the SARL preferences.
see #1041
Signed-off-by: Stéphane Galland <23860b554af9116d4237121086bd6767cdd4ff4b@arakhne.org>
## Code After:
SREsPreferencePage_0=Add, remove, or edit SRE definitions. By default, the checked SRE is used for running SARL projects.
SREsPreferencePage_1=Installed SREs:
SREsPreferencePage_10=Reset
SREsPreferencePage_2=Name
SREsPreferencePage_3=Location
SREsPreferencePage_4=Add...
SREsPreferencePage_5=Edit...
SREsPreferencePage_6=Duplicate...
SREsPreferencePage_7=Remove
SREsPreferencePage_8=You must specify a default SRE.
SREsPreferencePage_9=Internal Error: {0}
SarlEditorPreferencePage_0=Auto formatting of the inserted code on paste actions
SarlEditorPreferencePage_1=Show implicit SARL code in the editors (codemining)
| SREsPreferencePage_0=Add, remove, or edit SRE definitions. By default, the checked SRE is used for running SARL projects.
SREsPreferencePage_1=Installed SREs:
SREsPreferencePage_10=Reset
SREsPreferencePage_2=Name
SREsPreferencePage_3=Location
SREsPreferencePage_4=Add...
SREsPreferencePage_5=Edit...
SREsPreferencePage_6=Duplicate...
SREsPreferencePage_7=Remove
SREsPreferencePage_8=You must specify a default SRE.
SREsPreferencePage_9=Internal Error: {0}
- SarlEditorPreferencePage_0=Formatting on paste actions
? ^
+ SarlEditorPreferencePage_0=Auto formatting of the inserted code on paste actions
? ^^^^^^ +++++++++++++++++++++
- SarlEditorPreferencePage_1=Show codemining annotations
+ SarlEditorPreferencePage_1=Show implicit SARL code in the editors (codemining) | 4 | 0.307692 | 2 | 2 |
7dd723874ac5bae83039b313abd00393636f1d80 | modernrpc/tests/test_entry_points.py | modernrpc/tests/test_entry_points.py | import requests
def test_forbidden_get(live_server):
r = requests.get(live_server.url + '/all-rpc/')
assert r.status_code == 405
r2 = requests.post(live_server.url + '/all-rpc/')
assert r2.status_code == 200
def test_allowed_get(live_server):
r = requests.get(live_server.url + '/all-rpc-doc/')
assert r.status_code == 200
r2 = requests.post(live_server.url + '/all-rpc-doc/')
assert r2.status_code == 405
| import requests
from django.core.exceptions import ImproperlyConfigured
from pytest import raises
from modernrpc.views import RPCEntryPoint
def test_forbidden_get(live_server):
r = requests.get(live_server.url + '/all-rpc/')
assert r.status_code == 405
r2 = requests.post(live_server.url + '/all-rpc/')
assert r2.status_code == 200
def test_allowed_get(live_server):
r = requests.get(live_server.url + '/all-rpc-doc/')
assert r.status_code == 200
r2 = requests.post(live_server.url + '/all-rpc-doc/')
assert r2.status_code == 405
def test_invalid_entry_point(settings, rf):
settings.MODERNRPC_HANDLERS = []
entry_point = RPCEntryPoint.as_view()
with raises(ImproperlyConfigured) as e:
entry_point(rf.post('xxx'))
assert 'handler' in str(e.value)
| Test for bad setting value | Test for bad setting value
| Python | mit | alorence/django-modern-rpc,alorence/django-modern-rpc | python | ## Code Before:
import requests
def test_forbidden_get(live_server):
r = requests.get(live_server.url + '/all-rpc/')
assert r.status_code == 405
r2 = requests.post(live_server.url + '/all-rpc/')
assert r2.status_code == 200
def test_allowed_get(live_server):
r = requests.get(live_server.url + '/all-rpc-doc/')
assert r.status_code == 200
r2 = requests.post(live_server.url + '/all-rpc-doc/')
assert r2.status_code == 405
## Instruction:
Test for bad setting value
## Code After:
import requests
from django.core.exceptions import ImproperlyConfigured
from pytest import raises
from modernrpc.views import RPCEntryPoint
def test_forbidden_get(live_server):
r = requests.get(live_server.url + '/all-rpc/')
assert r.status_code == 405
r2 = requests.post(live_server.url + '/all-rpc/')
assert r2.status_code == 200
def test_allowed_get(live_server):
r = requests.get(live_server.url + '/all-rpc-doc/')
assert r.status_code == 200
r2 = requests.post(live_server.url + '/all-rpc-doc/')
assert r2.status_code == 405
def test_invalid_entry_point(settings, rf):
settings.MODERNRPC_HANDLERS = []
entry_point = RPCEntryPoint.as_view()
with raises(ImproperlyConfigured) as e:
entry_point(rf.post('xxx'))
assert 'handler' in str(e.value)
| import requests
+ from django.core.exceptions import ImproperlyConfigured
+ from pytest import raises
+
+ from modernrpc.views import RPCEntryPoint
def test_forbidden_get(live_server):
r = requests.get(live_server.url + '/all-rpc/')
assert r.status_code == 405
r2 = requests.post(live_server.url + '/all-rpc/')
assert r2.status_code == 200
def test_allowed_get(live_server):
r = requests.get(live_server.url + '/all-rpc-doc/')
assert r.status_code == 200
r2 = requests.post(live_server.url + '/all-rpc-doc/')
assert r2.status_code == 405
+
+
+ def test_invalid_entry_point(settings, rf):
+ settings.MODERNRPC_HANDLERS = []
+
+ entry_point = RPCEntryPoint.as_view()
+ with raises(ImproperlyConfigured) as e:
+ entry_point(rf.post('xxx'))
+
+ assert 'handler' in str(e.value) | 14 | 0.736842 | 14 | 0 |
ce830bb82e53fac191204c9027159a8179cea253 | response_test.go | response_test.go | package search
import "testing"
func TestSubset(t *testing.T) {
var (
a = &Asset{
VideoID: "video-id-123",
Type: "movie",
}
s = &Series{
BrandID: "brand-id-345",
Type: "series",
}
)
t.Run("Asset", func(t *testing.T) {
sub := Hit(a).Subset()
if got, want := sub.ID, a.VideoID; got != want {
t.Fatalf("sub.ID = %q, want %q", got, want)
}
if got, want := sub.Type, a.Type; got != want {
t.Fatalf("sub.Type = %q, want %q", got, want)
}
})
t.Run("Series", func(t *testing.T) {
sub := Hit(s).Subset()
if got, want := sub.ID, s.BrandID; got != want {
t.Fatalf("sub.ID = %q, want %q", got, want)
}
if got, want := sub.Type, s.Type; got != want {
t.Fatalf("sub.Type = %q, want %q", got, want)
}
})
}
| package search
import "testing"
func TestSubset(t *testing.T) {
t.Run("Asset", func(t *testing.T) {
a := &Asset{
VideoID: "video-id-123",
Type: "movie",
}
sub := Hit(a).Subset()
if got, want := sub.ID, a.VideoID; got != want {
t.Fatalf("sub.ID = %q, want %q", got, want)
}
if got, want := sub.Type, a.Type; got != want {
t.Fatalf("sub.Type = %q, want %q", got, want)
}
})
t.Run("Series", func(t *testing.T) {
s := &Series{
BrandID: "brand-id-345",
Type: "series",
}
sub := Hit(s).Subset()
if got, want := sub.ID, s.BrandID; got != want {
t.Fatalf("sub.ID = %q, want %q", got, want)
}
if got, want := sub.Type, s.Type; got != want {
t.Fatalf("sub.Type = %q, want %q", got, want)
}
})
}
| Move test data into the scope where it is used | Move test data into the scope where it is used
| Go | mit | TV4/search-go | go | ## Code Before:
package search
import "testing"
func TestSubset(t *testing.T) {
var (
a = &Asset{
VideoID: "video-id-123",
Type: "movie",
}
s = &Series{
BrandID: "brand-id-345",
Type: "series",
}
)
t.Run("Asset", func(t *testing.T) {
sub := Hit(a).Subset()
if got, want := sub.ID, a.VideoID; got != want {
t.Fatalf("sub.ID = %q, want %q", got, want)
}
if got, want := sub.Type, a.Type; got != want {
t.Fatalf("sub.Type = %q, want %q", got, want)
}
})
t.Run("Series", func(t *testing.T) {
sub := Hit(s).Subset()
if got, want := sub.ID, s.BrandID; got != want {
t.Fatalf("sub.ID = %q, want %q", got, want)
}
if got, want := sub.Type, s.Type; got != want {
t.Fatalf("sub.Type = %q, want %q", got, want)
}
})
}
## Instruction:
Move test data into the scope where it is used
## Code After:
package search
import "testing"
func TestSubset(t *testing.T) {
t.Run("Asset", func(t *testing.T) {
a := &Asset{
VideoID: "video-id-123",
Type: "movie",
}
sub := Hit(a).Subset()
if got, want := sub.ID, a.VideoID; got != want {
t.Fatalf("sub.ID = %q, want %q", got, want)
}
if got, want := sub.Type, a.Type; got != want {
t.Fatalf("sub.Type = %q, want %q", got, want)
}
})
t.Run("Series", func(t *testing.T) {
s := &Series{
BrandID: "brand-id-345",
Type: "series",
}
sub := Hit(s).Subset()
if got, want := sub.ID, s.BrandID; got != want {
t.Fatalf("sub.ID = %q, want %q", got, want)
}
if got, want := sub.Type, s.Type; got != want {
t.Fatalf("sub.Type = %q, want %q", got, want)
}
})
}
| package search
import "testing"
func TestSubset(t *testing.T) {
- var (
+ t.Run("Asset", func(t *testing.T) {
- a = &Asset{
+ a := &Asset{
? +
VideoID: "video-id-123",
Type: "movie",
}
- s = &Series{
- BrandID: "brand-id-345",
- Type: "series",
- }
- )
-
- t.Run("Asset", func(t *testing.T) {
sub := Hit(a).Subset()
if got, want := sub.ID, a.VideoID; got != want {
t.Fatalf("sub.ID = %q, want %q", got, want)
}
if got, want := sub.Type, a.Type; got != want {
t.Fatalf("sub.Type = %q, want %q", got, want)
}
})
t.Run("Series", func(t *testing.T) {
+ s := &Series{
+ BrandID: "brand-id-345",
+ Type: "series",
+ }
+
sub := Hit(s).Subset()
if got, want := sub.ID, s.BrandID; got != want {
t.Fatalf("sub.ID = %q, want %q", got, want)
}
if got, want := sub.Type, s.Type; got != want {
t.Fatalf("sub.Type = %q, want %q", got, want)
}
})
} | 16 | 0.390244 | 7 | 9 |
8f7f75158ec9d19076cde72093279c6835c81d5a | doc/source/more_outputs.rst | doc/source/more_outputs.rst | .. _more_output:
***************
More outputs
***************
Report
========
Beside the static HTML report that you can get using ``report`` `subcommand <http://seqcluster.readthedocs.org/getting_started.html#report>`_, you can download `this <https://github.com/lpantano/seqclusterViz/archive/master.zip>`_ HTML. (watch the repository to get notifications of new releases.)
* Go inside ``seqclusterViz`` folder
* Open ``reader.html``
* Upload the ``seqcluster.db`` file generated by ``report`` subcommand.
* Start browsing your data!
An example of the HTML code:
.. image:: seqclusterViz_example.png
Stats
========
Deprecated (this stats are part of the cluster subcommand now.)
You can obtain different statistics from the analyais:
* abundance distribution by length of reads that have been aligned,
that have appear in the output, and annotated with different databases.
To obtain this, you need to run this command::
samtools index Aligned.sortedByCoord.out.bam
seqcluster stats -j res/cluster/seqcluster.json -m res/seqs.ma -a Aligned.sortedByCoord.out.bam -o res/stats
The output file is ``stats_align.dat``. It is a 4 column file with the following information:
* size of the read
* sample
* expression
* class: ALIGN (aligned read), JSON (included in final output), DATABASE (names of the databases assigned to the read)
| .. _more_output:
***************
More outputs
***************
Report
========
Beside the static HTML report that you can get using ``report`` `subcommand <http://seqcluster.readthedocs.org/getting_started.html#report>`_, you can download `this <https://github.com/lpantano/seqclusterViz/archive/master.zip>`_ HTML. (watch the repository to get notifications of new releases.)
* Go inside ``seqclusterViz`` folder
* Open ``reader.html``
* Upload the ``seqcluster.db`` file generated by ``report`` subcommand.
* Start browsing your data!
An example of the HTML code:
.. image:: seqclusterViz_example.png
Stats
========
Deprecated (this stats are part of the cluster subcommand now.)
| Remove unused command [skip CI] | Remove unused command [skip CI] | reStructuredText | mit | lpantano/seqcluster,lpantano/seqcluster,lpantano/seqcluster,lpantano/seqcluster,lpantano/seqcluster | restructuredtext | ## Code Before:
.. _more_output:
***************
More outputs
***************
Report
========
Beside the static HTML report that you can get using ``report`` `subcommand <http://seqcluster.readthedocs.org/getting_started.html#report>`_, you can download `this <https://github.com/lpantano/seqclusterViz/archive/master.zip>`_ HTML. (watch the repository to get notifications of new releases.)
* Go inside ``seqclusterViz`` folder
* Open ``reader.html``
* Upload the ``seqcluster.db`` file generated by ``report`` subcommand.
* Start browsing your data!
An example of the HTML code:
.. image:: seqclusterViz_example.png
Stats
========
Deprecated (this stats are part of the cluster subcommand now.)
You can obtain different statistics from the analyais:
* abundance distribution by length of reads that have been aligned,
that have appear in the output, and annotated with different databases.
To obtain this, you need to run this command::
samtools index Aligned.sortedByCoord.out.bam
seqcluster stats -j res/cluster/seqcluster.json -m res/seqs.ma -a Aligned.sortedByCoord.out.bam -o res/stats
The output file is ``stats_align.dat``. It is a 4 column file with the following information:
* size of the read
* sample
* expression
* class: ALIGN (aligned read), JSON (included in final output), DATABASE (names of the databases assigned to the read)
## Instruction:
Remove unused command [skip CI]
## Code After:
.. _more_output:
***************
More outputs
***************
Report
========
Beside the static HTML report that you can get using ``report`` `subcommand <http://seqcluster.readthedocs.org/getting_started.html#report>`_, you can download `this <https://github.com/lpantano/seqclusterViz/archive/master.zip>`_ HTML. (watch the repository to get notifications of new releases.)
* Go inside ``seqclusterViz`` folder
* Open ``reader.html``
* Upload the ``seqcluster.db`` file generated by ``report`` subcommand.
* Start browsing your data!
An example of the HTML code:
.. image:: seqclusterViz_example.png
Stats
========
Deprecated (this stats are part of the cluster subcommand now.)
| .. _more_output:
***************
More outputs
***************
Report
========
Beside the static HTML report that you can get using ``report`` `subcommand <http://seqcluster.readthedocs.org/getting_started.html#report>`_, you can download `this <https://github.com/lpantano/seqclusterViz/archive/master.zip>`_ HTML. (watch the repository to get notifications of new releases.)
* Go inside ``seqclusterViz`` folder
* Open ``reader.html``
* Upload the ``seqcluster.db`` file generated by ``report`` subcommand.
* Start browsing your data!
An example of the HTML code:
.. image:: seqclusterViz_example.png
Stats
========
Deprecated (this stats are part of the cluster subcommand now.)
-
- You can obtain different statistics from the analyais:
-
- * abundance distribution by length of reads that have been aligned,
- that have appear in the output, and annotated with different databases.
- To obtain this, you need to run this command::
-
- samtools index Aligned.sortedByCoord.out.bam
- seqcluster stats -j res/cluster/seqcluster.json -m res/seqs.ma -a Aligned.sortedByCoord.out.bam -o res/stats
-
- The output file is ``stats_align.dat``. It is a 4 column file with the following information:
-
- * size of the read
- * sample
- * expression
- * class: ALIGN (aligned read), JSON (included in final output), DATABASE (names of the databases assigned to the read) | 16 | 0.380952 | 0 | 16 |
63e5d6617c2fd7c48be4af96922b51e42ff93d3a | doc/source/reference/algorithms.operators.rst | doc/source/reference/algorithms.operators.rst | .. _operators:
Operators
*********
.. automodule:: networkx.algorithms.operators.unary
.. autosummary::
:toctree: generated/
complement
.. automodule:: networkx.algorithms.operators.binary
.. autosummary::
:toctree: generated/
compose
union
disjoint_union
intersection
difference
symmetric_difference
.. automodule:: networkx.algorithms.operators.all
.. autosummary::
:toctree: generated/
compose_all
union_all
disjoint_union_all
intersection_all
.. automodule:: networkx.algorithms.operators.product
.. autosummary::
:toctree: generated/
cartesian_product
lexicographic_product
strong_product
tensor_product
| .. _operators:
Operators
*********
.. automodule:: networkx.algorithms.operators.unary
.. autosummary::
:toctree: generated/
complement
reverse
.. automodule:: networkx.algorithms.operators.binary
.. autosummary::
:toctree: generated/
compose
union
disjoint_union
intersection
difference
symmetric_difference
.. automodule:: networkx.algorithms.operators.all
.. autosummary::
:toctree: generated/
compose_all
union_all
disjoint_union_all
intersection_all
.. automodule:: networkx.algorithms.operators.product
.. autosummary::
:toctree: generated/
cartesian_product
lexicographic_product
strong_product
tensor_product
| Add unary reverse operator to documentation. | Add unary reverse operator to documentation.
| reStructuredText | bsd-3-clause | blublud/networkx,Sixshaman/networkx,farhaanbukhsh/networkx,jakevdp/networkx,ltiao/networkx,jtorrents/networkx,debsankha/networkx,ghdk/networkx,michaelpacer/networkx,JamesClough/networkx,kernc/networkx,yashu-seth/networkx,ghdk/networkx,wasade/networkx,chrisnatali/networkx,farhaanbukhsh/networkx,harlowja/networkx,farhaanbukhsh/networkx,dhimmel/networkx,harlowja/networkx,chrisnatali/networkx,kai5263499/networkx,jni/networkx,jakevdp/networkx,bzero/networkx,chrisnatali/networkx,sharifulgeo/networkx,ionanrozenfeld/networkx,jakevdp/networkx,jcurbelo/networkx,kai5263499/networkx,debsankha/networkx,RMKD/networkx,dmoliveira/networkx,dmoliveira/networkx,ghdk/networkx,aureooms/networkx,RMKD/networkx,kernc/networkx,dhimmel/networkx,jtorrents/networkx,RMKD/networkx,sharifulgeo/networkx,nathania/networkx,andnovar/networkx,bzero/networkx,aureooms/networkx,jni/networkx,kai5263499/networkx,ionanrozenfeld/networkx,cmtm/networkx,blublud/networkx,goulu/networkx,NvanAdrichem/networkx,beni55/networkx,dhimmel/networkx,dmoliveira/networkx,SanketDG/networkx,OrkoHunter/networkx,debsankha/networkx,nathania/networkx,aureooms/networkx,harlowja/networkx,nathania/networkx,blublud/networkx,jfinkels/networkx,bzero/networkx,jni/networkx,sharifulgeo/networkx,tmilicic/networkx,ionanrozenfeld/networkx,kernc/networkx | restructuredtext | ## Code Before:
.. _operators:
Operators
*********
.. automodule:: networkx.algorithms.operators.unary
.. autosummary::
:toctree: generated/
complement
.. automodule:: networkx.algorithms.operators.binary
.. autosummary::
:toctree: generated/
compose
union
disjoint_union
intersection
difference
symmetric_difference
.. automodule:: networkx.algorithms.operators.all
.. autosummary::
:toctree: generated/
compose_all
union_all
disjoint_union_all
intersection_all
.. automodule:: networkx.algorithms.operators.product
.. autosummary::
:toctree: generated/
cartesian_product
lexicographic_product
strong_product
tensor_product
## Instruction:
Add unary reverse operator to documentation.
## Code After:
.. _operators:
Operators
*********
.. automodule:: networkx.algorithms.operators.unary
.. autosummary::
:toctree: generated/
complement
reverse
.. automodule:: networkx.algorithms.operators.binary
.. autosummary::
:toctree: generated/
compose
union
disjoint_union
intersection
difference
symmetric_difference
.. automodule:: networkx.algorithms.operators.all
.. autosummary::
:toctree: generated/
compose_all
union_all
disjoint_union_all
intersection_all
.. automodule:: networkx.algorithms.operators.product
.. autosummary::
:toctree: generated/
cartesian_product
lexicographic_product
strong_product
tensor_product
| .. _operators:
Operators
*********
.. automodule:: networkx.algorithms.operators.unary
.. autosummary::
:toctree: generated/
complement
+ reverse
.. automodule:: networkx.algorithms.operators.binary
.. autosummary::
:toctree: generated/
compose
union
disjoint_union
intersection
difference
symmetric_difference
.. automodule:: networkx.algorithms.operators.all
.. autosummary::
:toctree: generated/
compose_all
union_all
disjoint_union_all
intersection_all
.. automodule:: networkx.algorithms.operators.product
.. autosummary::
:toctree: generated/
cartesian_product
lexicographic_product
strong_product
tensor_product
| 1 | 0.022222 | 1 | 0 |
2831d0eba9cd5f7435aa62d6b1b4d28c2bc6c413 | .travis.yml | .travis.yml | language: node_js
node_js:
- "0.10"
- "iojs"
install:
- travis_retry npm install -g grunt-cli@0.1.9
- travis_retry npm install
notifications:
email: false
cache:
directories:
- node_modules
branches:
only:
- master
env:
- TEST_CMD: test:unit
- TEST_CMD: shell:cheapseats:--range:0..1
# Add back in when we're out of emergency mode
# - TEST_CMD: shell:cheapseats:--range:0..50
# - TEST_CMD: shell:cheapseats:--range:51..100
# - TEST_CMD: shell:cheapseats:--range:101..150
# - TEST_CMD: shell:cheapseats:--range:151..
#
script: "grunt $TEST_CMD"
matrix:
fast_finish: true
| language: node_js
node_js:
- "0.10"
install:
- travis_retry npm install -g grunt-cli@0.1.9
- travis_retry npm install
notifications:
email: false
cache:
directories:
- node_modules
branches:
only:
- master
env:
- TEST_CMD: test:unit
- TEST_CMD: shell:cheapseats:--range:0..1
# Add back in when we're out of emergency mode
# - TEST_CMD: shell:cheapseats:--range:0..50
# - TEST_CMD: shell:cheapseats:--range:51..100
# - TEST_CMD: shell:cheapseats:--range:101..150
# - TEST_CMD: shell:cheapseats:--range:151..
#
script: "grunt $TEST_CMD"
matrix:
fast_finish: true
| Revert "Try running builds in io.js too" | Revert "Try running builds in io.js too"
| YAML | mit | alphagov/spotlight,keithiopia/spotlight,tijmenb/spotlight,alphagov/spotlight,keithiopia/spotlight,tijmenb/spotlight,keithiopia/spotlight,alphagov/spotlight,tijmenb/spotlight | yaml | ## Code Before:
language: node_js
node_js:
- "0.10"
- "iojs"
install:
- travis_retry npm install -g grunt-cli@0.1.9
- travis_retry npm install
notifications:
email: false
cache:
directories:
- node_modules
branches:
only:
- master
env:
- TEST_CMD: test:unit
- TEST_CMD: shell:cheapseats:--range:0..1
# Add back in when we're out of emergency mode
# - TEST_CMD: shell:cheapseats:--range:0..50
# - TEST_CMD: shell:cheapseats:--range:51..100
# - TEST_CMD: shell:cheapseats:--range:101..150
# - TEST_CMD: shell:cheapseats:--range:151..
#
script: "grunt $TEST_CMD"
matrix:
fast_finish: true
## Instruction:
Revert "Try running builds in io.js too"
## Code After:
language: node_js
node_js:
- "0.10"
install:
- travis_retry npm install -g grunt-cli@0.1.9
- travis_retry npm install
notifications:
email: false
cache:
directories:
- node_modules
branches:
only:
- master
env:
- TEST_CMD: test:unit
- TEST_CMD: shell:cheapseats:--range:0..1
# Add back in when we're out of emergency mode
# - TEST_CMD: shell:cheapseats:--range:0..50
# - TEST_CMD: shell:cheapseats:--range:51..100
# - TEST_CMD: shell:cheapseats:--range:101..150
# - TEST_CMD: shell:cheapseats:--range:151..
#
script: "grunt $TEST_CMD"
matrix:
fast_finish: true
| language: node_js
node_js:
- "0.10"
- - "iojs"
install:
- travis_retry npm install -g grunt-cli@0.1.9
- travis_retry npm install
notifications:
email: false
cache:
directories:
- node_modules
branches:
only:
- master
env:
- TEST_CMD: test:unit
- TEST_CMD: shell:cheapseats:--range:0..1
# Add back in when we're out of emergency mode
# - TEST_CMD: shell:cheapseats:--range:0..50
# - TEST_CMD: shell:cheapseats:--range:51..100
# - TEST_CMD: shell:cheapseats:--range:101..150
# - TEST_CMD: shell:cheapseats:--range:151..
#
script: "grunt $TEST_CMD"
matrix:
fast_finish: true | 1 | 0.037037 | 0 | 1 |
6c5d8a58f1e9760ebd73c9fa41d9adfb5fff1893 | tests/helpers/setup-mirage.js | tests/helpers/setup-mirage.js | import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
import window from 'ember-window-mock';
import { setupWindowMock } from 'ember-window-mock/test-support';
import timekeeper from 'timekeeper';
export default function (hooks) {
setupMirage(hooks);
setupWindowMock(hooks);
// To have deterministic visual tests, the seed has to be constant
hooks.beforeEach(function () {
timekeeper.freeze(new Date('11/20/2017 12:00'));
this.authenticateAs = user => {
this.server.create('mirage-session', { user });
window.localStorage.setItem('isLoggedIn', '1');
};
});
hooks.afterEach(function () {
timekeeper.reset();
});
}
| import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
import window from 'ember-window-mock';
import { setupWindowMock } from 'ember-window-mock/test-support';
import timekeeper from 'timekeeper';
export default function (hooks) {
setupMirage(hooks);
setupWindowMock(hooks);
// To have deterministic visual tests, the seed has to be constant
hooks.beforeEach(function () {
timekeeper.travel(new Date('2017-11-20T12:00:00'));
this.authenticateAs = user => {
this.server.create('mirage-session', { user });
window.localStorage.setItem('isLoggedIn', '1');
};
});
hooks.afterEach(function () {
timekeeper.reset();
});
}
| Use time travel instead of time freezing | tests/helpers: Use time travel instead of time freezing
| JavaScript | apache-2.0 | rust-lang/crates.io,rust-lang/crates.io,rust-lang/crates.io,rust-lang/crates.io | javascript | ## Code Before:
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
import window from 'ember-window-mock';
import { setupWindowMock } from 'ember-window-mock/test-support';
import timekeeper from 'timekeeper';
export default function (hooks) {
setupMirage(hooks);
setupWindowMock(hooks);
// To have deterministic visual tests, the seed has to be constant
hooks.beforeEach(function () {
timekeeper.freeze(new Date('11/20/2017 12:00'));
this.authenticateAs = user => {
this.server.create('mirage-session', { user });
window.localStorage.setItem('isLoggedIn', '1');
};
});
hooks.afterEach(function () {
timekeeper.reset();
});
}
## Instruction:
tests/helpers: Use time travel instead of time freezing
## Code After:
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
import window from 'ember-window-mock';
import { setupWindowMock } from 'ember-window-mock/test-support';
import timekeeper from 'timekeeper';
export default function (hooks) {
setupMirage(hooks);
setupWindowMock(hooks);
// To have deterministic visual tests, the seed has to be constant
hooks.beforeEach(function () {
timekeeper.travel(new Date('2017-11-20T12:00:00'));
this.authenticateAs = user => {
this.server.create('mirage-session', { user });
window.localStorage.setItem('isLoggedIn', '1');
};
});
hooks.afterEach(function () {
timekeeper.reset();
});
}
| import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
import window from 'ember-window-mock';
import { setupWindowMock } from 'ember-window-mock/test-support';
import timekeeper from 'timekeeper';
export default function (hooks) {
setupMirage(hooks);
setupWindowMock(hooks);
// To have deterministic visual tests, the seed has to be constant
hooks.beforeEach(function () {
- timekeeper.freeze(new Date('11/20/2017 12:00'));
? ^ ^^^ ------ ^
+ timekeeper.travel(new Date('2017-11-20T12:00:00'));
? ^ ++ ^ ^^^^^^^ +++
this.authenticateAs = user => {
this.server.create('mirage-session', { user });
window.localStorage.setItem('isLoggedIn', '1');
};
});
hooks.afterEach(function () {
timekeeper.reset();
});
} | 2 | 0.086957 | 1 | 1 |
c56b1706695c39d6743d5a7bd097bf8aac4aeaee | db/seeds/data/permitted_domains.yml | db/seeds/data/permitted_domains.yml | - cjs.gsi.gov.uk
- digital.cabinet-office.gov.uk
- digital.justice.gov.uk
- hmcourts-service.gsi.gov.uk
- hmcts.gsi.gov.uk
- hmps.gsi.gov.uk
- homeoffice.gsi.gov.uk
- ips.gsi.gov.uk
- justice.gsi.gov.uk
- legalaid.gsi.gov.uk
- noms.gsi.gov.uk
- publicguardian.gsi.gov.uk
- yjb.gsi.gov.uk
| - cafcass.gsi.gov.uk
- ccrc.x.gsi.gov.uk
- cica.gsi.gov.uk
- cjs.gsi.gov.uk
- digital.cabinet-office.gov.uk
- digital.justice.gov.uk
- hmcourts-service.gsi.gov.uk
- hmcts.gsi.gov.uk
- hmiprisons.gsi.gov.uk
- hmiprobation.gsi.gov.uk
- hmps.gsi.gov.uk
- homeoffice.gsi.gov.uk
- ips.gsi.gov.uk
- jac.gsi.gov.uk
- jaco.gsi.gov.uk
- judiciary.gsi.gov.uk
- justice.gsi.gov.uk
- lawcommission.gsi.gov.uk
- legalaid.gsi.gov.uk
- legalombudsman.org.uk
- legalservicesboard.org.uk
- noms.gsi.gov.uk
- offsol.gsi.gov.uk
- paroleboard.gsi.gov.uk
- ppo.gsi.gov.uk
- publicguardian.gsi.gov.uk
- sentencingcouncil.gsi.gov.uk
- yjb.gsi.gov.uk
| Extend list of permitted domains | Extend list of permitted domains
| YAML | mit | ministryofjustice/peoplefinder,ministryofjustice/peoplefinder,ministryofjustice/peoplefinder,ministryofjustice/peoplefinder,ministryofjustice/peoplefinder | yaml | ## Code Before:
- cjs.gsi.gov.uk
- digital.cabinet-office.gov.uk
- digital.justice.gov.uk
- hmcourts-service.gsi.gov.uk
- hmcts.gsi.gov.uk
- hmps.gsi.gov.uk
- homeoffice.gsi.gov.uk
- ips.gsi.gov.uk
- justice.gsi.gov.uk
- legalaid.gsi.gov.uk
- noms.gsi.gov.uk
- publicguardian.gsi.gov.uk
- yjb.gsi.gov.uk
## Instruction:
Extend list of permitted domains
## Code After:
- cafcass.gsi.gov.uk
- ccrc.x.gsi.gov.uk
- cica.gsi.gov.uk
- cjs.gsi.gov.uk
- digital.cabinet-office.gov.uk
- digital.justice.gov.uk
- hmcourts-service.gsi.gov.uk
- hmcts.gsi.gov.uk
- hmiprisons.gsi.gov.uk
- hmiprobation.gsi.gov.uk
- hmps.gsi.gov.uk
- homeoffice.gsi.gov.uk
- ips.gsi.gov.uk
- jac.gsi.gov.uk
- jaco.gsi.gov.uk
- judiciary.gsi.gov.uk
- justice.gsi.gov.uk
- lawcommission.gsi.gov.uk
- legalaid.gsi.gov.uk
- legalombudsman.org.uk
- legalservicesboard.org.uk
- noms.gsi.gov.uk
- offsol.gsi.gov.uk
- paroleboard.gsi.gov.uk
- ppo.gsi.gov.uk
- publicguardian.gsi.gov.uk
- sentencingcouncil.gsi.gov.uk
- yjb.gsi.gov.uk
| + - cafcass.gsi.gov.uk
+ - ccrc.x.gsi.gov.uk
+ - cica.gsi.gov.uk
- cjs.gsi.gov.uk
- digital.cabinet-office.gov.uk
- digital.justice.gov.uk
- hmcourts-service.gsi.gov.uk
- hmcts.gsi.gov.uk
+ - hmiprisons.gsi.gov.uk
+ - hmiprobation.gsi.gov.uk
- hmps.gsi.gov.uk
- homeoffice.gsi.gov.uk
- ips.gsi.gov.uk
+ - jac.gsi.gov.uk
+ - jaco.gsi.gov.uk
+ - judiciary.gsi.gov.uk
- justice.gsi.gov.uk
+ - lawcommission.gsi.gov.uk
- legalaid.gsi.gov.uk
+ - legalombudsman.org.uk
+ - legalservicesboard.org.uk
- noms.gsi.gov.uk
+ - offsol.gsi.gov.uk
+ - paroleboard.gsi.gov.uk
+ - ppo.gsi.gov.uk
- publicguardian.gsi.gov.uk
+ - sentencingcouncil.gsi.gov.uk
- yjb.gsi.gov.uk | 15 | 1.153846 | 15 | 0 |
27b7f91e14b4168feeeaf4eb2a63995bf480988a | lib/usaidwat/service.rb | lib/usaidwat/service.rb | require 'unirest'
module USaidWat
module Service
class RedditService
def user(username)
data = {}
%w{about comments submitted}.each do |page|
url = "https://www.reddit.com/user/#{username}/#{page}.json"
hdrs = {'User-Agent' => "usaidwat v#{USaidWat::VERSION}"}
r = Unirest.get(url, :headers => hdrs)
data[page.to_sym] = case r.code
when 404 then :no_such_user
when 500 then :server_error
else r.body
end
end
USaidWat::Thing::User.new(username, data[:about], data[:comments], data[:submitted])
end
end
class MockService
def user(username)
USaidWat::Thing::User.new(username,
load_data("user_#{username}.json"),
load_data("#{username}.json"),
load_data("submissions_#{username}.json"))
end
private
def load_data(data_file)
path = File.join(File.dirname(__FILE__), "..", "..", "features", "fixtures", data_file)
return :no_such_user unless File.exists?(path)
JSON.parse(IO.read(path))
end
end
end
end
| require 'unirest'
module USaidWat
module Service
class RedditService
USER_AGENT = "usaidwat v#{USaidWat::VERSION}"
def user(username)
data = {}
%w{about comments submitted}.each do |page|
url = "https://www.reddit.com/user/#{username}/#{page}.json"
hdrs = {'User-Agent' => USER_AGENT}
r = Unirest.get(url, :headers => hdrs)
data[page.to_sym] = case r.code
when 404 then :no_such_user
when 500 then :server_error
else r.body
end
end
USaidWat::Thing::User.new(username, data[:about], data[:comments], data[:submitted])
end
end
class MockService
def user(username)
USaidWat::Thing::User.new(username,
load_data("user_#{username}.json"),
load_data("#{username}.json"),
load_data("submissions_#{username}.json"))
end
private
def load_data(data_file)
path = File.join(File.dirname(__FILE__), "..", "..", "features", "fixtures", data_file)
return :no_such_user unless File.exists?(path)
JSON.parse(IO.read(path))
end
end
end
end
| Make user agent a class constant | Make user agent a class constant
| Ruby | mit | mdippery/usaidwat | ruby | ## Code Before:
require 'unirest'
module USaidWat
module Service
class RedditService
def user(username)
data = {}
%w{about comments submitted}.each do |page|
url = "https://www.reddit.com/user/#{username}/#{page}.json"
hdrs = {'User-Agent' => "usaidwat v#{USaidWat::VERSION}"}
r = Unirest.get(url, :headers => hdrs)
data[page.to_sym] = case r.code
when 404 then :no_such_user
when 500 then :server_error
else r.body
end
end
USaidWat::Thing::User.new(username, data[:about], data[:comments], data[:submitted])
end
end
class MockService
def user(username)
USaidWat::Thing::User.new(username,
load_data("user_#{username}.json"),
load_data("#{username}.json"),
load_data("submissions_#{username}.json"))
end
private
def load_data(data_file)
path = File.join(File.dirname(__FILE__), "..", "..", "features", "fixtures", data_file)
return :no_such_user unless File.exists?(path)
JSON.parse(IO.read(path))
end
end
end
end
## Instruction:
Make user agent a class constant
## Code After:
require 'unirest'
module USaidWat
module Service
class RedditService
USER_AGENT = "usaidwat v#{USaidWat::VERSION}"
def user(username)
data = {}
%w{about comments submitted}.each do |page|
url = "https://www.reddit.com/user/#{username}/#{page}.json"
hdrs = {'User-Agent' => USER_AGENT}
r = Unirest.get(url, :headers => hdrs)
data[page.to_sym] = case r.code
when 404 then :no_such_user
when 500 then :server_error
else r.body
end
end
USaidWat::Thing::User.new(username, data[:about], data[:comments], data[:submitted])
end
end
class MockService
def user(username)
USaidWat::Thing::User.new(username,
load_data("user_#{username}.json"),
load_data("#{username}.json"),
load_data("submissions_#{username}.json"))
end
private
def load_data(data_file)
path = File.join(File.dirname(__FILE__), "..", "..", "features", "fixtures", data_file)
return :no_such_user unless File.exists?(path)
JSON.parse(IO.read(path))
end
end
end
end
| require 'unirest'
module USaidWat
module Service
class RedditService
+ USER_AGENT = "usaidwat v#{USaidWat::VERSION}"
+
def user(username)
data = {}
%w{about comments submitted}.each do |page|
url = "https://www.reddit.com/user/#{username}/#{page}.json"
- hdrs = {'User-Agent' => "usaidwat v#{USaidWat::VERSION}"}
+ hdrs = {'User-Agent' => USER_AGENT}
r = Unirest.get(url, :headers => hdrs)
data[page.to_sym] = case r.code
when 404 then :no_such_user
when 500 then :server_error
else r.body
end
end
USaidWat::Thing::User.new(username, data[:about], data[:comments], data[:submitted])
end
end
class MockService
def user(username)
USaidWat::Thing::User.new(username,
load_data("user_#{username}.json"),
load_data("#{username}.json"),
load_data("submissions_#{username}.json"))
end
private
def load_data(data_file)
path = File.join(File.dirname(__FILE__), "..", "..", "features", "fixtures", data_file)
return :no_such_user unless File.exists?(path)
JSON.parse(IO.read(path))
end
end
end
end | 4 | 0.102564 | 3 | 1 |
c8194d635a6552269b541bb8d85cf6f9405ab2fa | client/src/services/users.js | client/src/services/users.js | import Connection from './Connection.js';
const API_PATH = '/users';
class RiderCardsApi {
createUser(userData) {
return Connection.send(API_PATH, userData, 'POST');
}
}
export default new RiderCardsApi();
| import Connection from './Connection.js';
const API_PATH = '/users';
class UsersApi {
createUser(userData) {
return Connection.send(API_PATH, userData, 'POST');
}
}
export default new UsersApi();
| Rename a leftover class name | Rename a leftover class name
| JavaScript | apache-2.0 | kakato10/hirundo2,kakato10/hirundo2 | javascript | ## Code Before:
import Connection from './Connection.js';
const API_PATH = '/users';
class RiderCardsApi {
createUser(userData) {
return Connection.send(API_PATH, userData, 'POST');
}
}
export default new RiderCardsApi();
## Instruction:
Rename a leftover class name
## Code After:
import Connection from './Connection.js';
const API_PATH = '/users';
class UsersApi {
createUser(userData) {
return Connection.send(API_PATH, userData, 'POST');
}
}
export default new UsersApi();
| import Connection from './Connection.js';
const API_PATH = '/users';
- class RiderCardsApi {
? ^^^ ----
+ class UsersApi {
? ^^
createUser(userData) {
return Connection.send(API_PATH, userData, 'POST');
}
}
+
- export default new RiderCardsApi();
? ^^^ ----
+ export default new UsersApi();
? ^^
| 5 | 0.5 | 3 | 2 |
93a3703d7f587f125515425e79845c9c911df0eb | elyoos/components/question/dialog/CreateQuestionDialog.vue | elyoos/components/question/dialog/CreateQuestionDialog.vue | <template>
<v-layout row justify-center>
<v-dialog v-model="dialog" scrollable persistent max-width="650px">
<create-question-dialog-content @close-dialog="$emit('close-dialog')"
:init-question="$store.getters['createQuestion/getQuestionCopy']">
</create-question-dialog-content>
</v-dialog>
</v-layout>
</template>
<script>
import CreateQuestionDialogContent from './CreateQuestionDialogContent';
export default {
data() {
return {dialog: true}
},
components: {CreateQuestionDialogContent}
}
</script>
<style lang="scss">
</style>
| <template>
<v-layout row justify-center>
<v-dialog v-model="dialog" scrollable persistent max-width="650px">
<create-question-dialog-content @close-dialog="$emit('close-dialog')"
:init-question="$store.getters['createQuestion/getQuestionCopy']">
</create-question-dialog-content>
</v-dialog>
</v-layout>
</template>
<script>
import CreateQuestionDialogContent from './CreateQuestionDialogContent';
export default {
data() {
return {dialog: true}
},
created() {
this.$store.commit('createQuestion/RESET');
},
components: {CreateQuestionDialogContent}
}
</script>
<style lang="scss">
</style>
| Delete previous question when created. | Delete previous question when created.
| Vue | agpl-3.0 | Elyoos/Elyoos,Elyoos/Elyoos,Elyoos/Elyoos | vue | ## Code Before:
<template>
<v-layout row justify-center>
<v-dialog v-model="dialog" scrollable persistent max-width="650px">
<create-question-dialog-content @close-dialog="$emit('close-dialog')"
:init-question="$store.getters['createQuestion/getQuestionCopy']">
</create-question-dialog-content>
</v-dialog>
</v-layout>
</template>
<script>
import CreateQuestionDialogContent from './CreateQuestionDialogContent';
export default {
data() {
return {dialog: true}
},
components: {CreateQuestionDialogContent}
}
</script>
<style lang="scss">
</style>
## Instruction:
Delete previous question when created.
## Code After:
<template>
<v-layout row justify-center>
<v-dialog v-model="dialog" scrollable persistent max-width="650px">
<create-question-dialog-content @close-dialog="$emit('close-dialog')"
:init-question="$store.getters['createQuestion/getQuestionCopy']">
</create-question-dialog-content>
</v-dialog>
</v-layout>
</template>
<script>
import CreateQuestionDialogContent from './CreateQuestionDialogContent';
export default {
data() {
return {dialog: true}
},
created() {
this.$store.commit('createQuestion/RESET');
},
components: {CreateQuestionDialogContent}
}
</script>
<style lang="scss">
</style>
| <template>
<v-layout row justify-center>
<v-dialog v-model="dialog" scrollable persistent max-width="650px">
<create-question-dialog-content @close-dialog="$emit('close-dialog')"
:init-question="$store.getters['createQuestion/getQuestionCopy']">
</create-question-dialog-content>
</v-dialog>
</v-layout>
</template>
<script>
import CreateQuestionDialogContent from './CreateQuestionDialogContent';
export default {
data() {
return {dialog: true}
},
+ created() {
+ this.$store.commit('createQuestion/RESET');
+ },
components: {CreateQuestionDialogContent}
}
</script>
<style lang="scss">
</style> | 3 | 0.125 | 3 | 0 |
eee5f72d4e50742a2df3fc076163798c5ca717b6 | src/test/java/net/runelite/cache/fs/StoreLoadTest.java | src/test/java/net/runelite/cache/fs/StoreLoadTest.java | package net.runelite.cache.fs;
import java.io.IOException;
import org.junit.Test;
public class StoreLoadTest
{
@Test
public void test() throws IOException
{
Store store = new Store(new java.io.File("d:/rs/07/cache"));//c:/rs/cache"));
store.load();
System.out.println(store);
}
}
| package net.runelite.cache.fs;
import java.io.FileOutputStream;
import java.io.IOException;
import org.junit.Test;
public class StoreLoadTest
{
@Test
public void test() throws IOException
{
Store store = new Store(new java.io.File("d:/rs/07/cache"));//c:/rs/cache"));
store.load();
System.out.println(store);
}
//@Test
public void unpackStore() throws IOException
{
java.io.File base = new java.io.File("d:/rs/07/cache");
try (Store store = new Store(base))
{
store.load();
for (Index i : store.getIndexes())
{
java.io.File ifile = new java.io.File(base, "" + i.getId());
ifile.mkdir();
for (Archive a : i.getArchives())
{
java.io.File afile = new java.io.File(ifile, "" + a.getArchiveId());
afile.mkdir();
for (File f : a.getFiles())
{
java.io.File ffile = new java.io.File(afile, "" + f.getFileId());
try (FileOutputStream fout = new FileOutputStream(ffile))
{
if (f.getContents() != null)
fout.write(f.getContents());
}
}
}
}
}
}
}
| Add disabled test to dump cache | Add disabled test to dump cache
| Java | bsd-2-clause | Sethtroll/runelite,runelite/runelite,Sethtroll/runelite,KronosDesign/runelite,kfricilone/runelite,devinfrench/runelite,devinfrench/runelite,KronosDesign/runelite,abelbriggs1/runelite,Noremac201/runelite,l2-/runelite,abelbriggs1/runelite,Noremac201/runelite,abelbriggs1/runelite,l2-/runelite,kfricilone/runelite,UniquePassive/runelite,UniquePassive/runelite,runelite/runelite,runelite/runelite | java | ## Code Before:
package net.runelite.cache.fs;
import java.io.IOException;
import org.junit.Test;
public class StoreLoadTest
{
@Test
public void test() throws IOException
{
Store store = new Store(new java.io.File("d:/rs/07/cache"));//c:/rs/cache"));
store.load();
System.out.println(store);
}
}
## Instruction:
Add disabled test to dump cache
## Code After:
package net.runelite.cache.fs;
import java.io.FileOutputStream;
import java.io.IOException;
import org.junit.Test;
public class StoreLoadTest
{
@Test
public void test() throws IOException
{
Store store = new Store(new java.io.File("d:/rs/07/cache"));//c:/rs/cache"));
store.load();
System.out.println(store);
}
//@Test
public void unpackStore() throws IOException
{
java.io.File base = new java.io.File("d:/rs/07/cache");
try (Store store = new Store(base))
{
store.load();
for (Index i : store.getIndexes())
{
java.io.File ifile = new java.io.File(base, "" + i.getId());
ifile.mkdir();
for (Archive a : i.getArchives())
{
java.io.File afile = new java.io.File(ifile, "" + a.getArchiveId());
afile.mkdir();
for (File f : a.getFiles())
{
java.io.File ffile = new java.io.File(afile, "" + f.getFileId());
try (FileOutputStream fout = new FileOutputStream(ffile))
{
if (f.getContents() != null)
fout.write(f.getContents());
}
}
}
}
}
}
}
| package net.runelite.cache.fs;
+ import java.io.FileOutputStream;
import java.io.IOException;
import org.junit.Test;
public class StoreLoadTest
{
@Test
public void test() throws IOException
{
Store store = new Store(new java.io.File("d:/rs/07/cache"));//c:/rs/cache"));
store.load();
System.out.println(store);
}
+
+ //@Test
+ public void unpackStore() throws IOException
+ {
+ java.io.File base = new java.io.File("d:/rs/07/cache");
+ try (Store store = new Store(base))
+ {
+ store.load();
+
+ for (Index i : store.getIndexes())
+ {
+ java.io.File ifile = new java.io.File(base, "" + i.getId());
+ ifile.mkdir();
+
+ for (Archive a : i.getArchives())
+ {
+ java.io.File afile = new java.io.File(ifile, "" + a.getArchiveId());
+ afile.mkdir();
+
+ for (File f : a.getFiles())
+ {
+ java.io.File ffile = new java.io.File(afile, "" + f.getFileId());
+ try (FileOutputStream fout = new FileOutputStream(ffile))
+ {
+ if (f.getContents() != null)
+ fout.write(f.getContents());
+ }
+ }
+ }
+ }
+ }
+ }
} | 33 | 2.2 | 33 | 0 |
984c395e3f43764a4d8125aea7556179bb4766dd | test/_mysqldb_test.py | test/_mysqldb_test.py | '''
$ mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 211
Server version: 5.6.15 Homebrew
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database luigi;
Query OK, 1 row affected (0.00 sec)
'''
import mysql.connector
from luigi.contrib.mysqldb import MySqlTarget
import unittest
host = 'localhost'
port = 3306
database = 'luigi_test'
username = None
password = None
table_updates = 'table_updates'
def _create_test_database():
con = mysql.connector.connect(user=username,
password=password,
host=host,
port=port,
autocommit=True)
con.cursor().execute('CREATE DATABASE IF NOT EXISTS %s' % database)
_create_test_database()
target = MySqlTarget(host, database, username, password, '', 'update_id')
class MySqlTargetTest(unittest.TestCase):
def test_touch_and_exists(self):
drop()
self.assertFalse(target.exists(),
'Target should not exist before touching it')
target.touch()
self.assertTrue(target.exists(),
'Target should exist after touching it')
def drop():
con = target.connect(autocommit=True)
con.cursor().execute('DROP TABLE IF EXISTS %s' % table_updates)
| import mysql.connector
from luigi.contrib.mysqldb import MySqlTarget
import unittest
host = 'localhost'
port = 3306
database = 'luigi_test'
username = None
password = None
table_updates = 'table_updates'
def _create_test_database():
con = mysql.connector.connect(user=username,
password=password,
host=host,
port=port,
autocommit=True)
con.cursor().execute('CREATE DATABASE IF NOT EXISTS %s' % database)
_create_test_database()
target = MySqlTarget(host, database, username, password, '', 'update_id')
class MySqlTargetTest(unittest.TestCase):
def test_touch_and_exists(self):
drop()
self.assertFalse(target.exists(),
'Target should not exist before touching it')
target.touch()
self.assertTrue(target.exists(),
'Target should exist after touching it')
def drop():
con = target.connect(autocommit=True)
con.cursor().execute('DROP TABLE IF EXISTS %s' % table_updates)
| Remove the doc that describes the setup. Setup is automated now | Remove the doc that describes the setup. Setup is automated now
| Python | apache-2.0 | moritzschaefer/luigi,kalaidin/luigi,riga/luigi,foursquare/luigi,dylanjbarth/luigi,Dawny33/luigi,harveyxia/luigi,graingert/luigi,slvnperron/luigi,harveyxia/luigi,sahitya-pavurala/luigi,hadesbox/luigi,rayrrr/luigi,humanlongevity/luigi,Tarrasch/luigi,Magnetic/luigi,percyfal/luigi,torypages/luigi,stroykova/luigi,theoryno3/luigi,leafjungle/luigi,slvnperron/luigi,vine/luigi,Houzz/luigi,SeedScientific/luigi,stephenpascoe/luigi,fw1121/luigi,LamCiuLoeng/luigi,ivannotes/luigi,kalaidin/luigi,dhruvg/luigi,meyerson/luigi,ViaSat/luigi,jw0201/luigi,anyman/luigi,bowlofstew/luigi,kalaidin/luigi,Yoone/luigi,stephenpascoe/luigi,SkyTruth/luigi,dlstadther/luigi,dstandish/luigi,ZhenxingWu/luigi,theoryno3/luigi,Dawny33/luigi,PeteW/luigi,ZhenxingWu/luigi,mbruggmann/luigi,aeron15/luigi,foursquare/luigi,penelopy/luigi,laserson/luigi,h3biomed/luigi,wakamori/luigi,adaitche/luigi,kevhill/luigi,ContextLogic/luigi,slvnperron/luigi,dstandish/luigi,samepage-labs/luigi,huiyi1990/luigi,rayrrr/luigi,meyerson/luigi,ContextLogic/luigi,bmaggard/luigi,penelopy/luigi,torypages/luigi,slvnperron/luigi,hellais/luigi,linearregression/luigi,ehdr/luigi,springcoil/luigi,neilisaac/luigi,lungetech/luigi,spotify/luigi,Tarrasch/luigi,PeteW/luigi,dstandish/luigi,javrasya/luigi,dhruvg/luigi,torypages/luigi,wakamori/luigi,jw0201/luigi,rayrrr/luigi,springcoil/luigi,lungetech/luigi,laserson/luigi,h3biomed/luigi,realgo/luigi,mfcabrera/luigi,jw0201/luigi,joeshaw/luigi,oldpa/luigi,soxofaan/luigi,republic-analytics/luigi,ChrisBeaumont/luigi,rizzatti/luigi,graingert/luigi,linsomniac/luigi,penelopy/luigi,casey-green/luigi,DomainGroupOSS/luigi,neilisaac/luigi,altaf-ali/luigi,belevtsoff/luigi,gpoulin/luigi,edx/luigi,laserson/luigi,anyman/luigi,altaf-ali/luigi,DomainGroupOSS/luigi,dhruvg/luigi,adaitche/luigi,PeteW/luigi,huiyi1990/luigi,walkers-mv/luigi,dkroy/luigi,alkemics/luigi,JackDanger/luigi,moandcompany/luigi,altaf-ali/luigi,dlstadther/luigi,jamesmcm/luigi,tuulos/luigi,edx/luigi,vine/luigi,walkers-mv/luigi,anyman/luigi,linearregression/luigi,jamesmcm/luigi,glenndmello/luigi,JackDanger/luigi,moritzschaefer/luigi,thejens/luigi,soxofaan/luigi,kalaidin/luigi,stroykova/luigi,neilisaac/luigi,dkroy/luigi,ViaSat/luigi,17zuoye/luigi,anyman/luigi,ehdr/luigi,samuell/luigi,samuell/luigi,graingert/luigi,vine/luigi,belevtsoff/luigi,SkyTruth/luigi,upworthy/luigi,upworthy/luigi,lichia/luigi,joeshaw/luigi,fabriziodemaria/luigi,neilisaac/luigi,humanlongevity/luigi,wakamori/luigi,percyfal/luigi,Dawny33/luigi,lichia/luigi,ViaSat/luigi,hadesbox/luigi,dylanjbarth/luigi,17zuoye/luigi,Houzz/luigi,PeteW/luigi,joeshaw/luigi,samepage-labs/luigi,meyerson/luigi,ChrisBeaumont/luigi,ehdr/luigi,LamCiuLoeng/luigi,ZhenxingWu/luigi,dylanjbarth/luigi,Magnetic/luigi,theoryno3/luigi,samepage-labs/luigi,dhruvg/luigi,theoryno3/luigi,mfcabrera/luigi,kevhill/luigi,h3biomed/luigi,DomainGroupOSS/luigi,17zuoye/luigi,fabriziodemaria/luigi,leafjungle/luigi,drincruz/luigi,javrasya/luigi,LamCiuLoeng/luigi,mbruggmann/luigi,cpcloud/luigi,dstandish/luigi,lichia/luigi,ViaSat/luigi,fw1121/luigi,dylanjbarth/luigi,hadesbox/luigi,bmaggard/luigi,ivannotes/luigi,oldpa/luigi,Tarrasch/luigi,lichia/luigi,soxofaan/luigi,tuulos/luigi,linsomniac/luigi,realgo/luigi,qpxu007/luigi,qpxu007/luigi,bmaggard/luigi,moritzschaefer/luigi,graingert/luigi,springcoil/luigi,foursquare/luigi,soxofaan/luigi,riga/luigi,springcoil/luigi,spotify/luigi,realgo/luigi,upworthy/luigi,ivannotes/luigi,SeedScientific/luigi,percyfal/luigi,republic-analytics/luigi,pkexcellent/luigi,ehdr/luigi,walkers-mv/luigi,thejens/luigi,humanlongevity/luigi,rizzatti/luigi,ChrisBeaumont/luigi,ThQ/luigi,drincruz/luigi,fabriziodemaria/luigi,samepage-labs/luigi,glenndmello/luigi,vine/luigi,republic-analytics/luigi,ContextLogic/luigi,mfcabrera/luigi,republic-analytics/luigi,jamesmcm/luigi,Wattpad/luigi,mbruggmann/luigi,ThQ/luigi,rizzatti/luigi,bowlofstew/luigi,hadesbox/luigi,linsomniac/luigi,stephenpascoe/luigi,dlstadther/luigi,belevtsoff/luigi,stroykova/luigi,upworthy/luigi,stroykova/luigi,moritzschaefer/luigi,casey-green/luigi,leafjungle/luigi,SkyTruth/luigi,casey-green/luigi,dlstadther/luigi,JackDanger/luigi,moandcompany/luigi,moandcompany/luigi,Houzz/luigi,ivannotes/luigi,lungetech/luigi,javrasya/luigi,Tarrasch/luigi,mfcabrera/luigi,DomainGroupOSS/luigi,spotify/luigi,humanlongevity/luigi,wakamori/luigi,linearregression/luigi,qpxu007/luigi,moandcompany/luigi,hellais/luigi,17zuoye/luigi,bowlofstew/luigi,riga/luigi,pkexcellent/luigi,altaf-ali/luigi,harveyxia/luigi,riga/luigi,h3biomed/luigi,samuell/luigi,ChrisBeaumont/luigi,kevhill/luigi,rayrrr/luigi,LamCiuLoeng/luigi,penelopy/luigi,sahitya-pavurala/luigi,aeron15/luigi,samuell/luigi,rizzatti/luigi,jw0201/luigi,SkyTruth/luigi,alkemics/luigi,Dawny33/luigi,bmaggard/luigi,linearregression/luigi,alkemics/luigi,SeedScientific/luigi,ThQ/luigi,sahitya-pavurala/luigi,jamesmcm/luigi,dkroy/luigi,oldpa/luigi,lungetech/luigi,Wattpad/luigi,dkroy/luigi,aeron15/luigi,gpoulin/luigi,thejens/luigi,Magnetic/luigi,JackDanger/luigi,belevtsoff/luigi,sahitya-pavurala/luigi,pkexcellent/luigi,casey-green/luigi,walkers-mv/luigi,Yoone/luigi,glenndmello/luigi,Magnetic/luigi,qpxu007/luigi,drincruz/luigi,Wattpad/luigi,hellais/luigi,ZhenxingWu/luigi,glenndmello/luigi,huiyi1990/luigi,linsomniac/luigi,edx/luigi,aeron15/luigi,adaitche/luigi,fw1121/luigi,thejens/luigi,meyerson/luigi,fw1121/luigi,SeedScientific/luigi,kevhill/luigi,fabriziodemaria/luigi,harveyxia/luigi,foursquare/luigi,percyfal/luigi,laserson/luigi,leafjungle/luigi,tuulos/luigi,drincruz/luigi,bowlofstew/luigi,oldpa/luigi,spotify/luigi,tuulos/luigi,joeshaw/luigi,gpoulin/luigi,pkexcellent/luigi,gpoulin/luigi,Yoone/luigi,adaitche/luigi,huiyi1990/luigi,ThQ/luigi,torypages/luigi,hellais/luigi,stephenpascoe/luigi,edx/luigi,cpcloud/luigi,ContextLogic/luigi,javrasya/luigi,realgo/luigi,mbruggmann/luigi,Houzz/luigi,alkemics/luigi,Yoone/luigi | python | ## Code Before:
'''
$ mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 211
Server version: 5.6.15 Homebrew
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database luigi;
Query OK, 1 row affected (0.00 sec)
'''
import mysql.connector
from luigi.contrib.mysqldb import MySqlTarget
import unittest
host = 'localhost'
port = 3306
database = 'luigi_test'
username = None
password = None
table_updates = 'table_updates'
def _create_test_database():
con = mysql.connector.connect(user=username,
password=password,
host=host,
port=port,
autocommit=True)
con.cursor().execute('CREATE DATABASE IF NOT EXISTS %s' % database)
_create_test_database()
target = MySqlTarget(host, database, username, password, '', 'update_id')
class MySqlTargetTest(unittest.TestCase):
def test_touch_and_exists(self):
drop()
self.assertFalse(target.exists(),
'Target should not exist before touching it')
target.touch()
self.assertTrue(target.exists(),
'Target should exist after touching it')
def drop():
con = target.connect(autocommit=True)
con.cursor().execute('DROP TABLE IF EXISTS %s' % table_updates)
## Instruction:
Remove the doc that describes the setup. Setup is automated now
## Code After:
import mysql.connector
from luigi.contrib.mysqldb import MySqlTarget
import unittest
host = 'localhost'
port = 3306
database = 'luigi_test'
username = None
password = None
table_updates = 'table_updates'
def _create_test_database():
con = mysql.connector.connect(user=username,
password=password,
host=host,
port=port,
autocommit=True)
con.cursor().execute('CREATE DATABASE IF NOT EXISTS %s' % database)
_create_test_database()
target = MySqlTarget(host, database, username, password, '', 'update_id')
class MySqlTargetTest(unittest.TestCase):
def test_touch_and_exists(self):
drop()
self.assertFalse(target.exists(),
'Target should not exist before touching it')
target.touch()
self.assertTrue(target.exists(),
'Target should exist after touching it')
def drop():
con = target.connect(autocommit=True)
con.cursor().execute('DROP TABLE IF EXISTS %s' % table_updates)
| - '''
- $ mysql
- Welcome to the MySQL monitor. Commands end with ; or \g.
- Your MySQL connection id is 211
- Server version: 5.6.15 Homebrew
-
- Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
-
- Oracle is a registered trademark of Oracle Corporation and/or its
- affiliates. Other names may be trademarks of their respective
- owners.
-
- Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
-
- mysql> create database luigi;
- Query OK, 1 row affected (0.00 sec)
- '''
-
import mysql.connector
from luigi.contrib.mysqldb import MySqlTarget
import unittest
host = 'localhost'
port = 3306
database = 'luigi_test'
username = None
password = None
table_updates = 'table_updates'
def _create_test_database():
con = mysql.connector.connect(user=username,
password=password,
host=host,
port=port,
autocommit=True)
con.cursor().execute('CREATE DATABASE IF NOT EXISTS %s' % database)
_create_test_database()
target = MySqlTarget(host, database, username, password, '', 'update_id')
class MySqlTargetTest(unittest.TestCase):
def test_touch_and_exists(self):
drop()
self.assertFalse(target.exists(),
'Target should not exist before touching it')
target.touch()
self.assertTrue(target.exists(),
'Target should exist after touching it')
def drop():
con = target.connect(autocommit=True)
con.cursor().execute('DROP TABLE IF EXISTS %s' % table_updates) | 18 | 0.321429 | 0 | 18 |
3426c15c7b3e99e0722c9a5fffce440009930316 | README.md | README.md |
`smtpp` is a preprocessor for SMT-LIB 2.0 scripts with extensions for
lambda-terms and polymorphic types in scripts.
# Dependencies
- OCaml
- [menhir](http://gallium.inria.fr/~fpottier/menhir/)
For developers only:
- headache for license header generation
# Compilation
The usual incantation
```{.bash}
% ./configure
% make
```
should produce two binaries in `src`
- `smtpp.byt` : a bytecode executable software
- `smtpp.opt` : a native code executable
## Developers
If you are working in the `src` directory, you might not want to recompile
everything for every change.
If there is no `.depend` file, do a `touch .depend` first.
Otherwise:
- If you have just changed a file and not added any, a simple `make` should
suffice
- If you have added a file, add it to the Makefile in the proper file list, and
do a `make depend && make`.
# Documentation
Options are detailed on stdout by executing `smtpp.opt -help` or
`smtpp.byt -help`.
Code source documentation can be generated by typing `make doc` either at the
root or in the `src` directory.
<!-- LocalWords: smtpp
-->
|
`smtpp` is a preprocessor for SMT-LIB 2.0 scripts with extensions for
lambda-terms and polymorphic types in scripts.
# Dependencies
- OCaml
- [menhir](http://gallium.inria.fr/~fpottier/menhir/)
For developers only:
- headache for license header generation
# Compilation
The usual incantation
```{.bash}
% ./configure
% make
```
should produce two binaries in `src`
- `smtpp.byt` : a bytecode executable software
- `smtpp.opt` : a native code executable
## Developers
### Generating a configuration script
Generate a configure using `autoconf` in the `src` directory.
This uses the file `configure.ac`
```{.bash}
% autoconf
% ./configure
```
### Compiling from `src` ###
If you are working in the `src` directory, you might not want to recompile
everything for every change, assuming you have not changed your development
environment.
If there is no `.depend` file, do a `touch .depend` first.
Otherwise:
- If you have just changed a file and not added any, a simple `make` should
suffice
- If you have added a file, add it to the Makefile in the proper file list, and
do a `make depend && make`.
# Documentation
Options are detailed on stdout by executing `smtpp.opt -help` or
`smtpp.byt -help`.
Code source documentation can be generated by typing `make doc` either at the
root or in the `src` directory. This phase needs `ocamldoc`.
<!-- LocalWords: smtpp
-->
| Update documentation to show configure | Update documentation to show configure
| Markdown | isc | ossanha/smtpp,ossanha/smtpp | markdown | ## Code Before:
`smtpp` is a preprocessor for SMT-LIB 2.0 scripts with extensions for
lambda-terms and polymorphic types in scripts.
# Dependencies
- OCaml
- [menhir](http://gallium.inria.fr/~fpottier/menhir/)
For developers only:
- headache for license header generation
# Compilation
The usual incantation
```{.bash}
% ./configure
% make
```
should produce two binaries in `src`
- `smtpp.byt` : a bytecode executable software
- `smtpp.opt` : a native code executable
## Developers
If you are working in the `src` directory, you might not want to recompile
everything for every change.
If there is no `.depend` file, do a `touch .depend` first.
Otherwise:
- If you have just changed a file and not added any, a simple `make` should
suffice
- If you have added a file, add it to the Makefile in the proper file list, and
do a `make depend && make`.
# Documentation
Options are detailed on stdout by executing `smtpp.opt -help` or
`smtpp.byt -help`.
Code source documentation can be generated by typing `make doc` either at the
root or in the `src` directory.
<!-- LocalWords: smtpp
-->
## Instruction:
Update documentation to show configure
## Code After:
`smtpp` is a preprocessor for SMT-LIB 2.0 scripts with extensions for
lambda-terms and polymorphic types in scripts.
# Dependencies
- OCaml
- [menhir](http://gallium.inria.fr/~fpottier/menhir/)
For developers only:
- headache for license header generation
# Compilation
The usual incantation
```{.bash}
% ./configure
% make
```
should produce two binaries in `src`
- `smtpp.byt` : a bytecode executable software
- `smtpp.opt` : a native code executable
## Developers
### Generating a configuration script
Generate a configure using `autoconf` in the `src` directory.
This uses the file `configure.ac`
```{.bash}
% autoconf
% ./configure
```
### Compiling from `src` ###
If you are working in the `src` directory, you might not want to recompile
everything for every change, assuming you have not changed your development
environment.
If there is no `.depend` file, do a `touch .depend` first.
Otherwise:
- If you have just changed a file and not added any, a simple `make` should
suffice
- If you have added a file, add it to the Makefile in the proper file list, and
do a `make depend && make`.
# Documentation
Options are detailed on stdout by executing `smtpp.opt -help` or
`smtpp.byt -help`.
Code source documentation can be generated by typing `make doc` either at the
root or in the `src` directory. This phase needs `ocamldoc`.
<!-- LocalWords: smtpp
-->
|
`smtpp` is a preprocessor for SMT-LIB 2.0 scripts with extensions for
lambda-terms and polymorphic types in scripts.
# Dependencies
- OCaml
- [menhir](http://gallium.inria.fr/~fpottier/menhir/)
For developers only:
- headache for license header generation
# Compilation
The usual incantation
```{.bash}
% ./configure
% make
```
should produce two binaries in `src`
- `smtpp.byt` : a bytecode executable software
- `smtpp.opt` : a native code executable
-
## Developers
+ ### Generating a configuration script
+
+ Generate a configure using `autoconf` in the `src` directory.
+ This uses the file `configure.ac`
+
+ ```{.bash}
+ % autoconf
+ % ./configure
+ ```
+
+ ### Compiling from `src` ###
+
If you are working in the `src` directory, you might not want to recompile
- everything for every change.
+ everything for every change, assuming you have not changed your development
+ environment.
If there is no `.depend` file, do a `touch .depend` first.
Otherwise:
- If you have just changed a file and not added any, a simple `make` should
suffice
- If you have added a file, add it to the Makefile in the proper file list, and
do a `make depend && make`.
# Documentation
Options are detailed on stdout by executing `smtpp.opt -help` or
`smtpp.byt -help`.
Code source documentation can be generated by typing `make doc` either at the
- root or in the `src` directory.
+ root or in the `src` directory. This phase needs `ocamldoc`.
+
<!-- LocalWords: smtpp
--> | 19 | 0.358491 | 16 | 3 |
f967ba433284c573cbce47d84ae55c209801ad6e | ash/PRESUBMIT.py | ash/PRESUBMIT.py |
def GetPreferredTrySlaves():
return ['linux_chromeos']
|
def GetPreferredTrySlaves():
return ['linux_chromeos', 'linux_chromeos_clang']
| Add linux_chromeos_clang to the list of automatic trybots. | Add linux_chromeos_clang to the list of automatic trybots.
BUG=none
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10833037
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@148600 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | krieger-od/nwjs_chromium.src,anirudhSK/chromium,crosswalk-project/chromium-crosswalk-efl,Fireblend/chromium-crosswalk,M4sse/chromium.src,chuan9/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,M4sse/chromium.src,hgl888/chromium-crosswalk-efl,patrickm/chromium.src,crosswalk-project/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,anirudhSK/chromium,M4sse/chromium.src,axinging/chromium-crosswalk,pozdnyakov/chromium-crosswalk,Chilledheart/chromium,ondra-novak/chromium.src,ondra-novak/chromium.src,zcbenz/cefode-chromium,bright-sparks/chromium-spacewalk,anirudhSK/chromium,pozdnyakov/chromium-crosswalk,nacl-webkit/chrome_deps,nacl-webkit/chrome_deps,chuan9/chromium-crosswalk,patrickm/chromium.src,nacl-webkit/chrome_deps,littlstar/chromium.src,zcbenz/cefode-chromium,PeterWangIntel/chromium-crosswalk,hujiajie/pa-chromium,crosswalk-project/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,anirudhSK/chromium,mogoweb/chromium-crosswalk,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,fujunwei/chromium-crosswalk,pozdnyakov/chromium-crosswalk,Just-D/chromium-1,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk,junmin-zhu/chromium-rivertrail,mohamed--abdel-maksoud/chromium.src,ChromiumWebApps/chromium,timopulkkinen/BubbleFish,zcbenz/cefode-chromium,ltilve/chromium,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,dednal/chromium.src,krieger-od/nwjs_chromium.src,Fireblend/chromium-crosswalk,markYoungH/chromium.src,ltilve/chromium,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,krieger-od/nwjs_chromium.src,Fireblend/chromium-crosswalk,Jonekee/chromium.src,hujiajie/pa-chromium,mohamed--abdel-maksoud/chromium.src,timopulkkinen/BubbleFish,M4sse/chromium.src,crosswalk-project/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,Pluto-tv/chromium-crosswalk,fujunwei/chromium-crosswalk,Jonekee/chromium.src,PeterWangIntel/chromium-crosswalk,markYoungH/chromium.src,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,junmin-zhu/chromium-rivertrail,jaruba/chromium.src,anirudhSK/chromium,Fireblend/chromium-crosswalk,Chilledheart/chromium,pozdnyakov/chromium-crosswalk,dednal/chromium.src,junmin-zhu/chromium-rivertrail,Jonekee/chromium.src,zcbenz/cefode-chromium,Pluto-tv/chromium-crosswalk,junmin-zhu/chromium-rivertrail,M4sse/chromium.src,ChromiumWebApps/chromium,nacl-webkit/chrome_deps,fujunwei/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk,M4sse/chromium.src,bright-sparks/chromium-spacewalk,jaruba/chromium.src,mogoweb/chromium-crosswalk,hujiajie/pa-chromium,hujiajie/pa-chromium,M4sse/chromium.src,mogoweb/chromium-crosswalk,markYoungH/chromium.src,Just-D/chromium-1,ondra-novak/chromium.src,hgl888/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,M4sse/chromium.src,pozdnyakov/chromium-crosswalk,pozdnyakov/chromium-crosswalk,Chilledheart/chromium,ondra-novak/chromium.src,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,zcbenz/cefode-chromium,hujiajie/pa-chromium,dushu1203/chromium.src,anirudhSK/chromium,ltilve/chromium,hgl888/chromium-crosswalk,bright-sparks/chromium-spacewalk,PeterWangIntel/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,ondra-novak/chromium.src,anirudhSK/chromium,jaruba/chromium.src,dushu1203/chromium.src,hujiajie/pa-chromium,mogoweb/chromium-crosswalk,chuan9/chromium-crosswalk,patrickm/chromium.src,Chilledheart/chromium,Pluto-tv/chromium-crosswalk,Jonekee/chromium.src,Jonekee/chromium.src,fujunwei/chromium-crosswalk,zcbenz/cefode-chromium,Chilledheart/chromium,dushu1203/chromium.src,anirudhSK/chromium,axinging/chromium-crosswalk,nacl-webkit/chrome_deps,dednal/chromium.src,hgl888/chromium-crosswalk,patrickm/chromium.src,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk-efl,littlstar/chromium.src,junmin-zhu/chromium-rivertrail,Chilledheart/chromium,patrickm/chromium.src,mohamed--abdel-maksoud/chromium.src,hujiajie/pa-chromium,fujunwei/chromium-crosswalk,littlstar/chromium.src,patrickm/chromium.src,TheTypoMaster/chromium-crosswalk,dednal/chromium.src,anirudhSK/chromium,Just-D/chromium-1,ondra-novak/chromium.src,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk,chuan9/chromium-crosswalk,anirudhSK/chromium,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk-efl,junmin-zhu/chromium-rivertrail,mohamed--abdel-maksoud/chromium.src,ChromiumWebApps/chromium,hgl888/chromium-crosswalk,bright-sparks/chromium-spacewalk,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,nacl-webkit/chrome_deps,hgl888/chromium-crosswalk-efl,zcbenz/cefode-chromium,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,jaruba/chromium.src,markYoungH/chromium.src,markYoungH/chromium.src,timopulkkinen/BubbleFish,markYoungH/chromium.src,junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,axinging/chromium-crosswalk,dushu1203/chromium.src,timopulkkinen/BubbleFish,pozdnyakov/chromium-crosswalk,krieger-od/nwjs_chromium.src,dushu1203/chromium.src,TheTypoMaster/chromium-crosswalk,ondra-novak/chromium.src,zcbenz/cefode-chromium,timopulkkinen/BubbleFish,pozdnyakov/chromium-crosswalk,patrickm/chromium.src,chuan9/chromium-crosswalk,dednal/chromium.src,hgl888/chromium-crosswalk,M4sse/chromium.src,jaruba/chromium.src,krieger-od/nwjs_chromium.src,bright-sparks/chromium-spacewalk,Fireblend/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,chuan9/chromium-crosswalk,pozdnyakov/chromium-crosswalk,ChromiumWebApps/chromium,PeterWangIntel/chromium-crosswalk,timopulkkinen/BubbleFish,jaruba/chromium.src,ChromiumWebApps/chromium,ChromiumWebApps/chromium,ChromiumWebApps/chromium,crosswalk-project/chromium-crosswalk-efl,dednal/chromium.src,Jonekee/chromium.src,nacl-webkit/chrome_deps,ChromiumWebApps/chromium,Chilledheart/chromium,bright-sparks/chromium-spacewalk,ChromiumWebApps/chromium,Fireblend/chromium-crosswalk,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,Chilledheart/chromium,littlstar/chromium.src,littlstar/chromium.src,Jonekee/chromium.src,ondra-novak/chromium.src,mohamed--abdel-maksoud/chromium.src,zcbenz/cefode-chromium,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk,mogoweb/chromium-crosswalk,Just-D/chromium-1,dushu1203/chromium.src,ChromiumWebApps/chromium,patrickm/chromium.src,mohamed--abdel-maksoud/chromium.src,nacl-webkit/chrome_deps,krieger-od/nwjs_chromium.src,jaruba/chromium.src,nacl-webkit/chrome_deps,PeterWangIntel/chromium-crosswalk,zcbenz/cefode-chromium,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,timopulkkinen/BubbleFish,zcbenz/cefode-chromium,fujunwei/chromium-crosswalk,Just-D/chromium-1,dednal/chromium.src,markYoungH/chromium.src,dushu1203/chromium.src,Fireblend/chromium-crosswalk,ChromiumWebApps/chromium,junmin-zhu/chromium-rivertrail,Jonekee/chromium.src,PeterWangIntel/chromium-crosswalk,nacl-webkit/chrome_deps,krieger-od/nwjs_chromium.src,fujunwei/chromium-crosswalk,Just-D/chromium-1,dednal/chromium.src,jaruba/chromium.src,pozdnyakov/chromium-crosswalk,littlstar/chromium.src,markYoungH/chromium.src,junmin-zhu/chromium-rivertrail,pozdnyakov/chromium-crosswalk,ltilve/chromium,krieger-od/nwjs_chromium.src,ltilve/chromium,anirudhSK/chromium,ltilve/chromium,Fireblend/chromium-crosswalk,ltilve/chromium,patrickm/chromium.src,mogoweb/chromium-crosswalk,junmin-zhu/chromium-rivertrail,timopulkkinen/BubbleFish,ChromiumWebApps/chromium,chuan9/chromium-crosswalk,dednal/chromium.src,ltilve/chromium,markYoungH/chromium.src,anirudhSK/chromium,crosswalk-project/chromium-crosswalk-efl,junmin-zhu/chromium-rivertrail,timopulkkinen/BubbleFish,chuan9/chromium-crosswalk,dushu1203/chromium.src,jaruba/chromium.src,axinging/chromium-crosswalk,dednal/chromium.src,Pluto-tv/chromium-crosswalk,timopulkkinen/BubbleFish,dushu1203/chromium.src,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk-efl,nacl-webkit/chrome_deps,chuan9/chromium-crosswalk,axinging/chromium-crosswalk,littlstar/chromium.src,Jonekee/chromium.src,bright-sparks/chromium-spacewalk,Just-D/chromium-1,bright-sparks/chromium-spacewalk,dushu1203/chromium.src,hujiajie/pa-chromium,hujiajie/pa-chromium,mogoweb/chromium-crosswalk,dushu1203/chromium.src,crosswalk-project/chromium-crosswalk-efl,littlstar/chromium.src,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,Jonekee/chromium.src,ondra-novak/chromium.src,Chilledheart/chromium,timopulkkinen/BubbleFish,hujiajie/pa-chromium,Just-D/chromium-1,ltilve/chromium,jaruba/chromium.src,dednal/chromium.src,hujiajie/pa-chromium,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk | python | ## Code Before:
def GetPreferredTrySlaves():
return ['linux_chromeos']
## Instruction:
Add linux_chromeos_clang to the list of automatic trybots.
BUG=none
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10833037
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@148600 0039d316-1c4b-4281-b951-d872f2087c98
## Code After:
def GetPreferredTrySlaves():
return ['linux_chromeos', 'linux_chromeos_clang']
|
def GetPreferredTrySlaves():
- return ['linux_chromeos']
+ return ['linux_chromeos', 'linux_chromeos_clang'] | 2 | 0.666667 | 1 | 1 |
d18882e8cc45ceedf272b1f722ce80e187f62435 | static/locales/el/messages.properties | static/locales/el/messages.properties | navigation-what=περιγραφη
navigation-how=Με ποιο τροπο
navigation-more=περισσοτερα
navigation-developers=προγραμματιστεσ
# Header
upper-title=Pontoon από το Mozilla
headline-1=Τοπικοποιήστε τον Ιστό.
# What
# How
how-title=Πως λειτουργει<br>
# More
# Developers
# Footer
| navigation-what=περιγραφη
navigation-more=περισσοτερα
navigation-developers=προγραμματιστεσ
# Header
upper-title=Pontoon από το Mozilla
headline-1=Τοπικοποιήστε τον Ιστό.
# What
# How
how-title=Πως λειτουργει<br>
# More
# Developers
# Footer
| Update Greek (el) localization of iiiii | Pontoon: Update Greek (el) localization of iiiii
| INI | bsd-3-clause | mathjazz/pontoon-intro,mathjazz/pontoon-intro,mathjazz/pontoon-intro | ini | ## Code Before:
navigation-what=περιγραφη
navigation-how=Με ποιο τροπο
navigation-more=περισσοτερα
navigation-developers=προγραμματιστεσ
# Header
upper-title=Pontoon από το Mozilla
headline-1=Τοπικοποιήστε τον Ιστό.
# What
# How
how-title=Πως λειτουργει<br>
# More
# Developers
# Footer
## Instruction:
Pontoon: Update Greek (el) localization of iiiii
## Code After:
navigation-what=περιγραφη
navigation-more=περισσοτερα
navigation-developers=προγραμματιστεσ
# Header
upper-title=Pontoon από το Mozilla
headline-1=Τοπικοποιήστε τον Ιστό.
# What
# How
how-title=Πως λειτουργει<br>
# More
# Developers
# Footer
| navigation-what=περιγραφη
- navigation-how=Με ποιο τροπο
navigation-more=περισσοτερα
navigation-developers=προγραμματιστεσ
# Header
upper-title=Pontoon από το Mozilla
headline-1=Τοπικοποιήστε τον Ιστό.
# What
# How
how-title=Πως λειτουργει<br>
# More
# Developers
# Footer
| 1 | 0.05 | 0 | 1 |
af7edd767fea86d68473ebda6299fc9392eea8fd | buildxt.sh | buildxt.sh | if [ -d "xt_distr" ]; then
rm -rf "xt_distr"
fi
log() {
echo -e "🕑 \033[0;36m$1\033[0m"
}
DEST="xt_distr"
mkdir $DEST
log "Building extension"
cd "chrome_extension"
../node_modules/.bin/webpack
cd ..
log "Copying manifest"
cp "manifest.json" $DEST
log "Copying icons"
cp -r "icons" $DEST
cp -r "favicons" $DEST
log "Copying img"
cp -r "img" $DEST
DEST="$DEST/chrome_extension"
mkdir $DEST
log "Copying html"
cp "chrome_extension/background.html" $DEST
cp "chrome_extension/popup.html" $DEST
log "Copying source"
cp -r "chrome_extension/bin" $DEST
log "Copying css"
cp -r "chrome_extension/css" $DEST
cp -r "chrome_extension/sizedicons" $DEST | if [ -d "xt_distr" ]; then
rm -rf "xt_distr"
fi
log() {
echo -e "🕑 \033[0;36m$1\033[0m"
}
DEST="xt_distr"
mkdir $DEST
log "Building extension"
cd "chrome_extension"
../node_modules/.bin/webpack
cd ..
log "Copying manifest"
cp "manifest.json" $DEST
log "Copying icons"
cp -r "icons" $DEST
cp -r "favicons" $DEST
log "Copying img"
cp -r "img" $DEST
DEST="$DEST/chrome_extension"
mkdir $DEST
log "Copying html"
cp "chrome_extension/background.html" $DEST
cp "chrome_extension/popup.html" $DEST
log "Copying source"
cp -r "chrome_extension/bin" $DEST
log "Copying css"
cp -r "chrome_extension/css" $DEST
cp -r "chrome_extension/sizedicons" $DEST
zip -r bellxt.zip xt_distr | Create zip of built xt | Create zip of built xt
| Shell | mit | nicolaschan/bell,nicolaschan/bell,nicolaschan/bell,nicolaschan/bell | shell | ## Code Before:
if [ -d "xt_distr" ]; then
rm -rf "xt_distr"
fi
log() {
echo -e "🕑 \033[0;36m$1\033[0m"
}
DEST="xt_distr"
mkdir $DEST
log "Building extension"
cd "chrome_extension"
../node_modules/.bin/webpack
cd ..
log "Copying manifest"
cp "manifest.json" $DEST
log "Copying icons"
cp -r "icons" $DEST
cp -r "favicons" $DEST
log "Copying img"
cp -r "img" $DEST
DEST="$DEST/chrome_extension"
mkdir $DEST
log "Copying html"
cp "chrome_extension/background.html" $DEST
cp "chrome_extension/popup.html" $DEST
log "Copying source"
cp -r "chrome_extension/bin" $DEST
log "Copying css"
cp -r "chrome_extension/css" $DEST
cp -r "chrome_extension/sizedicons" $DEST
## Instruction:
Create zip of built xt
## Code After:
if [ -d "xt_distr" ]; then
rm -rf "xt_distr"
fi
log() {
echo -e "🕑 \033[0;36m$1\033[0m"
}
DEST="xt_distr"
mkdir $DEST
log "Building extension"
cd "chrome_extension"
../node_modules/.bin/webpack
cd ..
log "Copying manifest"
cp "manifest.json" $DEST
log "Copying icons"
cp -r "icons" $DEST
cp -r "favicons" $DEST
log "Copying img"
cp -r "img" $DEST
DEST="$DEST/chrome_extension"
mkdir $DEST
log "Copying html"
cp "chrome_extension/background.html" $DEST
cp "chrome_extension/popup.html" $DEST
log "Copying source"
cp -r "chrome_extension/bin" $DEST
log "Copying css"
cp -r "chrome_extension/css" $DEST
cp -r "chrome_extension/sizedicons" $DEST
zip -r bellxt.zip xt_distr | if [ -d "xt_distr" ]; then
rm -rf "xt_distr"
fi
log() {
echo -e "🕑 \033[0;36m$1\033[0m"
}
DEST="xt_distr"
mkdir $DEST
log "Building extension"
cd "chrome_extension"
../node_modules/.bin/webpack
cd ..
log "Copying manifest"
cp "manifest.json" $DEST
log "Copying icons"
cp -r "icons" $DEST
cp -r "favicons" $DEST
log "Copying img"
cp -r "img" $DEST
DEST="$DEST/chrome_extension"
mkdir $DEST
log "Copying html"
cp "chrome_extension/background.html" $DEST
cp "chrome_extension/popup.html" $DEST
log "Copying source"
cp -r "chrome_extension/bin" $DEST
log "Copying css"
cp -r "chrome_extension/css" $DEST
cp -r "chrome_extension/sizedicons" $DEST
+
+ zip -r bellxt.zip xt_distr | 2 | 0.060606 | 2 | 0 |
c729efc39a7ab0a86d7d61a5734c59c5336c54a7 | package.json | package.json | {
"name": "angular-app-server",
"description": "Back end server to support our angular app",
"version": "0.0.1",
"private": true,
"scripts":{
"start":"node server.js",
"test": "node ./node_modules/grunt-cli/bin/grunt run"
},
"dependencies": {
"express": "~3.0",
"passport": "~0.1.12",
"nconf": "latest",
"secure.me": "~0.1.3",
"underscore": "~1.5.1",
"async": "~0.2.9",
"passport-github": "~0.1.5",
"mongojs": "~0.9.0",
"engine.io": "~0.7.9",
"engine.io-client": "~0.7.9",
"mocha": "~1.12.1",
"chai": "~1.7.2",
"request": "~2.27.0",
"grunt": "~0.4.1",
"grunt-cli": "~0.1.9",
"grunt-mocha-test": "~0.6.3"
}
}
| {
"name": "angular-app-server",
"description": "Back end server to support our angular app",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node server.js",
"test": "node ./node_modules/grunt-cli/bin/grunt"
},
"dependencies": {
"express": "~3.0",
"passport": "~0.1.12",
"nconf": "latest",
"secure.me": "~0.1.3",
"underscore": "~1.5.1",
"async": "~0.2.9",
"passport-github": "~0.1.5",
"mongojs": "~0.9.0",
"engine.io": "~0.7.9",
"engine.io-client": "~0.7.9",
"mocha": "~1.12.1",
"chai": "~1.7.2",
"request": "~2.27.0",
"grunt": "~0.4.1",
"grunt-cli": "~0.1.9",
"grunt-mocha-test": "~0.6.3",
"nock": "~0.22.1"
}
}
| Fix nock and npm test | Fix nock and npm test
| JSON | mit | openconf/jschat | json | ## Code Before:
{
"name": "angular-app-server",
"description": "Back end server to support our angular app",
"version": "0.0.1",
"private": true,
"scripts":{
"start":"node server.js",
"test": "node ./node_modules/grunt-cli/bin/grunt run"
},
"dependencies": {
"express": "~3.0",
"passport": "~0.1.12",
"nconf": "latest",
"secure.me": "~0.1.3",
"underscore": "~1.5.1",
"async": "~0.2.9",
"passport-github": "~0.1.5",
"mongojs": "~0.9.0",
"engine.io": "~0.7.9",
"engine.io-client": "~0.7.9",
"mocha": "~1.12.1",
"chai": "~1.7.2",
"request": "~2.27.0",
"grunt": "~0.4.1",
"grunt-cli": "~0.1.9",
"grunt-mocha-test": "~0.6.3"
}
}
## Instruction:
Fix nock and npm test
## Code After:
{
"name": "angular-app-server",
"description": "Back end server to support our angular app",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node server.js",
"test": "node ./node_modules/grunt-cli/bin/grunt"
},
"dependencies": {
"express": "~3.0",
"passport": "~0.1.12",
"nconf": "latest",
"secure.me": "~0.1.3",
"underscore": "~1.5.1",
"async": "~0.2.9",
"passport-github": "~0.1.5",
"mongojs": "~0.9.0",
"engine.io": "~0.7.9",
"engine.io-client": "~0.7.9",
"mocha": "~1.12.1",
"chai": "~1.7.2",
"request": "~2.27.0",
"grunt": "~0.4.1",
"grunt-cli": "~0.1.9",
"grunt-mocha-test": "~0.6.3",
"nock": "~0.22.1"
}
}
| {
"name": "angular-app-server",
"description": "Back end server to support our angular app",
"version": "0.0.1",
"private": true,
- "scripts":{
+ "scripts": {
? +
- "start":"node server.js",
+ "start": "node server.js",
? +
- "test": "node ./node_modules/grunt-cli/bin/grunt run"
? ----
+ "test": "node ./node_modules/grunt-cli/bin/grunt"
},
"dependencies": {
"express": "~3.0",
"passport": "~0.1.12",
"nconf": "latest",
"secure.me": "~0.1.3",
"underscore": "~1.5.1",
"async": "~0.2.9",
"passport-github": "~0.1.5",
"mongojs": "~0.9.0",
"engine.io": "~0.7.9",
"engine.io-client": "~0.7.9",
"mocha": "~1.12.1",
"chai": "~1.7.2",
"request": "~2.27.0",
"grunt": "~0.4.1",
"grunt-cli": "~0.1.9",
- "grunt-mocha-test": "~0.6.3"
+ "grunt-mocha-test": "~0.6.3",
? +
+ "nock": "~0.22.1"
}
} | 9 | 0.321429 | 5 | 4 |
e0839ae8d74e5d94972c12a87ee2cbfb965fa810 | spec/dctvbot_spec.rb | spec/dctvbot_spec.rb | RSpec.decribe DCTVBot do
end
| require 'dctvbot'
describe DCTVBot do
subject do
DCTVBot.new do
configure do |c|
c.server = "irc.chatrealm.net"
c.port = "6667"
c.nick = "dctvbot"
c.user = "Cinch"
c.realname = "DCTV Bot"
c.channels = [ "#testbot" ]
end
end
end
describe "attributes" do
it { is_expected.to respond_to(:callback) }
it { is_expected.to respond_to(:channel_list) }
it { is_expected.to respond_to(:channels) }
it { is_expected.to respond_to(:config) }
it { is_expected.to respond_to(:handlers) }
it { is_expected.to respond_to(:irc) }
it { is_expected.to respond_to(:last_connection_was_successful) }
it { is_expected.to respond_to(:loggers) }
it { is_expected.to respond_to(:modes) }
it { is_expected.to respond_to(:nick) }
it { is_expected.to respond_to(:plugins) }
it { is_expected.to respond_to(:quitting) }
it { is_expected.to respond_to(:user_list) }
end
end
| Add attributes block to DCTVBot spec to check for proper inheritance | Add attributes block to DCTVBot spec to check for proper inheritance
| Ruby | mit | chatrealm/dctvbot | ruby | ## Code Before:
RSpec.decribe DCTVBot do
end
## Instruction:
Add attributes block to DCTVBot spec to check for proper inheritance
## Code After:
require 'dctvbot'
describe DCTVBot do
subject do
DCTVBot.new do
configure do |c|
c.server = "irc.chatrealm.net"
c.port = "6667"
c.nick = "dctvbot"
c.user = "Cinch"
c.realname = "DCTV Bot"
c.channels = [ "#testbot" ]
end
end
end
describe "attributes" do
it { is_expected.to respond_to(:callback) }
it { is_expected.to respond_to(:channel_list) }
it { is_expected.to respond_to(:channels) }
it { is_expected.to respond_to(:config) }
it { is_expected.to respond_to(:handlers) }
it { is_expected.to respond_to(:irc) }
it { is_expected.to respond_to(:last_connection_was_successful) }
it { is_expected.to respond_to(:loggers) }
it { is_expected.to respond_to(:modes) }
it { is_expected.to respond_to(:nick) }
it { is_expected.to respond_to(:plugins) }
it { is_expected.to respond_to(:quitting) }
it { is_expected.to respond_to(:user_list) }
end
end
| + require 'dctvbot'
+
- RSpec.decribe DCTVBot do
? ------
+ describe DCTVBot do
? +
-
+
+ subject do
+ DCTVBot.new do
+ configure do |c|
+ c.server = "irc.chatrealm.net"
+ c.port = "6667"
+
+ c.nick = "dctvbot"
+ c.user = "Cinch"
+ c.realname = "DCTV Bot"
+ c.channels = [ "#testbot" ]
+ end
+ end
+ end
+
+ describe "attributes" do
+ it { is_expected.to respond_to(:callback) }
+ it { is_expected.to respond_to(:channel_list) }
+ it { is_expected.to respond_to(:channels) }
+ it { is_expected.to respond_to(:config) }
+ it { is_expected.to respond_to(:handlers) }
+ it { is_expected.to respond_to(:irc) }
+ it { is_expected.to respond_to(:last_connection_was_successful) }
+ it { is_expected.to respond_to(:loggers) }
+ it { is_expected.to respond_to(:modes) }
+ it { is_expected.to respond_to(:nick) }
+ it { is_expected.to respond_to(:plugins) }
+ it { is_expected.to respond_to(:quitting) }
+ it { is_expected.to respond_to(:user_list) }
+ end
+
end | 36 | 12 | 34 | 2 |
ad3e4c3d53702062c20ccec8fcd4365b4d69381e | scripts/travis/install_elasticsearch5.sh | scripts/travis/install_elasticsearch5.sh |
sudo sysctl -w vm.max_map_count=262144
sudo apt-get autoremove --purge elasticsearch
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-5.x.list
sudo apt-get update && sudo apt-get install elasticsearch -y
sudo service elasticsearch start
|
sudo sysctl -w vm.max_map_count=262144
sudo apt-get autoremove --purge elasticsearch
wget -P /tmp/ https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.3.3.deb
sudo dpkg -i /tmp/elasticsearch-5.3.3.deb
sudo service elasticsearch start
| Install Elasticsearch 5.3.3 for Travis | Install Elasticsearch 5.3.3 for Travis
5.4 has a bug in testing existence of aliases which causes tests to fail: https://github.com/elastic/elasticsearch/issues/24644
| Shell | bsd-3-clause | iansprice/wagtail,wagtail/wagtail,wagtail/wagtail,nimasmi/wagtail,FlipperPA/wagtail,rsalmaso/wagtail,timorieber/wagtail,gasman/wagtail,kaedroho/wagtail,nealtodd/wagtail,torchbox/wagtail,nimasmi/wagtail,iansprice/wagtail,mikedingjan/wagtail,takeflight/wagtail,wagtail/wagtail,kaedroho/wagtail,thenewguy/wagtail,nealtodd/wagtail,FlipperPA/wagtail,wagtail/wagtail,gasman/wagtail,nimasmi/wagtail,nimasmi/wagtail,timorieber/wagtail,zerolab/wagtail,torchbox/wagtail,FlipperPA/wagtail,kaedroho/wagtail,timorieber/wagtail,mikedingjan/wagtail,rsalmaso/wagtail,jnns/wagtail,jnns/wagtail,zerolab/wagtail,iansprice/wagtail,rsalmaso/wagtail,thenewguy/wagtail,kaedroho/wagtail,gasman/wagtail,mixxorz/wagtail,mikedingjan/wagtail,wagtail/wagtail,rsalmaso/wagtail,jnns/wagtail,zerolab/wagtail,nealtodd/wagtail,gasman/wagtail,mixxorz/wagtail,nealtodd/wagtail,mikedingjan/wagtail,gasman/wagtail,thenewguy/wagtail,rsalmaso/wagtail,zerolab/wagtail,thenewguy/wagtail,timorieber/wagtail,mixxorz/wagtail,iansprice/wagtail,FlipperPA/wagtail,takeflight/wagtail,zerolab/wagtail,jnns/wagtail,thenewguy/wagtail,takeflight/wagtail,mixxorz/wagtail,mixxorz/wagtail,takeflight/wagtail,torchbox/wagtail,kaedroho/wagtail,torchbox/wagtail | shell | ## Code Before:
sudo sysctl -w vm.max_map_count=262144
sudo apt-get autoremove --purge elasticsearch
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-5.x.list
sudo apt-get update && sudo apt-get install elasticsearch -y
sudo service elasticsearch start
## Instruction:
Install Elasticsearch 5.3.3 for Travis
5.4 has a bug in testing existence of aliases which causes tests to fail: https://github.com/elastic/elasticsearch/issues/24644
## Code After:
sudo sysctl -w vm.max_map_count=262144
sudo apt-get autoremove --purge elasticsearch
wget -P /tmp/ https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.3.3.deb
sudo dpkg -i /tmp/elasticsearch-5.3.3.deb
sudo service elasticsearch start
|
sudo sysctl -w vm.max_map_count=262144
sudo apt-get autoremove --purge elasticsearch
+ wget -P /tmp/ https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.3.3.deb
+ sudo dpkg -i /tmp/elasticsearch-5.3.3.deb
- wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
- echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-5.x.list
- sudo apt-get update && sudo apt-get install elasticsearch -y
sudo service elasticsearch start | 5 | 0.625 | 2 | 3 |
749747ca7dd61e9852a80f80c5ba100fb3c4da49 | tox.ini | tox.ini | [tox]
envlist = py26,py27,py33,flake8,cover
[testenv]
deps = -r{toxinidir}/test-requirements.txt
commands = nosetests -v --with-xunit
[testenv:cover]
commands =
coverage run --source=py2pack setup.py test
coverage report
[testenv:docs]
basepython = python
changedir = doc
deps = sphinx
commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
# sphinx-build -b doctest -d {envtmpdir}/doctrees . {envtmpdir}/doctest
[testenv:flake8]
commands = flake8
[flake8]
ignore = E501
show-source = True
exclude = .venv,.tox,build,dist,doc,*egg
| [tox]
envlist = py26,py27,py33,pep8,cover
[testenv]
deps = -r{toxinidir}/test-requirements.txt
commands = nosetests -v --with-xunit
[testenv:cover]
commands =
coverage run --source=py2pack setup.py test
coverage report
[testenv:docs]
basepython = python
changedir = doc
deps = sphinx
commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
# sphinx-build -b doctest -d {envtmpdir}/doctrees . {envtmpdir}/doctest
[testenv:pep8]
commands = flake8
[flake8]
ignore = E501
show-source = True
exclude = .venv,.tox,build,dist,doc,*egg
| Change 'flake8' to 'pep8' target | Change 'flake8' to 'pep8' target
| INI | apache-2.0 | saschpe/py2pack,toabctl/py2pack | ini | ## Code Before:
[tox]
envlist = py26,py27,py33,flake8,cover
[testenv]
deps = -r{toxinidir}/test-requirements.txt
commands = nosetests -v --with-xunit
[testenv:cover]
commands =
coverage run --source=py2pack setup.py test
coverage report
[testenv:docs]
basepython = python
changedir = doc
deps = sphinx
commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
# sphinx-build -b doctest -d {envtmpdir}/doctrees . {envtmpdir}/doctest
[testenv:flake8]
commands = flake8
[flake8]
ignore = E501
show-source = True
exclude = .venv,.tox,build,dist,doc,*egg
## Instruction:
Change 'flake8' to 'pep8' target
## Code After:
[tox]
envlist = py26,py27,py33,pep8,cover
[testenv]
deps = -r{toxinidir}/test-requirements.txt
commands = nosetests -v --with-xunit
[testenv:cover]
commands =
coverage run --source=py2pack setup.py test
coverage report
[testenv:docs]
basepython = python
changedir = doc
deps = sphinx
commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
# sphinx-build -b doctest -d {envtmpdir}/doctrees . {envtmpdir}/doctest
[testenv:pep8]
commands = flake8
[flake8]
ignore = E501
show-source = True
exclude = .venv,.tox,build,dist,doc,*egg
| [tox]
- envlist = py26,py27,py33,flake8,cover
? ^^^^
+ envlist = py26,py27,py33,pep8,cover
? ^ +
[testenv]
deps = -r{toxinidir}/test-requirements.txt
commands = nosetests -v --with-xunit
[testenv:cover]
commands =
coverage run --source=py2pack setup.py test
coverage report
[testenv:docs]
basepython = python
changedir = doc
deps = sphinx
commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
# sphinx-build -b doctest -d {envtmpdir}/doctrees . {envtmpdir}/doctest
- [testenv:flake8]
? ^^^^
+ [testenv:pep8]
? ^ +
commands = flake8
[flake8]
ignore = E501
show-source = True
exclude = .venv,.tox,build,dist,doc,*egg | 4 | 0.153846 | 2 | 2 |
658dc6e73b201d711cccdca0e97782f13591a52b | app/models/dataservice/bundle_content_observer.rb | app/models/dataservice/bundle_content_observer.rb | class Dataservice::BundleContentObserver < ActiveRecord::Observer
def after_create(bundle_content)
bundle_content.extract_saveables
end
def after_save(user)
# do nothing
end
end | class Dataservice::BundleContentObserver < ActiveRecord::Observer
def after_create(bundle_content)
# first schedule the bundle processing
cmd = "nice #{RAILS_ROOT}/script/runner 'Dataservice::BundleContent.find(#{bundle_content.id}).extract_saveables'"
jobs = ::Bj.submit cmd, :tag => 'bundle_content_processing'
end
def after_save(user)
# do nothing
end
end | Use the background job plugin to process bundle_contents | Use the background job plugin to process bundle_contents | Ruby | mit | concord-consortium/rigse,concord-consortium/rigse,concord-consortium/rigse,concord-consortium/rigse,concord-consortium/rigse,concord-consortium/rigse | ruby | ## Code Before:
class Dataservice::BundleContentObserver < ActiveRecord::Observer
def after_create(bundle_content)
bundle_content.extract_saveables
end
def after_save(user)
# do nothing
end
end
## Instruction:
Use the background job plugin to process bundle_contents
## Code After:
class Dataservice::BundleContentObserver < ActiveRecord::Observer
def after_create(bundle_content)
# first schedule the bundle processing
cmd = "nice #{RAILS_ROOT}/script/runner 'Dataservice::BundleContent.find(#{bundle_content.id}).extract_saveables'"
jobs = ::Bj.submit cmd, :tag => 'bundle_content_processing'
end
def after_save(user)
# do nothing
end
end | class Dataservice::BundleContentObserver < ActiveRecord::Observer
def after_create(bundle_content)
- bundle_content.extract_saveables
+ # first schedule the bundle processing
+ cmd = "nice #{RAILS_ROOT}/script/runner 'Dataservice::BundleContent.find(#{bundle_content.id}).extract_saveables'"
+ jobs = ::Bj.submit cmd, :tag => 'bundle_content_processing'
end
def after_save(user)
# do nothing
end
end | 4 | 0.444444 | 3 | 1 |
d5fffff4092cf4bd0cfaf789d118d36f84bfa29e | lib/rules_core/inline.js | lib/rules_core/inline.js | 'use strict';
module.exports = function inline(state) {
var tokens = state.tokens, tok, i, l;
// Parse inlines
for (i = 0, l = tokens.length; i < l; i++) {
tok = tokens[i];
if (tok.type === 'inline') {
state.md.inline.parse(tok.content, state.md, { ...state.env, parentToken: tok }, tok.children);
}
}
};
| 'use strict';
module.exports = function inline(state) {
var tokens = state.tokens, tok, i, l;
// Parse inlines
for (i = 0, l = tokens.length; i < l; i++) {
tok = tokens[i];
if (tok.type === 'inline') {
state.md.inline.parse(tok.content, state.md, Object.assign({}, state.env, { parentToken: tok }), tok.children);
}
}
};
| Fix es6 object spread with object.assign | Fix es6 object spread with object.assign
| JavaScript | mit | GerHobbelt/markdown-it,GerHobbelt/markdown-it | javascript | ## Code Before:
'use strict';
module.exports = function inline(state) {
var tokens = state.tokens, tok, i, l;
// Parse inlines
for (i = 0, l = tokens.length; i < l; i++) {
tok = tokens[i];
if (tok.type === 'inline') {
state.md.inline.parse(tok.content, state.md, { ...state.env, parentToken: tok }, tok.children);
}
}
};
## Instruction:
Fix es6 object spread with object.assign
## Code After:
'use strict';
module.exports = function inline(state) {
var tokens = state.tokens, tok, i, l;
// Parse inlines
for (i = 0, l = tokens.length; i < l; i++) {
tok = tokens[i];
if (tok.type === 'inline') {
state.md.inline.parse(tok.content, state.md, Object.assign({}, state.env, { parentToken: tok }), tok.children);
}
}
};
| 'use strict';
module.exports = function inline(state) {
var tokens = state.tokens, tok, i, l;
// Parse inlines
for (i = 0, l = tokens.length; i < l; i++) {
tok = tokens[i];
if (tok.type === 'inline') {
- state.md.inline.parse(tok.content, state.md, { ...state.env, parentToken: tok }, tok.children);
? ---
+ state.md.inline.parse(tok.content, state.md, Object.assign({}, state.env, { parentToken: tok }), tok.children);
? ++++++++++++++ ++ ++ +
}
}
}; | 2 | 0.153846 | 1 | 1 |
59b6bc10719c1ff28541e9b3a1b4c7b17937caac | .travis.yml | .travis.yml | language: node_js
node_js: 5
install: npm install
script:
- npm test
before_cache: npm prune
branches:
only:
- master
# force container based infra
# http://docs.travis-ci.com/user/workers/container-based-infrastructure/#Routing-your-build-to-container-based-infrastructure
sudo: false
cache:
directories:
- node_modules
| language: node_js
node_js: 5
install: npm install react redux && npm install
script:
- npm test
before_cache: npm prune
branches:
only:
- master
# force container based infra
# http://docs.travis-ci.com/user/workers/container-based-infrastructure/#Routing-your-build-to-container-based-infrastructure
sudo: false
cache:
directories:
- node_modules
| Add the peer deps to the Travis build script | Add the peer deps to the Travis build script
| YAML | mit | seriouscircus/unirouter,bkonkle/unirouter | yaml | ## Code Before:
language: node_js
node_js: 5
install: npm install
script:
- npm test
before_cache: npm prune
branches:
only:
- master
# force container based infra
# http://docs.travis-ci.com/user/workers/container-based-infrastructure/#Routing-your-build-to-container-based-infrastructure
sudo: false
cache:
directories:
- node_modules
## Instruction:
Add the peer deps to the Travis build script
## Code After:
language: node_js
node_js: 5
install: npm install react redux && npm install
script:
- npm test
before_cache: npm prune
branches:
only:
- master
# force container based infra
# http://docs.travis-ci.com/user/workers/container-based-infrastructure/#Routing-your-build-to-container-based-infrastructure
sudo: false
cache:
directories:
- node_modules
| language: node_js
node_js: 5
- install: npm install
+ install: npm install react redux && npm install
script:
- npm test
before_cache: npm prune
branches:
only:
- master
# force container based infra
# http://docs.travis-ci.com/user/workers/container-based-infrastructure/#Routing-your-build-to-container-based-infrastructure
sudo: false
cache:
directories:
- node_modules | 2 | 0.133333 | 1 | 1 |
1d0321a07a2eefa65e6d66fcb13515cf081bc94f | config/initializers/secret_token.rb | config/initializers/secret_token.rb | HigginsCatalog::Application.config.secret_token = '80839fae090945c2da18844ed009097d4ced15ea98c912fa861aaf549720bb6b722388042bb1e68e21227a78742d0831bcbea34d28613024f15bb07fe1cc3bff'
| HigginsCatalog::Application.config.secret_token = ENV['SESSION_SECRET']
| Move session secret out of source control. Duh. | Move session secret out of source control. Duh.
| Ruby | mit | shammond42/higgins-catalog,shammond42/higgins-catalog,shammond42/higgins-catalog,shammond42/higgins-catalog | ruby | ## Code Before:
HigginsCatalog::Application.config.secret_token = '80839fae090945c2da18844ed009097d4ced15ea98c912fa861aaf549720bb6b722388042bb1e68e21227a78742d0831bcbea34d28613024f15bb07fe1cc3bff'
## Instruction:
Move session secret out of source control. Duh.
## Code After:
HigginsCatalog::Application.config.secret_token = ENV['SESSION_SECRET']
| - HigginsCatalog::Application.config.secret_token = '80839fae090945c2da18844ed009097d4ced15ea98c912fa861aaf549720bb6b722388042bb1e68e21227a78742d0831bcbea34d28613024f15bb07fe1cc3bff'
+ HigginsCatalog::Application.config.secret_token = ENV['SESSION_SECRET'] | 2 | 2 | 1 | 1 |
2a6e7ffdfcaa916557da2e65ad23d3789d430dbd | doc/examples/plot_rag_draw.py | doc/examples/plot_rag_draw.py | from skimage import data, segmentation
from skimage.future import graph
from matplotlib import pyplot as plt, colors
img = data.coffee()
labels = segmentation.slic(img, compactness=30, n_segments=400)
g = graph.rag_mean_color(img, labels)
out = graph.draw_rag(labels, g, img)
plt.figure()
plt.title("RAG with all edges shown in green.")
plt.imshow(out)
# The color palette used was taken from
# http://www.colorcombos.com/color-schemes/2/ColorCombo2.html
cmap = colors.ListedColormap(['#6599FF', '#ff9900'])
out = graph.draw_rag(labels, g, img, node_color="#ffde00", colormap=cmap,
thresh=30, desaturate=True)
plt.figure()
plt.title("RAG with edge weights less than 30, color "
"mapped between blue and orange.")
plt.imshow(out)
plt.figure()
plt.title("All edges drawn with cubehelix colormap")
cmap = plt.get_cmap('cubehelix')
out = graph.draw_rag(labels, g, img, colormap=cmap,
desaturate=True)
plt.imshow(out)
plt.show()
| from skimage import data, segmentation
from skimage.future import graph
from matplotlib import pyplot as plt, colors
img = data.coffee()
labels = segmentation.slic(img, compactness=30, n_segments=400)
g = graph.rag_mean_color(img, labels)
out = graph.draw_rag(labels, g, img)
plt.figure()
plt.title("RAG with all edges shown in green.")
plt.imshow(out)
# The color palette used was taken from
# http://www.colorcombos.com/color-schemes/2/ColorCombo2.html
cmap = colors.ListedColormap(['#6599FF', '#ff9900'])
out = graph.draw_rag(labels, g, img, node_color="#ffde00", colormap=cmap,
thresh=30, desaturate=True)
plt.figure()
plt.title("RAG with edge weights less than 30, color "
"mapped between blue and orange.")
plt.imshow(out)
plt.figure()
plt.title("All edges drawn with viridis colormap")
cmap = plt.get_cmap('viridis')
out = graph.draw_rag(labels, g, img, colormap=cmap,
desaturate=True)
plt.imshow(out)
plt.show()
| Replace cubehelix with the viridis colormap in the RAG drawing example | Replace cubehelix with the viridis colormap in the RAG drawing example
| Python | bsd-3-clause | rjeli/scikit-image,paalge/scikit-image,oew1v07/scikit-image,ClinicalGraphics/scikit-image,WarrenWeckesser/scikits-image,vighneshbirodkar/scikit-image,emon10005/scikit-image,rjeli/scikit-image,Midafi/scikit-image,blink1073/scikit-image,rjeli/scikit-image,youprofit/scikit-image,jwiggins/scikit-image,ajaybhat/scikit-image,keflavich/scikit-image,pratapvardhan/scikit-image,ofgulban/scikit-image,oew1v07/scikit-image,paalge/scikit-image,vighneshbirodkar/scikit-image,Hiyorimi/scikit-image,Midafi/scikit-image,ajaybhat/scikit-image,jwiggins/scikit-image,youprofit/scikit-image,WarrenWeckesser/scikits-image,chriscrosscutler/scikit-image,ClinicalGraphics/scikit-image,juliusbierk/scikit-image,emon10005/scikit-image,juliusbierk/scikit-image,Hiyorimi/scikit-image,chriscrosscutler/scikit-image,ofgulban/scikit-image,pratapvardhan/scikit-image,paalge/scikit-image,blink1073/scikit-image,vighneshbirodkar/scikit-image,keflavich/scikit-image,ofgulban/scikit-image | python | ## Code Before:
from skimage import data, segmentation
from skimage.future import graph
from matplotlib import pyplot as plt, colors
img = data.coffee()
labels = segmentation.slic(img, compactness=30, n_segments=400)
g = graph.rag_mean_color(img, labels)
out = graph.draw_rag(labels, g, img)
plt.figure()
plt.title("RAG with all edges shown in green.")
plt.imshow(out)
# The color palette used was taken from
# http://www.colorcombos.com/color-schemes/2/ColorCombo2.html
cmap = colors.ListedColormap(['#6599FF', '#ff9900'])
out = graph.draw_rag(labels, g, img, node_color="#ffde00", colormap=cmap,
thresh=30, desaturate=True)
plt.figure()
plt.title("RAG with edge weights less than 30, color "
"mapped between blue and orange.")
plt.imshow(out)
plt.figure()
plt.title("All edges drawn with cubehelix colormap")
cmap = plt.get_cmap('cubehelix')
out = graph.draw_rag(labels, g, img, colormap=cmap,
desaturate=True)
plt.imshow(out)
plt.show()
## Instruction:
Replace cubehelix with the viridis colormap in the RAG drawing example
## Code After:
from skimage import data, segmentation
from skimage.future import graph
from matplotlib import pyplot as plt, colors
img = data.coffee()
labels = segmentation.slic(img, compactness=30, n_segments=400)
g = graph.rag_mean_color(img, labels)
out = graph.draw_rag(labels, g, img)
plt.figure()
plt.title("RAG with all edges shown in green.")
plt.imshow(out)
# The color palette used was taken from
# http://www.colorcombos.com/color-schemes/2/ColorCombo2.html
cmap = colors.ListedColormap(['#6599FF', '#ff9900'])
out = graph.draw_rag(labels, g, img, node_color="#ffde00", colormap=cmap,
thresh=30, desaturate=True)
plt.figure()
plt.title("RAG with edge weights less than 30, color "
"mapped between blue and orange.")
plt.imshow(out)
plt.figure()
plt.title("All edges drawn with viridis colormap")
cmap = plt.get_cmap('viridis')
out = graph.draw_rag(labels, g, img, colormap=cmap,
desaturate=True)
plt.imshow(out)
plt.show()
| from skimage import data, segmentation
from skimage.future import graph
from matplotlib import pyplot as plt, colors
img = data.coffee()
labels = segmentation.slic(img, compactness=30, n_segments=400)
g = graph.rag_mean_color(img, labels)
out = graph.draw_rag(labels, g, img)
plt.figure()
plt.title("RAG with all edges shown in green.")
plt.imshow(out)
# The color palette used was taken from
# http://www.colorcombos.com/color-schemes/2/ColorCombo2.html
cmap = colors.ListedColormap(['#6599FF', '#ff9900'])
out = graph.draw_rag(labels, g, img, node_color="#ffde00", colormap=cmap,
thresh=30, desaturate=True)
plt.figure()
plt.title("RAG with edge weights less than 30, color "
"mapped between blue and orange.")
plt.imshow(out)
plt.figure()
- plt.title("All edges drawn with cubehelix colormap")
? ^^^^^^^ ^
+ plt.title("All edges drawn with viridis colormap")
? ^ ^^^^^
- cmap = plt.get_cmap('cubehelix')
? ^^^^^^^ ^
+ cmap = plt.get_cmap('viridis')
? ^ ^^^^^
out = graph.draw_rag(labels, g, img, colormap=cmap,
desaturate=True)
plt.imshow(out)
plt.show() | 4 | 0.125 | 2 | 2 |
d44010acc32fcb78570cd34478d0f4e8f1cfa979 | utility/dbproc.py | utility/dbproc.py | from discord.ext import commands
from utils import *
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from member import Base, Member
import discord
import asyncio
class Baydb:
engine = create_engine('sqlite:///bayohwoolph.db')
Base.metadata.bind = engine
DBSession = sessionmaker(bind=engine)
session = DBSession()
conn = engine.connect()
| from discord.ext import commands
from utils import *
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from member import Base, Member
from config import Config
import discord
import asyncio
class Baydb:
engine = create_engine(Config.MAIN['dbpath'])
Base.metadata.bind = engine
DBSession = sessionmaker(bind=engine)
session = DBSession()
conn = engine.connect()
| Move another usage of DB into ini file thing. | Move another usage of DB into ini file thing.
| Python | agpl-3.0 | dark-echo/Bay-Oh-Woolph,freiheit/Bay-Oh-Woolph | python | ## Code Before:
from discord.ext import commands
from utils import *
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from member import Base, Member
import discord
import asyncio
class Baydb:
engine = create_engine('sqlite:///bayohwoolph.db')
Base.metadata.bind = engine
DBSession = sessionmaker(bind=engine)
session = DBSession()
conn = engine.connect()
## Instruction:
Move another usage of DB into ini file thing.
## Code After:
from discord.ext import commands
from utils import *
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from member import Base, Member
from config import Config
import discord
import asyncio
class Baydb:
engine = create_engine(Config.MAIN['dbpath'])
Base.metadata.bind = engine
DBSession = sessionmaker(bind=engine)
session = DBSession()
conn = engine.connect()
| from discord.ext import commands
from utils import *
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from member import Base, Member
+ from config import Config
import discord
import asyncio
class Baydb:
- engine = create_engine('sqlite:///bayohwoolph.db')
+ engine = create_engine(Config.MAIN['dbpath'])
Base.metadata.bind = engine
DBSession = sessionmaker(bind=engine)
session = DBSession()
conn = engine.connect()
| 3 | 0.1 | 2 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.