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
23e7d7153f5a2d09fe67497ce34bb46b28c4a31f
tests/client/protractorSuites.json
tests/client/protractorSuites.json
{ "applicationPage": "e2eTests/applicationPage*.js", "homePage": "e2eTests/homePage*.js", "leftMenu": "e2eTests/leftMenu*.js", "loginPage": "e2eTests/loginPage*.js", "profilePage": "e2eTests/profilePage*.js", "rolePage": "e2eTests/rolePage*.js", "topMenu": "e2eTests/topMenu*.js", "userPage": "e2eTests/userPage*.js" }
{ "applicationPage": "e2eTests/applicationPage*.js", "homePage": "e2eTests/homePage*.js", "leftMenu": "e2eTests/leftMenu*.js", "loginPage": "e2eTests/loginPage*.js", "profilePage": "e2eTests/profilePage*.js", "rolePage": "e2eTests/rolePage*.js", "topMenu": "e2eTests/topMenu*.js", "userPage": "e2eTests/userPage*.js", "core": "e2eTests/*.js" }
Add an end to end test suite to launch all core tests
Add an end to end test suite to launch all core tests
JSON
agpl-3.0
veo-labs/openveo-core,veo-labs/openveo-core,veo-labs/openveo-core
json
## Code Before: { "applicationPage": "e2eTests/applicationPage*.js", "homePage": "e2eTests/homePage*.js", "leftMenu": "e2eTests/leftMenu*.js", "loginPage": "e2eTests/loginPage*.js", "profilePage": "e2eTests/profilePage*.js", "rolePage": "e2eTests/rolePage*.js", "topMenu": "e2eTests/topMenu*.js", "userPage": "e2eTests/userPage*.js" } ## Instruction: Add an end to end test suite to launch all core tests ## Code After: { "applicationPage": "e2eTests/applicationPage*.js", "homePage": "e2eTests/homePage*.js", "leftMenu": "e2eTests/leftMenu*.js", "loginPage": "e2eTests/loginPage*.js", "profilePage": "e2eTests/profilePage*.js", "rolePage": "e2eTests/rolePage*.js", "topMenu": "e2eTests/topMenu*.js", "userPage": "e2eTests/userPage*.js", "core": "e2eTests/*.js" }
{ "applicationPage": "e2eTests/applicationPage*.js", "homePage": "e2eTests/homePage*.js", "leftMenu": "e2eTests/leftMenu*.js", "loginPage": "e2eTests/loginPage*.js", "profilePage": "e2eTests/profilePage*.js", "rolePage": "e2eTests/rolePage*.js", "topMenu": "e2eTests/topMenu*.js", - "userPage": "e2eTests/userPage*.js" + "userPage": "e2eTests/userPage*.js", ? + + "core": "e2eTests/*.js" }
3
0.3
2
1
f5faa38f0e7ddfc8d8add851e0ab3eaaf27878ce
backup_init.sh
backup_init.sh
set -e : "${PGDATA:?PGDATA must be set}" USE_WALE_SIDECAR=${USE_WALE_SIDECAR:-false} WALE_INIT_LOCKFILE=$PGDATA/wale_init_lockfile WALE_SIDECAR_HOSTNAME=${WALE_SIDECAR_HOSTNAME:-localhost} WALE_SIDECAR_PORT=${WALE_SIDECAR_PORT:-5000} ARCHIVE_COMMAND="archive_command='/usr/bin/wget "${WALE_SIDECAR_HOSTNAME}":"${WALE_SIDECAR_PORT}"/push/%f -O -'" if [ $USE_WALE_SIDECAR = 'true' ]; then touch $WALE_INIT_LOCKFILE if [ ! -f $PGDATA/postgresql.conf ] ; then echo $ARCHIVE_COMMAND >> /usr/local/share/postgresql/postgresql.conf.sample fi while [ -f $WALE_INIT_LOCKFILE ] ; do sleep 2 echo 'waiting for wal-e startup' done else echo "Running without wal-e sidecar" fi ./docker-entrypoint.sh $@
set -e : "${PGDATA:?PGDATA must be set}" WGET_BIN=${WGET_BIN:-/usr/bin/wget} USE_WALE_SIDECAR=${USE_WALE_SIDECAR:-false} WALE_INIT_LOCKFILE=$PGDATA/wale_init_lockfile WALE_SIDECAR_HOSTNAME=${WALE_SIDECAR_HOSTNAME:-localhost} WALE_SIDECAR_PORT=${WALE_SIDECAR_PORT:-5000} ARCHIVE_COMMAND="archive_command='"${WGET_BIN}" "${WALE_SIDECAR_HOSTNAME}":"${WALE_SIDECAR_PORT}"/push/%f -O -'" if [ $USE_WALE_SIDECAR = 'true' ]; then set +e ${WGET_BIN} ${WALE_SIDECAR_HOSTNAME}:${WALE_SIDECAR_PORT}/ping if [ $? -ne 0 ] ; then echo "Create wal-e lock file" touch $WALE_INIT_LOCKFILE fi set -e if [ -f $PGDATA/postmaster.pid ] ; then set +e pg_isready if [ $? -ne 0 ] ; then echo "Removing leftover postmaster file" rm $PGDATA/postmaster.pid fi set -e fi if [ ! -f $PGDATA/postgresql.conf ] ; then echo $ARCHIVE_COMMAND >> /usr/local/share/postgresql/postgresql.conf.sample fi while [ -f $WALE_INIT_LOCKFILE ] ; do sleep 2 echo 'waiting for wal-e startup' done else echo "Running without wal-e sidecar" fi echo "Launching postgres" echo "$@" ./docker-entrypoint.sh "$@"
Make wal-e backup setup more robust, particulary for recovery
Make wal-e backup setup more robust, particulary for recovery
Shell
apache-2.0
timescale/timescaledb-docker
shell
## Code Before: set -e : "${PGDATA:?PGDATA must be set}" USE_WALE_SIDECAR=${USE_WALE_SIDECAR:-false} WALE_INIT_LOCKFILE=$PGDATA/wale_init_lockfile WALE_SIDECAR_HOSTNAME=${WALE_SIDECAR_HOSTNAME:-localhost} WALE_SIDECAR_PORT=${WALE_SIDECAR_PORT:-5000} ARCHIVE_COMMAND="archive_command='/usr/bin/wget "${WALE_SIDECAR_HOSTNAME}":"${WALE_SIDECAR_PORT}"/push/%f -O -'" if [ $USE_WALE_SIDECAR = 'true' ]; then touch $WALE_INIT_LOCKFILE if [ ! -f $PGDATA/postgresql.conf ] ; then echo $ARCHIVE_COMMAND >> /usr/local/share/postgresql/postgresql.conf.sample fi while [ -f $WALE_INIT_LOCKFILE ] ; do sleep 2 echo 'waiting for wal-e startup' done else echo "Running without wal-e sidecar" fi ./docker-entrypoint.sh $@ ## Instruction: Make wal-e backup setup more robust, particulary for recovery ## Code After: set -e : "${PGDATA:?PGDATA must be set}" WGET_BIN=${WGET_BIN:-/usr/bin/wget} USE_WALE_SIDECAR=${USE_WALE_SIDECAR:-false} WALE_INIT_LOCKFILE=$PGDATA/wale_init_lockfile WALE_SIDECAR_HOSTNAME=${WALE_SIDECAR_HOSTNAME:-localhost} WALE_SIDECAR_PORT=${WALE_SIDECAR_PORT:-5000} ARCHIVE_COMMAND="archive_command='"${WGET_BIN}" "${WALE_SIDECAR_HOSTNAME}":"${WALE_SIDECAR_PORT}"/push/%f -O -'" if [ $USE_WALE_SIDECAR = 'true' ]; then set +e ${WGET_BIN} ${WALE_SIDECAR_HOSTNAME}:${WALE_SIDECAR_PORT}/ping if [ $? -ne 0 ] ; then echo "Create wal-e lock file" touch $WALE_INIT_LOCKFILE fi set -e if [ -f $PGDATA/postmaster.pid ] ; then set +e pg_isready if [ $? -ne 0 ] ; then echo "Removing leftover postmaster file" rm $PGDATA/postmaster.pid fi set -e fi if [ ! -f $PGDATA/postgresql.conf ] ; then echo $ARCHIVE_COMMAND >> /usr/local/share/postgresql/postgresql.conf.sample fi while [ -f $WALE_INIT_LOCKFILE ] ; do sleep 2 echo 'waiting for wal-e startup' done else echo "Running without wal-e sidecar" fi echo "Launching postgres" echo "$@" ./docker-entrypoint.sh "$@"
set -e : "${PGDATA:?PGDATA must be set}" + WGET_BIN=${WGET_BIN:-/usr/bin/wget} USE_WALE_SIDECAR=${USE_WALE_SIDECAR:-false} WALE_INIT_LOCKFILE=$PGDATA/wale_init_lockfile WALE_SIDECAR_HOSTNAME=${WALE_SIDECAR_HOSTNAME:-localhost} WALE_SIDECAR_PORT=${WALE_SIDECAR_PORT:-5000} - ARCHIVE_COMMAND="archive_command='/usr/bin/wget "${WALE_SIDECAR_HOSTNAME}":"${WALE_SIDECAR_PORT}"/push/%f -O -'" ? ^^^^^^^^^^^^^ + ARCHIVE_COMMAND="archive_command='"${WGET_BIN}" "${WALE_SIDECAR_HOSTNAME}":"${WALE_SIDECAR_PORT}"/push/%f -O -'" ? ^^^^^^^^^^^^^ if [ $USE_WALE_SIDECAR = 'true' ]; then + set +e + ${WGET_BIN} ${WALE_SIDECAR_HOSTNAME}:${WALE_SIDECAR_PORT}/ping + if [ $? -ne 0 ] ; then + echo "Create wal-e lock file" - touch $WALE_INIT_LOCKFILE + touch $WALE_INIT_LOCKFILE ? ++++ + fi + set -e + + if [ -f $PGDATA/postmaster.pid ] ; then + set +e + pg_isready + if [ $? -ne 0 ] ; then + echo "Removing leftover postmaster file" + rm $PGDATA/postmaster.pid + fi + set -e + fi if [ ! -f $PGDATA/postgresql.conf ] ; then echo $ARCHIVE_COMMAND >> /usr/local/share/postgresql/postgresql.conf.sample fi while [ -f $WALE_INIT_LOCKFILE ] ; do sleep 2 echo 'waiting for wal-e startup' done else echo "Running without wal-e sidecar" fi + echo "Launching postgres" + echo "$@" - ./docker-entrypoint.sh $@ + ./docker-entrypoint.sh "$@" ? + +
25
0.892857
22
3
e22ed56c8560cb79dc486f4b04d15b543da8112f
www/modules/api/Api.php
www/modules/api/Api.php
<?php namespace app\modules\api; use yii\base\BootstrapInterface; class Api extends \yii\base\Module implements BootstrapInterface { public $controllerNamespace = 'app\modules\api\controllers'; private static $_defaultVersion = 'v1'; public static function getDefaultVersion() { return self::$_defaultVersion; } public function bootstrap($app) { $app->getUrlManager()->addRules([ [ 'class' => 'yii\rest\UrlRule', 'controller' => [ 'api/v1/default' ] ] ], false); } function init() { parent::init(); $this->modules = [ 'v1' => 'app\modules\api\versions\v1\ApiV1' ]; } }
<?php namespace app\modules\api; use yii\base\BootstrapInterface; class Api extends \yii\base\Module implements BootstrapInterface { public $controllerNamespace = 'app\modules\api\controllers'; private static $_defaultVersion = 'v1'; public static function getDefaultVersion() { return self::$_defaultVersion; } public function bootstrap($app) { $app->getUrlManager()->addRules([ [ 'class' => 'yii\rest\UrlRule', 'controller' => [ 'api/v1/default' ] ] ], false); } function init() { parent::init(); \Yii::$app->user->enableSession = false; $this->modules = [ 'v1' => 'app\modules\api\versions\v1\ApiV1' ]; } }
Disable session for api modules
Disable session for api modules
PHP
bsd-3-clause
d-bf/server,d-bf/server
php
## Code Before: <?php namespace app\modules\api; use yii\base\BootstrapInterface; class Api extends \yii\base\Module implements BootstrapInterface { public $controllerNamespace = 'app\modules\api\controllers'; private static $_defaultVersion = 'v1'; public static function getDefaultVersion() { return self::$_defaultVersion; } public function bootstrap($app) { $app->getUrlManager()->addRules([ [ 'class' => 'yii\rest\UrlRule', 'controller' => [ 'api/v1/default' ] ] ], false); } function init() { parent::init(); $this->modules = [ 'v1' => 'app\modules\api\versions\v1\ApiV1' ]; } } ## Instruction: Disable session for api modules ## Code After: <?php namespace app\modules\api; use yii\base\BootstrapInterface; class Api extends \yii\base\Module implements BootstrapInterface { public $controllerNamespace = 'app\modules\api\controllers'; private static $_defaultVersion = 'v1'; public static function getDefaultVersion() { return self::$_defaultVersion; } public function bootstrap($app) { $app->getUrlManager()->addRules([ [ 'class' => 'yii\rest\UrlRule', 'controller' => [ 'api/v1/default' ] ] ], false); } function init() { parent::init(); \Yii::$app->user->enableSession = false; $this->modules = [ 'v1' => 'app\modules\api\versions\v1\ApiV1' ]; } }
<?php namespace app\modules\api; use yii\base\BootstrapInterface; class Api extends \yii\base\Module implements BootstrapInterface { public $controllerNamespace = 'app\modules\api\controllers'; private static $_defaultVersion = 'v1'; public static function getDefaultVersion() { return self::$_defaultVersion; } public function bootstrap($app) { $app->getUrlManager()->addRules([ [ 'class' => 'yii\rest\UrlRule', 'controller' => [ 'api/v1/default' ] ] ], false); } function init() { parent::init(); + \Yii::$app->user->enableSession = false; + $this->modules = [ 'v1' => 'app\modules\api\versions\v1\ApiV1' ]; } }
2
0.051282
2
0
3f5e302e2e5b986e8490a270b34fcacc34d8b64f
app/views/admin/gitaly_servers/index.html.haml
app/views/admin/gitaly_servers/index.html.haml
- breadcrumb_title _("Gitaly Servers") %h3.page-title= _("Gitaly Servers") %hr .gitaly_servers - if @gitaly_servers.any? .table-holder %table.table.responsive-table %thead.d-none.d-sm-none.d-md-block %tr %th= _("Storage") %th= n_("Gitaly|Address") %th= _("Server version") %th= _("Git version") %th= _("Up to date") - @gitaly_servers.each do |server| %tr %td = server.storage %td = server.address %td = server.server_version %td = server.git_binary_version %td = boolean_to_icon(server.up_to_date?) - else .empty-state .text-center %h4= _("No connection could be made to a Gitaly Server, please check your logs!")
- breadcrumb_title _("Gitaly Servers") %h3.page-title= _("Gitaly Servers") %hr .gitaly_servers - if @gitaly_servers.any? .table-holder %table.table.responsive-table %thead %tr %th= _("Storage") %th= n_("Gitaly|Address") %th= _("Server version") %th= _("Git version") %th= _("Up to date") - @gitaly_servers.each do |server| %tr %td = server.storage %td = server.address %td = server.server_version %td = server.git_binary_version %td = boolean_to_icon(server.up_to_date?) - else .empty-state .text-center %h4= _("No connection could be made to a Gitaly Server, please check your logs!")
Revert extra CSS causing Gitaly Servers table to be misalgined
Revert extra CSS causing Gitaly Servers table to be misalgined Closes #47648
Haml
mit
jirutka/gitlabhq,dreampet/gitlab,axilleas/gitlabhq,iiet/iiet-git,stoplightio/gitlabhq,stoplightio/gitlabhq,axilleas/gitlabhq,stoplightio/gitlabhq,mmkassem/gitlabhq,axilleas/gitlabhq,iiet/iiet-git,jirutka/gitlabhq,mmkassem/gitlabhq,stoplightio/gitlabhq,axilleas/gitlabhq,dreampet/gitlab,iiet/iiet-git,jirutka/gitlabhq,dreampet/gitlab,jirutka/gitlabhq,mmkassem/gitlabhq,mmkassem/gitlabhq,dreampet/gitlab,iiet/iiet-git
haml
## Code Before: - breadcrumb_title _("Gitaly Servers") %h3.page-title= _("Gitaly Servers") %hr .gitaly_servers - if @gitaly_servers.any? .table-holder %table.table.responsive-table %thead.d-none.d-sm-none.d-md-block %tr %th= _("Storage") %th= n_("Gitaly|Address") %th= _("Server version") %th= _("Git version") %th= _("Up to date") - @gitaly_servers.each do |server| %tr %td = server.storage %td = server.address %td = server.server_version %td = server.git_binary_version %td = boolean_to_icon(server.up_to_date?) - else .empty-state .text-center %h4= _("No connection could be made to a Gitaly Server, please check your logs!") ## Instruction: Revert extra CSS causing Gitaly Servers table to be misalgined Closes #47648 ## Code After: - breadcrumb_title _("Gitaly Servers") %h3.page-title= _("Gitaly Servers") %hr .gitaly_servers - if @gitaly_servers.any? .table-holder %table.table.responsive-table %thead %tr %th= _("Storage") %th= n_("Gitaly|Address") %th= _("Server version") %th= _("Git version") %th= _("Up to date") - @gitaly_servers.each do |server| %tr %td = server.storage %td = server.address %td = server.server_version %td = server.git_binary_version %td = boolean_to_icon(server.up_to_date?) - else .empty-state .text-center %h4= _("No connection could be made to a Gitaly Server, please check your logs!")
- breadcrumb_title _("Gitaly Servers") %h3.page-title= _("Gitaly Servers") %hr .gitaly_servers - if @gitaly_servers.any? .table-holder %table.table.responsive-table - %thead.d-none.d-sm-none.d-md-block + %thead %tr %th= _("Storage") %th= n_("Gitaly|Address") %th= _("Server version") %th= _("Git version") %th= _("Up to date") - @gitaly_servers.each do |server| %tr %td = server.storage %td = server.address %td = server.server_version %td = server.git_binary_version %td = boolean_to_icon(server.up_to_date?) - else .empty-state .text-center %h4= _("No connection could be made to a Gitaly Server, please check your logs!")
2
0.064516
1
1
a29d73ae3b098a3fedfb792271a2dfe0a5dc5293
app/views/comment/_show.rhtml
app/views/comment/_show.rhtml
<% comment = show %> <div class="comment"> <table> <tr> <td class="header">Comment ID #<%= comment.id %> by:</td> <td><%=h comment.commenter %></td> </tr> <tr> <td class="header">On:</td> <td><%=h comment.written_on %></td> </tr> <tr> <td class="content" colspan="2"> <%=h comment.content %> </td> </tr> </table> </div>
<% comment = show %> <div class="comment"> <table> <tr> <td class="header">Comment ID #<%= comment.id %> by:</td> <td><%=h comment.commenter %></td> </tr> <tr> <td class="header">On:</td> <td><%=h comment.written_on %></td> </tr> <tr> <td class="content" colspan="2"> <%=(h comment.content).gsub("\n", "<br/>") %></pre> </td> </tr> </table> </div>
Substitute <br/> for \n in review comments
Substitute <br/> for \n in review comments
RHTML
bsd-3-clause
toddlipcon/arb,toddlipcon/arb,toddlipcon/arb
rhtml
## Code Before: <% comment = show %> <div class="comment"> <table> <tr> <td class="header">Comment ID #<%= comment.id %> by:</td> <td><%=h comment.commenter %></td> </tr> <tr> <td class="header">On:</td> <td><%=h comment.written_on %></td> </tr> <tr> <td class="content" colspan="2"> <%=h comment.content %> </td> </tr> </table> </div> ## Instruction: Substitute <br/> for \n in review comments ## Code After: <% comment = show %> <div class="comment"> <table> <tr> <td class="header">Comment ID #<%= comment.id %> by:</td> <td><%=h comment.commenter %></td> </tr> <tr> <td class="header">On:</td> <td><%=h comment.written_on %></td> </tr> <tr> <td class="content" colspan="2"> <%=(h comment.content).gsub("\n", "<br/>") %></pre> </td> </tr> </table> </div>
<% comment = show %> <div class="comment"> <table> <tr> <td class="header">Comment ID #<%= comment.id %> by:</td> <td><%=h comment.commenter %></td> </tr> <tr> <td class="header">On:</td> <td><%=h comment.written_on %></td> </tr> <tr> <td class="content" colspan="2"> - <%=h comment.content %> + <%=(h comment.content).gsub("\n", "<br/>") %></pre> </td> </tr> </table> </div>
2
0.105263
1
1
60d7abaa414b33292de9799593383d9adb8c0ed0
config/_database.yml
config/_database.yml
test: dsn: "dbi:Pg:dbname=iwai_test;host=localhost" user: "user" pass: "pass" development: dsn: "dbi:Pg:dbname=iwai_development;host=localhost" user: "user" pass: "pass" production: dsn: "<: ENV("DB_DSN") :>" user: "<: ENV("DB_USER") :>" pass: "<: ENV("DB_PASS") :>"
test: dsn: "dbi:Pg:dbname=iwai_test;host=localhost" user: "" pass: "" development: dsn: "dbi:Pg:dbname=iwai_development;host=localhost" user: "" pass: "" production: dsn: "<: ENV("DB_DSN") :>" user: "<: ENV("DB_USER") :>" pass: "<: ENV("DB_PASS") :>"
Delete user setting from dev/test databse settings
Delete user setting from dev/test databse settings
YAML
mit
Sixeight/iwai,Sixeight/iwai,Sixeight/iwai
yaml
## Code Before: test: dsn: "dbi:Pg:dbname=iwai_test;host=localhost" user: "user" pass: "pass" development: dsn: "dbi:Pg:dbname=iwai_development;host=localhost" user: "user" pass: "pass" production: dsn: "<: ENV("DB_DSN") :>" user: "<: ENV("DB_USER") :>" pass: "<: ENV("DB_PASS") :>" ## Instruction: Delete user setting from dev/test databse settings ## Code After: test: dsn: "dbi:Pg:dbname=iwai_test;host=localhost" user: "" pass: "" development: dsn: "dbi:Pg:dbname=iwai_development;host=localhost" user: "" pass: "" production: dsn: "<: ENV("DB_DSN") :>" user: "<: ENV("DB_USER") :>" pass: "<: ENV("DB_PASS") :>"
test: dsn: "dbi:Pg:dbname=iwai_test;host=localhost" - user: "user" ? ---- + user: "" - pass: "pass" ? ---- + pass: "" development: dsn: "dbi:Pg:dbname=iwai_development;host=localhost" - user: "user" ? ---- + user: "" - pass: "pass" ? ---- + pass: "" production: dsn: "<: ENV("DB_DSN") :>" user: "<: ENV("DB_USER") :>" pass: "<: ENV("DB_PASS") :>"
8
0.533333
4
4
54e74e4ab44d1fe5ac1ab865c308f9f78f242638
src/server/clojure_template/templates/layouts.clj
src/server/clojure_template/templates/layouts.clj
(ns clojure-template.templates.layouts (:require [environ.core :refer [env]] [hiccup.page :refer [html5 include-css include-js]] [ring.middleware.anti-forgery :refer [*anti-forgery-token*]])) (defn application [& content] (html5 [:head [:meta {:charset "utf-8"}] [:meta {:http-equiv "X-UA-Compatible" :content "IE=edge"}] [:meta {:name "viewport" :content "width=device-width, initial-scale=1"}] [:meta {:csrf *anti-forgery-token*}] [:title "Application"] (include-css "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css") (include-css "https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css") (include-css "/css/app.css") [:body content (include-js "https://code.jquery.com/jquery-2.2.4.min.js") (include-js "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js") (include-js "/js/app.js")]]))
(ns clojure-template.templates.layouts (:require [environ.core :refer [env]] [hiccup.page :refer [html5 include-css include-js]])) (defn application [& content] (html5 [:head [:meta {:charset "utf-8"}] [:meta {:http-equiv "X-UA-Compatible" :content "IE=edge"}] [:meta {:name "viewport" :content "width=device-width, initial-scale=1"}] [:title "Application"] (include-css "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css") (include-css "https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css") (include-css "/css/app.css") [:body content (include-js "https://code.jquery.com/jquery-2.2.4.min.js") (include-js "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js") (include-js "/js/app.js")]]))
Remove csrf token from template
Remove csrf token from template
Clojure
epl-1.0
hung-phan/clojure-template,hung-phan/clojure-template
clojure
## Code Before: (ns clojure-template.templates.layouts (:require [environ.core :refer [env]] [hiccup.page :refer [html5 include-css include-js]] [ring.middleware.anti-forgery :refer [*anti-forgery-token*]])) (defn application [& content] (html5 [:head [:meta {:charset "utf-8"}] [:meta {:http-equiv "X-UA-Compatible" :content "IE=edge"}] [:meta {:name "viewport" :content "width=device-width, initial-scale=1"}] [:meta {:csrf *anti-forgery-token*}] [:title "Application"] (include-css "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css") (include-css "https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css") (include-css "/css/app.css") [:body content (include-js "https://code.jquery.com/jquery-2.2.4.min.js") (include-js "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js") (include-js "/js/app.js")]])) ## Instruction: Remove csrf token from template ## Code After: (ns clojure-template.templates.layouts (:require [environ.core :refer [env]] [hiccup.page :refer [html5 include-css include-js]])) (defn application [& content] (html5 [:head [:meta {:charset "utf-8"}] [:meta {:http-equiv "X-UA-Compatible" :content "IE=edge"}] [:meta {:name "viewport" :content "width=device-width, initial-scale=1"}] [:title "Application"] (include-css "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css") (include-css "https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css") (include-css "/css/app.css") [:body content (include-js "https://code.jquery.com/jquery-2.2.4.min.js") (include-js "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js") (include-js "/js/app.js")]]))
(ns clojure-template.templates.layouts (:require [environ.core :refer [env]] - [hiccup.page :refer [html5 include-css include-js]] + [hiccup.page :refer [html5 include-css include-js]])) ? ++ - [ring.middleware.anti-forgery :refer [*anti-forgery-token*]])) (defn application [& content] (html5 [:head [:meta {:charset "utf-8"}] [:meta {:http-equiv "X-UA-Compatible" :content "IE=edge"}] [:meta {:name "viewport" :content "width=device-width, initial-scale=1"}] - [:meta {:csrf *anti-forgery-token*}] [:title "Application"] (include-css "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css") (include-css "https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css") (include-css "/css/app.css") [:body content (include-js "https://code.jquery.com/jquery-2.2.4.min.js") (include-js "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js") (include-js "/js/app.js")]]))
4
0.2
1
3
84da1d803208b191d723bb84367ddc3380effcee
src/Http/Requests/CreateRoleRequest.php
src/Http/Requests/CreateRoleRequest.php
<?php namespace Aliukevicius\LaravelRbac\Http\Requests; class CreateRoleRequest extends Request { protected $translationFile = 'aliukevicius/laravelRbac::lang.role'; /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ 'name' => 'required' ]; } }
<?php namespace Aliukevicius\LaravelRbac\Http\Requests; class CreateRoleRequest extends Request { protected $translationFile = 'aliukevicius/laravelRbac::lang.role'; /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ 'name' => 'required|unique:roles,name' ]; } }
Update role create name validation rule
Update role create name validation rule
PHP
mit
aliukevicius/laravel-rbac
php
## Code Before: <?php namespace Aliukevicius\LaravelRbac\Http\Requests; class CreateRoleRequest extends Request { protected $translationFile = 'aliukevicius/laravelRbac::lang.role'; /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ 'name' => 'required' ]; } } ## Instruction: Update role create name validation rule ## Code After: <?php namespace Aliukevicius\LaravelRbac\Http\Requests; class CreateRoleRequest extends Request { protected $translationFile = 'aliukevicius/laravelRbac::lang.role'; /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ 'name' => 'required|unique:roles,name' ]; } }
<?php namespace Aliukevicius\LaravelRbac\Http\Requests; class CreateRoleRequest extends Request { protected $translationFile = 'aliukevicius/laravelRbac::lang.role'; /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ - 'name' => 'required' + 'name' => 'required|unique:roles,name' ? ++++++++++++++++++ ]; } }
2
0.105263
1
1
2e3fcd3cd791b1535ef94857de1b84e64a64d901
bower.json
bower.json
{ "name": "eve-srp", "version": "0.9.6-dev", "homepage": "https://github.com/paxswill/evesrp", "authors": [ "Will Ross <paxswill@gmail.com>" ], "license": "BSD", "private": true, "ignore": [ "**/.*", "node_modules", "bower_components", "test", "tests" ], "dependencies": { "bootstrap-tokenfield": "https://github.com/paxswill/bootstrap-tokenfield.git#current-fixes", "bootstrap": "~3.2.0", "font-awesome": "~4.1.0", "history.js": "~1.8.0", "typeahead.js": "~0.10.2", "underscore": "~1.6.0", "zeroclipboard": "1.3.5", "handlebars": "2.0.0-alpha.4" }, "resolutions": { "jquery": ">= 1.9.0", "bootstrap": "~3.2.0" } }
{ "name": "eve-srp", "version": "0.10.6-dev", "homepage": "https://github.com/paxswill/evesrp", "authors": [ "Will Ross <paxswill@gmail.com>" ], "license": "BSD", "private": true, "ignore": [ "**/.*", "node_modules", "bower_components", "test", "tests" ], "dependencies": { "bootstrap-tokenfield": "https://github.com/paxswill/bootstrap-tokenfield.git#current-fixes", "bootstrap": "~3.3.4", "font-awesome": "~4.3.0", "history.js": "~1.8.0", "typeahead.js": "~0.10.5", "underscore": "~1.6.0", "zeroclipboard": "1.3.5", "handlebars": "~3.0.3" }, "resolutions": { "jquery": ">= 1.9.1", "bootstrap": "~3.3.4" } }
Update JS dependencies to latest versions
Update JS dependencies to latest versions With the exceptions of ZeroClipboard (where I'm still using the 1.x branch for some reason), Bootstrap Tokenfield (which is nearly unmaintained it seems now), Underscore.js (breaking changes I need to investigate) and Typeahead.js (which is in the process of rewriting itself, and would also break tokenfield).
JSON
bsd-2-clause
paxswill/evesrp,paxswill/evesrp,paxswill/evesrp
json
## Code Before: { "name": "eve-srp", "version": "0.9.6-dev", "homepage": "https://github.com/paxswill/evesrp", "authors": [ "Will Ross <paxswill@gmail.com>" ], "license": "BSD", "private": true, "ignore": [ "**/.*", "node_modules", "bower_components", "test", "tests" ], "dependencies": { "bootstrap-tokenfield": "https://github.com/paxswill/bootstrap-tokenfield.git#current-fixes", "bootstrap": "~3.2.0", "font-awesome": "~4.1.0", "history.js": "~1.8.0", "typeahead.js": "~0.10.2", "underscore": "~1.6.0", "zeroclipboard": "1.3.5", "handlebars": "2.0.0-alpha.4" }, "resolutions": { "jquery": ">= 1.9.0", "bootstrap": "~3.2.0" } } ## Instruction: Update JS dependencies to latest versions With the exceptions of ZeroClipboard (where I'm still using the 1.x branch for some reason), Bootstrap Tokenfield (which is nearly unmaintained it seems now), Underscore.js (breaking changes I need to investigate) and Typeahead.js (which is in the process of rewriting itself, and would also break tokenfield). ## Code After: { "name": "eve-srp", "version": "0.10.6-dev", "homepage": "https://github.com/paxswill/evesrp", "authors": [ "Will Ross <paxswill@gmail.com>" ], "license": "BSD", "private": true, "ignore": [ "**/.*", "node_modules", "bower_components", "test", "tests" ], "dependencies": { "bootstrap-tokenfield": "https://github.com/paxswill/bootstrap-tokenfield.git#current-fixes", "bootstrap": "~3.3.4", "font-awesome": "~4.3.0", "history.js": "~1.8.0", "typeahead.js": "~0.10.5", "underscore": "~1.6.0", "zeroclipboard": "1.3.5", "handlebars": "~3.0.3" }, "resolutions": { "jquery": ">= 1.9.1", "bootstrap": "~3.3.4" } }
{ "name": "eve-srp", - "version": "0.9.6-dev", ? ^ + "version": "0.10.6-dev", ? ^^ "homepage": "https://github.com/paxswill/evesrp", "authors": [ "Will Ross <paxswill@gmail.com>" ], "license": "BSD", "private": true, "ignore": [ "**/.*", "node_modules", "bower_components", "test", "tests" ], "dependencies": { "bootstrap-tokenfield": "https://github.com/paxswill/bootstrap-tokenfield.git#current-fixes", - "bootstrap": "~3.2.0", ? ^ ^ + "bootstrap": "~3.3.4", ? ^ ^ - "font-awesome": "~4.1.0", ? ^ + "font-awesome": "~4.3.0", ? ^ "history.js": "~1.8.0", - "typeahead.js": "~0.10.2", ? ^ + "typeahead.js": "~0.10.5", ? ^ "underscore": "~1.6.0", "zeroclipboard": "1.3.5", - "handlebars": "2.0.0-alpha.4" ? ^ ^^^^^^^^^ + "handlebars": "~3.0.3" ? ^^ ^ }, "resolutions": { - "jquery": ">= 1.9.0", ? ^ + "jquery": ">= 1.9.1", ? ^ - "bootstrap": "~3.2.0" ? ^ ^ + "bootstrap": "~3.3.4" ? ^ ^ } }
14
0.451613
7
7
99e9c3338586562859a24437c24a5700e931089f
gnu/usr.bin/texinfo/libtxi/Makefile
gnu/usr.bin/texinfo/libtxi/Makefile
LIB= txi INTERNALLIB= true SRCS= getopt.c getopt1.c substring.c xexit.c xmalloc.c xstrdup.c .include <bsd.lib.mk> .PATH: ${TXIDIR}/lib
LIB= txi INTERNALLIB= true SRCS= substring.c xexit.c xmalloc.c xstrdup.c .include <bsd.lib.mk> .PATH: ${TXIDIR}/lib
Remove getopt*.c, we already have compatible getopt_long() in libc
Remove getopt*.c, we already have compatible getopt_long() in libc
unknown
bsd-3-clause
jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase
unknown
## Code Before: LIB= txi INTERNALLIB= true SRCS= getopt.c getopt1.c substring.c xexit.c xmalloc.c xstrdup.c .include <bsd.lib.mk> .PATH: ${TXIDIR}/lib ## Instruction: Remove getopt*.c, we already have compatible getopt_long() in libc ## Code After: LIB= txi INTERNALLIB= true SRCS= substring.c xexit.c xmalloc.c xstrdup.c .include <bsd.lib.mk> .PATH: ${TXIDIR}/lib
LIB= txi INTERNALLIB= true - SRCS= getopt.c getopt1.c substring.c xexit.c xmalloc.c xstrdup.c ? --------- ^^^^^^^^^ + SRCS= substring.c xexit.c xmalloc.c xstrdup.c ? ^ .include <bsd.lib.mk> .PATH: ${TXIDIR}/lib
2
0.222222
1
1
72ecc8ae59f14863ca3c93d4fae0d955f8e692b7
README.md
README.md
Octonore ======== An octolicious wrapper around the [Gitignore templates API](http://developer.github.com/v3/gitignore/). $ gem install octonore Usage ----- To get a gitignore template you first need to instantiate it. >> c_template = Octonore::Template.new('C') => #<Octonore::Template:0x007fe5f401a1d0 @name="C"> To get a hash of its name and source code, call its `data` method. >> c_template.data => #<HTTParty::Response:0x7fe5f50adad8 parsed_response={"name"=>"C", "source"=>"# Object fi… ### Example Program require 'octonore' templates = [ Octonore::Template.new('C'), Octonore::Template.new('Java') ] templates.each do |template| File.open("#{template.data["name"]}.gitignore", 'w') { |file| file.write(template.data["source"]) } end
Octonore ======== An octolicious wrapper around the [Gitignore templates API](http://developer.github.com/v3/gitignore/). $ gem install octonore Usage ----- To get a gitignore template you first need to instantiate it. >> c_template = Octonore::Template.new('C') => #<Octonore::Template:0x007fe5f401a1d0 @name="C"> To get a hash of its name and source code, call its `data` method. >> c_template.data => #<HTTParty::Response:0x7fe5f50adad8 parsed_response={"name"=>"C", "source"=>"# Object fi… ### Example Program ```ruby require 'octonore' templates = [ Octonore::Template.new('C'), Octonore::Template.new('Java') ] templates.each do |template| File.open("#{template.data["name"]}.gitignore", 'w') { |file| file.write(template.data["source"]) } end ```
Add syntax highlighting to example program.
Add syntax highlighting to example program.
Markdown
mit
zachlatta/octonore
markdown
## Code Before: Octonore ======== An octolicious wrapper around the [Gitignore templates API](http://developer.github.com/v3/gitignore/). $ gem install octonore Usage ----- To get a gitignore template you first need to instantiate it. >> c_template = Octonore::Template.new('C') => #<Octonore::Template:0x007fe5f401a1d0 @name="C"> To get a hash of its name and source code, call its `data` method. >> c_template.data => #<HTTParty::Response:0x7fe5f50adad8 parsed_response={"name"=>"C", "source"=>"# Object fi… ### Example Program require 'octonore' templates = [ Octonore::Template.new('C'), Octonore::Template.new('Java') ] templates.each do |template| File.open("#{template.data["name"]}.gitignore", 'w') { |file| file.write(template.data["source"]) } end ## Instruction: Add syntax highlighting to example program. ## Code After: Octonore ======== An octolicious wrapper around the [Gitignore templates API](http://developer.github.com/v3/gitignore/). $ gem install octonore Usage ----- To get a gitignore template you first need to instantiate it. >> c_template = Octonore::Template.new('C') => #<Octonore::Template:0x007fe5f401a1d0 @name="C"> To get a hash of its name and source code, call its `data` method. >> c_template.data => #<HTTParty::Response:0x7fe5f50adad8 parsed_response={"name"=>"C", "source"=>"# Object fi… ### Example Program ```ruby require 'octonore' templates = [ Octonore::Template.new('C'), Octonore::Template.new('Java') ] templates.each do |template| File.open("#{template.data["name"]}.gitignore", 'w') { |file| file.write(template.data["source"]) } end ```
Octonore ======== An octolicious wrapper around the [Gitignore templates API](http://developer.github.com/v3/gitignore/). $ gem install octonore Usage ----- To get a gitignore template you first need to instantiate it. >> c_template = Octonore::Template.new('C') => #<Octonore::Template:0x007fe5f401a1d0 @name="C"> To get a hash of its name and source code, call its `data` method. >> c_template.data => #<HTTParty::Response:0x7fe5f50adad8 parsed_response={"name"=>"C", "source"=>"# Object fi… ### Example Program + ```ruby - require 'octonore' ? ---- + require 'octonore' - templates = [ Octonore::Template.new('C'), Octonore::Template.new('Java') ] ? - + templates = [ Octonore::Template.new('C'), Octonore::Template.new('Java') ] - templates.each do |template| ? - + templates.each do |template| - File.open("#{template.data["name"]}.gitignore", 'w') { |file| ? - + File.open("#{template.data["name"]}.gitignore", 'w') { |file| - file.write(template.data["source"]) ? ^^ + file.write(template.data["source"]) ? ^^^^ - } ? - + } - end ? - + end - + ```
17
0.515152
9
8
a39fb8d58577ac5a29c1839df76d3836bbb2cf00
pkg/barback/test/transformer/catch_asset_not_found.dart
pkg/barback/test/transformer/catch_asset_not_found.dart
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. library barback.test.transformer.bad; import 'dart:async'; import 'package:barback/barback.dart'; import 'package:barback/src/utils.dart'; import 'mock.dart'; /// A transformer that tries to load a secondary input and catches an /// [AssetNotFoundException] if the input doesn't exist. class CatchAssetNotFoundTransformer extends MockTransformer { /// The extension of assets this applies to. final String extension; /// The id of the secondary input to load. final AssetId input; CatchAssetNotFoundTransformer(this.extension, String input) : input = new AssetId.parse(input); Future<bool> doIsPrimary(Asset asset) => new Future.value(asset.id.extension == extension); Future doApply(Transform transform) { return transform.getInput(input).then((_) { transform.addOutput(new Asset.fromString( transform.primaryInput.id, "success")); }).catchError((e) { if (e is! AssetNotFoundException) throw e; transform.addOutput(new Asset.fromString( transform.primaryInput.id, "failed to load $input")); }); } }
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. library barback.test.transformer.catch_asset_not_found; import 'dart:async'; import 'package:barback/barback.dart'; import 'package:barback/src/utils.dart'; import 'mock.dart'; /// A transformer that tries to load a secondary input and catches an /// [AssetNotFoundException] if the input doesn't exist. class CatchAssetNotFoundTransformer extends MockTransformer { /// The extension of assets this applies to. final String extension; /// The id of the secondary input to load. final AssetId input; CatchAssetNotFoundTransformer(this.extension, String input) : input = new AssetId.parse(input); Future<bool> doIsPrimary(Asset asset) => new Future.value(asset.id.extension == extension); Future doApply(Transform transform) { return transform.getInput(input).then((_) { transform.addOutput(new Asset.fromString( transform.primaryInput.id, "success")); }).catchError((e) { if (e is! AssetNotFoundException) throw e; transform.addOutput(new Asset.fromString( transform.primaryInput.id, "failed to load $input")); }); } }
Fix an analyzer warning in barback.
Fix an analyzer warning in barback. R=rnystrom@google.com BUG= Review URL: https://codereview.chromium.org//196573013 git-svn-id: c93d8a2297af3b929165606efe145742a534bc71@33678 260f80e4-7a28-3924-810f-c04153c831b5
Dart
bsd-3-clause
dart-archive/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dart-lang/sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk
dart
## Code Before: // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. library barback.test.transformer.bad; import 'dart:async'; import 'package:barback/barback.dart'; import 'package:barback/src/utils.dart'; import 'mock.dart'; /// A transformer that tries to load a secondary input and catches an /// [AssetNotFoundException] if the input doesn't exist. class CatchAssetNotFoundTransformer extends MockTransformer { /// The extension of assets this applies to. final String extension; /// The id of the secondary input to load. final AssetId input; CatchAssetNotFoundTransformer(this.extension, String input) : input = new AssetId.parse(input); Future<bool> doIsPrimary(Asset asset) => new Future.value(asset.id.extension == extension); Future doApply(Transform transform) { return transform.getInput(input).then((_) { transform.addOutput(new Asset.fromString( transform.primaryInput.id, "success")); }).catchError((e) { if (e is! AssetNotFoundException) throw e; transform.addOutput(new Asset.fromString( transform.primaryInput.id, "failed to load $input")); }); } } ## Instruction: Fix an analyzer warning in barback. R=rnystrom@google.com BUG= Review URL: https://codereview.chromium.org//196573013 git-svn-id: c93d8a2297af3b929165606efe145742a534bc71@33678 260f80e4-7a28-3924-810f-c04153c831b5 ## Code After: // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. library barback.test.transformer.catch_asset_not_found; import 'dart:async'; import 'package:barback/barback.dart'; import 'package:barback/src/utils.dart'; import 'mock.dart'; /// A transformer that tries to load a secondary input and catches an /// [AssetNotFoundException] if the input doesn't exist. class CatchAssetNotFoundTransformer extends MockTransformer { /// The extension of assets this applies to. final String extension; /// The id of the secondary input to load. final AssetId input; CatchAssetNotFoundTransformer(this.extension, String input) : input = new AssetId.parse(input); Future<bool> doIsPrimary(Asset asset) => new Future.value(asset.id.extension == extension); Future doApply(Transform transform) { return transform.getInput(input).then((_) { transform.addOutput(new Asset.fromString( transform.primaryInput.id, "success")); }).catchError((e) { if (e is! AssetNotFoundException) throw e; transform.addOutput(new Asset.fromString( transform.primaryInput.id, "failed to load $input")); }); } }
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. - library barback.test.transformer.bad; ? ^ + library barback.test.transformer.catch_asset_not_found; ? ^ ++++++++++++++++++ import 'dart:async'; import 'package:barback/barback.dart'; import 'package:barback/src/utils.dart'; import 'mock.dart'; /// A transformer that tries to load a secondary input and catches an /// [AssetNotFoundException] if the input doesn't exist. class CatchAssetNotFoundTransformer extends MockTransformer { /// The extension of assets this applies to. final String extension; /// The id of the secondary input to load. final AssetId input; CatchAssetNotFoundTransformer(this.extension, String input) : input = new AssetId.parse(input); Future<bool> doIsPrimary(Asset asset) => new Future.value(asset.id.extension == extension); Future doApply(Transform transform) { return transform.getInput(input).then((_) { transform.addOutput(new Asset.fromString( transform.primaryInput.id, "success")); }).catchError((e) { if (e is! AssetNotFoundException) throw e; transform.addOutput(new Asset.fromString( transform.primaryInput.id, "failed to load $input")); }); } }
2
0.051282
1
1
3d7f09bde69238bf9ee3f5c94ddeba03153e0089
app/views/my_modules/_state_buttons.html.erb
app/views/my_modules/_state_buttons.html.erb
<div class="btn-group pull-right"> <% if !@my_module.completed? %> <div data-action="complete-task" data-link-url="<%= toggle_task_state_my_module_path(@my_module) %>"> <button class="btn btn-primary"> <%= t("my_modules.buttons.complete") %> </button> </div> <% else @my_module.completed? %> <div data-action="uncomplete-task" data-link-url="<%= toggle_task_state_my_module_path(@my_module) %>"> <button class="btn btn-default"> <%= t("my_modules.buttons.uncomplete") %> </button> </div> <% end %> </div> <span data-hook="my_module-protocol-buttons"></span>
<div class="pull-right"> <div class="btn-group"> <% if !@my_module.completed? %> <div data-action="complete-task" data-link-url="<%= toggle_task_state_my_module_path(@my_module) %>"> <button class="btn btn-primary"> <span class="glyphicon glyphicon-ok"></span> <%= t("my_modules.buttons.complete") %> </button> </div> <% else @my_module.completed? %> <div data-action="uncomplete-task" data-link-url="<%= toggle_task_state_my_module_path(@my_module) %>"> <button class="btn btn-greyed"> <span class="glyphicon glyphicon-remove"></span> <%= t("my_modules.buttons.uncomplete") %> </button> </div> <% end %> </div> <span data-hook="my_module-protocol-buttons"></span> </div>
Fix protocol state buttons a bit
Fix protocol state buttons a bit Closes SCI-1073.
HTML+ERB
mpl-2.0
mlorb/scinote-web,mlorb/scinote-web,mlorb/scinote-web,Ducz0r/scinote-web,Ducz0r/scinote-web,Ducz0r/scinote-web
html+erb
## Code Before: <div class="btn-group pull-right"> <% if !@my_module.completed? %> <div data-action="complete-task" data-link-url="<%= toggle_task_state_my_module_path(@my_module) %>"> <button class="btn btn-primary"> <%= t("my_modules.buttons.complete") %> </button> </div> <% else @my_module.completed? %> <div data-action="uncomplete-task" data-link-url="<%= toggle_task_state_my_module_path(@my_module) %>"> <button class="btn btn-default"> <%= t("my_modules.buttons.uncomplete") %> </button> </div> <% end %> </div> <span data-hook="my_module-protocol-buttons"></span> ## Instruction: Fix protocol state buttons a bit Closes SCI-1073. ## Code After: <div class="pull-right"> <div class="btn-group"> <% if !@my_module.completed? %> <div data-action="complete-task" data-link-url="<%= toggle_task_state_my_module_path(@my_module) %>"> <button class="btn btn-primary"> <span class="glyphicon glyphicon-ok"></span> <%= t("my_modules.buttons.complete") %> </button> </div> <% else @my_module.completed? %> <div data-action="uncomplete-task" data-link-url="<%= toggle_task_state_my_module_path(@my_module) %>"> <button class="btn btn-greyed"> <span class="glyphicon glyphicon-remove"></span> <%= t("my_modules.buttons.uncomplete") %> </button> </div> <% end %> </div> <span data-hook="my_module-protocol-buttons"></span> </div>
- <div class="btn-group pull-right"> ? ---------- + <div class="pull-right"> + <div class="btn-group"> - <% if !@my_module.completed? %> + <% if !@my_module.completed? %> ? ++ - <div data-action="complete-task" data-link-url="<%= toggle_task_state_my_module_path(@my_module) %>"> + <div data-action="complete-task" data-link-url="<%= toggle_task_state_my_module_path(@my_module) %>"> ? ++ - <button class="btn btn-primary"> + <button class="btn btn-primary"> ? ++ + <span class="glyphicon glyphicon-ok"></span> - <%= t("my_modules.buttons.complete") %> + <%= t("my_modules.buttons.complete") %> ? ++ - </button> + </button> ? ++ - </div> + </div> ? ++ - <% else @my_module.completed? %> + <% else @my_module.completed? %> ? ++ - <div data-action="uncomplete-task" data-link-url="<%= toggle_task_state_my_module_path(@my_module) %>"> + <div data-action="uncomplete-task" data-link-url="<%= toggle_task_state_my_module_path(@my_module) %>"> ? ++ - <button class="btn btn-default"> ? ------ + <button class="btn btn-greyed"> ? ++ +++++ + <span class="glyphicon glyphicon-remove"></span> - <%= t("my_modules.buttons.uncomplete") %> + <%= t("my_modules.buttons.uncomplete") %> ? ++ - </button> + </button> ? ++ - </div> + </div> ? ++ - <% end %> + <% end %> ? ++ + </div> + <span data-hook="my_module-protocol-buttons"></span> </div> - <span data-hook="my_module-protocol-buttons"></span>
34
2.125
19
15
423084054705f43b9f00a41e24f5ee7c663584d4
README.md
README.md
Standardized health checker for all our services ## Usage var nurse = require('nurse'), app = require('express')(), server = app.listen(3000); app.get('/health-check', function(req, res){ res.send(nurse({'ok': true, 'server': server})); }); ## Install npm install node-nurse ## Testing git clone npm install mocha
Standardized health checker for all our services ## Usage var nurse = require('nurse'), app = require('express')(), server = app.listen(3000); app.get('/health-check', function(req, res){ res.send(nurse({'ok': true, 'server': server})); }); This will send back some JSON that look like this: { hostname: "someservice.ex.fm", pid: 34437, time: "2012-11-06T23:44:13.660Z", uptime: 6, memory: { free: 14770176, total: 2147483648, rss: 29224960, heap: 19622144, heap_used: 11072256 }, load: { 1m: 3.16552734375, 5m: 2.8232421875, 15m: 2.6494140625 }, node_env: "development", service_name: "user", ok: true, server: { connections: 2 } } ## Install npm install node-nurse ## Testing git clone npm install mocha
Add output example to readme
Add output example to readme
Markdown
mit
imlucas/node-nurse
markdown
## Code Before: Standardized health checker for all our services ## Usage var nurse = require('nurse'), app = require('express')(), server = app.listen(3000); app.get('/health-check', function(req, res){ res.send(nurse({'ok': true, 'server': server})); }); ## Install npm install node-nurse ## Testing git clone npm install mocha ## Instruction: Add output example to readme ## Code After: Standardized health checker for all our services ## Usage var nurse = require('nurse'), app = require('express')(), server = app.listen(3000); app.get('/health-check', function(req, res){ res.send(nurse({'ok': true, 'server': server})); }); This will send back some JSON that look like this: { hostname: "someservice.ex.fm", pid: 34437, time: "2012-11-06T23:44:13.660Z", uptime: 6, memory: { free: 14770176, total: 2147483648, rss: 29224960, heap: 19622144, heap_used: 11072256 }, load: { 1m: 3.16552734375, 5m: 2.8232421875, 15m: 2.6494140625 }, node_env: "development", service_name: "user", ok: true, server: { connections: 2 } } ## Install npm install node-nurse ## Testing git clone npm install mocha
Standardized health checker for all our services ## Usage var nurse = require('nurse'), app = require('express')(), server = app.listen(3000); app.get('/health-check', function(req, res){ res.send(nurse({'ok': true, 'server': server})); }); + This will send back some JSON that look like this: + + { + hostname: "someservice.ex.fm", + pid: 34437, + time: "2012-11-06T23:44:13.660Z", + uptime: 6, + memory: { + free: 14770176, + total: 2147483648, + rss: 29224960, + heap: 19622144, + heap_used: 11072256 + }, + load: { + 1m: 3.16552734375, + 5m: 2.8232421875, + 15m: 2.6494140625 + }, + node_env: "development", + service_name: "user", + ok: true, + server: { + connections: 2 + } + } + ## Install npm install node-nurse ## Testing git clone npm install mocha
27
1.125
27
0
a39bade0af5ec329970865cd016175441c0d4a8e
src/imap/cmd-create.c
src/imap/cmd-create.c
/* Copyright (C) 2002 Timo Sirainen */ #include "common.h" #include "commands.h" int cmd_create(Client *client) { const char *mailbox; /* <mailbox> */ if (!client_read_string_args(client, 1, &mailbox)) return FALSE; if (!client_verify_mailbox_name(client, mailbox, FALSE, TRUE)) return TRUE; if (mailbox[strlen(mailbox)-1] == client->storage->hierarchy_sep) { /* name ends with hierarchy separator - client is just informing us that it wants to create a mailbox under this name. we don't need that information. */ } else if (!client->storage->create_mailbox(client->storage, mailbox)) { client_send_storage_error(client); return TRUE; } client_send_tagline(client, "OK Create completed."); return TRUE; }
/* Copyright (C) 2002 Timo Sirainen */ #include "common.h" #include "commands.h" int cmd_create(Client *client) { const char *mailbox; int ignore; /* <mailbox> */ if (!client_read_string_args(client, 1, &mailbox)) return FALSE; ignore = mailbox[strlen(mailbox)-1] == client->storage->hierarchy_sep; if (ignore) { /* name ends with hierarchy separator - client is just informing us that it wants to create a mailbox under this name. we don't need that information, but verify that the mailbox name is valid */ mailbox = t_strndup(mailbox, strlen(mailbox)-1); } if (!client_verify_mailbox_name(client, mailbox, FALSE, !ignore)) return TRUE; if (!ignore && !client->storage->create_mailbox(client->storage, mailbox)) { client_send_storage_error(client); return TRUE; } client_send_tagline(client, "OK Create completed."); return TRUE; }
CREATE mailbox<hierarchy separator> failed always.
CREATE mailbox<hierarchy separator> failed always.
C
mit
Distrotech/dovecot,Distrotech/dovecot,damoxc/dovecot,LTD-Beget/dovecot,Distrotech/dovecot,damoxc/dovecot,LTD-Beget/dovecot,damoxc/dovecot,LTD-Beget/dovecot,LTD-Beget/dovecot,damoxc/dovecot,damoxc/dovecot,Distrotech/dovecot,Distrotech/dovecot,LTD-Beget/dovecot
c
## Code Before: /* Copyright (C) 2002 Timo Sirainen */ #include "common.h" #include "commands.h" int cmd_create(Client *client) { const char *mailbox; /* <mailbox> */ if (!client_read_string_args(client, 1, &mailbox)) return FALSE; if (!client_verify_mailbox_name(client, mailbox, FALSE, TRUE)) return TRUE; if (mailbox[strlen(mailbox)-1] == client->storage->hierarchy_sep) { /* name ends with hierarchy separator - client is just informing us that it wants to create a mailbox under this name. we don't need that information. */ } else if (!client->storage->create_mailbox(client->storage, mailbox)) { client_send_storage_error(client); return TRUE; } client_send_tagline(client, "OK Create completed."); return TRUE; } ## Instruction: CREATE mailbox<hierarchy separator> failed always. ## Code After: /* Copyright (C) 2002 Timo Sirainen */ #include "common.h" #include "commands.h" int cmd_create(Client *client) { const char *mailbox; int ignore; /* <mailbox> */ if (!client_read_string_args(client, 1, &mailbox)) return FALSE; ignore = mailbox[strlen(mailbox)-1] == client->storage->hierarchy_sep; if (ignore) { /* name ends with hierarchy separator - client is just informing us that it wants to create a mailbox under this name. we don't need that information, but verify that the mailbox name is valid */ mailbox = t_strndup(mailbox, strlen(mailbox)-1); } if (!client_verify_mailbox_name(client, mailbox, FALSE, !ignore)) return TRUE; if (!ignore && !client->storage->create_mailbox(client->storage, mailbox)) { client_send_storage_error(client); return TRUE; } client_send_tagline(client, "OK Create completed."); return TRUE; }
/* Copyright (C) 2002 Timo Sirainen */ #include "common.h" #include "commands.h" int cmd_create(Client *client) { const char *mailbox; + int ignore; /* <mailbox> */ if (!client_read_string_args(client, 1, &mailbox)) return FALSE; + ignore = mailbox[strlen(mailbox)-1] == client->storage->hierarchy_sep; + if (ignore) { + /* name ends with hierarchy separator - client is just + informing us that it wants to create a mailbox under + this name. we don't need that information, but verify + that the mailbox name is valid */ + mailbox = t_strndup(mailbox, strlen(mailbox)-1); + } + - if (!client_verify_mailbox_name(client, mailbox, FALSE, TRUE)) ? ^^^^ + if (!client_verify_mailbox_name(client, mailbox, FALSE, !ignore)) ? ^^^^^^^ return TRUE; + if (!ignore && - if (mailbox[strlen(mailbox)-1] == client->storage->hierarchy_sep) { - /* name ends with hierarchy separator - client is just - informing us that it wants to create a mailbox under - this name. we don't need that information. */ - } else if (!client->storage->create_mailbox(client->storage, mailbox)) { ? - ---- -- ^ + !client->storage->create_mailbox(client->storage, mailbox)) { ? ^ client_send_storage_error(client); return TRUE; } client_send_tagline(client, "OK Create completed."); return TRUE; }
19
0.678571
13
6
ac28bc7bb6e7a57ecbd39718c821cff7631423a8
client/react/Comments.js
client/react/Comments.js
app.Comments = React.createClass({ //get all loaded comments getInitialState: function () { return { displaying: false, comments: app.CommentStore.getAll(this.props.idea_id) }; }, //when we mount the view setup event listener for store changes componentDidMount: function () { app.CommentStore.addChangeListener(function () { if (this.isMounted()) { this.setState({ comments: app.CommentStore.getAll(this.props.idea_id) }); } }.bind(this)); }, show: function () { if (this.isMounted()) { this.setState({ displaying: !this.state.displaying }); } }, //render a comment component for each comment render: function () { var comments; var commentForm; var showCommentsButton; //display comments if we are displaying, otherwise show buttons if (this.state.displaying){ commentForm = <app.CommentForm idea_id={this.props.idea_id} /> comments = []; //render a comment component for each comment this.state.comments.forEach(function (comment) { comments.push( <app.Comment name={comment.name} key={comment._id} _id={comment._id} idea_id={comment.idea_id} /> ); }); } showCommentsButton = <button className="pure-button" onClick={this.show}>{this.state.displaying? 'Hide' : 'Show'} Comments</button> return ( <div ref="body"> { showCommentsButton } { comments } { commentForm } </div> ); } });
app.Comments = React.createClass({ //get all loaded comments getInitialState: function () { return { displaying: false, comments: app.CommentStore.getAll(this.props.idea_id) }; }, //when we mount the view setup event listener for store changes componentDidMount: function () { app.CommentStore.addChangeListener(function () { if (this.isMounted()) { this.setState({ comments: app.CommentStore.getAll(this.props.idea_id) }); } }.bind(this)); }, show: function (e) { e.preventDefault(); if (this.isMounted()) { this.setState({ displaying: !this.state.displaying }); } }, //render a comment component for each comment render: function () { var comments; var commentForm; var showCommentsButton; //display comments if we are displaying, otherwise show buttons if (this.state.displaying){ commentForm = <app.CommentForm idea_id={this.props.idea_id} /> comments = []; //render a comment component for each comment this.state.comments.forEach(function (comment) { comments.push( <app.Comment name={comment.name} key={comment._id} _id={comment._id} idea_id={comment.idea_id} /> ); }); } showCommentsButton = <button className="pure-button" onClick={this.show}>{this.state.displaying? 'Hide' : 'Show'} Comments</button> return ( <div ref="body"> { showCommentsButton } { comments } { commentForm } </div> ); } });
Add e.preventDefault to comments form.
Add e.preventDefault to comments form.
JavaScript
mit
JulieMarie/Brainstorm,plauer/Brainstorm,drabinowitz/Brainstorm,EJJ-Brainstorm/Brainstorm,ekeric13/Brainstorm,JulieMarie/Brainstorm,EJJ-Brainstorm/Brainstorm,ekeric13/Brainstorm,HRR2-Brainstorm/Brainstorm
javascript
## Code Before: app.Comments = React.createClass({ //get all loaded comments getInitialState: function () { return { displaying: false, comments: app.CommentStore.getAll(this.props.idea_id) }; }, //when we mount the view setup event listener for store changes componentDidMount: function () { app.CommentStore.addChangeListener(function () { if (this.isMounted()) { this.setState({ comments: app.CommentStore.getAll(this.props.idea_id) }); } }.bind(this)); }, show: function () { if (this.isMounted()) { this.setState({ displaying: !this.state.displaying }); } }, //render a comment component for each comment render: function () { var comments; var commentForm; var showCommentsButton; //display comments if we are displaying, otherwise show buttons if (this.state.displaying){ commentForm = <app.CommentForm idea_id={this.props.idea_id} /> comments = []; //render a comment component for each comment this.state.comments.forEach(function (comment) { comments.push( <app.Comment name={comment.name} key={comment._id} _id={comment._id} idea_id={comment.idea_id} /> ); }); } showCommentsButton = <button className="pure-button" onClick={this.show}>{this.state.displaying? 'Hide' : 'Show'} Comments</button> return ( <div ref="body"> { showCommentsButton } { comments } { commentForm } </div> ); } }); ## Instruction: Add e.preventDefault to comments form. ## Code After: app.Comments = React.createClass({ //get all loaded comments getInitialState: function () { return { displaying: false, comments: app.CommentStore.getAll(this.props.idea_id) }; }, //when we mount the view setup event listener for store changes componentDidMount: function () { app.CommentStore.addChangeListener(function () { if (this.isMounted()) { this.setState({ comments: app.CommentStore.getAll(this.props.idea_id) }); } }.bind(this)); }, show: function (e) { e.preventDefault(); if (this.isMounted()) { this.setState({ displaying: !this.state.displaying }); } }, //render a comment component for each comment render: function () { var comments; var commentForm; var showCommentsButton; //display comments if we are displaying, otherwise show buttons if (this.state.displaying){ commentForm = <app.CommentForm idea_id={this.props.idea_id} /> comments = []; //render a comment component for each comment this.state.comments.forEach(function (comment) { comments.push( <app.Comment name={comment.name} key={comment._id} _id={comment._id} idea_id={comment.idea_id} /> ); }); } showCommentsButton = <button className="pure-button" onClick={this.show}>{this.state.displaying? 'Hide' : 'Show'} Comments</button> return ( <div ref="body"> { showCommentsButton } { comments } { commentForm } </div> ); } });
app.Comments = React.createClass({ //get all loaded comments getInitialState: function () { return { displaying: false, comments: app.CommentStore.getAll(this.props.idea_id) }; }, //when we mount the view setup event listener for store changes componentDidMount: function () { app.CommentStore.addChangeListener(function () { if (this.isMounted()) { this.setState({ comments: app.CommentStore.getAll(this.props.idea_id) }); } }.bind(this)); }, - show: function () { + show: function (e) { ? + + e.preventDefault(); + if (this.isMounted()) { this.setState({ displaying: !this.state.displaying }); } }, //render a comment component for each comment render: function () { var comments; var commentForm; var showCommentsButton; //display comments if we are displaying, otherwise show buttons if (this.state.displaying){ commentForm = <app.CommentForm idea_id={this.props.idea_id} /> comments = []; //render a comment component for each comment this.state.comments.forEach(function (comment) { comments.push( <app.Comment name={comment.name} key={comment._id} _id={comment._id} idea_id={comment.idea_id} /> ); }); } showCommentsButton = <button className="pure-button" onClick={this.show}>{this.state.displaying? 'Hide' : 'Show'} Comments</button> return ( <div ref="body"> { showCommentsButton } { comments } { commentForm } </div> ); } });
4
0.076923
3
1
841fe4558ceded445338022ee572f00296f709bd
SwiftyJSONModelTests/SwiftyJSONModelTests.swift
SwiftyJSONModelTests/SwiftyJSONModelTests.swift
// // SwiftyJSONModelTests.swift // SwiftyJSONModelTests // // Created by Oleksii on 17/09/16. // Copyright © 2016 Oleksii Dykan. All rights reserved. // import XCTest import SwiftyJSON @testable import SwiftyJSONModel struct FullName { let firstName: String let lastName: String } extension FullName: JSONModelType { enum PropertyKey: String { case firstName, lastName } init(properties: [PropertyKey : JSON]) throws { firstName = try properties.value(for: .firstName).stringValue() lastName = try properties.value(for: .lastName).stringValue() } var dictValue: [PropertyKey : JSON] { return [.firstName: JSON(firstName), .lastName: JSON(lastName)] } } extension FullName: Equatable {} func == (left: FullName, right: FullName) -> Bool { return left.firstName == right.firstName && left.lastName == right.lastName } class SwiftyJSONModelTests: XCTestCase { func testJSONModelProtocols() { let name = FullName(firstName: "John", lastName: "Doe") XCTAssertEqual(try? FullName(json: name.jsonValue), name) } }
// // SwiftyJSONModelTests.swift // SwiftyJSONModelTests // // Created by Oleksii on 17/09/16. // Copyright © 2016 Oleksii Dykan. All rights reserved. // import XCTest import SwiftyJSON @testable import SwiftyJSONModel struct Person { let firstName: String let lastName: String let age: Int let isMarried: Bool let height: Double } extension Person: JSONModelType { enum PropertyKey: String { case firstName, lastName, age, isMarried, height } init(properties: [PropertyKey : JSON]) throws { firstName = try properties.value(for: .firstName).stringValue() lastName = try properties.value(for: .lastName).stringValue() age = try properties.value(for: .age).intValue() isMarried = try properties.value(for: .isMarried).boolValue() height = try properties.value(for: .height).doubleValue() } var dictValue: [PropertyKey : JSONRepresentable] { return [.firstName: firstName, .lastName: lastName, .age: age, .isMarried: isMarried, .height: height] } } extension Person: Equatable {} func == (left: Person, right: Person) -> Bool { return left.firstName == right.firstName && left.lastName == right.lastName && left.age == right.age && left.isMarried == right.isMarried && left.height == right.height } class SwiftyJSONModelTests: XCTestCase { func testJSONModelProtocols() { let person = Person(firstName: "John", lastName: "Doe", age: 21, isMarried: false, height: 180) XCTAssertEqual(try? Person(json: person.jsonValue), person) } }
Update test model with more properties
Update test model with more properties
Swift
mit
alickbass/SwiftyJSONModel,alickbass/SwiftyJSONModel
swift
## Code Before: // // SwiftyJSONModelTests.swift // SwiftyJSONModelTests // // Created by Oleksii on 17/09/16. // Copyright © 2016 Oleksii Dykan. All rights reserved. // import XCTest import SwiftyJSON @testable import SwiftyJSONModel struct FullName { let firstName: String let lastName: String } extension FullName: JSONModelType { enum PropertyKey: String { case firstName, lastName } init(properties: [PropertyKey : JSON]) throws { firstName = try properties.value(for: .firstName).stringValue() lastName = try properties.value(for: .lastName).stringValue() } var dictValue: [PropertyKey : JSON] { return [.firstName: JSON(firstName), .lastName: JSON(lastName)] } } extension FullName: Equatable {} func == (left: FullName, right: FullName) -> Bool { return left.firstName == right.firstName && left.lastName == right.lastName } class SwiftyJSONModelTests: XCTestCase { func testJSONModelProtocols() { let name = FullName(firstName: "John", lastName: "Doe") XCTAssertEqual(try? FullName(json: name.jsonValue), name) } } ## Instruction: Update test model with more properties ## Code After: // // SwiftyJSONModelTests.swift // SwiftyJSONModelTests // // Created by Oleksii on 17/09/16. // Copyright © 2016 Oleksii Dykan. All rights reserved. // import XCTest import SwiftyJSON @testable import SwiftyJSONModel struct Person { let firstName: String let lastName: String let age: Int let isMarried: Bool let height: Double } extension Person: JSONModelType { enum PropertyKey: String { case firstName, lastName, age, isMarried, height } init(properties: [PropertyKey : JSON]) throws { firstName = try properties.value(for: .firstName).stringValue() lastName = try properties.value(for: .lastName).stringValue() age = try properties.value(for: .age).intValue() isMarried = try properties.value(for: .isMarried).boolValue() height = try properties.value(for: .height).doubleValue() } var dictValue: [PropertyKey : JSONRepresentable] { return [.firstName: firstName, .lastName: lastName, .age: age, .isMarried: isMarried, .height: height] } } extension Person: Equatable {} func == (left: Person, right: Person) -> Bool { return left.firstName == right.firstName && left.lastName == right.lastName && left.age == right.age && left.isMarried == right.isMarried && left.height == right.height } class SwiftyJSONModelTests: XCTestCase { func testJSONModelProtocols() { let person = Person(firstName: "John", lastName: "Doe", age: 21, isMarried: false, height: 180) XCTAssertEqual(try? Person(json: person.jsonValue), person) } }
// // SwiftyJSONModelTests.swift // SwiftyJSONModelTests // // Created by Oleksii on 17/09/16. // Copyright © 2016 Oleksii Dykan. All rights reserved. // import XCTest import SwiftyJSON @testable import SwiftyJSONModel - struct FullName { + struct Person { let firstName: String let lastName: String + let age: Int + let isMarried: Bool + let height: Double } - extension FullName: JSONModelType { ? ^^^^^^^ + extension Person: JSONModelType { ? ^ ++++ enum PropertyKey: String { - case firstName, lastName + case firstName, lastName, age, isMarried, height } init(properties: [PropertyKey : JSON]) throws { firstName = try properties.value(for: .firstName).stringValue() lastName = try properties.value(for: .lastName).stringValue() + age = try properties.value(for: .age).intValue() + isMarried = try properties.value(for: .isMarried).boolValue() + height = try properties.value(for: .height).doubleValue() } - var dictValue: [PropertyKey : JSON] { + var dictValue: [PropertyKey : JSONRepresentable] { ? +++++++++++++ - return [.firstName: JSON(firstName), .lastName: JSON(lastName)] + return [.firstName: firstName, .lastName: lastName, .age: age, .isMarried: isMarried, .height: height] } } - extension FullName: Equatable {} ? ^^^^^^^ + extension Person: Equatable {} ? ^ ++++ - func == (left: FullName, right: FullName) -> Bool { ? ^^^^^^^ ^^^^^^^ + func == (left: Person, right: Person) -> Bool { ? ^ ++++ ^ ++++ - return left.firstName == right.firstName && left.lastName == right.lastName + return left.firstName == right.firstName && left.lastName == right.lastName && ? +++ + left.age == right.age && left.isMarried == right.isMarried && left.height == right.height } class SwiftyJSONModelTests: XCTestCase { func testJSONModelProtocols() { - let name = FullName(firstName: "John", lastName: "Doe") + let person = Person(firstName: "John", lastName: "Doe", age: 21, isMarried: false, height: 180) - XCTAssertEqual(try? FullName(json: name.jsonValue), name) ? ^^^^^^^ --- --- + XCTAssertEqual(try? Person(json: person.jsonValue), person) ? ^ ++++ +++++ +++++ } }
27
0.6
17
10
2e462ab27f5828a2598bb6355334519d543dc020
rotu.js
rotu.js
const path = require('path'); const url = require('url'); const jade = require('jade'); module.exports = function(route, root, data, options, err) { try { root = root || '.'; options = options || {}; var routed = path.normalize(url.parse(route).pathname); if (routed[routed.length - 1] === '/') { routed += "index"; } const filename = path.basename(routed); const template = jade.compileFile(root + routed + '.jade', options); return template(data[filename].locals); } catch(e) { typeof err === 'function' && err(e); } };
const path = require('path'); const url = require('url'); const jade = require('jade'); module.exports = function(route, root, data, options, err) { try { root = root || '.'; options = options || {}; var routed = path.normalize(url.parse(route).pathname); if (routed[routed.length - 1] === '/') { routed += "index"; } const filename = path.basename(routed); const template = jade.compileFile(root + routed + '.jade', options); if (data) { return template(data[filename].locals); } else { return template(); } } catch(e) { typeof err === 'function' && err(e); } };
Update readme and check for no data
Update readme and check for no data
JavaScript
cc0-1.0
sgarver/rotu,sgarver/rotu
javascript
## Code Before: const path = require('path'); const url = require('url'); const jade = require('jade'); module.exports = function(route, root, data, options, err) { try { root = root || '.'; options = options || {}; var routed = path.normalize(url.parse(route).pathname); if (routed[routed.length - 1] === '/') { routed += "index"; } const filename = path.basename(routed); const template = jade.compileFile(root + routed + '.jade', options); return template(data[filename].locals); } catch(e) { typeof err === 'function' && err(e); } }; ## Instruction: Update readme and check for no data ## Code After: const path = require('path'); const url = require('url'); const jade = require('jade'); module.exports = function(route, root, data, options, err) { try { root = root || '.'; options = options || {}; var routed = path.normalize(url.parse(route).pathname); if (routed[routed.length - 1] === '/') { routed += "index"; } const filename = path.basename(routed); const template = jade.compileFile(root + routed + '.jade', options); if (data) { return template(data[filename].locals); } else { return template(); } } catch(e) { typeof err === 'function' && err(e); } };
const path = require('path'); const url = require('url'); const jade = require('jade'); module.exports = function(route, root, data, options, err) { try { root = root || '.'; options = options || {}; var routed = path.normalize(url.parse(route).pathname); if (routed[routed.length - 1] === '/') { routed += "index"; } const filename = path.basename(routed); const template = jade.compileFile(root + routed + '.jade', options); + if (data) { - return template(data[filename].locals); + return template(data[filename].locals); ? ++++ + } else { + return template(); + } } catch(e) { typeof err === 'function' && err(e); } };
6
0.230769
5
1
105d46937babb7a43901d8238fb9cc0a7b00c8c9
lyman/tools/commandline.py
lyman/tools/commandline.py
import argparse parser = argparse.ArgumentParser() parser.add_argument("-subjects", nargs="*", dest="subjects", help=("list of subject ids, name of file in lyman " "directory, or full path to text file with " "subject ids")) parser.add_argument("-plugin", default="multiproc", choices=["linear", "multiproc", "ipython", "torque", "sge"], help="worklow execution plugin") parser.add_argument("-nprocs", default=4, type=int, help="number of MultiProc processes to use") parser.add_argument("-queue", help="which queue for PBS/SGE execution") parser.add_argument("-dontrun", action="store_true", help="don't actually execute the workflows")
import argparse parser = argparse.ArgumentParser() parser.add_argument("-subjects", nargs="*", dest="subjects", help=("list of subject ids, name of file in lyman " "directory, or full path to text file with " "subject ids")) parser.add_argument("-plugin", default="multiproc", choices=["linear", "multiproc", "ipython", "torque", "sge", "slurm"], help="worklow execution plugin") parser.add_argument("-nprocs", default=4, type=int, help="number of MultiProc processes to use") parser.add_argument("-queue", help="which queue for PBS/SGE execution") parser.add_argument("-dontrun", action="store_true", help="don't actually execute the workflows")
Add slurm to command line plugin choices
Add slurm to command line plugin choices
Python
bsd-3-clause
mwaskom/lyman,tuqc/lyman,kastman/lyman
python
## Code Before: import argparse parser = argparse.ArgumentParser() parser.add_argument("-subjects", nargs="*", dest="subjects", help=("list of subject ids, name of file in lyman " "directory, or full path to text file with " "subject ids")) parser.add_argument("-plugin", default="multiproc", choices=["linear", "multiproc", "ipython", "torque", "sge"], help="worklow execution plugin") parser.add_argument("-nprocs", default=4, type=int, help="number of MultiProc processes to use") parser.add_argument("-queue", help="which queue for PBS/SGE execution") parser.add_argument("-dontrun", action="store_true", help="don't actually execute the workflows") ## Instruction: Add slurm to command line plugin choices ## Code After: import argparse parser = argparse.ArgumentParser() parser.add_argument("-subjects", nargs="*", dest="subjects", help=("list of subject ids, name of file in lyman " "directory, or full path to text file with " "subject ids")) parser.add_argument("-plugin", default="multiproc", choices=["linear", "multiproc", "ipython", "torque", "sge", "slurm"], help="worklow execution plugin") parser.add_argument("-nprocs", default=4, type=int, help="number of MultiProc processes to use") parser.add_argument("-queue", help="which queue for PBS/SGE execution") parser.add_argument("-dontrun", action="store_true", help="don't actually execute the workflows")
import argparse parser = argparse.ArgumentParser() parser.add_argument("-subjects", nargs="*", dest="subjects", help=("list of subject ids, name of file in lyman " "directory, or full path to text file with " "subject ids")) parser.add_argument("-plugin", default="multiproc", - choices=["linear", "multiproc", + choices=["linear", "multiproc", "ipython", ? +++++++++++ - "ipython", "torque", "sge"], ? ----------- + "torque", "sge", "slurm"], ? +++++++++ help="worklow execution plugin") parser.add_argument("-nprocs", default=4, type=int, help="number of MultiProc processes to use") parser.add_argument("-queue", help="which queue for PBS/SGE execution") parser.add_argument("-dontrun", action="store_true", help="don't actually execute the workflows")
4
0.235294
2
2
d130a926c847f37f039dfff7c14140d933b7a6af
django/website/contacts/tests/test_group_permissions.py
django/website/contacts/tests/test_group_permissions.py
import pytest from django.contrib.auth.models import Permission, Group, ContentType from contacts.group_permissions import GroupPermissions @pytest.mark.django_db def test_add_perms(): g1, _ = Group.objects.get_or_create(name="Test Group 1") g2, _ = Group.objects.get_or_create(name="Test Group 2") any_model = Group # for example content_type = ContentType.objects.get_for_model(any_model) codenames = ['a_do_stuff', 'b_do_more_stuff'] expected_permissions = [] for name in codenames: perm, _ = Permission.objects.get_or_create(name=name, codename=name, content_type=content_type) expected_permissions.append(perm) gp = GroupPermissions() with gp.groups(g1, g2): gp.add_permissions(any_model, *codenames) assert list(g1.permissions.all()) == expected_permissions assert list(g2.permissions.all()) == expected_permissions
import pytest from django.contrib.auth.models import Permission, Group, ContentType from django.core.exceptions import ObjectDoesNotExist from contacts.group_permissions import GroupPermissions @pytest.mark.django_db def test_add_perms(): g1, _ = Group.objects.get_or_create(name="Test Group 1") g2, _ = Group.objects.get_or_create(name="Test Group 2") any_model = Group # for example content_type = ContentType.objects.get_for_model(any_model) codenames = ['a_do_stuff', 'b_do_more_stuff'] expected_permissions = [] for name in codenames: perm, _ = Permission.objects.get_or_create(name=name, codename=name, content_type=content_type) expected_permissions.append(perm) gp = GroupPermissions() with gp.groups(g1, g2): gp.add_permissions(any_model, *codenames) assert list(g1.permissions.all()) == expected_permissions assert list(g2.permissions.all()) == expected_permissions @pytest.mark.django_db def test_add_nonexistent_perms(): g1, _ = Group.objects.get_or_create(name="Test Group 1") g2, _ = Group.objects.get_or_create(name="Test Group 2") any_model = Group # for example codenames = ['a_do_stuff', 'b_do_more_stuff'] gp = GroupPermissions() with gp.groups(g1, g2): try: gp.add_permissions(any_model, *codenames) pytest.fail("This should raise an ObjectDoesNotExist exception", False) except ObjectDoesNotExist: pass
Test can't give group non-exsitent permission
Test can't give group non-exsitent permission
Python
agpl-3.0
aptivate/alfie,daniell/kashana,aptivate/alfie,aptivate/kashana,aptivate/alfie,aptivate/alfie,daniell/kashana,daniell/kashana,aptivate/kashana,daniell/kashana,aptivate/kashana,aptivate/kashana
python
## Code Before: import pytest from django.contrib.auth.models import Permission, Group, ContentType from contacts.group_permissions import GroupPermissions @pytest.mark.django_db def test_add_perms(): g1, _ = Group.objects.get_or_create(name="Test Group 1") g2, _ = Group.objects.get_or_create(name="Test Group 2") any_model = Group # for example content_type = ContentType.objects.get_for_model(any_model) codenames = ['a_do_stuff', 'b_do_more_stuff'] expected_permissions = [] for name in codenames: perm, _ = Permission.objects.get_or_create(name=name, codename=name, content_type=content_type) expected_permissions.append(perm) gp = GroupPermissions() with gp.groups(g1, g2): gp.add_permissions(any_model, *codenames) assert list(g1.permissions.all()) == expected_permissions assert list(g2.permissions.all()) == expected_permissions ## Instruction: Test can't give group non-exsitent permission ## Code After: import pytest from django.contrib.auth.models import Permission, Group, ContentType from django.core.exceptions import ObjectDoesNotExist from contacts.group_permissions import GroupPermissions @pytest.mark.django_db def test_add_perms(): g1, _ = Group.objects.get_or_create(name="Test Group 1") g2, _ = Group.objects.get_or_create(name="Test Group 2") any_model = Group # for example content_type = ContentType.objects.get_for_model(any_model) codenames = ['a_do_stuff', 'b_do_more_stuff'] expected_permissions = [] for name in codenames: perm, _ = Permission.objects.get_or_create(name=name, codename=name, content_type=content_type) expected_permissions.append(perm) gp = GroupPermissions() with gp.groups(g1, g2): gp.add_permissions(any_model, *codenames) assert list(g1.permissions.all()) == expected_permissions assert list(g2.permissions.all()) == expected_permissions @pytest.mark.django_db def test_add_nonexistent_perms(): g1, _ = Group.objects.get_or_create(name="Test Group 1") g2, _ = Group.objects.get_or_create(name="Test Group 2") any_model = Group # for example codenames = ['a_do_stuff', 'b_do_more_stuff'] gp = GroupPermissions() with gp.groups(g1, g2): try: gp.add_permissions(any_model, *codenames) pytest.fail("This should raise an ObjectDoesNotExist exception", False) except ObjectDoesNotExist: pass
import pytest from django.contrib.auth.models import Permission, Group, ContentType + from django.core.exceptions import ObjectDoesNotExist from contacts.group_permissions import GroupPermissions @pytest.mark.django_db def test_add_perms(): g1, _ = Group.objects.get_or_create(name="Test Group 1") g2, _ = Group.objects.get_or_create(name="Test Group 2") any_model = Group # for example content_type = ContentType.objects.get_for_model(any_model) codenames = ['a_do_stuff', 'b_do_more_stuff'] expected_permissions = [] for name in codenames: perm, _ = Permission.objects.get_or_create(name=name, codename=name, content_type=content_type) expected_permissions.append(perm) gp = GroupPermissions() with gp.groups(g1, g2): gp.add_permissions(any_model, *codenames) assert list(g1.permissions.all()) == expected_permissions assert list(g2.permissions.all()) == expected_permissions + + + @pytest.mark.django_db + def test_add_nonexistent_perms(): + g1, _ = Group.objects.get_or_create(name="Test Group 1") + g2, _ = Group.objects.get_or_create(name="Test Group 2") + any_model = Group # for example + codenames = ['a_do_stuff', 'b_do_more_stuff'] + + gp = GroupPermissions() + with gp.groups(g1, g2): + try: + gp.add_permissions(any_model, *codenames) + pytest.fail("This should raise an ObjectDoesNotExist exception", False) + except ObjectDoesNotExist: + pass
17
0.653846
17
0
2742b915015fe5645d7e1aa9a594cba976492cf9
content/tool/bonsai.md
content/tool/bonsai.md
--- title: Bonsai date: 2018-11-10 13:13:48 +0000 weight: '' description: Integrate powerful search functionality into your applications, without ever having to set up or manage servers. tools: - Interaction license: Commercial data_model: '' language: '' related_tools: [] tags: interactions: - search urls: website: https://bonsai.io/ github: '' twitter: '' other: '' resources: [] cat_test: '' --- Bonsai is a fully managed, highly scalable Elasticsearch engine. Thousands of businesses choose Bonsai to index and search billions of records without having to worry about configuring, monitoring or scaling the servers.
--- title: Bonsai #date: 2018-11-10 13:13:48 +0000 date: 2018-11-10T05:00:00.000Z weight: '' description: Integrate powerful search functionality into your applications, without ever having to set up or manage servers. tools: - Interaction license: Commercial data_model: '' language: '' related_tools: [] tags: interactions: - search urls: website: https://bonsai.io/ github: '' twitter: '' other: '' resources: [] cat_test: '' --- Bonsai is a fully managed, highly scalable Elasticsearch engine. Thousands of businesses choose Bonsai to index and search billions of records without having to worry about configuring, monitoring or scaling the servers.
Use data format from NCMS
Use data format from NCMS
Markdown
mit
budparr/thenewdynamic,budparr/thenewdynamic,budparr/thenewdynamic
markdown
## Code Before: --- title: Bonsai date: 2018-11-10 13:13:48 +0000 weight: '' description: Integrate powerful search functionality into your applications, without ever having to set up or manage servers. tools: - Interaction license: Commercial data_model: '' language: '' related_tools: [] tags: interactions: - search urls: website: https://bonsai.io/ github: '' twitter: '' other: '' resources: [] cat_test: '' --- Bonsai is a fully managed, highly scalable Elasticsearch engine. Thousands of businesses choose Bonsai to index and search billions of records without having to worry about configuring, monitoring or scaling the servers. ## Instruction: Use data format from NCMS ## Code After: --- title: Bonsai #date: 2018-11-10 13:13:48 +0000 date: 2018-11-10T05:00:00.000Z weight: '' description: Integrate powerful search functionality into your applications, without ever having to set up or manage servers. tools: - Interaction license: Commercial data_model: '' language: '' related_tools: [] tags: interactions: - search urls: website: https://bonsai.io/ github: '' twitter: '' other: '' resources: [] cat_test: '' --- Bonsai is a fully managed, highly scalable Elasticsearch engine. Thousands of businesses choose Bonsai to index and search billions of records without having to worry about configuring, monitoring or scaling the servers.
--- title: Bonsai - date: 2018-11-10 13:13:48 +0000 + #date: 2018-11-10 13:13:48 +0000 ? + + date: 2018-11-10T05:00:00.000Z weight: '' description: Integrate powerful search functionality into your applications, without ever having to set up or manage servers. tools: - Interaction license: Commercial data_model: '' language: '' related_tools: [] tags: interactions: - search urls: website: https://bonsai.io/ github: '' twitter: '' other: '' resources: [] cat_test: '' --- Bonsai is a fully managed, highly scalable Elasticsearch engine. Thousands of businesses choose Bonsai to index and search billions of records without having to worry about configuring, monitoring or scaling the servers.
3
0.12
2
1
5c4d41d9f89952d29b1247a2a0f413abcd23df58
app/Budget.php
app/Budget.php
<?php namespace App; use Illuminate\Database\Eloquent\Model; class Budget extends Model { // }
<?php namespace App; use Illuminate\Database\Eloquent\Model; class Budget extends Model { public function tag() { return $this->belongsTo('App\Tag'); } }
Add tag relationship to budget model
Add tag relationship to budget model
PHP
mit
pix3ly/budget,pix3ly/budget
php
## Code Before: <?php namespace App; use Illuminate\Database\Eloquent\Model; class Budget extends Model { // } ## Instruction: Add tag relationship to budget model ## Code After: <?php namespace App; use Illuminate\Database\Eloquent\Model; class Budget extends Model { public function tag() { return $this->belongsTo('App\Tag'); } }
<?php namespace App; use Illuminate\Database\Eloquent\Model; class Budget extends Model { - // + public function tag() { + return $this->belongsTo('App\Tag'); + } }
4
0.444444
3
1
e3c355f71fb11bbb0a54d9f53179805c52806cef
brews.sh
brews.sh
brew install bumpversion brew install htop brew install ping brew install python brew install python
brew install htop brew install ping brew install fd brew install bat
Add scripts to show files
Add scripts to show files fd is a better "find" https://github.com/sharkdp/fd/ bat is a better "cat" https://github.com/sharkdp/bat
Shell
mit
jalanb/jab,jalanb/jab,jalanb/dotjab,jalanb/dotjab
shell
## Code Before: brew install bumpversion brew install htop brew install ping brew install python brew install python ## Instruction: Add scripts to show files fd is a better "find" https://github.com/sharkdp/fd/ bat is a better "cat" https://github.com/sharkdp/bat ## Code After: brew install htop brew install ping brew install fd brew install bat
- brew install bumpversion brew install htop brew install ping + brew install fd - brew install python ? ^^ --- + brew install bat ? ^^ - brew install python -
6
0.857143
2
4
968158b78f2f76ea02d96005057a3094b8be7e7b
README.md
README.md
PHP-Login *** DEVELOPMENT VERSION *** ========= A simple, secure login and signup system with PHP, MySQL and jQuery using Bootstrap 3 for the form design as well as PHP-Mailer for user account verification and confirmation ## Installation ### Clone the Repository (dev branch) $ git clone -b dev https://github.com/fethica/PHP-Login.git ### Run through web-based installer Go to http://www.yoursite.com/install/index.php Enter all relevant information into the form, submit, and wait for install to complete. If any errors occur, you may need to do some manual work to get it up and running. This is still a development version, so results may vary. Once installation is complete, click the login link to sign in under your superadmin account and finish editing site configuration. Hover over the name of each setting to see a description.
PHP-Login *** DEVELOPMENT VERSION *** ========= A simple, secure login/user management system built on PHP, MySQL, jQuery and Bootstrap 3 as well as PHP-Mailer for user account verification and confirmation and several other open source libraries. ## Installation ### Clone the Repository (dev branch) into your webserver root $ git clone -b dev https://github.com/therecluse26/PHP-Login.git ### Run through web-based installer (located in /install folder of the application) Go to http://www.yoursite.com/install/index.php ### Select installation option ### Enter all relevant information into the form, submit, and wait for install to complete. If any errors occur, you may need to do some manual work to get it up and running. This is still a development version, so results may vary. Once installation is complete, click the login link to sign in under your superadmin account and finish editing site configuration. Hover over the name of each setting to see a description.
Update before changing DB table names to lower-case
Update before changing DB table names to lower-case
Markdown
mit
fethica/PHP-Login,fethica/PHP-Login
markdown
## Code Before: PHP-Login *** DEVELOPMENT VERSION *** ========= A simple, secure login and signup system with PHP, MySQL and jQuery using Bootstrap 3 for the form design as well as PHP-Mailer for user account verification and confirmation ## Installation ### Clone the Repository (dev branch) $ git clone -b dev https://github.com/fethica/PHP-Login.git ### Run through web-based installer Go to http://www.yoursite.com/install/index.php Enter all relevant information into the form, submit, and wait for install to complete. If any errors occur, you may need to do some manual work to get it up and running. This is still a development version, so results may vary. Once installation is complete, click the login link to sign in under your superadmin account and finish editing site configuration. Hover over the name of each setting to see a description. ## Instruction: Update before changing DB table names to lower-case ## Code After: PHP-Login *** DEVELOPMENT VERSION *** ========= A simple, secure login/user management system built on PHP, MySQL, jQuery and Bootstrap 3 as well as PHP-Mailer for user account verification and confirmation and several other open source libraries. ## Installation ### Clone the Repository (dev branch) into your webserver root $ git clone -b dev https://github.com/therecluse26/PHP-Login.git ### Run through web-based installer (located in /install folder of the application) Go to http://www.yoursite.com/install/index.php ### Select installation option ### Enter all relevant information into the form, submit, and wait for install to complete. If any errors occur, you may need to do some manual work to get it up and running. This is still a development version, so results may vary. Once installation is complete, click the login link to sign in under your superadmin account and finish editing site configuration. Hover over the name of each setting to see a description.
PHP-Login *** DEVELOPMENT VERSION *** ========= - A simple, secure login and signup system with PHP, MySQL and jQuery using Bootstrap 3 for the form design as well as PHP-Mailer for user account verification and confirmation + A simple, secure login/user management system built on PHP, MySQL, jQuery and Bootstrap 3 as well as PHP-Mailer for user account verification and confirmation and several other open source libraries. ## Installation - ### Clone the Repository (dev branch) + ### Clone the Repository (dev branch) into your webserver root - $ git clone -b dev https://github.com/fethica/PHP-Login.git ? -- ^ ^ + $ git clone -b dev https://github.com/therecluse26/PHP-Login.git ? ^^^ ^^^^^^ - ### Run through web-based installer + ### Run through web-based installer (located in /install folder of the application) Go to http://www.yoursite.com/install/index.php + + ### Select installation option + - Enter all relevant information into the form, submit, and wait for install to complete. + ### Enter all relevant information into the form, submit, and wait for install to complete. ? ++++ If any errors occur, you may need to do some manual work to get it up and running. This is still a development version, so results may vary. Once installation is complete, click the login link to sign in under your superadmin account and finish editing site configuration. Hover over the name of each setting to see a description.
13
0.764706
8
5
3e901c7740979048ca7ac4c8358c3d5ea990649d
views/structure/header/blank.php
views/structure/header/blank.php
<!DOCTYPE html> <!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]--> <!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]--> <head> <?php echo '<title>'; if (!empty($page->seo->title)) { echo $page->seo->title . ' - '; } elseif (!empty($page->title)) { echo $page->title . ' - '; } echo APP_NAME; echo '</title>'; // -------------------------------------------------------------------------- // Meta tags echo $this->meta->outputStr(); // -------------------------------------------------------------------------- // Assets $this->asset->output('CSS'); $this->asset->output('CSS-INLINE'); $this->asset->output('JS-INLINE-HEADER'); ?> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="<?=NAILS_ASSETS_URL . 'bower_components/html5shiv/dist/html5shiv.js'?>"></script> <script src="<?=NAILS_ASSETS_URL . 'bower_components/respond/dest/respond.min.js'?>"></script> <![endif]--> </head> <body>
<?php use Nails\Factory; $aPageTitle = []; if (!empty($page->seo->title)) { $aPageTitle[] = $page->seo->title; } elseif (!empty($page->title)) { $aPageTitle[] = $page->title; } $aPageTitle[] = APP_NAME; $sBodyClass = !empty($page->body_class) ? $page->body_class : ''; ?> <!DOCTYPE html> <!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]--> <!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]--> <head> <?php echo '<title>'; echo implode(' - ', $aPageTitle); echo '</title>'; // -------------------------------------------------------------------------- // Meta tags $oMeta = Factory::service('Meta'); echo $oMeta->outputStr(); // -------------------------------------------------------------------------- // Assets $oAsset = Factory::service('Meta'); $oAsset->output('CSS'); $oAsset->output('CSS-INLINE'); $oAsset->output('JS-INLINE-HEADER'); ?> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="<?=NAILS_ASSETS_URL . 'bower_components/html5shiv/dist/html5shiv.js'?>"></script> <script src="<?=NAILS_ASSETS_URL . 'bower_components/respond/dest/respond.min.js'?>"></script> <![endif]--> </head> <body <?=$sBodyClass ? 'class="' . $sBodyClass . '"' : ''?>>
Use and , and add body class functionality
Use and , and add body class functionality
PHP
mit
nailsapp/common,nailsapp/common,nailsapp/common
php
## Code Before: <!DOCTYPE html> <!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]--> <!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]--> <head> <?php echo '<title>'; if (!empty($page->seo->title)) { echo $page->seo->title . ' - '; } elseif (!empty($page->title)) { echo $page->title . ' - '; } echo APP_NAME; echo '</title>'; // -------------------------------------------------------------------------- // Meta tags echo $this->meta->outputStr(); // -------------------------------------------------------------------------- // Assets $this->asset->output('CSS'); $this->asset->output('CSS-INLINE'); $this->asset->output('JS-INLINE-HEADER'); ?> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="<?=NAILS_ASSETS_URL . 'bower_components/html5shiv/dist/html5shiv.js'?>"></script> <script src="<?=NAILS_ASSETS_URL . 'bower_components/respond/dest/respond.min.js'?>"></script> <![endif]--> </head> <body> ## Instruction: Use and , and add body class functionality ## Code After: <?php use Nails\Factory; $aPageTitle = []; if (!empty($page->seo->title)) { $aPageTitle[] = $page->seo->title; } elseif (!empty($page->title)) { $aPageTitle[] = $page->title; } $aPageTitle[] = APP_NAME; $sBodyClass = !empty($page->body_class) ? $page->body_class : ''; ?> <!DOCTYPE html> <!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]--> <!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]--> <head> <?php echo '<title>'; echo implode(' - ', $aPageTitle); echo '</title>'; // -------------------------------------------------------------------------- // Meta tags $oMeta = Factory::service('Meta'); echo $oMeta->outputStr(); // -------------------------------------------------------------------------- // Assets $oAsset = Factory::service('Meta'); $oAsset->output('CSS'); $oAsset->output('CSS-INLINE'); $oAsset->output('JS-INLINE-HEADER'); ?> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="<?=NAILS_ASSETS_URL . 'bower_components/html5shiv/dist/html5shiv.js'?>"></script> <script src="<?=NAILS_ASSETS_URL . 'bower_components/respond/dest/respond.min.js'?>"></script> <![endif]--> </head> <body <?=$sBodyClass ? 'class="' . $sBodyClass . '"' : ''?>>
+ <?php + + use Nails\Factory; + + $aPageTitle = []; + if (!empty($page->seo->title)) { + + $aPageTitle[] = $page->seo->title; + + } elseif (!empty($page->title)) { + + $aPageTitle[] = $page->title; + } + + $aPageTitle[] = APP_NAME; + + + $sBodyClass = !empty($page->body_class) ? $page->body_class : ''; + + ?> <!DOCTYPE html> <!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]--> <!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]--> <head> <?php echo '<title>'; + echo implode(' - ', $aPageTitle); - - if (!empty($page->seo->title)) { - - echo $page->seo->title . ' - '; - - } elseif (!empty($page->title)) { - - echo $page->title . ' - '; - } - - echo APP_NAME; - echo '</title>'; // -------------------------------------------------------------------------- // Meta tags + $oMeta = Factory::service('Meta'); - echo $this->meta->outputStr(); ? ^^^^^^^ + echo $oMeta->outputStr(); ? ^^ // -------------------------------------------------------------------------- // Assets + $oAsset = Factory::service('Meta'); - $this->asset->output('CSS'); ? ^^^^^^^ + $oAsset->output('CSS'); ? ^^ - $this->asset->output('CSS-INLINE'); ? ^^^^^^^ + $oAsset->output('CSS-INLINE'); ? ^^ - $this->asset->output('JS-INLINE-HEADER'); ? ^^^^^^^ + $oAsset->output('JS-INLINE-HEADER'); ? ^^ ?> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="<?=NAILS_ASSETS_URL . 'bower_components/html5shiv/dist/html5shiv.js'?>"></script> <script src="<?=NAILS_ASSETS_URL . 'bower_components/respond/dest/respond.min.js'?>"></script> <![endif]--> </head> - <body> + <body <?=$sBodyClass ? 'class="' . $sBodyClass . '"' : ''?>>
45
1.071429
28
17
5eeed3a04dc0320ad53015e428fbefa617f803b9
README.md
README.md
## DESCRIPTION This script creates up to 6 VMs, including Windows and Linux, however the number of Windows VMs can be user specified with the -WindowsInstanceCount parameter and integer values from 0-3. This script will create a set of Azure VMs to demonstrate Windows PowerShell and Azure Automation DSC functionality on Linux VMs. The deployment of Windows VMs are not essential for a basic demonstration of PowerShell on Linux, but will be required if Azure based Windows Push or Pull servers will be used in the lab. This script will be enhaced to eventually include those features also. Initially, the focus will be to simply configure the Linux distros to support Azure Automation DSC and PowerShell. The following VM instances will be deployed. 1) 0-3x Windows Server 2016 2) 1x UbuntuServer LTS 16.04 3) 1x CentOS 7.3 4) 1x openSUSE-Leap 42.2 EXAMPLE .\New-PowerShellOnLinuxLab -WindowsInstanceCount 2
## DESCRIPTION This script creates up to 6 VMs, including Windows and Linux, however the number of Windows VMs can be user specified with the -WindowsInstanceCount parameter and integer values from 0-3. This script will create a set of Azure VMs to demonstrate Windows PowerShell and Azure Automation DSC functionality on Linux VMs. The deployment of Windows VMs are not essential for a basic demonstration of PowerShell on Linux, but will be required if Azure based Windows Push or Pull servers will be used in the lab. This script will be enhaced to eventually include those features also. Initially, the focus will be to simply configure the Linux distros to support Azure Automation DSC and PowerShell. The following VM instances will be deployed. 1) 0-3x Windows Server 2016 2) 1x UbuntuServer LTS 16.04 3) 1x CentOS 7.3 4) 1x openSUSE-Leap 42.2 EXAMPLE .\New-PowerShellOnLinuxLab -WindowsInstanceCount 2 **FEEDBACK** Feel free to ask questions, provide feedback, contribute, file issues, etc. so we can make this even better!
Add feedback comment to readme.
Add feedback comment to readme.
Markdown
mit
autocloudarc/0008-New-PowerShellOnLinuxLab
markdown
## Code Before: ## DESCRIPTION This script creates up to 6 VMs, including Windows and Linux, however the number of Windows VMs can be user specified with the -WindowsInstanceCount parameter and integer values from 0-3. This script will create a set of Azure VMs to demonstrate Windows PowerShell and Azure Automation DSC functionality on Linux VMs. The deployment of Windows VMs are not essential for a basic demonstration of PowerShell on Linux, but will be required if Azure based Windows Push or Pull servers will be used in the lab. This script will be enhaced to eventually include those features also. Initially, the focus will be to simply configure the Linux distros to support Azure Automation DSC and PowerShell. The following VM instances will be deployed. 1) 0-3x Windows Server 2016 2) 1x UbuntuServer LTS 16.04 3) 1x CentOS 7.3 4) 1x openSUSE-Leap 42.2 EXAMPLE .\New-PowerShellOnLinuxLab -WindowsInstanceCount 2 ## Instruction: Add feedback comment to readme. ## Code After: ## DESCRIPTION This script creates up to 6 VMs, including Windows and Linux, however the number of Windows VMs can be user specified with the -WindowsInstanceCount parameter and integer values from 0-3. This script will create a set of Azure VMs to demonstrate Windows PowerShell and Azure Automation DSC functionality on Linux VMs. The deployment of Windows VMs are not essential for a basic demonstration of PowerShell on Linux, but will be required if Azure based Windows Push or Pull servers will be used in the lab. This script will be enhaced to eventually include those features also. Initially, the focus will be to simply configure the Linux distros to support Azure Automation DSC and PowerShell. The following VM instances will be deployed. 1) 0-3x Windows Server 2016 2) 1x UbuntuServer LTS 16.04 3) 1x CentOS 7.3 4) 1x openSUSE-Leap 42.2 EXAMPLE .\New-PowerShellOnLinuxLab -WindowsInstanceCount 2 **FEEDBACK** Feel free to ask questions, provide feedback, contribute, file issues, etc. so we can make this even better!
## DESCRIPTION This script creates up to 6 VMs, including Windows and Linux, however the number of Windows VMs can be user specified with the -WindowsInstanceCount parameter and integer values from 0-3. This script will create a set of Azure VMs to demonstrate Windows PowerShell and Azure Automation DSC functionality on Linux VMs. The deployment of Windows VMs are not essential for a basic demonstration of PowerShell on Linux, but will be required if Azure based Windows Push or Pull servers will be used in the lab. This script will be enhaced to eventually include those features also. Initially, the focus will be to simply configure the Linux distros to support Azure Automation DSC and PowerShell. The following VM instances will be deployed. 1) 0-3x Windows Server 2016 2) 1x UbuntuServer LTS 16.04 3) 1x CentOS 7.3 4) 1x openSUSE-Leap 42.2 EXAMPLE .\New-PowerShellOnLinuxLab -WindowsInstanceCount 2 + + **FEEDBACK** + Feel free to ask questions, provide feedback, contribute, file issues, etc. so we can make this even better!
3
0.214286
3
0
668e697e60927616c406e766a8b3bb4f5be98813
lib/poxa/console.ex
lib/poxa/console.ex
defmodule Poxa.Console do import JSEX, only: [encode!: 1] def connected(socket_id, origin) do message("Connection", socket_id, "Origin: #{origin}") |> send end def disconnected(socket_id, channels) when is_list(channels) do message("Disconnection", socket_id, "Channels: #{inspect channels}") |> send end def subscribed(socket_id, channel) do message("Subscribed", socket_id, "Channel: #{channel}") |> send end def unsubscribed(socket_id, channel) do message("Unsubscribed", socket_id, "Channel: #{channel}") |> send end def api_message(channel, message) do message("API Message", "", "Channel: #{channel}, Event: #{message["event"]}") |> send end defp send(message) do :gproc.send({:p, :l, :console}, {self, message |> encode!}) end defp message(type, socket_id, details) do [ type: type, socket: socket_id, details: details, time: time ] end defp time do {_, {hour, min, sec}} = :erlang.localtime :io_lib.format("~2w:~2..0w:~2..0w", [hour, min, sec]) |> to_string end end
defmodule Poxa.Console do import JSEX, only: [encode!: 1] def connected(socket_id, origin) do send_message("Connection", socket_id, "Origin: #{origin}") end def disconnected(socket_id, channels) when is_list(channels) do send_message("Disconnection", socket_id, "Channels: #{inspect channels}") end def subscribed(socket_id, channel) do send_message("Subscribed", socket_id, "Channel: #{channel}") end def unsubscribed(socket_id, channel) do send_message("Unsubscribed", socket_id, "Channel: #{channel}") end def api_message(channel, message) do send_message("API Message", "", "Channel: #{channel}, Event: #{message["event"]}") end defp send_message(type, socket_id, details) do message(type, socket_id, details) |> send end defp send(message) do :gproc.send({:p, :l, :console}, {self, message |> encode!}) end defp message(type, socket_id, details) do [ type: type, socket: socket_id, details: details, time: time ] end defp time do {_, {hour, min, sec}} = :erlang.localtime :io_lib.format("~2w:~2..0w:~2..0w", [hour, min, sec]) |> to_string end end
Refactor Console code to send_message
Refactor Console code to send_message
Elixir
mit
theinventor/rs-poxa,waffleio/poxa,joshk/poxa,RobertoSchneiders/poxa,edgurgel/poxa,RobertoSchneiders/poxa,waffleio/poxa,edgurgel/poxa,joshk/poxa,edgurgel/poxa
elixir
## Code Before: defmodule Poxa.Console do import JSEX, only: [encode!: 1] def connected(socket_id, origin) do message("Connection", socket_id, "Origin: #{origin}") |> send end def disconnected(socket_id, channels) when is_list(channels) do message("Disconnection", socket_id, "Channels: #{inspect channels}") |> send end def subscribed(socket_id, channel) do message("Subscribed", socket_id, "Channel: #{channel}") |> send end def unsubscribed(socket_id, channel) do message("Unsubscribed", socket_id, "Channel: #{channel}") |> send end def api_message(channel, message) do message("API Message", "", "Channel: #{channel}, Event: #{message["event"]}") |> send end defp send(message) do :gproc.send({:p, :l, :console}, {self, message |> encode!}) end defp message(type, socket_id, details) do [ type: type, socket: socket_id, details: details, time: time ] end defp time do {_, {hour, min, sec}} = :erlang.localtime :io_lib.format("~2w:~2..0w:~2..0w", [hour, min, sec]) |> to_string end end ## Instruction: Refactor Console code to send_message ## Code After: defmodule Poxa.Console do import JSEX, only: [encode!: 1] def connected(socket_id, origin) do send_message("Connection", socket_id, "Origin: #{origin}") end def disconnected(socket_id, channels) when is_list(channels) do send_message("Disconnection", socket_id, "Channels: #{inspect channels}") end def subscribed(socket_id, channel) do send_message("Subscribed", socket_id, "Channel: #{channel}") end def unsubscribed(socket_id, channel) do send_message("Unsubscribed", socket_id, "Channel: #{channel}") end def api_message(channel, message) do send_message("API Message", "", "Channel: #{channel}, Event: #{message["event"]}") end defp send_message(type, socket_id, details) do message(type, socket_id, details) |> send end defp send(message) do :gproc.send({:p, :l, :console}, {self, message |> encode!}) end defp message(type, socket_id, details) do [ type: type, socket: socket_id, details: details, time: time ] end defp time do {_, {hour, min, sec}} = :erlang.localtime :io_lib.format("~2w:~2..0w:~2..0w", [hour, min, sec]) |> to_string end end
defmodule Poxa.Console do import JSEX, only: [encode!: 1] def connected(socket_id, origin) do - message("Connection", socket_id, "Origin: #{origin}") |> send ? -------- + send_message("Connection", socket_id, "Origin: #{origin}") ? +++++ end def disconnected(socket_id, channels) when is_list(channels) do - message("Disconnection", socket_id, "Channels: #{inspect channels}") |> send ? -------- + send_message("Disconnection", socket_id, "Channels: #{inspect channels}") ? +++++ end def subscribed(socket_id, channel) do - message("Subscribed", socket_id, "Channel: #{channel}") |> send ? -------- + send_message("Subscribed", socket_id, "Channel: #{channel}") ? +++++ end def unsubscribed(socket_id, channel) do - message("Unsubscribed", socket_id, "Channel: #{channel}") |> send ? -------- + send_message("Unsubscribed", socket_id, "Channel: #{channel}") ? +++++ end def api_message(channel, message) do - message("API Message", "", "Channel: #{channel}, Event: #{message["event"]}") |> send ? -------- + send_message("API Message", "", "Channel: #{channel}, Event: #{message["event"]}") ? +++++ + end + + defp send_message(type, socket_id, details) do + message(type, socket_id, details) |> send end defp send(message) do :gproc.send({:p, :l, :console}, {self, message |> encode!}) end defp message(type, socket_id, details) do [ type: type, socket: socket_id, details: details, time: time ] end defp time do {_, {hour, min, sec}} = :erlang.localtime :io_lib.format("~2w:~2..0w:~2..0w", [hour, min, sec]) |> to_string end end
14
0.341463
9
5
260937103d166300b264f593e0f81e59bcb2a1ae
models/view/user.go
models/view/user.go
package view import "github.com/pufferpanel/pufferpanel/models" type UserViewModel struct { Username string `json:"username"` Email string `json:"email"` } func FromModel(model *models.User) *UserViewModel { return &UserViewModel{ Username: model.Username, Email: model.Email, } } func (model *UserViewModel) CopyToModel(newModel *models.User) { if model.Username != "" { newModel.Username = model.Username } if model.Email != "" { newModel.Email = model.Email } }
package view import "github.com/pufferpanel/pufferpanel/models" type UserViewModel struct { Username string `json:"username"` Email string `json:"email"` //ONLY SHOW WHEN COPYING Password string `json:"password,omitempty"` } func FromUser(model *models.User) *UserViewModel { return &UserViewModel{ Username: model.Username, Email: model.Email, } } func (model *UserViewModel) CopyToModel(newModel *models.User) { if model.Username != "" { newModel.Username = model.Username } if model.Email != "" { newModel.Email = model.Email } if model.Password != "" { newModel.SetPassword(model.Password) } }
Add ability to set password via view model
Add ability to set password via view model
Go
apache-2.0
PufferPanel/PufferPanel,PufferPanel/PufferPanel,PufferPanel/PufferPanel,PufferPanel/PufferPanel
go
## Code Before: package view import "github.com/pufferpanel/pufferpanel/models" type UserViewModel struct { Username string `json:"username"` Email string `json:"email"` } func FromModel(model *models.User) *UserViewModel { return &UserViewModel{ Username: model.Username, Email: model.Email, } } func (model *UserViewModel) CopyToModel(newModel *models.User) { if model.Username != "" { newModel.Username = model.Username } if model.Email != "" { newModel.Email = model.Email } } ## Instruction: Add ability to set password via view model ## Code After: package view import "github.com/pufferpanel/pufferpanel/models" type UserViewModel struct { Username string `json:"username"` Email string `json:"email"` //ONLY SHOW WHEN COPYING Password string `json:"password,omitempty"` } func FromUser(model *models.User) *UserViewModel { return &UserViewModel{ Username: model.Username, Email: model.Email, } } func (model *UserViewModel) CopyToModel(newModel *models.User) { if model.Username != "" { newModel.Username = model.Username } if model.Email != "" { newModel.Email = model.Email } if model.Password != "" { newModel.SetPassword(model.Password) } }
package view import "github.com/pufferpanel/pufferpanel/models" type UserViewModel struct { Username string `json:"username"` Email string `json:"email"` + //ONLY SHOW WHEN COPYING + Password string `json:"password,omitempty"` } - func FromModel(model *models.User) *UserViewModel { ? ^^^ ^ + func FromUser(model *models.User) *UserViewModel { ? ^^ ^ return &UserViewModel{ Username: model.Username, Email: model.Email, } } func (model *UserViewModel) CopyToModel(newModel *models.User) { if model.Username != "" { newModel.Username = model.Username } if model.Email != "" { newModel.Email = model.Email } + + if model.Password != "" { + newModel.SetPassword(model.Password) + } }
8
0.32
7
1
9ea1a78bd4c57f0db465342f05496828a7784509
internal/restic/find.go
internal/restic/find.go
package restic import "context" // FindUsedBlobs traverses the tree ID and adds all seen blobs (trees and data // blobs) to the set blobs. Already seen tree blobs will not be visited again. func FindUsedBlobs(ctx context.Context, repo Repository, treeID ID, blobs BlobSet) error { blobs.Insert(BlobHandle{ID: treeID, Type: TreeBlob}) tree, err := repo.LoadTree(ctx, treeID) if err != nil { return err } for _, node := range tree.Nodes { switch node.Type { case "file": for _, blob := range node.Content { blobs.Insert(BlobHandle{ID: blob, Type: DataBlob}) } case "dir": subtreeID := *node.Subtree h := BlobHandle{ID: subtreeID, Type: TreeBlob} if blobs.Has(h) { continue } err := FindUsedBlobs(ctx, repo, subtreeID, blobs) if err != nil { return err } } } return nil }
package restic import "context" // FindUsedBlobs traverses the tree ID and adds all seen blobs (trees and data // blobs) to the set blobs. Already seen tree blobs will not be visited again. func FindUsedBlobs(ctx context.Context, repo Repository, treeID ID, blobs BlobSet) error { h := BlobHandle{ID: treeID, Type: TreeBlob} if blobs.Has(h) { return nil } blobs.Insert(h) tree, err := repo.LoadTree(ctx, treeID) if err != nil { return err } for _, node := range tree.Nodes { switch node.Type { case "file": for _, blob := range node.Content { blobs.Insert(BlobHandle{ID: blob, Type: DataBlob}) } case "dir": err := FindUsedBlobs(ctx, repo, *node.Subtree, blobs) if err != nil { return err } } } return nil }
Check for seen blobs before loading trees
FindUsedBlobs: Check for seen blobs before loading trees The only effective change in behavior is that that toplevel nodes can also be skipped.
Go
bsd-2-clause
restic/restic,restic/restic
go
## Code Before: package restic import "context" // FindUsedBlobs traverses the tree ID and adds all seen blobs (trees and data // blobs) to the set blobs. Already seen tree blobs will not be visited again. func FindUsedBlobs(ctx context.Context, repo Repository, treeID ID, blobs BlobSet) error { blobs.Insert(BlobHandle{ID: treeID, Type: TreeBlob}) tree, err := repo.LoadTree(ctx, treeID) if err != nil { return err } for _, node := range tree.Nodes { switch node.Type { case "file": for _, blob := range node.Content { blobs.Insert(BlobHandle{ID: blob, Type: DataBlob}) } case "dir": subtreeID := *node.Subtree h := BlobHandle{ID: subtreeID, Type: TreeBlob} if blobs.Has(h) { continue } err := FindUsedBlobs(ctx, repo, subtreeID, blobs) if err != nil { return err } } } return nil } ## Instruction: FindUsedBlobs: Check for seen blobs before loading trees The only effective change in behavior is that that toplevel nodes can also be skipped. ## Code After: package restic import "context" // FindUsedBlobs traverses the tree ID and adds all seen blobs (trees and data // blobs) to the set blobs. Already seen tree blobs will not be visited again. func FindUsedBlobs(ctx context.Context, repo Repository, treeID ID, blobs BlobSet) error { h := BlobHandle{ID: treeID, Type: TreeBlob} if blobs.Has(h) { return nil } blobs.Insert(h) tree, err := repo.LoadTree(ctx, treeID) if err != nil { return err } for _, node := range tree.Nodes { switch node.Type { case "file": for _, blob := range node.Content { blobs.Insert(BlobHandle{ID: blob, Type: DataBlob}) } case "dir": err := FindUsedBlobs(ctx, repo, *node.Subtree, blobs) if err != nil { return err } } } return nil }
package restic import "context" // FindUsedBlobs traverses the tree ID and adds all seen blobs (trees and data // blobs) to the set blobs. Already seen tree blobs will not be visited again. func FindUsedBlobs(ctx context.Context, repo Repository, treeID ID, blobs BlobSet) error { - blobs.Insert(BlobHandle{ID: treeID, Type: TreeBlob}) ? ^^^^^^^^^^^^^ - + h := BlobHandle{ID: treeID, Type: TreeBlob} ? ^^^^^ + if blobs.Has(h) { + return nil + } + blobs.Insert(h) tree, err := repo.LoadTree(ctx, treeID) if err != nil { return err } for _, node := range tree.Nodes { switch node.Type { case "file": for _, blob := range node.Content { blobs.Insert(BlobHandle{ID: blob, Type: DataBlob}) } case "dir": - subtreeID := *node.Subtree - h := BlobHandle{ID: subtreeID, Type: TreeBlob} - if blobs.Has(h) { - continue - } - - err := FindUsedBlobs(ctx, repo, subtreeID, blobs) ? ^ -- + err := FindUsedBlobs(ctx, repo, *node.Subtree, blobs) ? ^^^^^^^ if err != nil { return err } } } return nil }
14
0.388889
6
8
9b59a2099925121202ec810fd0be319dd6ed0c6d
vagrant/salt/provision.sh
vagrant/salt/provision.sh
apt-get -y install python-software-properties add-apt-repository ppa:saltstack/salt apt-get -y update apt-get -y install salt-minion sed -i 's/#master: salt/master: salt-master.netsensia.com/g' /etc/salt/minion
apt-get -y install python-software-properties add-apt-repository ppa:saltstack/salt apt-get -y update apt-get -y install salt-minion sed -i 's/#master: salt/master: salt-master.netsensia.com/g' /etc/salt/minion sed -i 's/#id:/id: directorzone_vagrant/g' /etc/salt/minion
Add ID to salt minion config
Add ID to salt minion config
Shell
bsd-3-clause
Netsensia/directorzone,Netsensia/directorzone,Netsensia/directorzone,Netsensia/directorzone,Netsensia/directorzone,Netsensia/directorzone,Netsensia/directorzone,Netsensia/directorzone
shell
## Code Before: apt-get -y install python-software-properties add-apt-repository ppa:saltstack/salt apt-get -y update apt-get -y install salt-minion sed -i 's/#master: salt/master: salt-master.netsensia.com/g' /etc/salt/minion ## Instruction: Add ID to salt minion config ## Code After: apt-get -y install python-software-properties add-apt-repository ppa:saltstack/salt apt-get -y update apt-get -y install salt-minion sed -i 's/#master: salt/master: salt-master.netsensia.com/g' /etc/salt/minion sed -i 's/#id:/id: directorzone_vagrant/g' /etc/salt/minion
apt-get -y install python-software-properties add-apt-repository ppa:saltstack/salt apt-get -y update apt-get -y install salt-minion sed -i 's/#master: salt/master: salt-master.netsensia.com/g' /etc/salt/minion + sed -i 's/#id:/id: directorzone_vagrant/g' /etc/salt/minion
1
0.125
1
0
ff52533c93391efe9ea49d36e024c259d5ec7d12
src/IdFixture.php
src/IdFixture.php
<?php namespace OpenConext\Component\EngineBlockFixtures; use OpenConext\Component\EngineBlockFixtures\DataStore\AbstractDataStore; /** * Ids * @package OpenConext\Component\EngineBlockFixtures */ class IdFixture { protected $dataStore; protected $frames = array(); /** * @param AbstractDataStore $dataStore */ function __construct(AbstractDataStore $dataStore) { $this->dataStore = $dataStore; $this->frames = $this->dataStore->load(); } /** * Get the top frame off the queue for use. */ public function shiftFrame() { return array_shift($this->frames); } /** * Queue up another set of ids to use. * * @param IdFrame $frame */ public function addFrame(IdFrame $frame) { $this->frames[] = $frame; return $this; } /** * Remove all frames. */ public function clear() { $this->frames = array(); return $this; } /** * On destroy write out the current state. */ public function __destruct() { $this->dataStore->save($this->frames); } }
<?php namespace OpenConext\Component\EngineBlockFixtures; use OpenConext\Component\EngineBlockFixtures\DataStore\AbstractDataStore; /** * Ids * @package OpenConext\Component\EngineBlockFixtures */ class IdFixture { protected $dataStore; protected $frames = array(); /** * @param AbstractDataStore $dataStore */ function __construct(AbstractDataStore $dataStore) { $this->dataStore = $dataStore; $this->frames = $this->dataStore->load(); } /** * Get the top frame off the queue for use. */ public function shiftFrame() { if (empty($this->frames)) { throw new \RuntimeException('No more IdFrames?'); } return array_shift($this->frames); } /** * Queue up another set of ids to use. * * @param IdFrame $frame */ public function addFrame(IdFrame $frame) { $this->frames[] = $frame; return $this; } /** * Remove all frames. */ public function clear() { $this->frames = array(); return $this; } /** * On destroy write out the current state. */ public function __destruct() { $this->dataStore->save($this->frames); } }
Throw an exception if there are no more IdFrames
Throw an exception if there are no more IdFrames
PHP
apache-2.0
OpenConext/OpenConext-engineblock-fixtures
php
## Code Before: <?php namespace OpenConext\Component\EngineBlockFixtures; use OpenConext\Component\EngineBlockFixtures\DataStore\AbstractDataStore; /** * Ids * @package OpenConext\Component\EngineBlockFixtures */ class IdFixture { protected $dataStore; protected $frames = array(); /** * @param AbstractDataStore $dataStore */ function __construct(AbstractDataStore $dataStore) { $this->dataStore = $dataStore; $this->frames = $this->dataStore->load(); } /** * Get the top frame off the queue for use. */ public function shiftFrame() { return array_shift($this->frames); } /** * Queue up another set of ids to use. * * @param IdFrame $frame */ public function addFrame(IdFrame $frame) { $this->frames[] = $frame; return $this; } /** * Remove all frames. */ public function clear() { $this->frames = array(); return $this; } /** * On destroy write out the current state. */ public function __destruct() { $this->dataStore->save($this->frames); } } ## Instruction: Throw an exception if there are no more IdFrames ## Code After: <?php namespace OpenConext\Component\EngineBlockFixtures; use OpenConext\Component\EngineBlockFixtures\DataStore\AbstractDataStore; /** * Ids * @package OpenConext\Component\EngineBlockFixtures */ class IdFixture { protected $dataStore; protected $frames = array(); /** * @param AbstractDataStore $dataStore */ function __construct(AbstractDataStore $dataStore) { $this->dataStore = $dataStore; $this->frames = $this->dataStore->load(); } /** * Get the top frame off the queue for use. */ public function shiftFrame() { if (empty($this->frames)) { throw new \RuntimeException('No more IdFrames?'); } return array_shift($this->frames); } /** * Queue up another set of ids to use. * * @param IdFrame $frame */ public function addFrame(IdFrame $frame) { $this->frames[] = $frame; return $this; } /** * Remove all frames. */ public function clear() { $this->frames = array(); return $this; } /** * On destroy write out the current state. */ public function __destruct() { $this->dataStore->save($this->frames); } }
<?php namespace OpenConext\Component\EngineBlockFixtures; use OpenConext\Component\EngineBlockFixtures\DataStore\AbstractDataStore; /** * Ids * @package OpenConext\Component\EngineBlockFixtures */ class IdFixture { protected $dataStore; protected $frames = array(); /** * @param AbstractDataStore $dataStore */ function __construct(AbstractDataStore $dataStore) { $this->dataStore = $dataStore; $this->frames = $this->dataStore->load(); } /** * Get the top frame off the queue for use. */ public function shiftFrame() { + if (empty($this->frames)) { + throw new \RuntimeException('No more IdFrames?'); + } return array_shift($this->frames); } /** * Queue up another set of ids to use. * * @param IdFrame $frame */ public function addFrame(IdFrame $frame) { $this->frames[] = $frame; return $this; } /** * Remove all frames. */ public function clear() { $this->frames = array(); return $this; } /** * On destroy write out the current state. */ public function __destruct() { $this->dataStore->save($this->frames); } }
3
0.05
3
0
0c1243741701d50541ab0f7dd3728a67ae77625c
Formula/python.rb
Formula/python.rb
require 'brewkit' class Python <Formula @url='http://www.python.org/ftp/python/2.6.2/Python-2.6.2.tar.bz2' @homepage='http://www.python.org/' @md5='245db9f1e0f09ab7e0faaa0cf7301011' def deps # You can build Python without readline, but you really don't want to. LibraryDep.new 'readline' end def skip_clean? path return path == bin+'python' or path == bin+'python2.6' end def install system "./configure --prefix='#{prefix}' --with-framework-name=/Developer/SDKs/MacOSX10.5.sdk" system "make" system "make install" # lib/python2.6/config contains a copy of libpython.a; make this a link instead (lib+'python2.6/config/libpython2.6.a').unlink (lib+'python2.6/config/libpython2.6.a').make_link lib+'libpython2.6.a' end end
require 'brewkit' class Python <Formula @url='http://www.python.org/ftp/python/2.6.2/Python-2.6.2.tar.bz2' @homepage='http://www.python.org/' @md5='245db9f1e0f09ab7e0faaa0cf7301011' def deps # You can build Python without readline, but you really don't want to. LibraryDep.new 'readline' end def skip_clean? path path == bin+'python' or path == bin+'python2.6' or # if you strip these, it can't load modules path == lib+'python2.6' # save a lot of time end def install system "./configure --prefix='#{prefix}' --with-framework-name=/Developer/SDKs/MacOSX10.5.sdk" system "make" system "make install" # lib/python2.6/config contains a copy of libpython.a; make this a link instead (lib+'python2.6/config/libpython2.6.a').unlink (lib+'python2.6/config/libpython2.6.a').make_link lib+'libpython2.6.a' end end
Allow skip_clean? to skip entire directories
Allow skip_clean? to skip entire directories Speeds up Python formula plenty in clean phase
Ruby
bsd-2-clause
gserra-olx/homebrew-core,moderndeveloperllc/homebrew-core,rwhogg/homebrew-core,BrewTestBot/homebrew-core,cblecker/homebrew-core,mfikes/homebrew-core,zmwangx/homebrew-core,maxim-belkin/homebrew-core,jvillard/homebrew-core,jdubois/homebrew-core,sdorra/homebrew-core,FinalDes/homebrew-core,jdubois/homebrew-core,Moisan/homebrew-core,battlemidget/homebrew-core,stgraber/homebrew-core,Linuxbrew/homebrew-core,spaam/homebrew-core,zyedidia/homebrew-core,rwhogg/homebrew-core,straxhaber/homebrew-core,aabdnn/homebrew-core,passerbyid/homebrew-core,zyedidia/homebrew-core,grhawk/homebrew-core,lasote/homebrew-core,git-lfs/homebrew-core,LinuxbrewTestBot/homebrew-core,mvbattista/homebrew-core,sjackman/homebrew-core,dsXLII/homebrew-core,aren55555/homebrew-core,maxim-belkin/homebrew-core,uyjulian/homebrew-core,cblecker/homebrew-core,gserra-olx/homebrew-core,Homebrew/homebrew-core,FinalDes/homebrew-core,phusion/homebrew-core,battlemidget/homebrew-core,smessmer/homebrew-core,tkoenig/homebrew-core,lasote/homebrew-core,jdubois/homebrew-core,ShivaHuang/homebrew-core,wolffaxn/homebrew-core,mbcoguno/homebrew-core,ShivaHuang/homebrew-core,BrewTestBot/homebrew-core,j-bennet/homebrew-core,JCount/homebrew-core,mvbattista/homebrew-core,jvehent/homebrew-core,aabdnn/homebrew-core,git-lfs/homebrew-core,ilovezfs/homebrew-core,JCount/homebrew-core,adamliter/homebrew-core,ylluminarious/homebrew-core,adam-moss/homebrew-core,mbcoguno/homebrew-core,bigbes/homebrew-core,ylluminarious/homebrew-core,Linuxbrew/homebrew-core,kunickiaj/homebrew-core,dsXLII/homebrew-core,jabenninghoff/homebrew-core,phusion/homebrew-core,bcg62/homebrew-core,robohack/homebrew-core,forevergenin/homebrew-core,nandub/homebrew-core,adamliter/homebrew-core,edporras/homebrew-core,bfontaine/homebrew-core,sjackman/homebrew-core,reelsense/homebrew-core,DomT4/homebrew-core,filcab/homebrew-core,adam-moss/homebrew-core,fvioz/homebrew-core,lemzwerg/homebrew-core,bcg62/homebrew-core,forevergenin/homebrew-core,DomT4/homebrew-core,smessmer/homebrew-core,mvitz/homebrew-core,makigumo/homebrew-core,nbari/homebrew-core,bcg62/homebrew-core,kuahyeow/homebrew-core,wolffaxn/homebrew-core,bfontaine/homebrew-core,straxhaber/homebrew-core,lemzwerg/homebrew-core,ilovezfs/homebrew-core,reelsense/homebrew-core,tkoenig/homebrew-core,moderndeveloperllc/homebrew-core,stgraber/homebrew-core,nbari/homebrew-core,filcab/homebrew-core,edporras/homebrew-core,lembacon/homebrew-core,j-bennet/homebrew-core,mvitz/homebrew-core,zmwangx/homebrew-core,kuahyeow/homebrew-core,bigbes/homebrew-core,lembacon/homebrew-core,lembacon/homebrew-core,spaam/homebrew-core,mahori/homebrew-core,Homebrew/homebrew-core,mahori/homebrew-core,jvillard/homebrew-core,chrisfinazzo/homebrew-core,Moisan/homebrew-core,chrisfinazzo/homebrew-core,grhawk/homebrew-core,fvioz/homebrew-core,wolffaxn/homebrew-core,makigumo/homebrew-core,passerbyid/homebrew-core,sdorra/homebrew-core,nandub/homebrew-core,mvitz/homebrew-core,LinuxbrewTestBot/homebrew-core,kunickiaj/homebrew-core,andyjeffries/homebrew-core,jvillard/homebrew-core,mbcoguno/homebrew-core,uyjulian/homebrew-core,aren55555/homebrew-core,jvehent/homebrew-core,andyjeffries/homebrew-core,robohack/homebrew-core,jabenninghoff/homebrew-core,mfikes/homebrew-core
ruby
## Code Before: require 'brewkit' class Python <Formula @url='http://www.python.org/ftp/python/2.6.2/Python-2.6.2.tar.bz2' @homepage='http://www.python.org/' @md5='245db9f1e0f09ab7e0faaa0cf7301011' def deps # You can build Python without readline, but you really don't want to. LibraryDep.new 'readline' end def skip_clean? path return path == bin+'python' or path == bin+'python2.6' end def install system "./configure --prefix='#{prefix}' --with-framework-name=/Developer/SDKs/MacOSX10.5.sdk" system "make" system "make install" # lib/python2.6/config contains a copy of libpython.a; make this a link instead (lib+'python2.6/config/libpython2.6.a').unlink (lib+'python2.6/config/libpython2.6.a').make_link lib+'libpython2.6.a' end end ## Instruction: Allow skip_clean? to skip entire directories Speeds up Python formula plenty in clean phase ## Code After: require 'brewkit' class Python <Formula @url='http://www.python.org/ftp/python/2.6.2/Python-2.6.2.tar.bz2' @homepage='http://www.python.org/' @md5='245db9f1e0f09ab7e0faaa0cf7301011' def deps # You can build Python without readline, but you really don't want to. LibraryDep.new 'readline' end def skip_clean? path path == bin+'python' or path == bin+'python2.6' or # if you strip these, it can't load modules path == lib+'python2.6' # save a lot of time end def install system "./configure --prefix='#{prefix}' --with-framework-name=/Developer/SDKs/MacOSX10.5.sdk" system "make" system "make install" # lib/python2.6/config contains a copy of libpython.a; make this a link instead (lib+'python2.6/config/libpython2.6.a').unlink (lib+'python2.6/config/libpython2.6.a').make_link lib+'libpython2.6.a' end end
require 'brewkit' class Python <Formula @url='http://www.python.org/ftp/python/2.6.2/Python-2.6.2.tar.bz2' @homepage='http://www.python.org/' @md5='245db9f1e0f09ab7e0faaa0cf7301011' def deps # You can build Python without readline, but you really don't want to. LibraryDep.new 'readline' end def skip_clean? path - return path == bin+'python' or path == bin+'python2.6' + path == bin+'python' or path == bin+'python2.6' or # if you strip these, it can't load modules + path == lib+'python2.6' # save a lot of time end def install system "./configure --prefix='#{prefix}' --with-framework-name=/Developer/SDKs/MacOSX10.5.sdk" system "make" system "make install" # lib/python2.6/config contains a copy of libpython.a; make this a link instead (lib+'python2.6/config/libpython2.6.a').unlink (lib+'python2.6/config/libpython2.6.a').make_link lib+'libpython2.6.a' end end
3
0.115385
2
1
071fda94afcad69e5aca822080a551c45c939802
.bmi/frost_number/api.yaml
.bmi/frost_number/api.yaml
name: FrostNumberModel language: python package: permamodel class: frostnumber_method
name: FrostNumberModel language: python package: permamodel.components.bmi_frost_number class: BmiFrostnumberMethod
Fix package and class name for component
Fix package and class name for component I lifted these from **permamodel/examples/try_fn.py**.
YAML
mit
permamodel/permamodel,permamodel/permamodel
yaml
## Code Before: name: FrostNumberModel language: python package: permamodel class: frostnumber_method ## Instruction: Fix package and class name for component I lifted these from **permamodel/examples/try_fn.py**. ## Code After: name: FrostNumberModel language: python package: permamodel.components.bmi_frost_number class: BmiFrostnumberMethod
name: FrostNumberModel language: python - package: permamodel + package: permamodel.components.bmi_frost_number - class: frostnumber_method ? ^ ^^ + class: BmiFrostnumberMethod ? ^^^^ ^
4
0.8
2
2
2f8f43d6c967e0f8600681033acf582ef77cd38c
readme.md
readme.md
NGuard ========= Introduction ------------ Lightweight guard / pre-condition / parameter validation framework for .NET Using a guard ------------- ````csharp // Simple example: void ExampleMethod(string input) { Guard.Requires(input, "input").IsNotNull(); // method body } // Chaining guards: void ExampleMethod(string input) { Guard.Requires(input, "input").IsNotNull().IsNotEmpty().IsNotWhiteSpace(); // method body } ```` Defining a custom guard ----------------------- ````csharp // Example guard definition: static Guard<CustomType> SatisfiesCustomCondition(this Guard<CustomType> guard) { if (guard.Value != null) { bool valid = /* code to test custom condition */ if (!valid) { string paramName = guard.ParameterName; string message = paramName + " should satisfy custom condition."; throw new ArgumentException(message, paramName); } } return guard; } // Example guard usage: void ExampleMethod(CustomType value) { Guard.Requires(value, "value").SatisfiesCustomCondition(); // method body } ```` Copyright --------- Copyright Matthew King 2012-2016. License ------- NGuard is licensed under the [MIT License](https://opensource.org/licenses/MIT). Refer to license.txt for more information.
NGuard ========= Introduction ------------ Lightweight guard / pre-condition / parameter validation library for .NET Using a guard ------------- ````csharp // Simple example: void ExampleMethod(string input) { Guard.Requires(input, nameof(input)).IsNotNull(); // method body } // Chaining guards: void ExampleMethod(string input) { Guard.Requires(input, nameof(input)).IsNotNull().IsNotEmpty().IsNotWhiteSpace(); // method body } ```` Defining a custom guard ----------------------- ````csharp // Example guard definition: static Guard<CustomType> SatisfiesCustomCondition(this Guard<CustomType> guard) { if (guard.Value != null) { bool valid = /* code to test custom condition */ if (!valid) { string paramName = guard.ParameterName; string message = $"{paramName} should satisfy custom condition."; throw new ArgumentException(message, paramName); } } return guard; } // Example guard usage: void ExampleMethod(CustomType value) { Guard.Requires(value, nameof(value)).SatisfiesCustomCondition(); // method body } ```` Copyright --------- Copyright Matthew King 2012-2016. License ------- NGuard is licensed under the [MIT License](https://opensource.org/licenses/MIT). Refer to license.txt for more information.
Use modern language features in the examples.
Use modern language features in the examples.
Markdown
mit
MatthewKing/NGuard
markdown
## Code Before: NGuard ========= Introduction ------------ Lightweight guard / pre-condition / parameter validation framework for .NET Using a guard ------------- ````csharp // Simple example: void ExampleMethod(string input) { Guard.Requires(input, "input").IsNotNull(); // method body } // Chaining guards: void ExampleMethod(string input) { Guard.Requires(input, "input").IsNotNull().IsNotEmpty().IsNotWhiteSpace(); // method body } ```` Defining a custom guard ----------------------- ````csharp // Example guard definition: static Guard<CustomType> SatisfiesCustomCondition(this Guard<CustomType> guard) { if (guard.Value != null) { bool valid = /* code to test custom condition */ if (!valid) { string paramName = guard.ParameterName; string message = paramName + " should satisfy custom condition."; throw new ArgumentException(message, paramName); } } return guard; } // Example guard usage: void ExampleMethod(CustomType value) { Guard.Requires(value, "value").SatisfiesCustomCondition(); // method body } ```` Copyright --------- Copyright Matthew King 2012-2016. License ------- NGuard is licensed under the [MIT License](https://opensource.org/licenses/MIT). Refer to license.txt for more information. ## Instruction: Use modern language features in the examples. ## Code After: NGuard ========= Introduction ------------ Lightweight guard / pre-condition / parameter validation library for .NET Using a guard ------------- ````csharp // Simple example: void ExampleMethod(string input) { Guard.Requires(input, nameof(input)).IsNotNull(); // method body } // Chaining guards: void ExampleMethod(string input) { Guard.Requires(input, nameof(input)).IsNotNull().IsNotEmpty().IsNotWhiteSpace(); // method body } ```` Defining a custom guard ----------------------- ````csharp // Example guard definition: static Guard<CustomType> SatisfiesCustomCondition(this Guard<CustomType> guard) { if (guard.Value != null) { bool valid = /* code to test custom condition */ if (!valid) { string paramName = guard.ParameterName; string message = $"{paramName} should satisfy custom condition."; throw new ArgumentException(message, paramName); } } return guard; } // Example guard usage: void ExampleMethod(CustomType value) { Guard.Requires(value, nameof(value)).SatisfiesCustomCondition(); // method body } ```` Copyright --------- Copyright Matthew King 2012-2016. License ------- NGuard is licensed under the [MIT License](https://opensource.org/licenses/MIT). Refer to license.txt for more information.
NGuard ========= Introduction ------------ - Lightweight guard / pre-condition / parameter validation framework for .NET ? ^ ---- ^ + Lightweight guard / pre-condition / parameter validation library for .NET ? ^^^ ^ Using a guard ------------- ````csharp // Simple example: void ExampleMethod(string input) { - Guard.Requires(input, "input").IsNotNull(); ? ^ ^ + Guard.Requires(input, nameof(input)).IsNotNull(); ? ^^^^^^^ ^ // method body } // Chaining guards: void ExampleMethod(string input) { - Guard.Requires(input, "input").IsNotNull().IsNotEmpty().IsNotWhiteSpace(); ? ^ ^ + Guard.Requires(input, nameof(input)).IsNotNull().IsNotEmpty().IsNotWhiteSpace(); ? ^^^^^^^ ^ // method body } ```` Defining a custom guard ----------------------- ````csharp // Example guard definition: static Guard<CustomType> SatisfiesCustomCondition(this Guard<CustomType> guard) { if (guard.Value != null) { bool valid = /* code to test custom condition */ if (!valid) { string paramName = guard.ParameterName; - string message = paramName + " should satisfy custom condition."; ? ^^^^ + string message = $"{paramName} should satisfy custom condition."; ? +++ ^ throw new ArgumentException(message, paramName); } } return guard; } // Example guard usage: void ExampleMethod(CustomType value) { - Guard.Requires(value, "value").SatisfiesCustomCondition(); ? ^ ^ + Guard.Requires(value, nameof(value)).SatisfiesCustomCondition(); ? ^^^^^^^ ^ // method body } ```` Copyright --------- Copyright Matthew King 2012-2016. License ------- NGuard is licensed under the [MIT License](https://opensource.org/licenses/MIT). Refer to license.txt for more information.
10
0.15873
5
5
44c17ac74b1fb96de5844f42ea8cd63e539c9674
Utilities/UICollectionView+Extensions.swift
Utilities/UICollectionView+Extensions.swift
// // UICollectionView+Extensions.swift // Utilities // // Created by Caio Mello on 6/2/19. // Copyright © 2019 Caio Mello. All rights reserved. // import UIKit extension UICollectionView { public func registerCell<T: UICollectionViewCell>(_ cellClass: T.Type) { register(UINib(nibName: "\(T.self)", bundle: nil), forCellWithReuseIdentifier: "\(T.self)") } public func dequeueCell<T: UICollectionViewCell>(forItemAt indexPath: IndexPath) -> T { return dequeueReusableCell(withReuseIdentifier: "\(T.self)", for: indexPath) as! T } }
// // UICollectionView+Extensions.swift // Utilities // // Created by Caio Mello on 6/2/19. // Copyright © 2019 Caio Mello. All rights reserved. // import UIKit extension UICollectionView { public func registerCell<T: UICollectionViewCell>(_ type: T.Type) { register(UINib(nibName: "\(T.self)", bundle: nil), forCellWithReuseIdentifier: "\(T.self)") } public func registerSupplementaryView<T: UICollectionReusableView>(ofKind kind: String, _ type: T.Type) { register(UINib(nibName: "\(T.self)", bundle: nil), forSupplementaryViewOfKind: kind, withReuseIdentifier: "\(T.self)") } public func dequeueCell<T: UICollectionViewCell>(forItemAt indexPath: IndexPath) -> T { return dequeueReusableCell(withReuseIdentifier: "\(T.self)", for: indexPath) as! T } public func dequeueSupplementaryView<T: UICollectionReusableView>(ofKind kind: String, at indexPath: IndexPath) -> T { return dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "\(T.self)", for: indexPath) as! T } }
Add new collection view helper methods
Add new collection view helper methods
Swift
mit
caiomello/utilities
swift
## Code Before: // // UICollectionView+Extensions.swift // Utilities // // Created by Caio Mello on 6/2/19. // Copyright © 2019 Caio Mello. All rights reserved. // import UIKit extension UICollectionView { public func registerCell<T: UICollectionViewCell>(_ cellClass: T.Type) { register(UINib(nibName: "\(T.self)", bundle: nil), forCellWithReuseIdentifier: "\(T.self)") } public func dequeueCell<T: UICollectionViewCell>(forItemAt indexPath: IndexPath) -> T { return dequeueReusableCell(withReuseIdentifier: "\(T.self)", for: indexPath) as! T } } ## Instruction: Add new collection view helper methods ## Code After: // // UICollectionView+Extensions.swift // Utilities // // Created by Caio Mello on 6/2/19. // Copyright © 2019 Caio Mello. All rights reserved. // import UIKit extension UICollectionView { public func registerCell<T: UICollectionViewCell>(_ type: T.Type) { register(UINib(nibName: "\(T.self)", bundle: nil), forCellWithReuseIdentifier: "\(T.self)") } public func registerSupplementaryView<T: UICollectionReusableView>(ofKind kind: String, _ type: T.Type) { register(UINib(nibName: "\(T.self)", bundle: nil), forSupplementaryViewOfKind: kind, withReuseIdentifier: "\(T.self)") } public func dequeueCell<T: UICollectionViewCell>(forItemAt indexPath: IndexPath) -> T { return dequeueReusableCell(withReuseIdentifier: "\(T.self)", for: indexPath) as! T } public func dequeueSupplementaryView<T: UICollectionReusableView>(ofKind kind: String, at indexPath: IndexPath) -> T { return dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "\(T.self)", for: indexPath) as! T } }
// // UICollectionView+Extensions.swift // Utilities // // Created by Caio Mello on 6/2/19. // Copyright © 2019 Caio Mello. All rights reserved. // import UIKit extension UICollectionView { - public func registerCell<T: UICollectionViewCell>(_ cellClass: T.Type) { ? ^ ------- + public func registerCell<T: UICollectionViewCell>(_ type: T.Type) { ? ^^^ register(UINib(nibName: "\(T.self)", bundle: nil), forCellWithReuseIdentifier: "\(T.self)") + } + + public func registerSupplementaryView<T: UICollectionReusableView>(ofKind kind: String, _ type: T.Type) { + register(UINib(nibName: "\(T.self)", bundle: nil), forSupplementaryViewOfKind: kind, withReuseIdentifier: "\(T.self)") } public func dequeueCell<T: UICollectionViewCell>(forItemAt indexPath: IndexPath) -> T { return dequeueReusableCell(withReuseIdentifier: "\(T.self)", for: indexPath) as! T } + + public func dequeueSupplementaryView<T: UICollectionReusableView>(ofKind kind: String, at indexPath: IndexPath) -> T { + return dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "\(T.self)", for: indexPath) as! T + } }
10
0.526316
9
1
abc0eeba909bb5a511169096f2f473ee5a3fdd23
README.md
README.md
firebase adapter for orbit.js WARNING this is very much a WIP!
firebase adapter for orbit.js WARNING this is very much a WIP! ## Prerequisites You will need the following things properly installed on your computer. * [Git](http://git-scm.com/) * [Node.js](http://nodejs.org/) (with NPM) * [Bower](http://bower.io/) * [PhantomJS](http://phantomjs.org/) * [Fswatch](https://github.com/emcrisostomo/fswatch) # required by autoload, brew install fswatch * [Terminal Notifier](https://github.com/alloy/terminal-notifier) # required by autoload, brew install terminal-notifier * [Broccoli-cli](https://github.com/broccolijs/broccoli-cli) # required by autoload, npm -g install broccoli-cli ## Installation * `git clone <repository-url>` this repository * change into the new directory * npm install ## Running * change into the new directory * ./autoload * change a file within lib, test and the ./builder script will be called this will run the server on http://localhost:4200
Add prerequisites, installation, and running info
Add prerequisites, installation, and running info
Markdown
mit
opsb/orbit-firebase,opsb/orbit-firebase,opsb/orbit-firebase,lytbulb/orbit-firebase,lytbulb/orbit-firebase,lytbulb/orbit-firebase,opsb/orbit-firebase
markdown
## Code Before: firebase adapter for orbit.js WARNING this is very much a WIP! ## Instruction: Add prerequisites, installation, and running info ## Code After: firebase adapter for orbit.js WARNING this is very much a WIP! ## Prerequisites You will need the following things properly installed on your computer. * [Git](http://git-scm.com/) * [Node.js](http://nodejs.org/) (with NPM) * [Bower](http://bower.io/) * [PhantomJS](http://phantomjs.org/) * [Fswatch](https://github.com/emcrisostomo/fswatch) # required by autoload, brew install fswatch * [Terminal Notifier](https://github.com/alloy/terminal-notifier) # required by autoload, brew install terminal-notifier * [Broccoli-cli](https://github.com/broccolijs/broccoli-cli) # required by autoload, npm -g install broccoli-cli ## Installation * `git clone <repository-url>` this repository * change into the new directory * npm install ## Running * change into the new directory * ./autoload * change a file within lib, test and the ./builder script will be called this will run the server on http://localhost:4200
firebase adapter for orbit.js WARNING this is very much a WIP! + + ## Prerequisites + + You will need the following things properly installed on your computer. + + * [Git](http://git-scm.com/) + * [Node.js](http://nodejs.org/) (with NPM) + * [Bower](http://bower.io/) + * [PhantomJS](http://phantomjs.org/) + * [Fswatch](https://github.com/emcrisostomo/fswatch) # required by autoload, brew install fswatch + * [Terminal Notifier](https://github.com/alloy/terminal-notifier) # required by autoload, brew install terminal-notifier + * [Broccoli-cli](https://github.com/broccolijs/broccoli-cli) # required by autoload, npm -g install broccoli-cli + + ## Installation + + * `git clone <repository-url>` this repository + * change into the new directory + * npm install + + ## Running + + * change into the new directory + * ./autoload + * change a file within lib, test and the ./builder script will be called + this will run the server on http://localhost:4200
25
6.25
25
0
f2b2eaf5f54ba11a5c002ebf8efb5d86f2abdc32
conda.recipe/build.sh
conda.recipe/build.sh
$PYTHON setup.py install
rm $PREFIX/bin/activate rm $PREFIX/bin/deactivate $PYTHON setup.py install
Make sure to remove the symlinked versions
Make sure to remove the symlinked versions
Shell
bsd-3-clause
isaac-kit/conda-env,dan-blanchard/conda-env,asmeurer/conda-env,nicoddemus/conda-env,phobson/conda-env,mikecroucher/conda-env,ESSS/conda-env,asmeurer/conda-env,isaac-kit/conda-env,conda/conda-env,phobson/conda-env,ESSS/conda-env,mikecroucher/conda-env,dan-blanchard/conda-env,nicoddemus/conda-env,conda/conda-env
shell
## Code Before: $PYTHON setup.py install ## Instruction: Make sure to remove the symlinked versions ## Code After: rm $PREFIX/bin/activate rm $PREFIX/bin/deactivate $PYTHON setup.py install
+ rm $PREFIX/bin/activate + rm $PREFIX/bin/deactivate + $PYTHON setup.py install
3
3
3
0
386d6da1029f1b5cc1336f8d920079c148431347
packages/ll/llvm-ffi-tools.yaml
packages/ll/llvm-ffi-tools.yaml
homepage: http://haskell.org/haskellwiki/LLVM changelog-type: '' hash: 4ff44829e1aa902b4b46aeb417d8a5b27438d68bb3c1582153fa09d258b7f8dd test-bench-deps: {} maintainer: Henning Thielemann <llvm@henning-thielemann.de> synopsis: Tools for maintaining the llvm-ffi package changelog: '' basic-deps: bytestring: ! '>=0.9 && <0.11' base: ! '>=4.5 && <5' utility-ht: ! '>=0.0.9 && <0.1' containers: ! '>=0.4 && <0.7' regex-posix: ==0.95.* all-versions: - '0.0' - 0.0.0.1 author: Henning Thielemann, Bryan O'Sullivan, Lennart Augustsson latest: 0.0.0.1 description-type: haddock description: ! 'The package contains tools for maintaining the FFI interface to LLVM in the @llvm-ffi@ package <http://hackage.haskell.org/package/llvm-ffi>. Most notably there is the @llvm-function-mangler@ that converts LLVM-C bindings to Haskell foreign imports.' license-name: BSD-3-Clause
homepage: http://haskell.org/haskellwiki/LLVM changelog-type: '' hash: a703133c777cfa3292015f0c577050fd5d53103d6b2d18d7fb518ca325ccbcf2 test-bench-deps: {} maintainer: Henning Thielemann <llvm@henning-thielemann.de> synopsis: Tools for maintaining the llvm-ffi package changelog: '' basic-deps: bytestring: '>=0.9 && <0.12' base: '>=4.5 && <5' utility-ht: '>=0.0.9 && <0.1' containers: '>=0.4 && <0.7' regex-posix: '>=0.95 && <0.97' all-versions: - '0.0' - 0.0.0.1 author: Henning Thielemann, Bryan O'Sullivan, Lennart Augustsson latest: 0.0.0.1 description-type: haddock description: |- The package contains tools for maintaining the FFI interface to LLVM in the @llvm-ffi@ package <http://hackage.haskell.org/package/llvm-ffi>. Most notably there is the @llvm-function-mangler@ that converts LLVM-C bindings to Haskell foreign imports. license-name: BSD-3-Clause
Update from Hackage at 2021-11-07T23:44:54Z
Update from Hackage at 2021-11-07T23:44:54Z
YAML
mit
commercialhaskell/all-cabal-metadata
yaml
## Code Before: homepage: http://haskell.org/haskellwiki/LLVM changelog-type: '' hash: 4ff44829e1aa902b4b46aeb417d8a5b27438d68bb3c1582153fa09d258b7f8dd test-bench-deps: {} maintainer: Henning Thielemann <llvm@henning-thielemann.de> synopsis: Tools for maintaining the llvm-ffi package changelog: '' basic-deps: bytestring: ! '>=0.9 && <0.11' base: ! '>=4.5 && <5' utility-ht: ! '>=0.0.9 && <0.1' containers: ! '>=0.4 && <0.7' regex-posix: ==0.95.* all-versions: - '0.0' - 0.0.0.1 author: Henning Thielemann, Bryan O'Sullivan, Lennart Augustsson latest: 0.0.0.1 description-type: haddock description: ! 'The package contains tools for maintaining the FFI interface to LLVM in the @llvm-ffi@ package <http://hackage.haskell.org/package/llvm-ffi>. Most notably there is the @llvm-function-mangler@ that converts LLVM-C bindings to Haskell foreign imports.' license-name: BSD-3-Clause ## Instruction: Update from Hackage at 2021-11-07T23:44:54Z ## Code After: homepage: http://haskell.org/haskellwiki/LLVM changelog-type: '' hash: a703133c777cfa3292015f0c577050fd5d53103d6b2d18d7fb518ca325ccbcf2 test-bench-deps: {} maintainer: Henning Thielemann <llvm@henning-thielemann.de> synopsis: Tools for maintaining the llvm-ffi package changelog: '' basic-deps: bytestring: '>=0.9 && <0.12' base: '>=4.5 && <5' utility-ht: '>=0.0.9 && <0.1' containers: '>=0.4 && <0.7' regex-posix: '>=0.95 && <0.97' all-versions: - '0.0' - 0.0.0.1 author: Henning Thielemann, Bryan O'Sullivan, Lennart Augustsson latest: 0.0.0.1 description-type: haddock description: |- The package contains tools for maintaining the FFI interface to LLVM in the @llvm-ffi@ package <http://hackage.haskell.org/package/llvm-ffi>. Most notably there is the @llvm-function-mangler@ that converts LLVM-C bindings to Haskell foreign imports. license-name: BSD-3-Clause
homepage: http://haskell.org/haskellwiki/LLVM changelog-type: '' - hash: 4ff44829e1aa902b4b46aeb417d8a5b27438d68bb3c1582153fa09d258b7f8dd + hash: a703133c777cfa3292015f0c577050fd5d53103d6b2d18d7fb518ca325ccbcf2 test-bench-deps: {} maintainer: Henning Thielemann <llvm@henning-thielemann.de> synopsis: Tools for maintaining the llvm-ffi package changelog: '' basic-deps: - bytestring: ! '>=0.9 && <0.11' ? -- ^ + bytestring: '>=0.9 && <0.12' ? ^ - base: ! '>=4.5 && <5' ? -- + base: '>=4.5 && <5' - utility-ht: ! '>=0.0.9 && <0.1' ? -- + utility-ht: '>=0.0.9 && <0.1' - containers: ! '>=0.4 && <0.7' ? -- + containers: '>=0.4 && <0.7' - regex-posix: ==0.95.* ? ^ ^ + regex-posix: '>=0.95 && <0.97' ? ^^ ++++++ ^^^ all-versions: - '0.0' - 0.0.0.1 author: Henning Thielemann, Bryan O'Sullivan, Lennart Augustsson latest: 0.0.0.1 description-type: haddock + description: |- - description: ! 'The package contains tools for maintaining the FFI interface to LLVM ? ------------ - - + The package contains tools for maintaining the FFI interface to LLVM - in the @llvm-ffi@ package - <http://hackage.haskell.org/package/llvm-ffi>. - Most notably there is the @llvm-function-mangler@ - - that converts LLVM-C bindings to Haskell foreign imports.' ? - + that converts LLVM-C bindings to Haskell foreign imports. license-name: BSD-3-Clause
21
0.724138
9
12
a179134a18b943a0c82b9930629a5f34c017b884
subscriptionManager.rb
subscriptionManager.rb
class @@method @@cents #Use cents to not have to deal with floats def method puts method end def cents puts cents end #Various Transaction Types enum TX_TYPES: [ SIGNUP, RENEWAL, FAILED_CHARGE ] end #Class that associates with a payment provider class Provider @@name @@type @@apiUrl end #Class that handles the mailing operations class Mailer @@sender @@recipient @@subject #Mailer specific enums enum SUBJECTS: { SUCCESS: "Your payment was successful", FAILURE: "Your payment was UNsuccessful." } enum MESSAGES: { SUCCESS: "Congratulations you\'ve successfully paid your [post]interval[/post] bill for service totaling [post]amount[/post] with payment method [post]method[/post] indentified by [post]account[/post].", FAILURE: "Unfortunately the payment method [post]method[/post] identified by [post]account[/post] was unsuccessful for [post]amount[/post] for your [post]interval[/post] payment. Please correct payment or contact our support at [post]supportEmail[/post]" } end class User end
class @@method @@cents #Use cents to not have to deal with floats def method puts method end def cents puts cents end #Various Transaction Types enum TX_TYPES: [ SIGNUP, RENEWAL, FAILED_CHARGE ] end #Class that associates with a payment provider class Provider @@name @@type @@apiUrl end #Class that handles the mailing operations class Mailer @@sender @@recipient @@subject #Mailer specific enums enum SUBJECTS: { SUCCESS: "Your payment was successful", FAILURE: "Your payment was UNsuccessful." } enum MESSAGES: { SUCCESS: "Congratulations you\'ve successfully paid your [post]interval[/post] bill for service totaling [post]amount[/post] with payment method [post]method[/post] indentified by [post]account[/post].", FAILURE: "Unfortunately the payment method [post]method[/post] identified by [post]account[/post] was unsuccessful for [post]amount[/post] for your [post]interval[/post] payment. Please correct payment or contact our support at [post]supportEmail[/post]" } def sendMail(from, to, sub, msg) #Build message email = <<EMAIL_END From: %s To: %s Subject: %s %s EMAIL_END # Insert message params email = email % [from, to, sub, msg] # Send it from our mail server # Todo add authentication/security/TLS Net::SMTP.start('localhost') do |smtp| smtp.send_message email, from, to end end end class User end
Add method to send email.
Add method to send email. Requires a mailserver (postfix on localhost will work)
Ruby
unlicense
MagikSquirrel/RubySubscriptionManager
ruby
## Code Before: class @@method @@cents #Use cents to not have to deal with floats def method puts method end def cents puts cents end #Various Transaction Types enum TX_TYPES: [ SIGNUP, RENEWAL, FAILED_CHARGE ] end #Class that associates with a payment provider class Provider @@name @@type @@apiUrl end #Class that handles the mailing operations class Mailer @@sender @@recipient @@subject #Mailer specific enums enum SUBJECTS: { SUCCESS: "Your payment was successful", FAILURE: "Your payment was UNsuccessful." } enum MESSAGES: { SUCCESS: "Congratulations you\'ve successfully paid your [post]interval[/post] bill for service totaling [post]amount[/post] with payment method [post]method[/post] indentified by [post]account[/post].", FAILURE: "Unfortunately the payment method [post]method[/post] identified by [post]account[/post] was unsuccessful for [post]amount[/post] for your [post]interval[/post] payment. Please correct payment or contact our support at [post]supportEmail[/post]" } end class User end ## Instruction: Add method to send email. Requires a mailserver (postfix on localhost will work) ## Code After: class @@method @@cents #Use cents to not have to deal with floats def method puts method end def cents puts cents end #Various Transaction Types enum TX_TYPES: [ SIGNUP, RENEWAL, FAILED_CHARGE ] end #Class that associates with a payment provider class Provider @@name @@type @@apiUrl end #Class that handles the mailing operations class Mailer @@sender @@recipient @@subject #Mailer specific enums enum SUBJECTS: { SUCCESS: "Your payment was successful", FAILURE: "Your payment was UNsuccessful." } enum MESSAGES: { SUCCESS: "Congratulations you\'ve successfully paid your [post]interval[/post] bill for service totaling [post]amount[/post] with payment method [post]method[/post] indentified by [post]account[/post].", FAILURE: "Unfortunately the payment method [post]method[/post] identified by [post]account[/post] was unsuccessful for [post]amount[/post] for your [post]interval[/post] payment. Please correct payment or contact our support at [post]supportEmail[/post]" } def sendMail(from, to, sub, msg) #Build message email = <<EMAIL_END From: %s To: %s Subject: %s %s EMAIL_END # Insert message params email = email % [from, to, sub, msg] # Send it from our mail server # Todo add authentication/security/TLS Net::SMTP.start('localhost') do |smtp| smtp.send_message email, from, to end end end class User end
class @@method @@cents #Use cents to not have to deal with floats def method puts method end def cents puts cents end #Various Transaction Types enum TX_TYPES: [ SIGNUP, RENEWAL, FAILED_CHARGE ] end #Class that associates with a payment provider class Provider @@name @@type @@apiUrl end #Class that handles the mailing operations - class Mailer + class Mailer ? + + @@sender @@recipient @@subject #Mailer specific enums enum SUBJECTS: { SUCCESS: "Your payment was successful", FAILURE: "Your payment was UNsuccessful." } enum MESSAGES: { SUCCESS: "Congratulations you\'ve successfully paid your [post]interval[/post] bill for service totaling [post]amount[/post] with payment method [post]method[/post] indentified by [post]account[/post].", FAILURE: "Unfortunately the payment method [post]method[/post] identified by [post]account[/post] was unsuccessful for [post]amount[/post] for your [post]interval[/post] payment. Please correct payment or contact our support at [post]supportEmail[/post]" } + def sendMail(from, to, sub, msg) + + #Build message + email = <<EMAIL_END + From: %s + To: %s + Subject: %s + + %s + EMAIL_END + + # Insert message params + email = email % [from, to, sub, msg] + + # Send it from our mail server + + # Todo add authentication/security/TLS + Net::SMTP.start('localhost') do |smtp| + smtp.send_message email, from, to + end + end end + class User end -
26
0.530612
24
2
84333212bafe9682be9b620fdd1368b0d5be2908
.travis.yml
.travis.yml
language: python python: - "2.7" - "3.5" - "3.6" install: - "pip install ." - "pip install -r test_requirements.txt" script: - "pytest -v -s --doctest-modules --cov httpie_asap_auth --cov-report term-missing tests/" - "flake8 httpie_asap_auth.py" ater_success: - "coveralls"
language: python python: - "2.7" - "3.5" - "3.6" install: - "pip install ." - "pip install -r test_requirements.txt" script: - "pytest -v -s --doctest-modules --cov httpie_asap_auth --cov-report term-missing httpie_asap_auth.py tests/" - "flake8 httpie_asap_auth.py" ater_success: - "coveralls"
Add doctest fix to TravisCI too
Add doctest fix to TravisCI too
YAML
mit
jasonfriedland/httpie-asap-auth
yaml
## Code Before: language: python python: - "2.7" - "3.5" - "3.6" install: - "pip install ." - "pip install -r test_requirements.txt" script: - "pytest -v -s --doctest-modules --cov httpie_asap_auth --cov-report term-missing tests/" - "flake8 httpie_asap_auth.py" ater_success: - "coveralls" ## Instruction: Add doctest fix to TravisCI too ## Code After: language: python python: - "2.7" - "3.5" - "3.6" install: - "pip install ." - "pip install -r test_requirements.txt" script: - "pytest -v -s --doctest-modules --cov httpie_asap_auth --cov-report term-missing httpie_asap_auth.py tests/" - "flake8 httpie_asap_auth.py" ater_success: - "coveralls"
language: python python: - "2.7" - "3.5" - "3.6" install: - "pip install ." - "pip install -r test_requirements.txt" script: - - "pytest -v -s --doctest-modules --cov httpie_asap_auth --cov-report term-missing tests/" + - "pytest -v -s --doctest-modules --cov httpie_asap_auth --cov-report term-missing httpie_asap_auth.py tests/" ? ++++++++++++++++++++ - "flake8 httpie_asap_auth.py" ater_success: - "coveralls"
2
0.153846
1
1
1339be71399a7fc8efaea4f2bd892f1b54ced011
libcontextsubscriber/multithreading-tests/stress-test/provider.py
libcontextsubscriber/multithreading-tests/stress-test/provider.py
"""A test provider for the stress testing.""" # change registry this often [msec] registryChangeTimeout = 2017 from ContextKit.flexiprovider import * import gobject import time import os def update(): t = time.time() dt = int(1000*(t - round(t))) gobject.timeout_add(1000 - dt, update) v = int(round(t)) fp.set('test.int', v) fp.set('test.int2', v) print t return False pcnt = 0 def chgRegistry(): global pcnt pcnt += 1 if pcnt % 2: print "1 provider" os.system('cp 1provider.cdb cache.cdb') else: print "2 providers" os.system('cp 2providers.cdb cache.cdb') return True gobject.timeout_add(1000, update) # uncoment this to see the "Bus error" XXX gobject.timeout_add(registryChangeTimeout, chgRegistry) fp = Flexiprovider([INT('test.int'), INT('test.int2')], 'my.test.provider', 'session') fp.run()
"""A test provider for the stress testing.""" # change registry this often [msec] registryChangeTimeout = 2017 from ContextKit.flexiprovider import * import gobject import time import os def update(): t = time.time() dt = int(1000*(t - round(t))) gobject.timeout_add(1000 - dt, update) v = int(round(t)) fp.set('test.int', v) fp.set('test.int2', v) print t return False pcnt = 0 def chgRegistry(): global pcnt pcnt += 1 if pcnt % 2: print "1 provider" os.system('cp 1provider.cdb tmp.cdb; mv tmp.cdb cache.cdb') else: print "2 providers" os.system('cp 2providers.cdb tmp.cdb; mv tmp.cdb cache.cdb') return True gobject.timeout_add(1000, update) # uncoment this to see the "Bus error" XXX gobject.timeout_add(registryChangeTimeout, chgRegistry) fp = Flexiprovider([INT('test.int'), INT('test.int2')], 'my.test.provider', 'session') fp.run()
Fix stress test to avoid cdb bus error bug ref 125505
Fix stress test to avoid cdb bus error bug ref 125505 Signed-off-by: Marja Hassinen <97dfd0cfe579e2c003b71e95ee20ee035e309879@nokia.com>
Python
lgpl-2.1
rburchell/ck,rburchell/ck,rburchell/ck,rburchell/ck,rburchell/ck
python
## Code Before: """A test provider for the stress testing.""" # change registry this often [msec] registryChangeTimeout = 2017 from ContextKit.flexiprovider import * import gobject import time import os def update(): t = time.time() dt = int(1000*(t - round(t))) gobject.timeout_add(1000 - dt, update) v = int(round(t)) fp.set('test.int', v) fp.set('test.int2', v) print t return False pcnt = 0 def chgRegistry(): global pcnt pcnt += 1 if pcnt % 2: print "1 provider" os.system('cp 1provider.cdb cache.cdb') else: print "2 providers" os.system('cp 2providers.cdb cache.cdb') return True gobject.timeout_add(1000, update) # uncoment this to see the "Bus error" XXX gobject.timeout_add(registryChangeTimeout, chgRegistry) fp = Flexiprovider([INT('test.int'), INT('test.int2')], 'my.test.provider', 'session') fp.run() ## Instruction: Fix stress test to avoid cdb bus error bug ref 125505 Signed-off-by: Marja Hassinen <97dfd0cfe579e2c003b71e95ee20ee035e309879@nokia.com> ## Code After: """A test provider for the stress testing.""" # change registry this often [msec] registryChangeTimeout = 2017 from ContextKit.flexiprovider import * import gobject import time import os def update(): t = time.time() dt = int(1000*(t - round(t))) gobject.timeout_add(1000 - dt, update) v = int(round(t)) fp.set('test.int', v) fp.set('test.int2', v) print t return False pcnt = 0 def chgRegistry(): global pcnt pcnt += 1 if pcnt % 2: print "1 provider" os.system('cp 1provider.cdb tmp.cdb; mv tmp.cdb cache.cdb') else: print "2 providers" os.system('cp 2providers.cdb tmp.cdb; mv tmp.cdb cache.cdb') return True gobject.timeout_add(1000, update) # uncoment this to see the "Bus error" XXX gobject.timeout_add(registryChangeTimeout, chgRegistry) fp = Flexiprovider([INT('test.int'), INT('test.int2')], 'my.test.provider', 'session') fp.run()
"""A test provider for the stress testing.""" # change registry this often [msec] registryChangeTimeout = 2017 from ContextKit.flexiprovider import * import gobject import time import os def update(): t = time.time() dt = int(1000*(t - round(t))) gobject.timeout_add(1000 - dt, update) v = int(round(t)) fp.set('test.int', v) fp.set('test.int2', v) print t return False pcnt = 0 def chgRegistry(): global pcnt pcnt += 1 if pcnt % 2: - print "1 provider" ? ^^^^^^^^ + print "1 provider" ? ^^ - os.system('cp 1provider.cdb cache.cdb') + os.system('cp 1provider.cdb tmp.cdb; mv tmp.cdb cache.cdb') else: print "2 providers" - os.system('cp 2providers.cdb cache.cdb') + os.system('cp 2providers.cdb tmp.cdb; mv tmp.cdb cache.cdb') ? ++++++++++++++++++++ return True gobject.timeout_add(1000, update) # uncoment this to see the "Bus error" XXX gobject.timeout_add(registryChangeTimeout, chgRegistry) fp = Flexiprovider([INT('test.int'), INT('test.int2')], 'my.test.provider', 'session') fp.run()
6
0.146341
3
3
c0fa9939201ce41c45a92b03df1c425f93b4186f
lib/tracksperanto/block_init.rb
lib/tracksperanto/block_init.rb
module Tracksperanto::BlockInit def initialize(**object_attribute_hash) object_attribute_hash.map { |(k, v)| public_send("#{k}=", v) } yield(self) if block_given? end end
module Tracksperanto::BlockInit def initialize(attributes = {}) attributes.map { |(k, v)| public_send("#{k}=", v) } yield(self) if block_given? end end
Switch back to attributes for BlockInit
Switch back to attributes for BlockInit as the kwargs version would cause issues with Ruby 3
Ruby
mit
guerilla-di/tracksperanto,guerilla-di/tracksperanto,guerilla-di/tracksperanto
ruby
## Code Before: module Tracksperanto::BlockInit def initialize(**object_attribute_hash) object_attribute_hash.map { |(k, v)| public_send("#{k}=", v) } yield(self) if block_given? end end ## Instruction: Switch back to attributes for BlockInit as the kwargs version would cause issues with Ruby 3 ## Code After: module Tracksperanto::BlockInit def initialize(attributes = {}) attributes.map { |(k, v)| public_send("#{k}=", v) } yield(self) if block_given? end end
module Tracksperanto::BlockInit - def initialize(**object_attribute_hash) ? --------- --- ^ + def initialize(attributes = {}) ? ^^^^^ - object_attribute_hash.map { |(k, v)| public_send("#{k}=", v) } ? ------- --- - + attributes.map { |(k, v)| public_send("#{k}=", v) } yield(self) if block_given? end end
4
0.666667
2
2
cbf59317e634ab10f8d6a0be1647ca81a5524c72
src/sidebar.css
src/sidebar.css
body { font: message-box; } #tabs-list { list-style-type: none; padding-inline-start: 0px; mask-image: linear-gradient(to left, transparent, black 1em); } #tabs-list > li > label > input[type="checkbox"] { padding-inline-start: 0px; padding-inline-end: 0px; margin-inline-start: 0px; margin-inline-end: 0px; } #tabs-list > li { white-space: nowrap; overflow: hidden; padding: 1px; } #tabs-list > li > label { display: flex; flex-direction: row; align-items: center; } #controls { margin-inline-start: 5px; } .favicon { display: inline; width: 16px; height: 16px; margin-inline-end: 5px; margin-inline-start: 5px; } label.active { font-weight: bold; }
body { font: message-box; } #tabs-list { list-style-type: none; padding-inline-start: 0px; mask-image: linear-gradient(to left, transparent, black 1em); } #tabs-list > li > label > input[type="checkbox"] { padding-inline-start: 0px; padding-inline-end: 0px; margin-inline-start: 0px; margin-inline-end: 0px; } #tabs-list > li { white-space: nowrap; overflow: hidden; padding: 1px; } #tabs-list > li > label { display: flex; flex-direction: row; align-items: center; } #controls { margin-inline-start: 5px; } .favicon { display: inline; width: 16px; height: 16px; min-width: 16px; min-height: 16px; margin-inline-end: 5px; margin-inline-start: 5px; } label.active { font-weight: bold; }
Put minimum dimensions on favicon for regularity
Put minimum dimensions on favicon for regularity
CSS
mit
n1lsB/multi-select-tabs,mikeconley/multi-select-tabs,mikeconley/multi-select-tabs,n1lsB/multi-select-tabs
css
## Code Before: body { font: message-box; } #tabs-list { list-style-type: none; padding-inline-start: 0px; mask-image: linear-gradient(to left, transparent, black 1em); } #tabs-list > li > label > input[type="checkbox"] { padding-inline-start: 0px; padding-inline-end: 0px; margin-inline-start: 0px; margin-inline-end: 0px; } #tabs-list > li { white-space: nowrap; overflow: hidden; padding: 1px; } #tabs-list > li > label { display: flex; flex-direction: row; align-items: center; } #controls { margin-inline-start: 5px; } .favicon { display: inline; width: 16px; height: 16px; margin-inline-end: 5px; margin-inline-start: 5px; } label.active { font-weight: bold; } ## Instruction: Put minimum dimensions on favicon for regularity ## Code After: body { font: message-box; } #tabs-list { list-style-type: none; padding-inline-start: 0px; mask-image: linear-gradient(to left, transparent, black 1em); } #tabs-list > li > label > input[type="checkbox"] { padding-inline-start: 0px; padding-inline-end: 0px; margin-inline-start: 0px; margin-inline-end: 0px; } #tabs-list > li { white-space: nowrap; overflow: hidden; padding: 1px; } #tabs-list > li > label { display: flex; flex-direction: row; align-items: center; } #controls { margin-inline-start: 5px; } .favicon { display: inline; width: 16px; height: 16px; min-width: 16px; min-height: 16px; margin-inline-end: 5px; margin-inline-start: 5px; } label.active { font-weight: bold; }
body { font: message-box; } #tabs-list { list-style-type: none; padding-inline-start: 0px; mask-image: linear-gradient(to left, transparent, black 1em); } #tabs-list > li > label > input[type="checkbox"] { padding-inline-start: 0px; padding-inline-end: 0px; margin-inline-start: 0px; margin-inline-end: 0px; } #tabs-list > li { white-space: nowrap; overflow: hidden; padding: 1px; } #tabs-list > li > label { display: flex; flex-direction: row; align-items: center; } #controls { margin-inline-start: 5px; } .favicon { display: inline; width: 16px; height: 16px; + min-width: 16px; + min-height: 16px; margin-inline-end: 5px; margin-inline-start: 5px; } label.active { font-weight: bold; }
2
0.045455
2
0
e2d391d460949e40b336abd828806c28df0682e7
requirements.txt
requirements.txt
mock==1.0.1 nose==1.3.4 py==1.4.26 requests==2.5.0 responses==0.3.0 six==1.8.0 wsgiref==0.1.2
mock==1.0.1 nose==1.3.4 py==1.4.26 requests==2.5.0 responses==0.3.0 six==1.8.0
Remove wsgiref. Not sure what it is.
Remove wsgiref. Not sure what it is.
Text
mit
bellhops/pipedrive-python
text
## Code Before: mock==1.0.1 nose==1.3.4 py==1.4.26 requests==2.5.0 responses==0.3.0 six==1.8.0 wsgiref==0.1.2 ## Instruction: Remove wsgiref. Not sure what it is. ## Code After: mock==1.0.1 nose==1.3.4 py==1.4.26 requests==2.5.0 responses==0.3.0 six==1.8.0
mock==1.0.1 nose==1.3.4 py==1.4.26 requests==2.5.0 responses==0.3.0 six==1.8.0 - wsgiref==0.1.2
1
0.142857
0
1
bc3e7cf4bf12637f2a7bf380db29343ceb231064
src/jspsych-conditional-run.js
src/jspsych-conditional-run.js
jsPsych.plugins['conditional-run'] = (function () { var plugin = {}; plugin.info = { name: 'conditional-run', description: 'Only run the specified plugin if a condition is met', parameters: { 'dependentPluginParameters': { type: jsPsych.plugins.parameterType.COMPLEX, description: 'The parameters to pass to the plugin that will be run, including the type of plugin', nested: { 'type': { type: jsPsych.plugins.parameterType.STRING, description: 'The type of the plugin to use if the condition is met' } // + Other parameters relevant to the dependent plugin } }, 'conditionalFunction': { type: jsPsych.plugins.parameterType.FUNCTION, description: 'Function that will be executed when this trial is started. If it returns true, the trial is run. Otherwise, it is skipped.' } } } plugin.trial = function (display_element, trial) { if (typeof trial.conditionalFunction === 'function' && trial.conditionalFunction()) { jsPsych.plugins[trial.dependentPluginParameters.type].trial(display_element, trial.dependentPluginParameters); } else { // skip jsPsych.finishTrial(); } } return plugin; })();
jsPsych.plugins['conditional-run'] = (function () { var plugin = {}; plugin.info = { name: 'conditional-run', description: 'Only run the specified plugin if a condition is met', parameters: { 'dependentPluginParameters': { type: jsPsych.plugins.parameterType.COMPLEX, description: 'The parameters to pass to the plugin that will be run, including the type of plugin', nested: { 'type': { type: jsPsych.plugins.parameterType.STRING, description: 'The type of the plugin to use if the condition is met' } // + Other parameters relevant to the dependent plugin } }, 'conditionalFunction': { type: jsPsych.plugins.parameterType.FUNCTION, description: 'Function that will be executed when this trial is started. If it returns true, the trial is run. Otherwise, it is skipped.' } } } plugin.trial = function (display_element, trial) { if (typeof trial.conditionalFunction === 'function' && trial.conditionalFunction()) { // protect functions in the parameters (only does a shallow copy) var dependentPluginParams = Object.assign({}, trial.dependentPluginParameters); jsPsych.plugins[dependentPluginParams.type].trial(display_element, dependentPluginParams); } else { // skip jsPsych.finishTrial(); } } return plugin; })();
Enable usage with multiple jspsych timeline_variables
Enable usage with multiple jspsych timeline_variables
JavaScript
mit
mkraeva/jspsych-custom-plugins,mkraeva/jspsych-custom-plugins
javascript
## Code Before: jsPsych.plugins['conditional-run'] = (function () { var plugin = {}; plugin.info = { name: 'conditional-run', description: 'Only run the specified plugin if a condition is met', parameters: { 'dependentPluginParameters': { type: jsPsych.plugins.parameterType.COMPLEX, description: 'The parameters to pass to the plugin that will be run, including the type of plugin', nested: { 'type': { type: jsPsych.plugins.parameterType.STRING, description: 'The type of the plugin to use if the condition is met' } // + Other parameters relevant to the dependent plugin } }, 'conditionalFunction': { type: jsPsych.plugins.parameterType.FUNCTION, description: 'Function that will be executed when this trial is started. If it returns true, the trial is run. Otherwise, it is skipped.' } } } plugin.trial = function (display_element, trial) { if (typeof trial.conditionalFunction === 'function' && trial.conditionalFunction()) { jsPsych.plugins[trial.dependentPluginParameters.type].trial(display_element, trial.dependentPluginParameters); } else { // skip jsPsych.finishTrial(); } } return plugin; })(); ## Instruction: Enable usage with multiple jspsych timeline_variables ## Code After: jsPsych.plugins['conditional-run'] = (function () { var plugin = {}; plugin.info = { name: 'conditional-run', description: 'Only run the specified plugin if a condition is met', parameters: { 'dependentPluginParameters': { type: jsPsych.plugins.parameterType.COMPLEX, description: 'The parameters to pass to the plugin that will be run, including the type of plugin', nested: { 'type': { type: jsPsych.plugins.parameterType.STRING, description: 'The type of the plugin to use if the condition is met' } // + Other parameters relevant to the dependent plugin } }, 'conditionalFunction': { type: jsPsych.plugins.parameterType.FUNCTION, description: 'Function that will be executed when this trial is started. If it returns true, the trial is run. Otherwise, it is skipped.' } } } plugin.trial = function (display_element, trial) { if (typeof trial.conditionalFunction === 'function' && trial.conditionalFunction()) { // protect functions in the parameters (only does a shallow copy) var dependentPluginParams = Object.assign({}, trial.dependentPluginParameters); jsPsych.plugins[dependentPluginParams.type].trial(display_element, dependentPluginParams); } else { // skip jsPsych.finishTrial(); } } return plugin; })();
jsPsych.plugins['conditional-run'] = (function () { var plugin = {}; plugin.info = { name: 'conditional-run', description: 'Only run the specified plugin if a condition is met', parameters: { 'dependentPluginParameters': { type: jsPsych.plugins.parameterType.COMPLEX, description: 'The parameters to pass to the plugin that will be run, including the type of plugin', nested: { 'type': { type: jsPsych.plugins.parameterType.STRING, description: 'The type of the plugin to use if the condition is met' } // + Other parameters relevant to the dependent plugin } }, 'conditionalFunction': { type: jsPsych.plugins.parameterType.FUNCTION, description: 'Function that will be executed when this trial is started. If it returns true, the trial is run. Otherwise, it is skipped.' } } } plugin.trial = function (display_element, trial) { if (typeof trial.conditionalFunction === 'function' && trial.conditionalFunction()) { + // protect functions in the parameters (only does a shallow copy) + var dependentPluginParams = Object.assign({}, trial.dependentPluginParameters); - jsPsych.plugins[trial.dependentPluginParameters.type].trial(display_element, trial.dependentPluginParameters); ? ------ ---- ------ ---- + jsPsych.plugins[dependentPluginParams.type].trial(display_element, dependentPluginParams); } else { // skip jsPsych.finishTrial(); } } return plugin; })();
4
0.117647
3
1
b6d178b4dcb894180356c445b8cde644e7dc4327
Squirrel/SQRLShipItLauncher.h
Squirrel/SQRLShipItLauncher.h
// // SQRLShipItLauncher.h // Squirrel // // Created by Justin Spahr-Summers on 2013-08-12. // Copyright (c) 2013 GitHub. All rights reserved. // #import <Foundation/Foundation.h> // The domain for errors originating within SQRLShipItLauncher. extern NSString * const SQRLShipItLauncherErrorDomain; // The ShipIt service could not be started. extern const NSInteger SQRLShipItLauncherErrorCouldNotStartService; // Responsible for launching the ShipIt service to actually install an update. @interface SQRLShipItLauncher : NSObject // Attempts to launch the ShipIt service. // // error - If not NULL, set to any error that occurs. // // Returns the XPC connection established, or NULL if an error occurs. If an // error occurs in the connection, it will be automatically released. Retain it // if you'll still need it after that point. - (xpc_connection_t)launch:(NSError **)error; @end
// // SQRLShipItLauncher.h // Squirrel // // Created by Justin Spahr-Summers on 2013-08-12. // Copyright (c) 2013 GitHub. All rights reserved. // #import <Foundation/Foundation.h> // The domain for errors originating within SQRLShipItLauncher. extern NSString * const SQRLShipItLauncherErrorDomain; // The ShipIt service could not be started. extern const NSInteger SQRLShipItLauncherErrorCouldNotStartService; // Responsible for launching the ShipIt service to actually install an update. @interface SQRLShipItLauncher : NSObject // Attempts to launch the ShipIt service. // // error - If not NULL, set to any error that occurs. // // Returns the XPC connection established, or NULL if an error occurs. The // connection will be automatically released once it has completed or received // an error. Retain the connection if you'll still need it after that point. - (xpc_connection_t)launch:(NSError **)error; @end
Clarify XPC connection lifecycle for -launch:
Clarify XPC connection lifecycle for -launch:
C
mit
emiscience/Squirrel.Mac,EdZava/Squirrel.Mac,Squirrel/Squirrel.Mac,EdZava/Squirrel.Mac,Squirrel/Squirrel.Mac,emiscience/Squirrel.Mac,EdZava/Squirrel.Mac,emiscience/Squirrel.Mac,Squirrel/Squirrel.Mac
c
## Code Before: // // SQRLShipItLauncher.h // Squirrel // // Created by Justin Spahr-Summers on 2013-08-12. // Copyright (c) 2013 GitHub. All rights reserved. // #import <Foundation/Foundation.h> // The domain for errors originating within SQRLShipItLauncher. extern NSString * const SQRLShipItLauncherErrorDomain; // The ShipIt service could not be started. extern const NSInteger SQRLShipItLauncherErrorCouldNotStartService; // Responsible for launching the ShipIt service to actually install an update. @interface SQRLShipItLauncher : NSObject // Attempts to launch the ShipIt service. // // error - If not NULL, set to any error that occurs. // // Returns the XPC connection established, or NULL if an error occurs. If an // error occurs in the connection, it will be automatically released. Retain it // if you'll still need it after that point. - (xpc_connection_t)launch:(NSError **)error; @end ## Instruction: Clarify XPC connection lifecycle for -launch: ## Code After: // // SQRLShipItLauncher.h // Squirrel // // Created by Justin Spahr-Summers on 2013-08-12. // Copyright (c) 2013 GitHub. All rights reserved. // #import <Foundation/Foundation.h> // The domain for errors originating within SQRLShipItLauncher. extern NSString * const SQRLShipItLauncherErrorDomain; // The ShipIt service could not be started. extern const NSInteger SQRLShipItLauncherErrorCouldNotStartService; // Responsible for launching the ShipIt service to actually install an update. @interface SQRLShipItLauncher : NSObject // Attempts to launch the ShipIt service. // // error - If not NULL, set to any error that occurs. // // Returns the XPC connection established, or NULL if an error occurs. The // connection will be automatically released once it has completed or received // an error. Retain the connection if you'll still need it after that point. - (xpc_connection_t)launch:(NSError **)error; @end
// // SQRLShipItLauncher.h // Squirrel // // Created by Justin Spahr-Summers on 2013-08-12. // Copyright (c) 2013 GitHub. All rights reserved. // #import <Foundation/Foundation.h> // The domain for errors originating within SQRLShipItLauncher. extern NSString * const SQRLShipItLauncherErrorDomain; // The ShipIt service could not be started. extern const NSInteger SQRLShipItLauncherErrorCouldNotStartService; // Responsible for launching the ShipIt service to actually install an update. @interface SQRLShipItLauncher : NSObject // Attempts to launch the ShipIt service. // // error - If not NULL, set to any error that occurs. // - // Returns the XPC connection established, or NULL if an error occurs. If an ? ^^^^^ + // Returns the XPC connection established, or NULL if an error occurs. The ? ^^^ - // error occurs in the connection, it will be automatically released. Retain it - // if you'll still need it after that point. + // connection will be automatically released once it has completed or received + // an error. Retain the connection if you'll still need it after that point. - (xpc_connection_t)launch:(NSError **)error; @end
6
0.206897
3
3
60a940e76a46e2dc616ad9af89b3bd36297834ea
src/Route/Bank.php
src/Route/Bank.php
<?php /** * @author "Michael Collette" <metrol@metrol.net> * @package Metrol/Route * @version 1.0 * @copyright (c) 2016, Michael Collette */ namespace Metrol\Route; use Metrol; /** * Maintains the list of routes a site has registered. * */ class Bank { /** * List of route objects * * @var Metrol\Route[] */ private static $routes = array(); /** * Make a route deposit to the bank * * @param Metrol\Route $route */ public static function addRoute(Metrol\Route $route) { self::$routes[$route->getName()] = $route; } /** * Find a route by name * * @param string $routeName * * @return Metrol\Route|null */ public static function getNamedRoute($routeName) { if ( isset(self::$routes[ $routeName ]) ) { return self::$routes[ $routeName ]; } return null; } /** * Find a route for the specified Request * * @param Metrol\Request $request * * @return Metrol\Route|null */ public static function getRequestedRoute(Metrol\Request $request) { foreach ( array_reverse(self::$routes) as $route ) { $matched = Metrol\Route\Match::check($request, $route); if ( $matched ) { return $route; } } return null; } }
<?php /** * @author "Michael Collette" <metrol@metrol.net> * @package Metrol/Route * @version 1.0 * @copyright (c) 2016, Michael Collette */ namespace Metrol\Route; use Metrol; /** * Maintains the list of routes a site has registered. * */ class Bank { /** * List of route objects * * @var Metrol\Route[] */ private static $routes = array(); /** * Make a route deposit to the bank * * @param Metrol\Route $route */ public static function addRoute(Metrol\Route $route) { self::$routes[$route->getName()] = $route; } /** * Find a route by name * * @param string $routeName * * @return Metrol\Route|null */ public static function getNamedRoute($routeName) { if ( isset(self::$routes[ $routeName ]) ) { return self::$routes[ $routeName ]; } return null; } /** * Find a route for the specified Request * * @param Metrol\Route\Request $request * * @return Metrol\Route|null */ public static function getRequestedRoute(Metrol\Route\Request $request) { foreach ( array_reverse(self::$routes) as $route ) { $matched = Metrol\Route\Match::check($request, $route); if ( $matched ) { return $route; } } return null; } }
Use the Route\Request to perform a route search.
Use the Route\Request to perform a route search.
PHP
mit
Metrol/Route
php
## Code Before: <?php /** * @author "Michael Collette" <metrol@metrol.net> * @package Metrol/Route * @version 1.0 * @copyright (c) 2016, Michael Collette */ namespace Metrol\Route; use Metrol; /** * Maintains the list of routes a site has registered. * */ class Bank { /** * List of route objects * * @var Metrol\Route[] */ private static $routes = array(); /** * Make a route deposit to the bank * * @param Metrol\Route $route */ public static function addRoute(Metrol\Route $route) { self::$routes[$route->getName()] = $route; } /** * Find a route by name * * @param string $routeName * * @return Metrol\Route|null */ public static function getNamedRoute($routeName) { if ( isset(self::$routes[ $routeName ]) ) { return self::$routes[ $routeName ]; } return null; } /** * Find a route for the specified Request * * @param Metrol\Request $request * * @return Metrol\Route|null */ public static function getRequestedRoute(Metrol\Request $request) { foreach ( array_reverse(self::$routes) as $route ) { $matched = Metrol\Route\Match::check($request, $route); if ( $matched ) { return $route; } } return null; } } ## Instruction: Use the Route\Request to perform a route search. ## Code After: <?php /** * @author "Michael Collette" <metrol@metrol.net> * @package Metrol/Route * @version 1.0 * @copyright (c) 2016, Michael Collette */ namespace Metrol\Route; use Metrol; /** * Maintains the list of routes a site has registered. * */ class Bank { /** * List of route objects * * @var Metrol\Route[] */ private static $routes = array(); /** * Make a route deposit to the bank * * @param Metrol\Route $route */ public static function addRoute(Metrol\Route $route) { self::$routes[$route->getName()] = $route; } /** * Find a route by name * * @param string $routeName * * @return Metrol\Route|null */ public static function getNamedRoute($routeName) { if ( isset(self::$routes[ $routeName ]) ) { return self::$routes[ $routeName ]; } return null; } /** * Find a route for the specified Request * * @param Metrol\Route\Request $request * * @return Metrol\Route|null */ public static function getRequestedRoute(Metrol\Route\Request $request) { foreach ( array_reverse(self::$routes) as $route ) { $matched = Metrol\Route\Match::check($request, $route); if ( $matched ) { return $route; } } return null; } }
<?php /** * @author "Michael Collette" <metrol@metrol.net> * @package Metrol/Route * @version 1.0 * @copyright (c) 2016, Michael Collette */ namespace Metrol\Route; use Metrol; /** * Maintains the list of routes a site has registered. * */ class Bank { /** * List of route objects * * @var Metrol\Route[] */ private static $routes = array(); /** * Make a route deposit to the bank * * @param Metrol\Route $route */ public static function addRoute(Metrol\Route $route) { self::$routes[$route->getName()] = $route; } /** * Find a route by name * * @param string $routeName * * @return Metrol\Route|null */ public static function getNamedRoute($routeName) { if ( isset(self::$routes[ $routeName ]) ) { return self::$routes[ $routeName ]; } return null; } /** * Find a route for the specified Request * - * @param Metrol\Request $request + * @param Metrol\Route\Request $request ? ++++++ * * @return Metrol\Route|null */ - public static function getRequestedRoute(Metrol\Request $request) + public static function getRequestedRoute(Metrol\Route\Request $request) ? ++++++ { foreach ( array_reverse(self::$routes) as $route ) { $matched = Metrol\Route\Match::check($request, $route); if ( $matched ) { return $route; } } return null; } }
4
0.054054
2
2
49a013ab64f84e0ed5b68a4d70120887069fc92a
sass/_mixins.sass
sass/_mixins.sass
=offline-keyframes($name) @-webkit-keyframes #{$name} @content @-moz-keyframes #{$name} @content @-ms-keyframes #{$name} @content @-o-keyframes #{$name} @content @keyframes #{$name} @content =offline-animation($animation) -webkit-animation: $animation -moz-animation: $animation -ms-animation: $animation -o-animation: $animation animation: $animation -webkit-backface-visibility: hidden =offline-transform($transform) transform: $transform -webkit-transform: $transform -moz-transform: $transform -ms-transform: $transform -o-transform: $transform =offline-preserve-3d -webkit-transform-style: preserve-3d -moz-transform-style: preserve-3d transform-style: preserve-3d
=offline-keyframes($name) @-webkit-keyframes #{$name} @content @-moz-keyframes #{$name} @content @-ms-keyframes #{$name} @content @-o-keyframes #{$name} @content @keyframes #{$name} @content =offline-animation($animation) -webkit-animation: $animation -moz-animation: $animation -ms-animation: $animation -o-animation: $animation animation: $animation -webkit-backface-visibility: hidden =offline-animation-fill-mode($direction) -webkit-animation-fill-mode: $direction -moz-animation-fill-mode: $direction -ms-animation-fill-mode: $direction -o-animation-fill-mode: $direction animation-fill-mode: $direction =offline-transform($transform) transform: $transform -webkit-transform: $transform -moz-transform: $transform -ms-transform: $transform -o-transform: $transform =offline-preserve-3d -webkit-transform-style: preserve-3d -moz-transform-style: preserve-3d transform-style: preserve-3d
Add animation fill mode mixin
Add animation fill mode mixin
Sass
mit
zartata/offline,sombr/offline,sojimaxi/offline,mcanthony/offline,saada/offline,marcomatteocci/offline,umutc1/offline,hadifarnoud/offline,hadifarnoud/offline,matghaleb/offline,dieface/offline,sanbiv/offline,Thunderforge/offline,Thunderforge/offline,HubSpot/offline,barryvdh/offline,zartata/offline,MartinReidy/offline,sojimaxi/offline,saada/offline,viljami/offline,Climax777/offline,marcomatteocci/offline,viljami/offline,micha/offline,micha/offline,HubSpot/offline,mcanthony/offline,dieface/offline,matghaleb/offline,Climax777/offline,MartinReidy/offline,sombr/offline,sanbiv/offline
sass
## Code Before: =offline-keyframes($name) @-webkit-keyframes #{$name} @content @-moz-keyframes #{$name} @content @-ms-keyframes #{$name} @content @-o-keyframes #{$name} @content @keyframes #{$name} @content =offline-animation($animation) -webkit-animation: $animation -moz-animation: $animation -ms-animation: $animation -o-animation: $animation animation: $animation -webkit-backface-visibility: hidden =offline-transform($transform) transform: $transform -webkit-transform: $transform -moz-transform: $transform -ms-transform: $transform -o-transform: $transform =offline-preserve-3d -webkit-transform-style: preserve-3d -moz-transform-style: preserve-3d transform-style: preserve-3d ## Instruction: Add animation fill mode mixin ## Code After: =offline-keyframes($name) @-webkit-keyframes #{$name} @content @-moz-keyframes #{$name} @content @-ms-keyframes #{$name} @content @-o-keyframes #{$name} @content @keyframes #{$name} @content =offline-animation($animation) -webkit-animation: $animation -moz-animation: $animation -ms-animation: $animation -o-animation: $animation animation: $animation -webkit-backface-visibility: hidden =offline-animation-fill-mode($direction) -webkit-animation-fill-mode: $direction -moz-animation-fill-mode: $direction -ms-animation-fill-mode: $direction -o-animation-fill-mode: $direction animation-fill-mode: $direction =offline-transform($transform) transform: $transform -webkit-transform: $transform -moz-transform: $transform -ms-transform: $transform -o-transform: $transform =offline-preserve-3d -webkit-transform-style: preserve-3d -moz-transform-style: preserve-3d transform-style: preserve-3d
=offline-keyframes($name) @-webkit-keyframes #{$name} @content @-moz-keyframes #{$name} @content @-ms-keyframes #{$name} @content @-o-keyframes #{$name} @content @keyframes #{$name} @content =offline-animation($animation) -webkit-animation: $animation -moz-animation: $animation -ms-animation: $animation -o-animation: $animation animation: $animation -webkit-backface-visibility: hidden + =offline-animation-fill-mode($direction) + -webkit-animation-fill-mode: $direction + -moz-animation-fill-mode: $direction + -ms-animation-fill-mode: $direction + -o-animation-fill-mode: $direction + animation-fill-mode: $direction + =offline-transform($transform) transform: $transform -webkit-transform: $transform -moz-transform: $transform -ms-transform: $transform -o-transform: $transform =offline-preserve-3d -webkit-transform-style: preserve-3d -moz-transform-style: preserve-3d transform-style: preserve-3d
7
0.225806
7
0
122f9363682e5de8ce4056c4c05c1eaf8935cf19
src/libstddjb/cdb_free.c
src/libstddjb/cdb_free.c
/* ISC license. */ #include <sys/mman.h> #include <skalibs/cdb.h> extern void cdb_free (struct cdb *c) { if (c->map) munmap(c->map, c->size) ; *c = cdb_zero ; }
/* ISC license. */ #include <sys/mman.h> #include <errno.h> #include <skalibs/cdb.h> extern void cdb_free (struct cdb *c) { if (c->map) { int e = errno ; munmap(c->map, c->size) ; errno = e ; } *c = cdb_zero ; }
Save errno when freeing a cdb
Save errno when freeing a cdb Signed-off-by: Laurent Bercot <3aa9adbbb49a4d5ab9c798d5e366f54570870800@appnovation.com>
C
isc
skarnet/skalibs,skarnet/skalibs
c
## Code Before: /* ISC license. */ #include <sys/mman.h> #include <skalibs/cdb.h> extern void cdb_free (struct cdb *c) { if (c->map) munmap(c->map, c->size) ; *c = cdb_zero ; } ## Instruction: Save errno when freeing a cdb Signed-off-by: Laurent Bercot <3aa9adbbb49a4d5ab9c798d5e366f54570870800@appnovation.com> ## Code After: /* ISC license. */ #include <sys/mman.h> #include <errno.h> #include <skalibs/cdb.h> extern void cdb_free (struct cdb *c) { if (c->map) { int e = errno ; munmap(c->map, c->size) ; errno = e ; } *c = cdb_zero ; }
/* ISC license. */ #include <sys/mman.h> + #include <errno.h> + #include <skalibs/cdb.h> extern void cdb_free (struct cdb *c) { + if (c->map) + { + int e = errno ; - if (c->map) munmap(c->map, c->size) ; ? -- -------- + munmap(c->map, c->size) ; + errno = e ; + } *c = cdb_zero ; }
9
0.9
8
1
aaf25fafae81a1ce9dc13739a0780aa085bcf045
lib/sequent/test/database_helpers.rb
lib/sequent/test/database_helpers.rb
module Sequent module Test module DatabaseHelpers class << self # Utility method to let Sequent handle creation of sequent_schema and view_schema # rather than using the available rake tasks. def maintain_test_database_schema(env: 'test') fail ArgumentError, "env must be test or spec but was '#{env}'" unless %w[test spec].include?(env) Migrations::SequentSchema.create_sequent_schema_if_not_exists(env: env, fail_if_exists: false) Migrations::ViewSchema.create_view_tables(env: env) end end end end end
module Sequent module Test module DatabaseHelpers ALLOWED_ENS = %w[development test spec].freeze class << self # Utility method to let Sequent handle creation of sequent_schema and view_schema # rather than using the available rake tasks. def maintain_test_database_schema(env: 'test') fail ArgumentError, "env must one of [#{ALLOWED_ENS.join(',')}] '#{env}'" unless ALLOWED_ENS.include?(env) Migrations::SequentSchema.create_sequent_schema_if_not_exists(env: env, fail_if_exists: false) Migrations::ViewSchema.create_view_tables(env: env) end end end end end
Allow maintain_test_database_schema usage for development as well
Allow maintain_test_database_schema usage for development as well Handy if you programmatically want to create the database schema in development.
Ruby
mit
zilverline/sequent,zilverline/sequent
ruby
## Code Before: module Sequent module Test module DatabaseHelpers class << self # Utility method to let Sequent handle creation of sequent_schema and view_schema # rather than using the available rake tasks. def maintain_test_database_schema(env: 'test') fail ArgumentError, "env must be test or spec but was '#{env}'" unless %w[test spec].include?(env) Migrations::SequentSchema.create_sequent_schema_if_not_exists(env: env, fail_if_exists: false) Migrations::ViewSchema.create_view_tables(env: env) end end end end end ## Instruction: Allow maintain_test_database_schema usage for development as well Handy if you programmatically want to create the database schema in development. ## Code After: module Sequent module Test module DatabaseHelpers ALLOWED_ENS = %w[development test spec].freeze class << self # Utility method to let Sequent handle creation of sequent_schema and view_schema # rather than using the available rake tasks. def maintain_test_database_schema(env: 'test') fail ArgumentError, "env must one of [#{ALLOWED_ENS.join(',')}] '#{env}'" unless ALLOWED_ENS.include?(env) Migrations::SequentSchema.create_sequent_schema_if_not_exists(env: env, fail_if_exists: false) Migrations::ViewSchema.create_view_tables(env: env) end end end end end
module Sequent module Test module DatabaseHelpers + ALLOWED_ENS = %w[development test spec].freeze + class << self # Utility method to let Sequent handle creation of sequent_schema and view_schema # rather than using the available rake tasks. def maintain_test_database_schema(env: 'test') - fail ArgumentError, "env must be test or spec but was '#{env}'" unless %w[test spec].include?(env) + fail ArgumentError, "env must one of [#{ALLOWED_ENS.join(',')}] '#{env}'" unless ALLOWED_ENS.include?(env) Migrations::SequentSchema.create_sequent_schema_if_not_exists(env: env, fail_if_exists: false) Migrations::ViewSchema.create_view_tables(env: env) end end end end end
4
0.235294
3
1
abdcfec66a83eb906e9bd5280c394445f7abf135
src/sentry/static/sentry/app/utils/deviceNameMapper.jsx
src/sentry/static/sentry/app/utils/deviceNameMapper.jsx
import iOSDeviceList from 'ios-device-list'; export default function(model) { const modelIdentifier = model.split(' ')[0]; const modelId = model.split(' ').splice(1).join(' '); const modelName = iOSDeviceList.generationByIdentifier(modelIdentifier); return modelName === undefined ? model : modelName + ' ' + modelId; }
import iOSDeviceList from 'ios-device-list'; export default function(model) { if (!model) { return null; } const modelIdentifier = model.split(' ')[0]; const modelId = model.split(' ').splice(1).join(' '); const modelName = iOSDeviceList.generationByIdentifier(modelIdentifier); return modelName === undefined ? model : modelName + ' ' + modelId; }
Make the device mapper work with null and undefined
Make the device mapper work with null and undefined
JSX
bsd-3-clause
JackDanger/sentry,jean/sentry,ifduyue/sentry,beeftornado/sentry,ifduyue/sentry,BuildingLink/sentry,zenefits/sentry,mvaled/sentry,zenefits/sentry,JackDanger/sentry,gencer/sentry,zenefits/sentry,mvaled/sentry,looker/sentry,looker/sentry,JamesMura/sentry,gencer/sentry,JamesMura/sentry,ifduyue/sentry,BuildingLink/sentry,BuildingLink/sentry,jean/sentry,gencer/sentry,zenefits/sentry,looker/sentry,gencer/sentry,jean/sentry,looker/sentry,jean/sentry,mvaled/sentry,beeftornado/sentry,JamesMura/sentry,beeftornado/sentry,BuildingLink/sentry,ifduyue/sentry,JackDanger/sentry,zenefits/sentry,gencer/sentry,ifduyue/sentry,mvaled/sentry,JamesMura/sentry,jean/sentry,looker/sentry,JamesMura/sentry,mvaled/sentry,BuildingLink/sentry,mvaled/sentry
jsx
## Code Before: import iOSDeviceList from 'ios-device-list'; export default function(model) { const modelIdentifier = model.split(' ')[0]; const modelId = model.split(' ').splice(1).join(' '); const modelName = iOSDeviceList.generationByIdentifier(modelIdentifier); return modelName === undefined ? model : modelName + ' ' + modelId; } ## Instruction: Make the device mapper work with null and undefined ## Code After: import iOSDeviceList from 'ios-device-list'; export default function(model) { if (!model) { return null; } const modelIdentifier = model.split(' ')[0]; const modelId = model.split(' ').splice(1).join(' '); const modelName = iOSDeviceList.generationByIdentifier(modelIdentifier); return modelName === undefined ? model : modelName + ' ' + modelId; }
import iOSDeviceList from 'ios-device-list'; export default function(model) { + if (!model) { + return null; + } - const modelIdentifier = model.split(' ')[0]; ? -- + const modelIdentifier = model.split(' ')[0]; - const modelId = model.split(' ').splice(1).join(' '); ? -- + const modelId = model.split(' ').splice(1).join(' '); - const modelName = iOSDeviceList.generationByIdentifier(modelIdentifier); ? -- + const modelName = iOSDeviceList.generationByIdentifier(modelIdentifier); - return modelName === undefined ? model : modelName + ' ' + modelId; ? -- + return modelName === undefined ? model : modelName + ' ' + modelId; }
11
1.375
7
4
2aec558cb2518426284b0a6bca79ab87178a5ccb
TrackedViews.js
TrackedViews.js
/** * @flow */ import React, { Component, Text, View, } from 'react-native'; import {registerView, unregisterView} from './ViewTracker' /** * Higher-order component that turns a built-in View component into a component * that is tracked with the key specified in the viewKey prop. If the viewKey * prop is not specified, then no tracking is done. */ const createTrackedView = (ViewComponent: any) => class TrackedComponent extends Component { componentDidMount() { const {viewKey} = this.props; if (viewKey) { registerView(viewKey, this.refs.viewRef); } } componentWillUnmount() { const {viewKey} = this.props; if (viewKey) { unregisterView(viewKey, this.refs.viewRef); } } render() { const {viewKey, ...childProps} = this.props; return <ViewComponent ref="viewRef" {...childProps} /> } }; export const TrackedView = createTrackedView(View); export const TrackedText = createTrackedView(Text);
/** * @flow */ import React, { Component, Text, View, } from 'react-native'; import {registerView, unregisterView} from './ViewTracker' /** * Higher-order component that turns a built-in View component into a component * that is tracked with the key specified in the viewKey prop. If the viewKey * prop is not specified, then no tracking is done. */ const createTrackedView = (ViewComponent: any) => class TrackedComponent extends Component { componentDidMount() { const {viewKey} = this.props; if (viewKey) { registerView(viewKey, this.refs.viewRef); } } componentWillUpdate(nextProps: any) { const {viewKey} = this.props; if (viewKey && !viewKey.equals(nextProps.viewKey)) { unregisterView(viewKey, this.refs.viewRef); } } componentDidUpdate(prevProps: any) { const {viewKey} = this.props; if (viewKey && !viewKey.equals(prevProps.viewKey)) { registerView(viewKey, this.refs.viewRef); } } componentWillUnmount() { const {viewKey} = this.props; if (viewKey) { unregisterView(viewKey, this.refs.viewRef); } } render() { const {viewKey, ...childProps} = this.props; return <ViewComponent ref="viewRef" {...childProps} /> } }; export const TrackedView = createTrackedView(View); export const TrackedText = createTrackedView(Text);
Fix crash when dragging definitions
Fix crash when dragging definitions I was accidentally updating the view key for a view, and the tracked view code couldn't handle prop changes.
JavaScript
mit
alangpierce/LambdaCalculusPlayground,alangpierce/LambdaCalculusPlayground,alangpierce/LambdaCalculusPlayground
javascript
## Code Before: /** * @flow */ import React, { Component, Text, View, } from 'react-native'; import {registerView, unregisterView} from './ViewTracker' /** * Higher-order component that turns a built-in View component into a component * that is tracked with the key specified in the viewKey prop. If the viewKey * prop is not specified, then no tracking is done. */ const createTrackedView = (ViewComponent: any) => class TrackedComponent extends Component { componentDidMount() { const {viewKey} = this.props; if (viewKey) { registerView(viewKey, this.refs.viewRef); } } componentWillUnmount() { const {viewKey} = this.props; if (viewKey) { unregisterView(viewKey, this.refs.viewRef); } } render() { const {viewKey, ...childProps} = this.props; return <ViewComponent ref="viewRef" {...childProps} /> } }; export const TrackedView = createTrackedView(View); export const TrackedText = createTrackedView(Text); ## Instruction: Fix crash when dragging definitions I was accidentally updating the view key for a view, and the tracked view code couldn't handle prop changes. ## Code After: /** * @flow */ import React, { Component, Text, View, } from 'react-native'; import {registerView, unregisterView} from './ViewTracker' /** * Higher-order component that turns a built-in View component into a component * that is tracked with the key specified in the viewKey prop. If the viewKey * prop is not specified, then no tracking is done. */ const createTrackedView = (ViewComponent: any) => class TrackedComponent extends Component { componentDidMount() { const {viewKey} = this.props; if (viewKey) { registerView(viewKey, this.refs.viewRef); } } componentWillUpdate(nextProps: any) { const {viewKey} = this.props; if (viewKey && !viewKey.equals(nextProps.viewKey)) { unregisterView(viewKey, this.refs.viewRef); } } componentDidUpdate(prevProps: any) { const {viewKey} = this.props; if (viewKey && !viewKey.equals(prevProps.viewKey)) { registerView(viewKey, this.refs.viewRef); } } componentWillUnmount() { const {viewKey} = this.props; if (viewKey) { unregisterView(viewKey, this.refs.viewRef); } } render() { const {viewKey, ...childProps} = this.props; return <ViewComponent ref="viewRef" {...childProps} /> } }; export const TrackedView = createTrackedView(View); export const TrackedText = createTrackedView(Text);
/** * @flow */ import React, { Component, Text, View, } from 'react-native'; import {registerView, unregisterView} from './ViewTracker' /** * Higher-order component that turns a built-in View component into a component * that is tracked with the key specified in the viewKey prop. If the viewKey * prop is not specified, then no tracking is done. */ const createTrackedView = (ViewComponent: any) => class TrackedComponent extends Component { componentDidMount() { const {viewKey} = this.props; if (viewKey) { registerView(viewKey, this.refs.viewRef); } } + componentWillUpdate(nextProps: any) { + const {viewKey} = this.props; + if (viewKey && !viewKey.equals(nextProps.viewKey)) { + unregisterView(viewKey, this.refs.viewRef); + } + } + + componentDidUpdate(prevProps: any) { + const {viewKey} = this.props; + if (viewKey && !viewKey.equals(prevProps.viewKey)) { + registerView(viewKey, this.refs.viewRef); + } + } + componentWillUnmount() { const {viewKey} = this.props; if (viewKey) { unregisterView(viewKey, this.refs.viewRef); } } render() { const {viewKey, ...childProps} = this.props; return <ViewComponent ref="viewRef" {...childProps} /> } }; export const TrackedView = createTrackedView(View); export const TrackedText = createTrackedView(Text);
14
0.35
14
0
19825a93cfefc401c8514b4a7f8e0cfc8331d378
hieradata/common.yaml
hieradata/common.yaml
--- classes: - ci_environment::base - ci_environment::dns ssl::params::ssl_path: '/etc/ssl' ssl::params::ssl_cert_file: 'certs/ssl-cert-snakeoil.pem' ssl::params::ssl_key_file: 'private/ssl-cert-snakeoil.key'
--- classes: - ci_environment::base - ci_environment::dns jenkins::lts: 1 ssl::params::ssl_path: '/etc/ssl' ssl::params::ssl_cert_file: 'certs/ssl-cert-snakeoil.pem' ssl::params::ssl_key_file: 'private/ssl-cert-snakeoil.key'
Switch to Jenkins LTS releases
Switch to Jenkins LTS releases These should be a bit more stable (better tested and changing less frequently) than the weekly point releases. Prompted by compatibility issues with plugins after an automatic upgrade on `ci.alphagov` this week: gds/puppet@e7f69a2. This will replace the existing repo entry but any installs on existing machines will need to be downgraded manually. Might need testing with the plugins you're currently playing with.
YAML
mit
alphagov/ci-puppet,alphagov/ci-puppet,boffbowsh/ci-puppet,boffbowsh/ci-puppet,alphagov/ci-puppet,alphagov/ci-puppet,boffbowsh/ci-puppet,boffbowsh/ci-puppet
yaml
## Code Before: --- classes: - ci_environment::base - ci_environment::dns ssl::params::ssl_path: '/etc/ssl' ssl::params::ssl_cert_file: 'certs/ssl-cert-snakeoil.pem' ssl::params::ssl_key_file: 'private/ssl-cert-snakeoil.key' ## Instruction: Switch to Jenkins LTS releases These should be a bit more stable (better tested and changing less frequently) than the weekly point releases. Prompted by compatibility issues with plugins after an automatic upgrade on `ci.alphagov` this week: gds/puppet@e7f69a2. This will replace the existing repo entry but any installs on existing machines will need to be downgraded manually. Might need testing with the plugins you're currently playing with. ## Code After: --- classes: - ci_environment::base - ci_environment::dns jenkins::lts: 1 ssl::params::ssl_path: '/etc/ssl' ssl::params::ssl_cert_file: 'certs/ssl-cert-snakeoil.pem' ssl::params::ssl_key_file: 'private/ssl-cert-snakeoil.key'
--- classes: - ci_environment::base - ci_environment::dns + jenkins::lts: 1 + ssl::params::ssl_path: '/etc/ssl' ssl::params::ssl_cert_file: 'certs/ssl-cert-snakeoil.pem' ssl::params::ssl_key_file: 'private/ssl-cert-snakeoil.key'
2
0.25
2
0
47a30d95db1bfad9864b9e3330e7936879c29b3b
docs/matrix/host/README.md
docs/matrix/host/README.md
Assume that we're ready to create own matrix of virtual servers. What's needed to have for that? - Machine with **Ubuntu 16.04 LTS (64 bit)** - `openssh-server` configured for key-based access - Root or no-password `sudo` user ## Questions Some points you might be interested in. ### Whether host for matrix can be a virtual machine? Yes. But it's **definitely not recommended**, because you will create virtual machines inside of virtual machine. Also, nested virtualization must be supported on hardware level. And be ready for slower usability doing this weird way.
Assume that we're ready to create own matrix of virtual servers. What's needed to have for that? - Machine with **Ubuntu 16.04 LTS (64 bit)** - `openssh-server` configured for key-based access - Root or no-password `sudo` user ## Questions Some points you might be interested in. ### Whether host for matrix can be a virtual machine? Yes. But it's **definitely not recommended**, because you will create virtual machines inside of virtual machine. Also, nested virtualization must be supported on hardware level. And be ready for slower usability doing this weird way. ### Can I restrict SSH access to host by IP? Yes. Enable [strict SSH policy](../../../matrix/vars/os-configuration.yml#L3-L4) and [list allowed hosts](../../../matrix/vars/os-configuration.yml#L12-L13). **Note**: list of allowed hosts will contain your current IP even when configuration is empty. This ensures that you never lose an access to server.
Document IP-based SSH access restriction to host
[CIKit][Matrix] Document IP-based SSH access restriction to host
Markdown
apache-2.0
BR0kEN-/cikit,BR0kEN-/cikit,BR0kEN-/cikit,BR0kEN-/cikit,BR0kEN-/cikit
markdown
## Code Before: Assume that we're ready to create own matrix of virtual servers. What's needed to have for that? - Machine with **Ubuntu 16.04 LTS (64 bit)** - `openssh-server` configured for key-based access - Root or no-password `sudo` user ## Questions Some points you might be interested in. ### Whether host for matrix can be a virtual machine? Yes. But it's **definitely not recommended**, because you will create virtual machines inside of virtual machine. Also, nested virtualization must be supported on hardware level. And be ready for slower usability doing this weird way. ## Instruction: [CIKit][Matrix] Document IP-based SSH access restriction to host ## Code After: Assume that we're ready to create own matrix of virtual servers. What's needed to have for that? - Machine with **Ubuntu 16.04 LTS (64 bit)** - `openssh-server` configured for key-based access - Root or no-password `sudo` user ## Questions Some points you might be interested in. ### Whether host for matrix can be a virtual machine? Yes. But it's **definitely not recommended**, because you will create virtual machines inside of virtual machine. Also, nested virtualization must be supported on hardware level. And be ready for slower usability doing this weird way. ### Can I restrict SSH access to host by IP? Yes. Enable [strict SSH policy](../../../matrix/vars/os-configuration.yml#L3-L4) and [list allowed hosts](../../../matrix/vars/os-configuration.yml#L12-L13). **Note**: list of allowed hosts will contain your current IP even when configuration is empty. This ensures that you never lose an access to server.
Assume that we're ready to create own matrix of virtual servers. What's needed to have for that? - Machine with **Ubuntu 16.04 LTS (64 bit)** - `openssh-server` configured for key-based access - Root or no-password `sudo` user ## Questions Some points you might be interested in. ### Whether host for matrix can be a virtual machine? Yes. But it's **definitely not recommended**, because you will create virtual machines inside of virtual machine. Also, nested virtualization must be supported on hardware level. And be ready for slower usability doing this weird way. + + ### Can I restrict SSH access to host by IP? + + Yes. Enable [strict SSH policy](../../../matrix/vars/os-configuration.yml#L3-L4) and [list allowed hosts](../../../matrix/vars/os-configuration.yml#L12-L13). + + **Note**: list of allowed hosts will contain your current IP even when configuration is empty. This ensures that you never lose an access to server.
6
0.428571
6
0
43a94ffdf83504beaeb3ac636d3253b5ba80ff84
Cargo.toml
Cargo.toml
cargo-features = ["edition"] [package] name = "rustc_codegen_cranelift" version = "0.1.0" authors = ["bjorn3 <bjorn3@users.noreply.github.com>"] edition = "2018" [lib] crate-type = ["dylib"] [dependencies] #cranelift = "0.14.0" #cranelift-module = "0.14.0" #cranelift-simplejit = "0.14.0" #cranelift-faerie = "0.14.0" cranelift = { git = "https://github.com/CraneStation/cranelift.git" } cranelift-module = { git = "https://github.com/CraneStation/cranelift.git" } cranelift-simplejit = { git = "https://github.com/CraneStation/cranelift.git" } cranelift-faerie = { git = "https://github.com/CraneStation/cranelift.git" } target-lexicon = "0.0.3" #goblin = "0.0.17" faerie = "0.4.4" ar = "0.6.0" bitflags = "1.0.3"
cargo-features = ["edition"] [package] name = "rustc_codegen_cranelift" version = "0.1.0" authors = ["bjorn3 <bjorn3@users.noreply.github.com>"] edition = "2018" [lib] crate-type = ["dylib"] [dependencies] #cranelift = "0.14.0" #cranelift-module = "0.14.0" #cranelift-simplejit = "0.14.0" #cranelift-faerie = "0.14.0" cranelift = { git = "https://github.com/CraneStation/cranelift.git" } cranelift-module = { git = "https://github.com/CraneStation/cranelift.git" } cranelift-simplejit = { git = "https://github.com/CraneStation/cranelift.git" } cranelift-faerie = { git = "https://github.com/CraneStation/cranelift.git" } target-lexicon = "0.0.3" #goblin = "0.0.17" faerie = "0.4.4" ar = "0.6.0" bitflags = "1.0.3" # Uncomment to use local checkout of cranelift #[patch."https://github.com/CraneStation/cranelift.git"] #cranelift = { path = "../cranelift/lib/umbrella" } #cranelift-module = { path = "../cranelift/lib/module" } #cranelift-simplejit = { path = "../cranelift/lib/simplejit" } #cranelift-faerie = { path = "../cranelift/lib/faerie" }
Add comment about how to use local cranelift checkout
Add comment about how to use local cranelift checkout
TOML
apache-2.0
graydon/rust,graydon/rust,graydon/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,aidancully/rust,aidancully/rust,aidancully/rust
toml
## Code Before: cargo-features = ["edition"] [package] name = "rustc_codegen_cranelift" version = "0.1.0" authors = ["bjorn3 <bjorn3@users.noreply.github.com>"] edition = "2018" [lib] crate-type = ["dylib"] [dependencies] #cranelift = "0.14.0" #cranelift-module = "0.14.0" #cranelift-simplejit = "0.14.0" #cranelift-faerie = "0.14.0" cranelift = { git = "https://github.com/CraneStation/cranelift.git" } cranelift-module = { git = "https://github.com/CraneStation/cranelift.git" } cranelift-simplejit = { git = "https://github.com/CraneStation/cranelift.git" } cranelift-faerie = { git = "https://github.com/CraneStation/cranelift.git" } target-lexicon = "0.0.3" #goblin = "0.0.17" faerie = "0.4.4" ar = "0.6.0" bitflags = "1.0.3" ## Instruction: Add comment about how to use local cranelift checkout ## Code After: cargo-features = ["edition"] [package] name = "rustc_codegen_cranelift" version = "0.1.0" authors = ["bjorn3 <bjorn3@users.noreply.github.com>"] edition = "2018" [lib] crate-type = ["dylib"] [dependencies] #cranelift = "0.14.0" #cranelift-module = "0.14.0" #cranelift-simplejit = "0.14.0" #cranelift-faerie = "0.14.0" cranelift = { git = "https://github.com/CraneStation/cranelift.git" } cranelift-module = { git = "https://github.com/CraneStation/cranelift.git" } cranelift-simplejit = { git = "https://github.com/CraneStation/cranelift.git" } cranelift-faerie = { git = "https://github.com/CraneStation/cranelift.git" } target-lexicon = "0.0.3" #goblin = "0.0.17" faerie = "0.4.4" ar = "0.6.0" bitflags = "1.0.3" # Uncomment to use local checkout of cranelift #[patch."https://github.com/CraneStation/cranelift.git"] #cranelift = { path = "../cranelift/lib/umbrella" } #cranelift-module = { path = "../cranelift/lib/module" } #cranelift-simplejit = { path = "../cranelift/lib/simplejit" } #cranelift-faerie = { path = "../cranelift/lib/faerie" }
cargo-features = ["edition"] [package] name = "rustc_codegen_cranelift" version = "0.1.0" authors = ["bjorn3 <bjorn3@users.noreply.github.com>"] edition = "2018" [lib] crate-type = ["dylib"] [dependencies] #cranelift = "0.14.0" #cranelift-module = "0.14.0" #cranelift-simplejit = "0.14.0" #cranelift-faerie = "0.14.0" cranelift = { git = "https://github.com/CraneStation/cranelift.git" } cranelift-module = { git = "https://github.com/CraneStation/cranelift.git" } cranelift-simplejit = { git = "https://github.com/CraneStation/cranelift.git" } cranelift-faerie = { git = "https://github.com/CraneStation/cranelift.git" } target-lexicon = "0.0.3" #goblin = "0.0.17" faerie = "0.4.4" ar = "0.6.0" bitflags = "1.0.3" + + # Uncomment to use local checkout of cranelift + #[patch."https://github.com/CraneStation/cranelift.git"] + #cranelift = { path = "../cranelift/lib/umbrella" } + #cranelift-module = { path = "../cranelift/lib/module" } + #cranelift-simplejit = { path = "../cranelift/lib/simplejit" } + #cranelift-faerie = { path = "../cranelift/lib/faerie" }
7
0.269231
7
0
347d577686b208520a139f926fcea031e24a881d
roles/dynect_session/handlers/main.yml
roles/dynect_session/handlers/main.yml
--- # file: roles/dynect_session/handlers/main.yml - name: End DynECT API session local_action: > command curl -s -X DELETE -H 'Content-Type: application/json' -H 'Auth-Token: {{ dynect_session_token }}' {{ dynect_api_url }}/Session/ changed_when: False
--- - name: End DynECT session local_action: uri method=DELETE url="{{ dynect_api_url | mandatory }}/Session/" HEADER_Content-Type="application/json" HEADER_Auth-Token="{{ dynect_session_token | mandatory }}" changed_when: False
Use the Ansible uri module for ending DynECT session
Use the Ansible uri module for ending DynECT session
YAML
agpl-3.0
sakaal/service_commons_ansible
yaml
## Code Before: --- # file: roles/dynect_session/handlers/main.yml - name: End DynECT API session local_action: > command curl -s -X DELETE -H 'Content-Type: application/json' -H 'Auth-Token: {{ dynect_session_token }}' {{ dynect_api_url }}/Session/ changed_when: False ## Instruction: Use the Ansible uri module for ending DynECT session ## Code After: --- - name: End DynECT session local_action: uri method=DELETE url="{{ dynect_api_url | mandatory }}/Session/" HEADER_Content-Type="application/json" HEADER_Auth-Token="{{ dynect_session_token | mandatory }}" changed_when: False
--- - # file: roles/dynect_session/handlers/main.yml - - name: End DynECT API session ? ---- + - name: End DynECT session + local_action: uri method=DELETE - local_action: > - command curl -s -X DELETE -H 'Content-Type: application/json' - -H 'Auth-Token: {{ dynect_session_token }}' - {{ dynect_api_url }}/Session/ + url="{{ dynect_api_url | mandatory }}/Session/" ? +++++ ++++++++++++ + + HEADER_Content-Type="application/json" + HEADER_Auth-Token="{{ dynect_session_token | mandatory }}" changed_when: False
11
1.222222
5
6
9a6d5bf9c655f3c90998f6926d7fb630913fc4d8
pkgs/development/libraries/libva/default.nix
pkgs/development/libraries/libva/default.nix
{ stdenv, fetchurl, libX11, pkgconfig, libXext, mesa, libdrm, libXfixes }: stdenv.mkDerivation rec { name = "libva-1.2.1"; src = fetchurl { url = "http://www.freedesktop.org/software/vaapi/releases/libva/${name}.tar.bz2"; sha1 = "f716a4cadd670b14f44a2e833f96a2c509956339"; }; buildInputs = [ libX11 libXext pkgconfig mesa libdrm libXfixes ]; configureFlags = [ "--enable-glx" ]; meta = { homepage = http://www.freedesktop.org/wiki/Software/vaapi; license = "MIT"; description = "VAAPI library: Video Acceleration API"; }; }
{ stdenv, fetchurl, libX11, pkgconfig, libXext, mesa, libdrm, libXfixes }: stdenv.mkDerivation rec { name = "libva-1.1.1"; src = fetchurl { url = "http://www.freedesktop.org/software/vaapi/releases/libva/${name}.tar.bz2"; sha256 = "0kfdcrzcr82g15l0vvmm6rqr0f0604d4dgrza78gn6bfx7rppby0"; }; buildInputs = [ libX11 libXext pkgconfig mesa libdrm libXfixes ]; configureFlags = [ "--enable-glx" ]; meta = { homepage = http://www.freedesktop.org/wiki/Software/vaapi; license = "MIT"; description = "VAAPI library: Video Acceleration API"; }; }
Revert "libva: update (fix h264encode)"
Revert "libva: update (fix h264encode)" It breaks the latest vlc, and I don't need the new libva that much. http://hydra.nixos.org/build/5540612/nixlog/1/tail-reload This reverts commit 6a13cd01ac76465f7ce6397075ea8edeab434a74.
Nix
mit
SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,triton/triton,NixOS/nixpkgs,triton/triton,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,triton/triton,NixOS/nixpkgs,triton/triton,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,triton/triton,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,triton/triton,SymbiFlow/nixpkgs,triton/triton,NixOS/nixpkgs,NixOS/nixpkgs,triton/triton,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs
nix
## Code Before: { stdenv, fetchurl, libX11, pkgconfig, libXext, mesa, libdrm, libXfixes }: stdenv.mkDerivation rec { name = "libva-1.2.1"; src = fetchurl { url = "http://www.freedesktop.org/software/vaapi/releases/libva/${name}.tar.bz2"; sha1 = "f716a4cadd670b14f44a2e833f96a2c509956339"; }; buildInputs = [ libX11 libXext pkgconfig mesa libdrm libXfixes ]; configureFlags = [ "--enable-glx" ]; meta = { homepage = http://www.freedesktop.org/wiki/Software/vaapi; license = "MIT"; description = "VAAPI library: Video Acceleration API"; }; } ## Instruction: Revert "libva: update (fix h264encode)" It breaks the latest vlc, and I don't need the new libva that much. http://hydra.nixos.org/build/5540612/nixlog/1/tail-reload This reverts commit 6a13cd01ac76465f7ce6397075ea8edeab434a74. ## Code After: { stdenv, fetchurl, libX11, pkgconfig, libXext, mesa, libdrm, libXfixes }: stdenv.mkDerivation rec { name = "libva-1.1.1"; src = fetchurl { url = "http://www.freedesktop.org/software/vaapi/releases/libva/${name}.tar.bz2"; sha256 = "0kfdcrzcr82g15l0vvmm6rqr0f0604d4dgrza78gn6bfx7rppby0"; }; buildInputs = [ libX11 libXext pkgconfig mesa libdrm libXfixes ]; configureFlags = [ "--enable-glx" ]; meta = { homepage = http://www.freedesktop.org/wiki/Software/vaapi; license = "MIT"; description = "VAAPI library: Video Acceleration API"; }; }
{ stdenv, fetchurl, libX11, pkgconfig, libXext, mesa, libdrm, libXfixes }: stdenv.mkDerivation rec { - name = "libva-1.2.1"; ? ^ + name = "libva-1.1.1"; ? ^ src = fetchurl { url = "http://www.freedesktop.org/software/vaapi/releases/libva/${name}.tar.bz2"; - sha1 = "f716a4cadd670b14f44a2e833f96a2c509956339"; + sha256 = "0kfdcrzcr82g15l0vvmm6rqr0f0604d4dgrza78gn6bfx7rppby0"; }; buildInputs = [ libX11 libXext pkgconfig mesa libdrm libXfixes ]; configureFlags = [ "--enable-glx" ]; meta = { homepage = http://www.freedesktop.org/wiki/Software/vaapi; license = "MIT"; description = "VAAPI library: Video Acceleration API"; }; }
4
0.2
2
2
b99acdf77e704bafe348bd60d5480d5c2dca4b14
docs/sessions.rst
docs/sessions.rst
======== Sessions ======== ChatterBot supports the ability to have multiple concurrent chat sessions. A chat session is where the chat bot interacts with a person, and supporting multiple chat sessions means that your chat bot can have multiple different conversations with different people at the same time. .. autoclass:: chatterbot.conversation.session.Session :members: .. autoclass:: chatterbot.conversation.session.SessionManager :members: Each session object holds a queue of the most recent communications that have occured durring that session. The queue holds tuples with two values each, the first value is the input that the bot recieved and the second value is the response that the bot returned. .. autoclass:: chatterbot.queues.ResponseQueue :members:
======== Sessions ======== ChatterBot supports the ability to have multiple concurrent chat sessions. A chat session is where the chat bot interacts with a person, and supporting multiple chat sessions means that your chat bot can have multiple different conversations with different people at the same time. .. autoclass:: chatterbot.conversation.session.Session :members: .. autoclass:: chatterbot.conversation.session.SessionManager :members: Each session object holds a queue of the most recent communications that have occured durring that session. The queue holds tuples with two values each, the first value is the input that the bot recieved and the second value is the response that the bot returned. .. autoclass:: chatterbot.queues.ResponseQueue :members: Session scope ------------- If two :code:`ChatBot` instances are created, each will have sessions separate from each other. An adapter can access any session as long as the unique identifier for the session is provided. Session example --------------- The following example is taken from the Django :code:`ChatterBotView` built into ChatterBot. In this method, the unique identifiers for each chat session are being stored in Django's session objects. This allows different users who interact with the bot through different web browsers to have seperate conversations with the chat bot. .. literalinclude:: ../chatterbot/ext/django_chatterbot/views.py :language: python :pyobject: ChatterBotView.post :dedent: 4
Add session example to documentation
Add session example to documentation
reStructuredText
bsd-3-clause
gunthercox/ChatterBot,Reinaesaya/OUIRL-ChatBot,Gustavo6046/ChatterBot,Reinaesaya/OUIRL-ChatBot,davizucon/ChatterBot,maclogan/VirtualPenPal,vkosuri/ChatterBot
restructuredtext
## Code Before: ======== Sessions ======== ChatterBot supports the ability to have multiple concurrent chat sessions. A chat session is where the chat bot interacts with a person, and supporting multiple chat sessions means that your chat bot can have multiple different conversations with different people at the same time. .. autoclass:: chatterbot.conversation.session.Session :members: .. autoclass:: chatterbot.conversation.session.SessionManager :members: Each session object holds a queue of the most recent communications that have occured durring that session. The queue holds tuples with two values each, the first value is the input that the bot recieved and the second value is the response that the bot returned. .. autoclass:: chatterbot.queues.ResponseQueue :members: ## Instruction: Add session example to documentation ## Code After: ======== Sessions ======== ChatterBot supports the ability to have multiple concurrent chat sessions. A chat session is where the chat bot interacts with a person, and supporting multiple chat sessions means that your chat bot can have multiple different conversations with different people at the same time. .. autoclass:: chatterbot.conversation.session.Session :members: .. autoclass:: chatterbot.conversation.session.SessionManager :members: Each session object holds a queue of the most recent communications that have occured durring that session. The queue holds tuples with two values each, the first value is the input that the bot recieved and the second value is the response that the bot returned. .. autoclass:: chatterbot.queues.ResponseQueue :members: Session scope ------------- If two :code:`ChatBot` instances are created, each will have sessions separate from each other. An adapter can access any session as long as the unique identifier for the session is provided. Session example --------------- The following example is taken from the Django :code:`ChatterBotView` built into ChatterBot. In this method, the unique identifiers for each chat session are being stored in Django's session objects. This allows different users who interact with the bot through different web browsers to have seperate conversations with the chat bot. .. literalinclude:: ../chatterbot/ext/django_chatterbot/views.py :language: python :pyobject: ChatterBotView.post :dedent: 4
======== Sessions ======== ChatterBot supports the ability to have multiple concurrent chat sessions. A chat session is where the chat bot interacts with a person, and supporting multiple chat sessions means that your chat bot can have multiple different conversations with different people at the same time. .. autoclass:: chatterbot.conversation.session.Session :members: .. autoclass:: chatterbot.conversation.session.SessionManager :members: Each session object holds a queue of the most recent communications that have occured durring that session. The queue holds tuples with two values each, the first value is the input that the bot recieved and the second value is the response that the bot returned. .. autoclass:: chatterbot.queues.ResponseQueue :members: + + Session scope + ------------- + + If two :code:`ChatBot` instances are created, each will have sessions separate from each other. + + An adapter can access any session as long as the unique identifier for the session is provided. + + Session example + --------------- + + The following example is taken from the Django :code:`ChatterBotView` built into ChatterBot. + In this method, the unique identifiers for each chat session are being stored in Django's + session objects. This allows different users who interact with the bot through different + web browsers to have seperate conversations with the chat bot. + + .. literalinclude:: ../chatterbot/ext/django_chatterbot/views.py + :language: python + :pyobject: ChatterBotView.post + :dedent: 4
20
0.909091
20
0
7d600cfe7463264bae02848c133341811394d542
source/stylesheets/base/_html.sass
source/stylesheets/base/_html.sass
html box-sizing: border-box *, *:before, *:after box-sizing: inherit
html box-sizing: border-box html, body background-color: darken(#FFFFFF, 2.8%) *, *:before, *:after box-sizing: inherit
Add background color on html/body.
Add background color on html/body.
Sass
mit
Dexyne/tab2space.ws,Dexyne/tab2space.ws,Dexyne/tab2space.ws
sass
## Code Before: html box-sizing: border-box *, *:before, *:after box-sizing: inherit ## Instruction: Add background color on html/body. ## Code After: html box-sizing: border-box html, body background-color: darken(#FFFFFF, 2.8%) *, *:before, *:after box-sizing: inherit
html box-sizing: border-box + html, body + background-color: darken(#FFFFFF, 2.8%) + *, *:before, *:after box-sizing: inherit
3
0.5
3
0
e2f4d07f5f77c64dd0bfb96d9750303e8247617b
server/markdown/index.md
server/markdown/index.md
- [Terms of Service](/docs/terms) - [Privacy](/docs/privacy)
Thanks for selecting Dmail for your Discord based E-Mail client! The documentation here documents how to use Dmail. This documentation can be found on [GitHub](https://github.com/moustacheminer/discordmail/tree/master/server/markdown). ### Commands Dmail commands are triggered by placing a prefix that defines a context, and a command. #### Prefixes - User: `dmail` - Guild: `dsuite` #### Commands ##### `block` Block emails separated by semicolons. Example: `dmail block mdteam.ga;example.com` This command blocks the `mdteam.ga and example.com` domains. ##### `register` Register for Dmail. Please read the [Terms and Conditions](/docs/terms) and [Privacy Statement](/docs/privacy) before registering. ##### `reply` Reply to a specific email. Example: `dmail reply aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa This is a reply` This command replies to the email with the specific Reply ID ##### `send` Send to a specific email. Example: `dmail send admin@moustacheminer.com "exciting" test` This command sends a message with the subject "exciting" with a body of "test" ##### `what` Find out your Dmail address
Add command documentation into documentation
Add command documentation into documentation
Markdown
mit
moustacheminer/discordmail,moustacheminer/discordmail
markdown
## Code Before: - [Terms of Service](/docs/terms) - [Privacy](/docs/privacy) ## Instruction: Add command documentation into documentation ## Code After: Thanks for selecting Dmail for your Discord based E-Mail client! The documentation here documents how to use Dmail. This documentation can be found on [GitHub](https://github.com/moustacheminer/discordmail/tree/master/server/markdown). ### Commands Dmail commands are triggered by placing a prefix that defines a context, and a command. #### Prefixes - User: `dmail` - Guild: `dsuite` #### Commands ##### `block` Block emails separated by semicolons. Example: `dmail block mdteam.ga;example.com` This command blocks the `mdteam.ga and example.com` domains. ##### `register` Register for Dmail. Please read the [Terms and Conditions](/docs/terms) and [Privacy Statement](/docs/privacy) before registering. ##### `reply` Reply to a specific email. Example: `dmail reply aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa This is a reply` This command replies to the email with the specific Reply ID ##### `send` Send to a specific email. Example: `dmail send admin@moustacheminer.com "exciting" test` This command sends a message with the subject "exciting" with a body of "test" ##### `what` Find out your Dmail address
- - [Terms of Service](/docs/terms) - - [Privacy](/docs/privacy) + + Thanks for selecting Dmail for your Discord based E-Mail client! + The documentation here documents how to use Dmail. + This documentation can be found on [GitHub](https://github.com/moustacheminer/discordmail/tree/master/server/markdown). + + ### Commands + + Dmail commands are triggered by placing a prefix that defines a context, and a command. + + #### Prefixes + + - User: `dmail` + - Guild: `dsuite` + + #### Commands + + ##### `block` + Block emails separated by semicolons. + + Example: + `dmail block mdteam.ga;example.com` + This command blocks the `mdteam.ga and example.com` domains. + + ##### `register` + Register for Dmail. Please read the [Terms and Conditions](/docs/terms) and [Privacy Statement](/docs/privacy) before registering. + + ##### `reply` + Reply to a specific email. + + Example: + `dmail reply aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa This is a reply` + This command replies to the email with the specific Reply ID + + ##### `send` + Send to a specific email. + + Example: + `dmail send admin@moustacheminer.com "exciting" test` + This command sends a message with the subject "exciting" with a body of "test" + + ##### `what` + Find out your Dmail address
44
22
42
2
721bbe44ec86ee25b01599e545a01768d2ad1923
README.md
README.md
Fullscreen mode for web browsers ### JSLint To test Fullscreen.js, use `jslint --browser --sloppy fullscreen.js`. ### Usage Fullscreen.js should be pretty self-explanatory from the function comments; all you have to do to include it in your project is: `<script src="fullscreen.js"></script>` from some HTML file, in the `<head>` tag, before you use any of the library's functions. You can also use `require()` as supplied by Node.js-style module systems, like so: `var fs = require('./fullscreen.js');`
Fullscreen mode for web browsers ### Installation npm install --save fullscreenjs ### JSLint To test Fullscreen.js, use `jslint --browser --sloppy fullscreen.js`. ### Usage Fullscreen.js should be pretty self-explanatory from the function comments; all you have to do to include it in your project is: <script src="fullscreen.js"></script> from some HTML file, in the `<head>` tag, before you use any of the library's functions. You can also use `require()` as supplied by Node.js-style module systems if you use NPM, like so: var fs = require('fullscreenjs');
Add NPM installation and inclusion instructions
Add NPM installation and inclusion instructions
Markdown
mit
xnil/fullscreenjs
markdown
## Code Before: Fullscreen mode for web browsers ### JSLint To test Fullscreen.js, use `jslint --browser --sloppy fullscreen.js`. ### Usage Fullscreen.js should be pretty self-explanatory from the function comments; all you have to do to include it in your project is: `<script src="fullscreen.js"></script>` from some HTML file, in the `<head>` tag, before you use any of the library's functions. You can also use `require()` as supplied by Node.js-style module systems, like so: `var fs = require('./fullscreen.js');` ## Instruction: Add NPM installation and inclusion instructions ## Code After: Fullscreen mode for web browsers ### Installation npm install --save fullscreenjs ### JSLint To test Fullscreen.js, use `jslint --browser --sloppy fullscreen.js`. ### Usage Fullscreen.js should be pretty self-explanatory from the function comments; all you have to do to include it in your project is: <script src="fullscreen.js"></script> from some HTML file, in the `<head>` tag, before you use any of the library's functions. You can also use `require()` as supplied by Node.js-style module systems if you use NPM, like so: var fs = require('fullscreenjs');
Fullscreen mode for web browsers + + ### Installation + npm install --save fullscreenjs ### JSLint To test Fullscreen.js, use `jslint --browser --sloppy fullscreen.js`. ### Usage Fullscreen.js should be pretty self-explanatory from the function comments; all you have to do to include it in your project is: - `<script src="fullscreen.js"></script>` ? ^ - + <script src="fullscreen.js"></script> ? ^^^^ from some HTML file, in the `<head>` tag, before you use any of the library's functions. - You can also use `require()` as supplied by Node.js-style module systems, like so: ? - - ^^ ^ ^ + You can also use `require()` as supplied by Node.js-style module systems if you ? ^ ^ ^ + use NPM, like so: - `var fs = require('./fullscreen.js');` ? ^ -- - - + var fs = require('fullscreenjs'); ? ^^^^
10
0.588235
7
3
ef5442c3f1c11e52e9c1d7400e11a829d56a7107
lib/udongo/engine.rb
lib/udongo/engine.rb
module Udongo class Engine < ::Rails::Engine end end
module Udongo class Engine < ::Rails::Engine # Let Rails generators create FactoryGirl factories. config.generators do |g| g.test_framework :rspec, fixture: false g.fixture_replacement :factory_girl, dir: 'spec/factories' end end end
Make sure rspec is used when invoking generators.
Make sure rspec is used when invoking generators.
Ruby
mit
udongo/udongo,udongo/udongo,udongo/udongo
ruby
## Code Before: module Udongo class Engine < ::Rails::Engine end end ## Instruction: Make sure rspec is used when invoking generators. ## Code After: module Udongo class Engine < ::Rails::Engine # Let Rails generators create FactoryGirl factories. config.generators do |g| g.test_framework :rspec, fixture: false g.fixture_replacement :factory_girl, dir: 'spec/factories' end end end
module Udongo class Engine < ::Rails::Engine + + # Let Rails generators create FactoryGirl factories. + config.generators do |g| + g.test_framework :rspec, fixture: false + g.fixture_replacement :factory_girl, dir: 'spec/factories' + end end end
6
1.5
6
0
9da7f07e2a6900b1df2cc0d8e0766409d4a41495
setup.py
setup.py
from setuptools import setup setup( name='Favien', version='dev', url='https://github.com/limeburst/favien', author='Jihyeok Seo', author_email='me@limeburst.net', description='Network canvas community', long_description=__doc__, zip_safe=False, packages=['favien', 'favien.web'], package_data={ 'favien.web': ['templates/*.*', 'templates/*/*.*', 'static/*.*', 'translations/*/LC_MESSAGES/*'], }, message_extractors={ 'favien/web/templates': [ ('**.html', 'jinja2', { 'extensions': 'jinja2.ext.autoescape,' 'jinja2.ext.with_' }) ] }, install_requires=[ 'Flask', 'Flask-Babel', 'SQLAlchemy', 'boto', 'click', 'redis', 'requests', 'requests_oauthlib', ], entry_points={ 'console_scripts': ['fav = favien.cli:cli'], } )
from setuptools import setup setup( name='Favien', version='dev', url='https://github.com/limeburst/favien', author='Jihyeok Seo', author_email='me@limeburst.net', description='Network canvas community', long_description=__doc__, zip_safe=False, packages=['favien', 'favien.web'], package_data={ 'favien.web': ['templates/*.*', 'templates/*/*.*', 'static/*.*', 'static/*/*.*', 'translations/*/LC_MESSAGES/*'], }, message_extractors={ 'favien/web/templates': [ ('**.html', 'jinja2', { 'extensions': 'jinja2.ext.autoescape,' 'jinja2.ext.with_' }) ] }, install_requires=[ 'Flask', 'Flask-Babel', 'SQLAlchemy', 'boto', 'click', 'redis', 'requests', 'requests_oauthlib', ], entry_points={ 'console_scripts': ['fav = favien.cli:cli'], } )
Include static subdirectories in package
Include static subdirectories in package
Python
agpl-3.0
favien/favien,favien/favien,favien/favien
python
## Code Before: from setuptools import setup setup( name='Favien', version='dev', url='https://github.com/limeburst/favien', author='Jihyeok Seo', author_email='me@limeburst.net', description='Network canvas community', long_description=__doc__, zip_safe=False, packages=['favien', 'favien.web'], package_data={ 'favien.web': ['templates/*.*', 'templates/*/*.*', 'static/*.*', 'translations/*/LC_MESSAGES/*'], }, message_extractors={ 'favien/web/templates': [ ('**.html', 'jinja2', { 'extensions': 'jinja2.ext.autoescape,' 'jinja2.ext.with_' }) ] }, install_requires=[ 'Flask', 'Flask-Babel', 'SQLAlchemy', 'boto', 'click', 'redis', 'requests', 'requests_oauthlib', ], entry_points={ 'console_scripts': ['fav = favien.cli:cli'], } ) ## Instruction: Include static subdirectories in package ## Code After: from setuptools import setup setup( name='Favien', version='dev', url='https://github.com/limeburst/favien', author='Jihyeok Seo', author_email='me@limeburst.net', description='Network canvas community', long_description=__doc__, zip_safe=False, packages=['favien', 'favien.web'], package_data={ 'favien.web': ['templates/*.*', 'templates/*/*.*', 'static/*.*', 'static/*/*.*', 'translations/*/LC_MESSAGES/*'], }, message_extractors={ 'favien/web/templates': [ ('**.html', 'jinja2', { 'extensions': 'jinja2.ext.autoescape,' 'jinja2.ext.with_' }) ] }, install_requires=[ 'Flask', 'Flask-Babel', 'SQLAlchemy', 'boto', 'click', 'redis', 'requests', 'requests_oauthlib', ], entry_points={ 'console_scripts': ['fav = favien.cli:cli'], } )
from setuptools import setup setup( name='Favien', version='dev', url='https://github.com/limeburst/favien', author='Jihyeok Seo', author_email='me@limeburst.net', description='Network canvas community', long_description=__doc__, zip_safe=False, packages=['favien', 'favien.web'], package_data={ - 'favien.web': ['templates/*.*', 'templates/*/*.*', 'static/*.*', ? -------------- + 'favien.web': ['templates/*.*', 'templates/*/*.*', + 'static/*.*', 'static/*/*.*', 'translations/*/LC_MESSAGES/*'], }, message_extractors={ 'favien/web/templates': [ ('**.html', 'jinja2', { 'extensions': 'jinja2.ext.autoescape,' 'jinja2.ext.with_' }) ] }, install_requires=[ 'Flask', 'Flask-Babel', 'SQLAlchemy', 'boto', 'click', 'redis', 'requests', 'requests_oauthlib', ], entry_points={ 'console_scripts': ['fav = favien.cli:cli'], } )
3
0.076923
2
1
e5c02aadb15775f829c27774044a92c9fefcf3e4
CONTRIBUTING.md
CONTRIBUTING.md
Please submit all issues and pull requests to the [laravel/framework](http://github.com/laravel/framework) repository!
Currently Quill is not accepting code contributions. ## Laravel 4 Please submit all issues and pull requests to the [laravel/framework](http://github.com/laravel/framework) repository!
Change contributing file to not be Laravel stock
Change contributing file to not be Laravel stock
Markdown
bsd-2-clause
chipotle/quill,chipotle/quill,chipotle/quill,chipotle/quill
markdown
## Code Before: Please submit all issues and pull requests to the [laravel/framework](http://github.com/laravel/framework) repository! ## Instruction: Change contributing file to not be Laravel stock ## Code After: Currently Quill is not accepting code contributions. ## Laravel 4 Please submit all issues and pull requests to the [laravel/framework](http://github.com/laravel/framework) repository!
+ + Currently Quill is not accepting code contributions. + + ## Laravel 4 Please submit all issues and pull requests to the [laravel/framework](http://github.com/laravel/framework) repository!
4
2
4
0
cf9b72f5687b2dbea444a44a3b4fd6594de0843c
lib/buzzerbeater/api.rb
lib/buzzerbeater/api.rb
require 'httparty' # Buzzerbeater API wrapper class # # @author Moritz Lawitschka <moritz@urbanvention.com> class Buzzerbeater::API include HTTParty # HTTParty configuration base_uri 'bbapi.buzzerbeater.com' format :xml # Create a new API object. # # @example # api = Buzzerbeater::API.new('username', 'access_key') # # @param [String] username the username # @param [String] access_key the user's access key # # @return [Buzzerbeater::API] the API object. def initialize(username, access_key) @username, @access_key = username, access_key end end
require 'httparty' # Buzzerbeater API wrapper class # # @author Moritz Lawitschka <moritz@urbanvention.com> class Buzzerbeater::API include HTTParty # HTTParty configuration base_uri 'bbapi.buzzerbeater.com' format :xml # @!attribute session_id # @return [String] the session ID used by this API object attr_accessor :session_id # @!attribute auth_token # @return [String] the authentication token for this session attr_accessor :auth_token # Create a new API object. # # When creating a new API object as entry point for accessing the API a session ID and authentication # token can be provided if already retrieved during a former login. # # @example # api = Buzzerbeater::API.new # api = Buzzerbeater::API.new('session_id', 'auth_token') # # @see Buzzerbeater::API#login # # @param [String] session_id the session ID retrieved from the API after performing a login (optional) # @param [String] auth_token the authentication token returned by the login method (optional) # # @return [Buzzerbeater::API] the API object. def initialize(session_id, auth_token) @session_id, @auth_token = session_id, auth_token end end
Correct constructor and instance variables for API
Correct constructor and instance variables for API
Ruby
mit
lawitschka/buzzerbeater
ruby
## Code Before: require 'httparty' # Buzzerbeater API wrapper class # # @author Moritz Lawitschka <moritz@urbanvention.com> class Buzzerbeater::API include HTTParty # HTTParty configuration base_uri 'bbapi.buzzerbeater.com' format :xml # Create a new API object. # # @example # api = Buzzerbeater::API.new('username', 'access_key') # # @param [String] username the username # @param [String] access_key the user's access key # # @return [Buzzerbeater::API] the API object. def initialize(username, access_key) @username, @access_key = username, access_key end end ## Instruction: Correct constructor and instance variables for API ## Code After: require 'httparty' # Buzzerbeater API wrapper class # # @author Moritz Lawitschka <moritz@urbanvention.com> class Buzzerbeater::API include HTTParty # HTTParty configuration base_uri 'bbapi.buzzerbeater.com' format :xml # @!attribute session_id # @return [String] the session ID used by this API object attr_accessor :session_id # @!attribute auth_token # @return [String] the authentication token for this session attr_accessor :auth_token # Create a new API object. # # When creating a new API object as entry point for accessing the API a session ID and authentication # token can be provided if already retrieved during a former login. # # @example # api = Buzzerbeater::API.new # api = Buzzerbeater::API.new('session_id', 'auth_token') # # @see Buzzerbeater::API#login # # @param [String] session_id the session ID retrieved from the API after performing a login (optional) # @param [String] auth_token the authentication token returned by the login method (optional) # # @return [Buzzerbeater::API] the API object. def initialize(session_id, auth_token) @session_id, @auth_token = session_id, auth_token end end
require 'httparty' # Buzzerbeater API wrapper class # # @author Moritz Lawitschka <moritz@urbanvention.com> class Buzzerbeater::API include HTTParty # HTTParty configuration base_uri 'bbapi.buzzerbeater.com' format :xml + # @!attribute session_id + # @return [String] the session ID used by this API object + attr_accessor :session_id + + # @!attribute auth_token + # @return [String] the authentication token for this session + attr_accessor :auth_token + + # Create a new API object. # + # When creating a new API object as entry point for accessing the API a session ID and authentication + # token can be provided if already retrieved during a former login. + # # @example + # api = Buzzerbeater::API.new - # api = Buzzerbeater::API.new('username', 'access_key') ? - ^ ^^^ ^^^^^ ^ + # api = Buzzerbeater::API.new('session_id', 'auth_token') ? ^^^^ ^^^ ^^^ ++ ^ # - # @param [String] username the username - # @param [String] access_key the user's access key + # @see Buzzerbeater::API#login + # + # @param [String] session_id the session ID retrieved from the API after performing a login (optional) + # @param [String] auth_token the authentication token returned by the login method (optional) # # @return [Buzzerbeater::API] the API object. - def initialize(username, access_key) - @username, @access_key = username, access_key + def initialize(session_id, auth_token) + @session_id, @auth_token = session_id, auth_token end end
25
0.925926
20
5
8db861d67f257a3e9ac1790ea06d4e2a7a193a6c
stack.yml
stack.yml
version: '3.2' services: db: image: postgres restart: always volumes: - db:/var/lib/postgresql/data environment: - POSTGRES_DB=nextcloud - POSTGRES_USER=nextcloud - POSTGRES_PASSWORD=nextcloud app: image: nextcloud restart: always ports: - 8080:80 volumes: - nextcloud:/var/www/html environment: - POSTGRES_HOST=db - POSTGRES_DB=nextcloud - POSTGRES_USER=nextcloud - POSTGRES_PASSWORD=nextcloud depends_on: - db cron: image: nextcloud restart: always volumes: - nextcloud:/var/www/html user: www-data entrypoint: | bash -c 'bash -s <<EOF trap "break;exit" SIGHUP SIGINT SIGTERM while [ ! -f /var/www/html/config/config.php ]; do sleep 1 done while true; do php -f /var/www/html/cron.php sleep 15m done EOF' depends_on: - db volumes: db: nextcloud:
version: '3.2' services: db: image: postgres restart: always volumes: - db:/var/lib/postgresql/data environment: - POSTGRES_DB=nextcloud - POSTGRES_USER=nextcloud - POSTGRES_PASSWORD=nextcloud app: image: nextcloud restart: always ports: - 8080:80 volumes: - nextcloud:/var/www/html environment: - POSTGRES_HOST=db - POSTGRES_DB=nextcloud - POSTGRES_USER=nextcloud - POSTGRES_PASSWORD=nextcloud depends_on: - db cron: image: nextcloud restart: always volumes: - nextcloud:/var/www/html entrypoint: /cron.sh depends_on: - db volumes: db: nextcloud:
Use cron.sh for the cron container
Use cron.sh for the cron container
YAML
agpl-3.0
pebcac/docker,pebcac/docker
yaml
## Code Before: version: '3.2' services: db: image: postgres restart: always volumes: - db:/var/lib/postgresql/data environment: - POSTGRES_DB=nextcloud - POSTGRES_USER=nextcloud - POSTGRES_PASSWORD=nextcloud app: image: nextcloud restart: always ports: - 8080:80 volumes: - nextcloud:/var/www/html environment: - POSTGRES_HOST=db - POSTGRES_DB=nextcloud - POSTGRES_USER=nextcloud - POSTGRES_PASSWORD=nextcloud depends_on: - db cron: image: nextcloud restart: always volumes: - nextcloud:/var/www/html user: www-data entrypoint: | bash -c 'bash -s <<EOF trap "break;exit" SIGHUP SIGINT SIGTERM while [ ! -f /var/www/html/config/config.php ]; do sleep 1 done while true; do php -f /var/www/html/cron.php sleep 15m done EOF' depends_on: - db volumes: db: nextcloud: ## Instruction: Use cron.sh for the cron container ## Code After: version: '3.2' services: db: image: postgres restart: always volumes: - db:/var/lib/postgresql/data environment: - POSTGRES_DB=nextcloud - POSTGRES_USER=nextcloud - POSTGRES_PASSWORD=nextcloud app: image: nextcloud restart: always ports: - 8080:80 volumes: - nextcloud:/var/www/html environment: - POSTGRES_HOST=db - POSTGRES_DB=nextcloud - POSTGRES_USER=nextcloud - POSTGRES_PASSWORD=nextcloud depends_on: - db cron: image: nextcloud restart: always volumes: - nextcloud:/var/www/html entrypoint: /cron.sh depends_on: - db volumes: db: nextcloud:
version: '3.2' services: db: image: postgres restart: always volumes: - db:/var/lib/postgresql/data environment: - POSTGRES_DB=nextcloud - POSTGRES_USER=nextcloud - POSTGRES_PASSWORD=nextcloud app: image: nextcloud restart: always ports: - 8080:80 volumes: - nextcloud:/var/www/html environment: - POSTGRES_HOST=db - POSTGRES_DB=nextcloud - POSTGRES_USER=nextcloud - POSTGRES_PASSWORD=nextcloud depends_on: - db cron: image: nextcloud restart: always volumes: - nextcloud:/var/www/html - user: www-data - entrypoint: | ? ^ + entrypoint: /cron.sh ? ^^^^^^^^ - bash -c 'bash -s <<EOF - trap "break;exit" SIGHUP SIGINT SIGTERM - - while [ ! -f /var/www/html/config/config.php ]; do - sleep 1 - done - - while true; do - php -f /var/www/html/cron.php - sleep 15m - done - EOF' depends_on: - db volumes: db: nextcloud:
15
0.283019
1
14
5a814afebb6ed8478d63d8c6167c686c90381ef9
lib/util/getVerification.js
lib/util/getVerification.js
// Includes var http = require('./http.js').func; var getHash = require('./getHash.js').func; var getVerificationInputs = require('./getVerificationInputs.js').func; var cache = require('../cache'); // Args exports.required = ['url']; exports.optional = ['getBody', 'jar']; // Define function getVerification (jar, url, getBody) { return function (resolve, reject) { var httpOpt = { url: url, options: { jar: jar } }; http(httpOpt) .then(function (body) { var inputs = getVerificationInputs({html: body}); resolve({ body: (getBody ? body : null), inputs: inputs }); }); }; } exports.func = function (args) { var jar = args.jar; return cache.wrap('Verify', getHash({jar: jar}), getVerification(jar, args.url, args.getBody)); };
// Dependencies var url = require('url'); // Includes var http = require('./http.js').func; var getHash = require('./getHash.js').func; var getVerificationInputs = require('./getVerificationInputs.js').func; var cache = require('../cache'); var promise = require('./promise.js'); // Args exports.required = ['url']; exports.optional = ['ignoreCache', 'getBody', 'jar']; // Define function getVerification (jar, url, getBody) { return function (resolve, reject) { var httpOpt = { url: url, options: { jar: jar } }; http(httpOpt) .then(function (body) { var inputs = getVerificationInputs({html: body}); resolve({ body: (getBody ? body : null), inputs: inputs }); }); }; } exports.func = function (args) { var jar = args.jar; var func = getVerification(jar, args.url, args.getBody); if (args.ignoreCache) { return promise(func); } else { return cache.wrap('Verify', url.parse(args.url).pathname + getHash({jar: jar}), func); } };
Add ignoreCache option and cache based on url
Add ignoreCache option and cache based on url Verification does end up being dependent on URL and is cached accordingly
JavaScript
mit
OnlyTwentyCharacters/roblox-js,sentanos/roblox-js,FroastJ/roblox-js
javascript
## Code Before: // Includes var http = require('./http.js').func; var getHash = require('./getHash.js').func; var getVerificationInputs = require('./getVerificationInputs.js').func; var cache = require('../cache'); // Args exports.required = ['url']; exports.optional = ['getBody', 'jar']; // Define function getVerification (jar, url, getBody) { return function (resolve, reject) { var httpOpt = { url: url, options: { jar: jar } }; http(httpOpt) .then(function (body) { var inputs = getVerificationInputs({html: body}); resolve({ body: (getBody ? body : null), inputs: inputs }); }); }; } exports.func = function (args) { var jar = args.jar; return cache.wrap('Verify', getHash({jar: jar}), getVerification(jar, args.url, args.getBody)); }; ## Instruction: Add ignoreCache option and cache based on url Verification does end up being dependent on URL and is cached accordingly ## Code After: // Dependencies var url = require('url'); // Includes var http = require('./http.js').func; var getHash = require('./getHash.js').func; var getVerificationInputs = require('./getVerificationInputs.js').func; var cache = require('../cache'); var promise = require('./promise.js'); // Args exports.required = ['url']; exports.optional = ['ignoreCache', 'getBody', 'jar']; // Define function getVerification (jar, url, getBody) { return function (resolve, reject) { var httpOpt = { url: url, options: { jar: jar } }; http(httpOpt) .then(function (body) { var inputs = getVerificationInputs({html: body}); resolve({ body: (getBody ? body : null), inputs: inputs }); }); }; } exports.func = function (args) { var jar = args.jar; var func = getVerification(jar, args.url, args.getBody); if (args.ignoreCache) { return promise(func); } else { return cache.wrap('Verify', url.parse(args.url).pathname + getHash({jar: jar}), func); } };
+ // Dependencies + var url = require('url'); + // Includes var http = require('./http.js').func; var getHash = require('./getHash.js').func; var getVerificationInputs = require('./getVerificationInputs.js').func; var cache = require('../cache'); + var promise = require('./promise.js'); // Args exports.required = ['url']; - exports.optional = ['getBody', 'jar']; + exports.optional = ['ignoreCache', 'getBody', 'jar']; ? +++++++++++++++ // Define function getVerification (jar, url, getBody) { return function (resolve, reject) { var httpOpt = { url: url, options: { jar: jar } }; http(httpOpt) .then(function (body) { var inputs = getVerificationInputs({html: body}); resolve({ body: (getBody ? body : null), inputs: inputs }); }); }; } exports.func = function (args) { var jar = args.jar; - return cache.wrap('Verify', getHash({jar: jar}), getVerification(jar, args.url, args.getBody)); + var func = getVerification(jar, args.url, args.getBody); + if (args.ignoreCache) { + return promise(func); + } else { + return cache.wrap('Verify', url.parse(args.url).pathname + getHash({jar: jar}), func); + } };
13
0.382353
11
2
196343886f090b95bd0b1e72f716d372db9ea244
app/views/ideas/show.html.erb
app/views/ideas/show.html.erb
<!-- show one idea and all its comments, can upvote main idea and comments, can click to reply to idea or comment, can click on square to see author of idea or comment --> <%= link_to("V") %> <!-- ajax will grab this and create a vote --> <h1><%= @idea.title %></h1> <p><%= @idea.description %></p> <p><%= link_to("Yes and!", new_comment_path(commentable_type: "Idea", commentable_id: @idea.id), remote: true, id: "idea_reply") %></p> <!-- ajax will grab this and show a form to create a comment--> <p><%= link_to(@idea.creator.username, user_path(@idea.creator)) %></p> <!-- partials for comments will go here --> <div class="comments"> <% @idea.comments.each do |comment| %> <p><%= comment.text %> - <%= link_to("Yes and!", new_comment_path(commentable_type: "Comment", commentable_id: comment.id), remote: true, class: "comment_reply") %></p> <% end %> </div>
<!-- show one idea and all its comments, can upvote main idea and comments, can click to reply to idea or comment, can click on square to see author of idea or comment --> <%= button_to("Vote", votes_path) %> <!-- ajax will grab this and create a vote --> <h1><%= @idea.title %></h1> <p><%= @idea.description %></p> <p><%= link_to("Yes and!", new_comment_path(commentable_type: "Idea", commentable_id: @idea.id), remote: true, id: "idea_reply") %></p> <!-- ajax will grab this and show a form to create a comment--> <p><%= link_to(@idea.creator.username, user_path(@idea.creator)) %></p> <!-- partials for comments will go here --> <div class="comments"> <% @idea.comments.each do |comment| %> <p><%= comment.text %> - <%= link_to("Yes and!", new_comment_path(commentable_type: "Comment", commentable_id: comment.id), remote: true, class: "comment_reply") %></p> <% end %> </div>
Add DOM element for vote creation
Add DOM element for vote creation
HTML+ERB
mit
chi-fiddler-crabs-2015/yesand,chi-fiddler-crabs-2015/yesand,chi-fiddler-crabs-2015/yesand
html+erb
## Code Before: <!-- show one idea and all its comments, can upvote main idea and comments, can click to reply to idea or comment, can click on square to see author of idea or comment --> <%= link_to("V") %> <!-- ajax will grab this and create a vote --> <h1><%= @idea.title %></h1> <p><%= @idea.description %></p> <p><%= link_to("Yes and!", new_comment_path(commentable_type: "Idea", commentable_id: @idea.id), remote: true, id: "idea_reply") %></p> <!-- ajax will grab this and show a form to create a comment--> <p><%= link_to(@idea.creator.username, user_path(@idea.creator)) %></p> <!-- partials for comments will go here --> <div class="comments"> <% @idea.comments.each do |comment| %> <p><%= comment.text %> - <%= link_to("Yes and!", new_comment_path(commentable_type: "Comment", commentable_id: comment.id), remote: true, class: "comment_reply") %></p> <% end %> </div> ## Instruction: Add DOM element for vote creation ## Code After: <!-- show one idea and all its comments, can upvote main idea and comments, can click to reply to idea or comment, can click on square to see author of idea or comment --> <%= button_to("Vote", votes_path) %> <!-- ajax will grab this and create a vote --> <h1><%= @idea.title %></h1> <p><%= @idea.description %></p> <p><%= link_to("Yes and!", new_comment_path(commentable_type: "Idea", commentable_id: @idea.id), remote: true, id: "idea_reply") %></p> <!-- ajax will grab this and show a form to create a comment--> <p><%= link_to(@idea.creator.username, user_path(@idea.creator)) %></p> <!-- partials for comments will go here --> <div class="comments"> <% @idea.comments.each do |comment| %> <p><%= comment.text %> - <%= link_to("Yes and!", new_comment_path(commentable_type: "Comment", commentable_id: comment.id), remote: true, class: "comment_reply") %></p> <% end %> </div>
<!-- show one idea and all its comments, can upvote main idea and comments, can click to reply to idea or comment, can click on square to see author of idea or comment --> - <%= link_to("V") %> <!-- ajax will grab this and create a vote --> ? ^^ - + <%= button_to("Vote", votes_path) %> <!-- ajax will grab this and create a vote --> ? ^^^^^ +++ ++++++++++++ <h1><%= @idea.title %></h1> <p><%= @idea.description %></p> <p><%= link_to("Yes and!", new_comment_path(commentable_type: "Idea", commentable_id: @idea.id), remote: true, id: "idea_reply") %></p> <!-- ajax will grab this and show a form to create a comment--> <p><%= link_to(@idea.creator.username, user_path(@idea.creator)) %></p> <!-- partials for comments will go here --> <div class="comments"> <% @idea.comments.each do |comment| %> <p><%= comment.text %> - <%= link_to("Yes and!", new_comment_path(commentable_type: "Comment", commentable_id: comment.id), remote: true, class: "comment_reply") %></p> <% end %> </div>
2
0.153846
1
1
8ce43a80622e2db28d0b72a755d7e4ac259356ba
zguide/hwserver.rs
zguide/hwserver.rs
/*! * Hello World server in Rust * Binds REP socket to tcp://*:5555 * Expects "Hello" from client, replies with "World" */ extern mod zmq; use std::libc; fn main() { #[fixed_stack_segment]; let context = zmq::Context::new(); let responder = context.socket(zmq::REP).unwrap(); assert!(responder.bind("tcp://*:5555").is_ok()); let mut msg = zmq::Message::new(); loop { responder.recv(&mut msg, 0); do msg.with_str |s| { printfln!("Received %s", s); } responder.send_str("World", 0); unsafe { libc::sleep(1); } } }
/*! * Hello World server in Rust * Binds REP socket to tcp://*:5555 * Expects "Hello" from client, replies with "World" */ extern mod zmq; use std::rt; fn main() { #[fixed_stack_segment]; let context = zmq::Context::new(); let responder = context.socket(zmq::REP).unwrap(); assert!(responder.bind("tcp://*:5555").is_ok()); let mut msg = zmq::Message::new(); loop { responder.recv(&mut msg, 0); do msg.with_str |s| { printfln!("Received %s", s); } responder.send_str("World", 0); let timer = ~rt::io::Timer::new(); do timer.map_move |mut t| { t.sleep(1) }; } }
Use std::rt::io::Timer instead of an unsafe sleep()
Use std::rt::io::Timer instead of an unsafe sleep()
Rust
apache-2.0
tempbottle/rust-zmq,alexkamp/rust-zmq,erickt/rust-zmq,pblasucci/rust-zmq,petehayes102/rust-zmq,jedisct1/rust-zmq,cristicbz/rust-zmq,dginev/rust-zmq,pfernie/rust-zmq
rust
## Code Before: /*! * Hello World server in Rust * Binds REP socket to tcp://*:5555 * Expects "Hello" from client, replies with "World" */ extern mod zmq; use std::libc; fn main() { #[fixed_stack_segment]; let context = zmq::Context::new(); let responder = context.socket(zmq::REP).unwrap(); assert!(responder.bind("tcp://*:5555").is_ok()); let mut msg = zmq::Message::new(); loop { responder.recv(&mut msg, 0); do msg.with_str |s| { printfln!("Received %s", s); } responder.send_str("World", 0); unsafe { libc::sleep(1); } } } ## Instruction: Use std::rt::io::Timer instead of an unsafe sleep() ## Code After: /*! * Hello World server in Rust * Binds REP socket to tcp://*:5555 * Expects "Hello" from client, replies with "World" */ extern mod zmq; use std::rt; fn main() { #[fixed_stack_segment]; let context = zmq::Context::new(); let responder = context.socket(zmq::REP).unwrap(); assert!(responder.bind("tcp://*:5555").is_ok()); let mut msg = zmq::Message::new(); loop { responder.recv(&mut msg, 0); do msg.with_str |s| { printfln!("Received %s", s); } responder.send_str("World", 0); let timer = ~rt::io::Timer::new(); do timer.map_move |mut t| { t.sleep(1) }; } }
/*! * Hello World server in Rust * Binds REP socket to tcp://*:5555 * Expects "Hello" from client, replies with "World" */ extern mod zmq; - use std::libc; ? ^^^^ + use std::rt; ? ^^ fn main() { #[fixed_stack_segment]; let context = zmq::Context::new(); let responder = context.socket(zmq::REP).unwrap(); assert!(responder.bind("tcp://*:5555").is_ok()); let mut msg = zmq::Message::new(); loop { responder.recv(&mut msg, 0); do msg.with_str |s| { printfln!("Received %s", s); } responder.send_str("World", 0); - unsafe { libc::sleep(1); } + let timer = ~rt::io::Timer::new(); + do timer.map_move |mut t| { t.sleep(1) }; } }
5
0.178571
3
2
f9381bf5f72f9e594f1d58e3675741d74b503b49
packages/te/test-framework-hunit.yaml
packages/te/test-framework-hunit.yaml
homepage: https://batterseapower.github.io/test-framework/ changelog-type: '' hash: 6e637a0904fd0b96bf35c2c00fb5282c8fcb5f329f0a24b4dbf3d131ae531bd0 test-bench-deps: {} maintainer: Haskell Libraries <libraries@haskell.org> synopsis: HUnit support for the test-framework package. changelog: '' basic-deps: test-framework: ! '>=0.2.0' extensible-exceptions: ! '>=0.1.1 && <0.2.0' base: ! '>=4 && <5' HUnit: ! '>=1.2 && <1.4' all-versions: - '0.2.0' - '0.2.1' - '0.2.2' - '0.2.3' - '0.2.4' - '0.2.5' - '0.2.6' - '0.2.7' - '0.3.0' - '0.3.0.1' - '0.3.0.2' author: Max Bolingbroke <batterseapower@hotmail.com> latest: '0.3.0.2' description-type: haddock description: HUnit support for the test-framework package. license-name: BSD3
homepage: https://batterseapower.github.io/test-framework/ changelog-type: '' hash: 50dfa482f626505b45ab433d0110f275e314f872a198b5fc24d1a640af755880 test-bench-deps: {} maintainer: Haskell Libraries <libraries@haskell.org> synopsis: HUnit support for the test-framework package. changelog: '' basic-deps: test-framework: ! '>=0.2.0' extensible-exceptions: ! '>=0.1.1 && <0.2.0' base: ! '>=4 && <5' HUnit: ! '>=1.2 && <1.5' all-versions: - '0.2.0' - '0.2.1' - '0.2.2' - '0.2.3' - '0.2.4' - '0.2.5' - '0.2.6' - '0.2.7' - '0.3.0' - '0.3.0.1' - '0.3.0.2' author: Max Bolingbroke <batterseapower@hotmail.com> latest: '0.3.0.2' description-type: haddock description: HUnit support for the test-framework package. license-name: BSD3
Update from Hackage at 2016-10-07T16:00:25+00:00
Update from Hackage at 2016-10-07T16:00:25+00:00
YAML
mit
commercialhaskell/all-cabal-metadata
yaml
## Code Before: homepage: https://batterseapower.github.io/test-framework/ changelog-type: '' hash: 6e637a0904fd0b96bf35c2c00fb5282c8fcb5f329f0a24b4dbf3d131ae531bd0 test-bench-deps: {} maintainer: Haskell Libraries <libraries@haskell.org> synopsis: HUnit support for the test-framework package. changelog: '' basic-deps: test-framework: ! '>=0.2.0' extensible-exceptions: ! '>=0.1.1 && <0.2.0' base: ! '>=4 && <5' HUnit: ! '>=1.2 && <1.4' all-versions: - '0.2.0' - '0.2.1' - '0.2.2' - '0.2.3' - '0.2.4' - '0.2.5' - '0.2.6' - '0.2.7' - '0.3.0' - '0.3.0.1' - '0.3.0.2' author: Max Bolingbroke <batterseapower@hotmail.com> latest: '0.3.0.2' description-type: haddock description: HUnit support for the test-framework package. license-name: BSD3 ## Instruction: Update from Hackage at 2016-10-07T16:00:25+00:00 ## Code After: homepage: https://batterseapower.github.io/test-framework/ changelog-type: '' hash: 50dfa482f626505b45ab433d0110f275e314f872a198b5fc24d1a640af755880 test-bench-deps: {} maintainer: Haskell Libraries <libraries@haskell.org> synopsis: HUnit support for the test-framework package. changelog: '' basic-deps: test-framework: ! '>=0.2.0' extensible-exceptions: ! '>=0.1.1 && <0.2.0' base: ! '>=4 && <5' HUnit: ! '>=1.2 && <1.5' all-versions: - '0.2.0' - '0.2.1' - '0.2.2' - '0.2.3' - '0.2.4' - '0.2.5' - '0.2.6' - '0.2.7' - '0.3.0' - '0.3.0.1' - '0.3.0.2' author: Max Bolingbroke <batterseapower@hotmail.com> latest: '0.3.0.2' description-type: haddock description: HUnit support for the test-framework package. license-name: BSD3
homepage: https://batterseapower.github.io/test-framework/ changelog-type: '' - hash: 6e637a0904fd0b96bf35c2c00fb5282c8fcb5f329f0a24b4dbf3d131ae531bd0 + hash: 50dfa482f626505b45ab433d0110f275e314f872a198b5fc24d1a640af755880 test-bench-deps: {} maintainer: Haskell Libraries <libraries@haskell.org> synopsis: HUnit support for the test-framework package. changelog: '' basic-deps: test-framework: ! '>=0.2.0' extensible-exceptions: ! '>=0.1.1 && <0.2.0' base: ! '>=4 && <5' - HUnit: ! '>=1.2 && <1.4' ? ^ + HUnit: ! '>=1.2 && <1.5' ? ^ all-versions: - '0.2.0' - '0.2.1' - '0.2.2' - '0.2.3' - '0.2.4' - '0.2.5' - '0.2.6' - '0.2.7' - '0.3.0' - '0.3.0.1' - '0.3.0.2' author: Max Bolingbroke <batterseapower@hotmail.com> latest: '0.3.0.2' description-type: haddock description: HUnit support for the test-framework package. license-name: BSD3
4
0.137931
2
2
c8717cd8ba999a1f19283b7286a9864cb90865b8
components/layout/templates/index.jade
components/layout/templates/index.jade
- pageTitle = 'Futures Market' - footerClass = '' - wrapperClass = '' block vars doctype html html head title | Åzone | #{pageTitle} link(rel="shortcut icon" href="/public/favicon.ico" type="image/x-icon") link( type='text/css', rel='stylesheet', href=asset('/assets/all.css') ) meta(name="viewport" content="initial-scale = 1.0, maximum-scale = 1.0") block styles body .wrapper(class=wrapperClass) include ../../nav/templates/index include ./modal include ./market_status main include ./flash block body footer(class=footerClass) include ./footer block post_footer != sharify.script() script( src="//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js" ) script( src=asset('/assets/layout.js') ) block scripts
- pageTitle = 'Futures Market' - bodyClass = '' - footerClass = '' - wrapperClass = '' block vars doctype html html head title | Åzone | #{pageTitle} link(rel="shortcut icon" href="/public/favicon.ico" type="image/x-icon") link( type='text/css', rel='stylesheet', href=asset('/assets/all.css') ) meta(name="viewport" content="initial-scale = 1.0, maximum-scale = 1.0") block styles body(class=bodyClass) .wrapper(class=wrapperClass) include ../../nav/templates/index include ./modal include ./market_status main include ./flash block body footer(class=footerClass) include ./footer block post_footer != sharify.script() script( src="//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js" ) script( src=asset('/assets/layout.js') ) block scripts
Allow a bodyClass var rather than using a completely different layout
Allow a bodyClass var rather than using a completely different layout
Jade
mit
AOzone/median,AOzone/median
jade
## Code Before: - pageTitle = 'Futures Market' - footerClass = '' - wrapperClass = '' block vars doctype html html head title | Åzone | #{pageTitle} link(rel="shortcut icon" href="/public/favicon.ico" type="image/x-icon") link( type='text/css', rel='stylesheet', href=asset('/assets/all.css') ) meta(name="viewport" content="initial-scale = 1.0, maximum-scale = 1.0") block styles body .wrapper(class=wrapperClass) include ../../nav/templates/index include ./modal include ./market_status main include ./flash block body footer(class=footerClass) include ./footer block post_footer != sharify.script() script( src="//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js" ) script( src=asset('/assets/layout.js') ) block scripts ## Instruction: Allow a bodyClass var rather than using a completely different layout ## Code After: - pageTitle = 'Futures Market' - bodyClass = '' - footerClass = '' - wrapperClass = '' block vars doctype html html head title | Åzone | #{pageTitle} link(rel="shortcut icon" href="/public/favicon.ico" type="image/x-icon") link( type='text/css', rel='stylesheet', href=asset('/assets/all.css') ) meta(name="viewport" content="initial-scale = 1.0, maximum-scale = 1.0") block styles body(class=bodyClass) .wrapper(class=wrapperClass) include ../../nav/templates/index include ./modal include ./market_status main include ./flash block body footer(class=footerClass) include ./footer block post_footer != sharify.script() script( src="//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js" ) script( src=asset('/assets/layout.js') ) block scripts
- pageTitle = 'Futures Market' + - bodyClass = '' - footerClass = '' - wrapperClass = '' block vars doctype html html head title | Åzone | #{pageTitle} link(rel="shortcut icon" href="/public/favicon.ico" type="image/x-icon") link( type='text/css', rel='stylesheet', href=asset('/assets/all.css') ) meta(name="viewport" content="initial-scale = 1.0, maximum-scale = 1.0") block styles - body + body(class=bodyClass) .wrapper(class=wrapperClass) include ../../nav/templates/index include ./modal include ./market_status main include ./flash block body footer(class=footerClass) include ./footer block post_footer != sharify.script() script( src="//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js" ) script( src=asset('/assets/layout.js') ) block scripts
3
0.096774
2
1
fdad7ec8f9ed08f791143b7d7f88f7bbe92a1678
etc/config-1.7.yaml
etc/config-1.7.yaml
--- cluster_name: dcos-vagrant bootstrap_url: http://boot.dcos exhibitor_storage_backend: zookeeper exhibitor_zk_hosts: 192.168.65.50:2181 exhibitor_zk_path: /dcos master_discovery: static master_list: - 192.168.65.90 resolvers: - 8.8.8.8 superuser_username: admin superuser_password_hash: "$6$rounds=656000$123o/Qz.InhbkbsO$kn5IkpWm5CplEorQo7jG/27LkyDgWrml36lLxDtckZkCxu22uihAJ4DOJVVnNbsz/Y5MCK3B1InquE6E7Jmh30" # admin ssh_port: 22 ssh_user: vagrant agent_list: []
--- cluster_name: dcos-vagrant bootstrap_url: http://boot.dcos exhibitor_storage_backend: static master_discovery: static master_list: - 192.168.65.90 resolvers: - 8.8.8.8 superuser_username: admin superuser_password_hash: "$6$rounds=656000$123o/Qz.InhbkbsO$kn5IkpWm5CplEorQo7jG/27LkyDgWrml36lLxDtckZkCxu22uihAJ4DOJVVnNbsz/Y5MCK3B1InquE6E7Jmh30" # admin ssh_port: 22 ssh_user: vagrant agent_list: []
Switch to static exhibitor to make multi-master clusters come up faster.
Switch to static exhibitor to make multi-master clusters come up faster.
YAML
apache-2.0
timcharper/dcos-vagrant,timcharper/dcos-vagrant
yaml
## Code Before: --- cluster_name: dcos-vagrant bootstrap_url: http://boot.dcos exhibitor_storage_backend: zookeeper exhibitor_zk_hosts: 192.168.65.50:2181 exhibitor_zk_path: /dcos master_discovery: static master_list: - 192.168.65.90 resolvers: - 8.8.8.8 superuser_username: admin superuser_password_hash: "$6$rounds=656000$123o/Qz.InhbkbsO$kn5IkpWm5CplEorQo7jG/27LkyDgWrml36lLxDtckZkCxu22uihAJ4DOJVVnNbsz/Y5MCK3B1InquE6E7Jmh30" # admin ssh_port: 22 ssh_user: vagrant agent_list: [] ## Instruction: Switch to static exhibitor to make multi-master clusters come up faster. ## Code After: --- cluster_name: dcos-vagrant bootstrap_url: http://boot.dcos exhibitor_storage_backend: static master_discovery: static master_list: - 192.168.65.90 resolvers: - 8.8.8.8 superuser_username: admin superuser_password_hash: "$6$rounds=656000$123o/Qz.InhbkbsO$kn5IkpWm5CplEorQo7jG/27LkyDgWrml36lLxDtckZkCxu22uihAJ4DOJVVnNbsz/Y5MCK3B1InquE6E7Jmh30" # admin ssh_port: 22 ssh_user: vagrant agent_list: []
--- cluster_name: dcos-vagrant bootstrap_url: http://boot.dcos - exhibitor_storage_backend: zookeeper ? ^^^^^^^^^ + exhibitor_storage_backend: static ? ^^^^^^ - exhibitor_zk_hosts: 192.168.65.50:2181 - exhibitor_zk_path: /dcos master_discovery: static master_list: - 192.168.65.90 resolvers: - 8.8.8.8 superuser_username: admin superuser_password_hash: "$6$rounds=656000$123o/Qz.InhbkbsO$kn5IkpWm5CplEorQo7jG/27LkyDgWrml36lLxDtckZkCxu22uihAJ4DOJVVnNbsz/Y5MCK3B1InquE6E7Jmh30" # admin ssh_port: 22 ssh_user: vagrant agent_list: []
4
0.25
1
3
716e04f203c10387bd66aa3bcf1663e75ce208cf
src/whitespace.md
src/whitespace.md
Whitespace is any non-empty string containing only characters that have the `Pattern_White_Space` Unicode property, namely: - `U+0009` (horizontal tab, `'\t'`) - `U+000A` (line feed, `'\n'`) - `U+000B` (vertical tab) - `U+000C` (form feed) - `U+000D` (carriage return, `'\r'`) - `U+0020` (space, `' '`) - `U+0085` (next line) - `U+200E` (left-to-right mark) - `U+200F` (right-to-left mark) - `U+2028` (line separator) - `U+2029` (paragraph separator) Rust is a "free-form" language, meaning that all forms of whitespace serve only to separate _tokens_ in the grammar, and have no semantic significance. A Rust program has identical meaning if each whitespace element is replaced with any other legal whitespace element, such as a single space character.
Whitespace is any non-empty string containing only characters that have the [`Pattern_White_Space`] Unicode property, namely: - `U+0009` (horizontal tab, `'\t'`) - `U+000A` (line feed, `'\n'`) - `U+000B` (vertical tab) - `U+000C` (form feed) - `U+000D` (carriage return, `'\r'`) - `U+0020` (space, `' '`) - `U+0085` (next line) - `U+200E` (left-to-right mark) - `U+200F` (right-to-left mark) - `U+2028` (line separator) - `U+2029` (paragraph separator) Rust is a "free-form" language, meaning that all forms of whitespace serve only to separate _tokens_ in the grammar, and have no semantic significance. A Rust program has identical meaning if each whitespace element is replaced with any other legal whitespace element, such as a single space character. [`Pattern_White_Space`]: https://www.unicode.org/reports/tr31/
Add a link to the definition of Pattern_White_Space.
Add a link to the definition of Pattern_White_Space.
Markdown
apache-2.0
rust-lang/reference,rust-lang/reference
markdown
## Code Before: Whitespace is any non-empty string containing only characters that have the `Pattern_White_Space` Unicode property, namely: - `U+0009` (horizontal tab, `'\t'`) - `U+000A` (line feed, `'\n'`) - `U+000B` (vertical tab) - `U+000C` (form feed) - `U+000D` (carriage return, `'\r'`) - `U+0020` (space, `' '`) - `U+0085` (next line) - `U+200E` (left-to-right mark) - `U+200F` (right-to-left mark) - `U+2028` (line separator) - `U+2029` (paragraph separator) Rust is a "free-form" language, meaning that all forms of whitespace serve only to separate _tokens_ in the grammar, and have no semantic significance. A Rust program has identical meaning if each whitespace element is replaced with any other legal whitespace element, such as a single space character. ## Instruction: Add a link to the definition of Pattern_White_Space. ## Code After: Whitespace is any non-empty string containing only characters that have the [`Pattern_White_Space`] Unicode property, namely: - `U+0009` (horizontal tab, `'\t'`) - `U+000A` (line feed, `'\n'`) - `U+000B` (vertical tab) - `U+000C` (form feed) - `U+000D` (carriage return, `'\r'`) - `U+0020` (space, `' '`) - `U+0085` (next line) - `U+200E` (left-to-right mark) - `U+200F` (right-to-left mark) - `U+2028` (line separator) - `U+2029` (paragraph separator) Rust is a "free-form" language, meaning that all forms of whitespace serve only to separate _tokens_ in the grammar, and have no semantic significance. A Rust program has identical meaning if each whitespace element is replaced with any other legal whitespace element, such as a single space character. [`Pattern_White_Space`]: https://www.unicode.org/reports/tr31/
Whitespace is any non-empty string containing only characters that have the - `Pattern_White_Space` Unicode property, namely: + [`Pattern_White_Space`] Unicode property, namely: ? + + - `U+0009` (horizontal tab, `'\t'`) - `U+000A` (line feed, `'\n'`) - `U+000B` (vertical tab) - `U+000C` (form feed) - `U+000D` (carriage return, `'\r'`) - `U+0020` (space, `' '`) - `U+0085` (next line) - `U+200E` (left-to-right mark) - `U+200F` (right-to-left mark) - `U+2028` (line separator) - `U+2029` (paragraph separator) Rust is a "free-form" language, meaning that all forms of whitespace serve only to separate _tokens_ in the grammar, and have no semantic significance. A Rust program has identical meaning if each whitespace element is replaced with any other legal whitespace element, such as a single space character. + + [`Pattern_White_Space`]: https://www.unicode.org/reports/tr31/
4
0.190476
3
1
9b00cdd68054bbf71f417e0535f19d19a14123c5
lib/daimon_skycrawlers/url_consumer.rb
lib/daimon_skycrawlers/url_consumer.rb
require 'daimon_skycrawlers/crawler' require 'daimon_skycrawlers/processor' module DaimonSkycrawlers class URLConsumer include SongkickQueue::Consumer consume_from_queue 'daimon-skycrawler.url' class << self def register(crawler) crawlers << crawler end private def crawlers @crawlers ||= [] end end def process(message) url = message[:url] self.class.crawlers.each do |crawler| crawler.fetch(url) end end end end
require 'daimon_skycrawlers/crawler' require 'daimon_skycrawlers/processor' module DaimonSkycrawlers class URLConsumer include SongkickQueue::Consumer consume_from_queue 'daimon-skycrawler.url' class << self def register(crawler) crawlers << crawler end private def crawlers @crawlers ||= [] end end def process(message) url = message[:url] # XXX When several crawlers are registed, how should they behave? self.class.crawlers.each do |crawler| crawler.fetch(url) end end end end
Add comment for unresolved behavior
Add comment for unresolved behavior I don't know now.
Ruby
mit
bm-sms/daimon_skycrawlers,bm-sms/daimon_skycrawlers,bm-sms/daimon-skycrawlers,bm-sms/daimon-skycrawlers,yucao24hours/daimon-skycrawlers,bm-sms/daimon_skycrawlers,yucao24hours/daimon-skycrawlers,yucao24hours/daimon-skycrawlers
ruby
## Code Before: require 'daimon_skycrawlers/crawler' require 'daimon_skycrawlers/processor' module DaimonSkycrawlers class URLConsumer include SongkickQueue::Consumer consume_from_queue 'daimon-skycrawler.url' class << self def register(crawler) crawlers << crawler end private def crawlers @crawlers ||= [] end end def process(message) url = message[:url] self.class.crawlers.each do |crawler| crawler.fetch(url) end end end end ## Instruction: Add comment for unresolved behavior I don't know now. ## Code After: require 'daimon_skycrawlers/crawler' require 'daimon_skycrawlers/processor' module DaimonSkycrawlers class URLConsumer include SongkickQueue::Consumer consume_from_queue 'daimon-skycrawler.url' class << self def register(crawler) crawlers << crawler end private def crawlers @crawlers ||= [] end end def process(message) url = message[:url] # XXX When several crawlers are registed, how should they behave? self.class.crawlers.each do |crawler| crawler.fetch(url) end end end end
require 'daimon_skycrawlers/crawler' require 'daimon_skycrawlers/processor' module DaimonSkycrawlers class URLConsumer include SongkickQueue::Consumer consume_from_queue 'daimon-skycrawler.url' class << self def register(crawler) crawlers << crawler end private def crawlers @crawlers ||= [] end end def process(message) url = message[:url] + # XXX When several crawlers are registed, how should they behave? self.class.crawlers.each do |crawler| crawler.fetch(url) end end end end
1
0.033333
1
0
fc1d6acf87b2c46665b2a1fa0a03e73399922715
.travis.yml
.travis.yml
language: go os: linux sudo: required go: - 1.x install: - echo "Don't run anything." script: - make test after_success: - bash <(curl -s https://codecov.io/bash)
language: go os: linux sudo: required go: - 1.x before_install: - sudo apt-get install -y libvirt-dev install: - echo "Don't run anything." script: - make test after_success: - bash <(curl -s https://codecov.io/bash)
Install libvirt-dev to build/lint kvm2
Install libvirt-dev to build/lint kvm2
YAML
apache-2.0
warmchang/minikube,kubernetes/minikube,kubernetes/minikube,dlorenc/minikube,dlorenc/minikube,kubernetes/minikube,dlorenc/minikube,warmchang/minikube,dlorenc/minikube,dalehamel/minikube,warmchang/minikube,warmchang/minikube,warmchang/minikube,warmchang/minikube,kubernetes/minikube,dlorenc/minikube,dlorenc/minikube,warmchang/minikube,dlorenc/minikube,kubernetes/minikube,kubernetes/minikube,dlorenc/minikube,dalehamel/minikube,dalehamel/minikube,kubernetes/minikube
yaml
## Code Before: language: go os: linux sudo: required go: - 1.x install: - echo "Don't run anything." script: - make test after_success: - bash <(curl -s https://codecov.io/bash) ## Instruction: Install libvirt-dev to build/lint kvm2 ## Code After: language: go os: linux sudo: required go: - 1.x before_install: - sudo apt-get install -y libvirt-dev install: - echo "Don't run anything." script: - make test after_success: - bash <(curl -s https://codecov.io/bash)
language: go os: linux sudo: required go: - 1.x + before_install: + - sudo apt-get install -y libvirt-dev install: - echo "Don't run anything." script: - make test after_success: - bash <(curl -s https://codecov.io/bash)
2
0.153846
2
0
c006daf770c667dd58909e3f25da41464a6cc0f0
styles/options-linux.css
styles/options-linux.css
/* Styles for the options page on Linux * Part of the CRX Options Page boilerplate * * Copyright 2013-2015 Zachary Yaro * Released under the MIT license * https://raw.github.com/zmyaro/crx-options-page/master/LICENSE.txt */ body { font-family: Cantarell, Arial, sans-serif; }
/* Styles for the options page on Linux * Part of the CRX Options Page boilerplate * * Copyright 2013-2015 Zachary Yaro * Released under the MIT license * https://raw.github.com/zmyaro/crx-options-page/master/LICENSE.txt */ body { font-family: sans-serif; }
Use the default sans-serif font on Linux
Use the default sans-serif font on Linux
CSS
mit
zmyaro/crx-options-page,zmyaro/crx-options-page
css
## Code Before: /* Styles for the options page on Linux * Part of the CRX Options Page boilerplate * * Copyright 2013-2015 Zachary Yaro * Released under the MIT license * https://raw.github.com/zmyaro/crx-options-page/master/LICENSE.txt */ body { font-family: Cantarell, Arial, sans-serif; } ## Instruction: Use the default sans-serif font on Linux ## Code After: /* Styles for the options page on Linux * Part of the CRX Options Page boilerplate * * Copyright 2013-2015 Zachary Yaro * Released under the MIT license * https://raw.github.com/zmyaro/crx-options-page/master/LICENSE.txt */ body { font-family: sans-serif; }
/* Styles for the options page on Linux * Part of the CRX Options Page boilerplate * * Copyright 2013-2015 Zachary Yaro * Released under the MIT license * https://raw.github.com/zmyaro/crx-options-page/master/LICENSE.txt */ body { - font-family: Cantarell, Arial, sans-serif; + font-family: sans-serif; }
2
0.181818
1
1
f83101039093b2f7b02ae50539125632bccb2493
README.md
README.md
[![Build Status](https://api.travis-ci.org/laboiteproject/laboite-backend.svg?branch=master)](https://travis-ci.org/laboiteproject/laboite-backend) # laboîte Django web app of the laboîte project http://laboite.cc/help ## Getting Started Make sure you are using a virtual environment of some sort (e.g. `virtualenv` or `pyenv`) and the following packages are installed : * libxslt1-dev * python2.7-dev (depending on your version) * zlib1g-dev * libjpeg-dev For exemple on linux distributions, use: ``` apt-get install libxslt1-dev python2.7-dev zlib1g-dev libjpeg-dev libcurl4-openssl-dev ``` ``` pip install -r requirements.txt ./manage.py migrate ./manage.py loaddata sites ./manage.py createsuperuser ./manage.py runserver ``` You can then connect to the admin on http://127.0.0.1:8000/admin with the super user you created above.
[![Build Status](https://api.travis-ci.org/laboiteproject/laboite-backend.svg?branch=master)](https://travis-ci.org/laboiteproject/laboite-backend) # laboîte Django web app of the laboîte project http://laboite.cc/help ## Getting Started Make sure you are using a virtual environment of some sort (e.g. `virtualenv` or `pyenv`) and the following packages are installed : * libxslt1-dev * python2.7-dev (depending on your version) * zlib1g-dev * libjpeg-dev * libcurl4-gnutls-dev * libgnutls28-dev For exemple on linux distributions, use: ``` apt-get install libxslt1-dev python2.7-dev zlib1g-dev libjpeg-dev libcurl4-openssl-dev ``` ``` pip install -r requirements.txt ./manage.py migrate ./manage.py loaddata sites ./manage.py createsuperuser ./manage.py runserver ``` You can then connect to the admin on http://127.0.0.1:8000/admin with the super user you created above.
Add system packages needed for pycurl build
Add system packages needed for pycurl build
Markdown
agpl-3.0
bgaultier/laboitepro,bgaultier/laboitepro,laboiteproject/laboite-backend,laboiteproject/laboite-backend,laboiteproject/laboite-backend,bgaultier/laboitepro
markdown
## Code Before: [![Build Status](https://api.travis-ci.org/laboiteproject/laboite-backend.svg?branch=master)](https://travis-ci.org/laboiteproject/laboite-backend) # laboîte Django web app of the laboîte project http://laboite.cc/help ## Getting Started Make sure you are using a virtual environment of some sort (e.g. `virtualenv` or `pyenv`) and the following packages are installed : * libxslt1-dev * python2.7-dev (depending on your version) * zlib1g-dev * libjpeg-dev For exemple on linux distributions, use: ``` apt-get install libxslt1-dev python2.7-dev zlib1g-dev libjpeg-dev libcurl4-openssl-dev ``` ``` pip install -r requirements.txt ./manage.py migrate ./manage.py loaddata sites ./manage.py createsuperuser ./manage.py runserver ``` You can then connect to the admin on http://127.0.0.1:8000/admin with the super user you created above. ## Instruction: Add system packages needed for pycurl build ## Code After: [![Build Status](https://api.travis-ci.org/laboiteproject/laboite-backend.svg?branch=master)](https://travis-ci.org/laboiteproject/laboite-backend) # laboîte Django web app of the laboîte project http://laboite.cc/help ## Getting Started Make sure you are using a virtual environment of some sort (e.g. `virtualenv` or `pyenv`) and the following packages are installed : * libxslt1-dev * python2.7-dev (depending on your version) * zlib1g-dev * libjpeg-dev * libcurl4-gnutls-dev * libgnutls28-dev For exemple on linux distributions, use: ``` apt-get install libxslt1-dev python2.7-dev zlib1g-dev libjpeg-dev libcurl4-openssl-dev ``` ``` pip install -r requirements.txt ./manage.py migrate ./manage.py loaddata sites ./manage.py createsuperuser ./manage.py runserver ``` You can then connect to the admin on http://127.0.0.1:8000/admin with the super user you created above.
[![Build Status](https://api.travis-ci.org/laboiteproject/laboite-backend.svg?branch=master)](https://travis-ci.org/laboiteproject/laboite-backend) # laboîte Django web app of the laboîte project http://laboite.cc/help ## Getting Started Make sure you are using a virtual environment of some sort (e.g. `virtualenv` or `pyenv`) and the following packages are installed : * libxslt1-dev * python2.7-dev (depending on your version) * zlib1g-dev * libjpeg-dev + * libcurl4-gnutls-dev + * libgnutls28-dev For exemple on linux distributions, use: ``` apt-get install libxslt1-dev python2.7-dev zlib1g-dev libjpeg-dev libcurl4-openssl-dev ``` ``` pip install -r requirements.txt ./manage.py migrate ./manage.py loaddata sites ./manage.py createsuperuser ./manage.py runserver ``` You can then connect to the admin on http://127.0.0.1:8000/admin with the super user you created above.
2
0.066667
2
0
b324efee64f24ac30158f80fdf2841c0d4c1f791
tools/check_interreplay_violations.rb
tools/check_interreplay_violations.rb
replay_number = 0 replay_to_violation = {} File.foreach(ARGV[0]) do |line| if line =~ /Current subset:/ replay_number += 1 end if line =~ /No violation in/ replay_to_violation[replay_number] = false end if line =~ /Violation!/ replay_to_violation[replay_number] = true end end replay_to_violation.keys.sort.each do |key| puts "Replay #{key} violation #{replay_to_violation[key]}" end
require 'json' replay_number = 0 replay_to_violation = {} File.foreach(ARGV[0]) do |line| if line =~ /Current subset:/ replay_number += 1 end if line =~ /No violation in/ replay_to_violation[replay_number] = false end if line =~ /Violation!/ replay_to_violation[replay_number] = true end end puts JSON.pretty_generate(replay_to_violation)
Print JSON rather than plain text
Print JSON rather than plain text
Ruby
apache-2.0
ucb-sts/sts,jmiserez/sts,jmiserez/sts,ucb-sts/sts
ruby
## Code Before: replay_number = 0 replay_to_violation = {} File.foreach(ARGV[0]) do |line| if line =~ /Current subset:/ replay_number += 1 end if line =~ /No violation in/ replay_to_violation[replay_number] = false end if line =~ /Violation!/ replay_to_violation[replay_number] = true end end replay_to_violation.keys.sort.each do |key| puts "Replay #{key} violation #{replay_to_violation[key]}" end ## Instruction: Print JSON rather than plain text ## Code After: require 'json' replay_number = 0 replay_to_violation = {} File.foreach(ARGV[0]) do |line| if line =~ /Current subset:/ replay_number += 1 end if line =~ /No violation in/ replay_to_violation[replay_number] = false end if line =~ /Violation!/ replay_to_violation[replay_number] = true end end puts JSON.pretty_generate(replay_to_violation)
+ + require 'json' replay_number = 0 replay_to_violation = {} File.foreach(ARGV[0]) do |line| if line =~ /Current subset:/ replay_number += 1 end if line =~ /No violation in/ replay_to_violation[replay_number] = false end if line =~ /Violation!/ replay_to_violation[replay_number] = true end end + puts JSON.pretty_generate(replay_to_violation) + - replay_to_violation.keys.sort.each do |key| - puts "Replay #{key} violation #{replay_to_violation[key]}" - end
7
0.368421
4
3
9f5503b4d63d3845996e76368dd3a6f723127866
code-generation/equatable.js
code-generation/equatable.js
const R = require('ramda') const indentLines = require('./utils/indentLines') const associatedNamesForCase = require('./utils/associatedNamesForCase') const equatesForAssociatedNames = R.pipe( R.map((associatedName) => `l.${associatedName} == r.${associatedName}`), R.join(' && ') ) const equatesForCase = R.converge((name, associatedNames) => ( !R.isEmpty(associatedNames) ? ([ `case let (.${name}(l), .${name}(r)):`, `\treturn ${ equatesForAssociatedNames(associatedNames) }` ]) : ([ `case let (.${name}, .${name}):`, `\treturn true` ]) ), [ R.prop('name'), associatedNamesForCase ]) const equatesFuncForEnum = R.converge( (enumName, innerLines) => R.flatten([ `public func == (lhs: ${enumName}, rhs: ${enumName}) {`, '\tswitch (lhs, rhs) {', indentLines(innerLines), '\t}', '}' ]), [ R.prop('name'), R.pipe( R.prop('cases'), R.map(equatesForCase), R.flatten ) ] ) module.exports = { equatesFuncForEnum }
const R = require('ramda') const indentLines = require('./utils/indentLines') const associatedNamesForCase = require('./utils/associatedNamesForCase') const equatesForAssociatedNames = R.pipe( R.map((associatedName) => `l.${associatedName} == r.${associatedName}`), R.join(' && ') ) const equatesForCase = R.converge((name, associatedNames) => ( !R.isEmpty(associatedNames) ? ([ `case let (.${name}(l), .${name}(r)):`, `\treturn ${ equatesForAssociatedNames(associatedNames) }` ]) : ([ `case let (.${name}, .${name}):`, `\treturn true` ]) ), [ R.prop('name'), associatedNamesForCase ]) const equatesFuncForEnum = R.converge( (enumName, innerLines) => R.flatten([ `public func == (lhs: ${enumName}, rhs: ${enumName}) -> Bool {`, '\tswitch (lhs, rhs) {', indentLines(innerLines), 'default:', '\treturn false', '\t}', '}' ]), [ R.prop('name'), R.pipe( R.prop('cases'), R.map(equatesForCase), R.flatten ) ] ) module.exports = { equatesFuncForEnum }
Fix syntax of generated ==
Fix syntax of generated ==
JavaScript
mit
BurntCaramel/swift-kick
javascript
## Code Before: const R = require('ramda') const indentLines = require('./utils/indentLines') const associatedNamesForCase = require('./utils/associatedNamesForCase') const equatesForAssociatedNames = R.pipe( R.map((associatedName) => `l.${associatedName} == r.${associatedName}`), R.join(' && ') ) const equatesForCase = R.converge((name, associatedNames) => ( !R.isEmpty(associatedNames) ? ([ `case let (.${name}(l), .${name}(r)):`, `\treturn ${ equatesForAssociatedNames(associatedNames) }` ]) : ([ `case let (.${name}, .${name}):`, `\treturn true` ]) ), [ R.prop('name'), associatedNamesForCase ]) const equatesFuncForEnum = R.converge( (enumName, innerLines) => R.flatten([ `public func == (lhs: ${enumName}, rhs: ${enumName}) {`, '\tswitch (lhs, rhs) {', indentLines(innerLines), '\t}', '}' ]), [ R.prop('name'), R.pipe( R.prop('cases'), R.map(equatesForCase), R.flatten ) ] ) module.exports = { equatesFuncForEnum } ## Instruction: Fix syntax of generated == ## Code After: const R = require('ramda') const indentLines = require('./utils/indentLines') const associatedNamesForCase = require('./utils/associatedNamesForCase') const equatesForAssociatedNames = R.pipe( R.map((associatedName) => `l.${associatedName} == r.${associatedName}`), R.join(' && ') ) const equatesForCase = R.converge((name, associatedNames) => ( !R.isEmpty(associatedNames) ? ([ `case let (.${name}(l), .${name}(r)):`, `\treturn ${ equatesForAssociatedNames(associatedNames) }` ]) : ([ `case let (.${name}, .${name}):`, `\treturn true` ]) ), [ R.prop('name'), associatedNamesForCase ]) const equatesFuncForEnum = R.converge( (enumName, innerLines) => R.flatten([ `public func == (lhs: ${enumName}, rhs: ${enumName}) -> Bool {`, '\tswitch (lhs, rhs) {', indentLines(innerLines), 'default:', '\treturn false', '\t}', '}' ]), [ R.prop('name'), R.pipe( R.prop('cases'), R.map(equatesForCase), R.flatten ) ] ) module.exports = { equatesFuncForEnum }
const R = require('ramda') const indentLines = require('./utils/indentLines') const associatedNamesForCase = require('./utils/associatedNamesForCase') const equatesForAssociatedNames = R.pipe( R.map((associatedName) => `l.${associatedName} == r.${associatedName}`), R.join(' && ') ) const equatesForCase = R.converge((name, associatedNames) => ( !R.isEmpty(associatedNames) ? ([ `case let (.${name}(l), .${name}(r)):`, `\treturn ${ equatesForAssociatedNames(associatedNames) }` ]) : ([ `case let (.${name}, .${name}):`, `\treturn true` ]) ), [ R.prop('name'), associatedNamesForCase ]) const equatesFuncForEnum = R.converge( (enumName, innerLines) => R.flatten([ - `public func == (lhs: ${enumName}, rhs: ${enumName}) {`, + `public func == (lhs: ${enumName}, rhs: ${enumName}) -> Bool {`, ? ++++++++ '\tswitch (lhs, rhs) {', indentLines(innerLines), + 'default:', + '\treturn false', '\t}', '}' ]), [ R.prop('name'), R.pipe( R.prop('cases'), R.map(equatesForCase), R.flatten ) ] ) module.exports = { equatesFuncForEnum }
4
0.090909
3
1
f541872a64d76bf5f5af83b52c6e97e60e424a69
packages/ai/airtable-api.yaml
packages/ai/airtable-api.yaml
homepage: https://github.com/ooblahman/airtable-api changelog-type: '' hash: ceb93fea0a23ab87bd8503a7fec421311e2cf387049f48a29c6b052dc3e2f485 test-bench-deps: base: -any airtable-api: -any maintainer: Anand Srinivasan synopsis: Requesting and introspecting Tables within an Airtable project. changelog: '' basic-deps: bytestring: -any base: ! '>=4.7 && <5' unordered-containers: -any text: -any wreq: -any lens: -any hashable: -any aeson: -any all-versions: - '0.1.0.0' author: Anand Srinivasan latest: '0.1.0.0' description-type: markdown description: ! '## The Airtable API for Haskell Provides a high-level interface to requesting and introspecting Tables within an Airtable project. ' license-name: BSD3
homepage: https://github.com/ooblahman/airtable-api changelog-type: '' hash: 5a02a8ebc6766ac7334ca61342bbc8b4581178db6a5491702bc79f33c49749b4 test-bench-deps: base: -any airtable-api: -any maintainer: Anand Srinivasan synopsis: Requesting and introspecting Tables within an Airtable project. changelog: '' basic-deps: bytestring: -any base: ! '>=4.7 && <5' unordered-containers: -any text: -any wreq: -any lens: -any hashable: -any aeson: -any all-versions: - '0.1.0.0' - '0.1.0.1' author: Anand Srinivasan latest: '0.1.0.1' description-type: markdown description: ! '## The Airtable API for Haskell Provides a high-level interface to requesting and introspecting Tables within an Airtable project. ' license-name: BSD3
Update from Hackage at 2017-02-07T22:24:45Z
Update from Hackage at 2017-02-07T22:24:45Z
YAML
mit
commercialhaskell/all-cabal-metadata
yaml
## Code Before: homepage: https://github.com/ooblahman/airtable-api changelog-type: '' hash: ceb93fea0a23ab87bd8503a7fec421311e2cf387049f48a29c6b052dc3e2f485 test-bench-deps: base: -any airtable-api: -any maintainer: Anand Srinivasan synopsis: Requesting and introspecting Tables within an Airtable project. changelog: '' basic-deps: bytestring: -any base: ! '>=4.7 && <5' unordered-containers: -any text: -any wreq: -any lens: -any hashable: -any aeson: -any all-versions: - '0.1.0.0' author: Anand Srinivasan latest: '0.1.0.0' description-type: markdown description: ! '## The Airtable API for Haskell Provides a high-level interface to requesting and introspecting Tables within an Airtable project. ' license-name: BSD3 ## Instruction: Update from Hackage at 2017-02-07T22:24:45Z ## Code After: homepage: https://github.com/ooblahman/airtable-api changelog-type: '' hash: 5a02a8ebc6766ac7334ca61342bbc8b4581178db6a5491702bc79f33c49749b4 test-bench-deps: base: -any airtable-api: -any maintainer: Anand Srinivasan synopsis: Requesting and introspecting Tables within an Airtable project. changelog: '' basic-deps: bytestring: -any base: ! '>=4.7 && <5' unordered-containers: -any text: -any wreq: -any lens: -any hashable: -any aeson: -any all-versions: - '0.1.0.0' - '0.1.0.1' author: Anand Srinivasan latest: '0.1.0.1' description-type: markdown description: ! '## The Airtable API for Haskell Provides a high-level interface to requesting and introspecting Tables within an Airtable project. ' license-name: BSD3
homepage: https://github.com/ooblahman/airtable-api changelog-type: '' - hash: ceb93fea0a23ab87bd8503a7fec421311e2cf387049f48a29c6b052dc3e2f485 + hash: 5a02a8ebc6766ac7334ca61342bbc8b4581178db6a5491702bc79f33c49749b4 test-bench-deps: base: -any airtable-api: -any maintainer: Anand Srinivasan synopsis: Requesting and introspecting Tables within an Airtable project. changelog: '' basic-deps: bytestring: -any base: ! '>=4.7 && <5' unordered-containers: -any text: -any wreq: -any lens: -any hashable: -any aeson: -any all-versions: - '0.1.0.0' + - '0.1.0.1' author: Anand Srinivasan - latest: '0.1.0.0' ? ^ + latest: '0.1.0.1' ? ^ description-type: markdown description: ! '## The Airtable API for Haskell Provides a high-level interface to requesting and introspecting Tables within an Airtable project. ' license-name: BSD3
5
0.172414
3
2
906576d97803b2fd65decd10706c9f7a368445c2
src/flambe/Log.hx
src/flambe/Log.hx
// // Flambe - Rapid game development // https://github.com/aduros/flambe/blob/master/LICENSE.txt package flambe; import flambe.util.Logger; class Log { public static var log = System.logger("flambe"); }
// // Flambe - Rapid game development // https://github.com/aduros/flambe/blob/master/LICENSE.txt package flambe; import flambe.util.Logger; class Log { #if server public static var log = flambe.server.Node.logger("flambe"); #else public static var log = System.logger("flambe"); #end }
Allow flambe's internal logger to be used on the server.
Allow flambe's internal logger to be used on the server.
Haxe
mit
weilitao/flambe,aduros/flambe,aduros/flambe,mikedotalmond/flambe,mikedotalmond/flambe,markknol/flambe,playedonline/flambe,Disar/flambe,Disar/flambe,playedonline/flambe,markknol/flambe,mikedotalmond/flambe,playedonline/flambe,aduros/flambe,playedonline/flambe,aduros/flambe,Disar/flambe,weilitao/flambe,weilitao/flambe,markknol/flambe,mikedotalmond/flambe,weilitao/flambe,Disar/flambe
haxe
## Code Before: // // Flambe - Rapid game development // https://github.com/aduros/flambe/blob/master/LICENSE.txt package flambe; import flambe.util.Logger; class Log { public static var log = System.logger("flambe"); } ## Instruction: Allow flambe's internal logger to be used on the server. ## Code After: // // Flambe - Rapid game development // https://github.com/aduros/flambe/blob/master/LICENSE.txt package flambe; import flambe.util.Logger; class Log { #if server public static var log = flambe.server.Node.logger("flambe"); #else public static var log = System.logger("flambe"); #end }
// // Flambe - Rapid game development // https://github.com/aduros/flambe/blob/master/LICENSE.txt package flambe; import flambe.util.Logger; class Log { + #if server + public static var log = flambe.server.Node.logger("flambe"); + #else public static var log = System.logger("flambe"); + #end }
4
0.333333
4
0
b301dd4eecd3840a9400e600dc63c102303ff0ff
README.md
README.md
League Of Legends - RunePage creator ==== Bon bah déjà désolé pour le titre anglais mais on sur un site anglais donc... En bref ---- Ce programme est un créateur de page de runes pour le jeu League Of Legends. Il vous permettra de sauvegarder et de charger des pages de runes déjà créée. L'éditeur est très simple, un clic sur l'index des runes l'ajoutera à votre page actuelle et un clic sur une rune déjà placée sur votre page la supprimera. *Actuellement ce programme n'est pas très utile mais il a été créé dans le but d'être intégré à une suite plus conséquenté qui lui permettra de trouver son utilité* Bla bla compliqué ---- Le programme est actuellement sous license APACHE v2 et vous êtes donc libre de : * partager le code. * réutiliser le code dans un autre programme. * modifier le code et le reposter. * réutiliser le code dans un logiciel comercial. Tout cela à condition de citer son auteur, à savoir moi uniquement pour le moment, zeFresk. C'est chiant hein ? ---- Donc du coup, commentez et présentez moi les améliorations que vou voudriez et... ####*ENJOY & HAVE FUN*
League Of Legends - RunePage creator ==== Bon bah déjà désolé pour le titre anglais mais on sur un site anglais donc... En bref ---- Ce programme est un créateur de page de runes pour le jeu League Of Legends. Il vous permettra de sauvegarder et de charger des pages de runes déjà créée. L'éditeur est très simple, un clic sur l'index des runes l'ajoutera à votre page actuelle et un clic sur une rune déjà placée sur votre page la supprimera. *Actuellement ce programme n'est pas très utile mais il a été créé dans le but d'être intégré à une suite plus conséquenté qui lui permettra de trouver son utilité* Où télécharger ? ---- Pour télécharger directement le programme compilé rendez-vous dans la section Binaries :D Bla bla compliqué ---- Le programme est actuellement sous license APACHE v2 et vous êtes donc libre de : * partager le code. * réutiliser le code dans un autre programme. * modifier le code et le reposter. * réutiliser le code dans un logiciel comercial. Tout cela à condition de citer son auteur, à savoir moi uniquement pour le moment, zeFresk. C'est chiant hein ? ---- Donc du coup, commentez et présentez moi les améliorations que vou voudriez et... ####*ENJOY & HAVE FUN*
Update du readme suite à l'ajout du dossier "binaries"
Update du readme suite à l'ajout du dossier "binaries"
Markdown
apache-2.0
zeFresk/RunePage-creator
markdown
## Code Before: League Of Legends - RunePage creator ==== Bon bah déjà désolé pour le titre anglais mais on sur un site anglais donc... En bref ---- Ce programme est un créateur de page de runes pour le jeu League Of Legends. Il vous permettra de sauvegarder et de charger des pages de runes déjà créée. L'éditeur est très simple, un clic sur l'index des runes l'ajoutera à votre page actuelle et un clic sur une rune déjà placée sur votre page la supprimera. *Actuellement ce programme n'est pas très utile mais il a été créé dans le but d'être intégré à une suite plus conséquenté qui lui permettra de trouver son utilité* Bla bla compliqué ---- Le programme est actuellement sous license APACHE v2 et vous êtes donc libre de : * partager le code. * réutiliser le code dans un autre programme. * modifier le code et le reposter. * réutiliser le code dans un logiciel comercial. Tout cela à condition de citer son auteur, à savoir moi uniquement pour le moment, zeFresk. C'est chiant hein ? ---- Donc du coup, commentez et présentez moi les améliorations que vou voudriez et... ####*ENJOY & HAVE FUN* ## Instruction: Update du readme suite à l'ajout du dossier "binaries" ## Code After: League Of Legends - RunePage creator ==== Bon bah déjà désolé pour le titre anglais mais on sur un site anglais donc... En bref ---- Ce programme est un créateur de page de runes pour le jeu League Of Legends. Il vous permettra de sauvegarder et de charger des pages de runes déjà créée. L'éditeur est très simple, un clic sur l'index des runes l'ajoutera à votre page actuelle et un clic sur une rune déjà placée sur votre page la supprimera. *Actuellement ce programme n'est pas très utile mais il a été créé dans le but d'être intégré à une suite plus conséquenté qui lui permettra de trouver son utilité* Où télécharger ? ---- Pour télécharger directement le programme compilé rendez-vous dans la section Binaries :D Bla bla compliqué ---- Le programme est actuellement sous license APACHE v2 et vous êtes donc libre de : * partager le code. * réutiliser le code dans un autre programme. * modifier le code et le reposter. * réutiliser le code dans un logiciel comercial. Tout cela à condition de citer son auteur, à savoir moi uniquement pour le moment, zeFresk. C'est chiant hein ? ---- Donc du coup, commentez et présentez moi les améliorations que vou voudriez et... ####*ENJOY & HAVE FUN*
League Of Legends - RunePage creator ==== Bon bah déjà désolé pour le titre anglais mais on sur un site anglais donc... En bref ---- Ce programme est un créateur de page de runes pour le jeu League Of Legends. Il vous permettra de sauvegarder et de charger des pages de runes déjà créée. L'éditeur est très simple, un clic sur l'index des runes l'ajoutera à votre page actuelle et un clic sur une rune déjà placée sur votre page la supprimera. *Actuellement ce programme n'est pas très utile mais il a été créé dans le but d'être intégré à une suite plus conséquenté qui lui permettra de trouver son utilité* + + Où télécharger ? + ---- + Pour télécharger directement le programme compilé rendez-vous dans la section Binaries :D Bla bla compliqué ---- Le programme est actuellement sous license APACHE v2 et vous êtes donc libre de : * partager le code. * réutiliser le code dans un autre programme. * modifier le code et le reposter. * réutiliser le code dans un logiciel comercial. Tout cela à condition de citer son auteur, à savoir moi uniquement pour le moment, zeFresk. C'est chiant hein ? ---- Donc du coup, commentez et présentez moi les améliorations que vou voudriez et... ####*ENJOY & HAVE FUN*
4
0.166667
4
0
ec367969fd42f3c1f0ed4778a65148301fead403
features/renalware/medications/recording_a_prescription.feature
features/renalware/medications/recording_a_prescription.feature
Feature: Recording a prescription Background: Given Clyde is a clinician And Patty is a patient @web @javascript Scenario: A clinician recorded the prescription for a patient When Clyde records the prescription for Patty Then the prescription is recorded for Patty
Feature: Recording a prescription Background: Given Clyde is a clinician And Patty is a patient @web @javascript Scenario: A clinician recorded the prescription for a patient When Clyde records the prescription for Patty Then the prescription is recorded for Patty @web @javascript @wip Scenario: A clinician recorded the prescription for a patient When Clyde records the prescription for Patty with a termination date Then the prescription is recorded for Patty And Clyde is recorded as the user who terminated the prescription
Add acceptance test for specifying the termination date when a prescription is recorded
Add acceptance test for specifying the termination date when a prescription is recorded
Cucumber
mit
airslie/renalware-core,airslie/renalware-core,airslie/renalware-core,airslie/renalware-core
cucumber
## Code Before: Feature: Recording a prescription Background: Given Clyde is a clinician And Patty is a patient @web @javascript Scenario: A clinician recorded the prescription for a patient When Clyde records the prescription for Patty Then the prescription is recorded for Patty ## Instruction: Add acceptance test for specifying the termination date when a prescription is recorded ## Code After: Feature: Recording a prescription Background: Given Clyde is a clinician And Patty is a patient @web @javascript Scenario: A clinician recorded the prescription for a patient When Clyde records the prescription for Patty Then the prescription is recorded for Patty @web @javascript @wip Scenario: A clinician recorded the prescription for a patient When Clyde records the prescription for Patty with a termination date Then the prescription is recorded for Patty And Clyde is recorded as the user who terminated the prescription
Feature: Recording a prescription Background: Given Clyde is a clinician And Patty is a patient @web @javascript Scenario: A clinician recorded the prescription for a patient When Clyde records the prescription for Patty Then the prescription is recorded for Patty + + @web @javascript @wip + Scenario: A clinician recorded the prescription for a patient + When Clyde records the prescription for Patty with a termination date + Then the prescription is recorded for Patty + And Clyde is recorded as the user who terminated the prescription
6
0.6
6
0
99380f22c898be0b97891297d8ff6faa82c42638
puppet/modules/mediawiki/templates/wiki/apache-images.erb
puppet/modules/mediawiki/templates/wiki/apache-images.erb
<Directory <%= @upload_dir %>> Require all granted Header set Access-Control-Allow-Origin "*" </Directory> Alias <%= @upload_path %> <%= @upload_dir %>
<Directory <%= @upload_dir %>> Require all granted Header set Access-Control-Allow-Origin "*" Header set Access-Control-Allow-Headers "Range" Header set Access-Control-Expose-Headers "Content-Range" </Directory> Alias <%= @upload_path %> <%= @upload_dir %>
Allow range requests on uploads; fixes 'commons' role video in Safari
Allow range requests on uploads; fixes 'commons' role video in Safari Adds a CORS allowance for the 'Range' header incoming and the 'Content-Range' header outgoing, which allows the ogv.js video shim for Safari and old Edge/IE11 to play video from the "commons" role on the other local sites. Bug: T225452 Change-Id: If6244027dfcb92009f604004a04bf82b9f43c206
HTML+ERB
mit
wikimedia/mediawiki-vagrant,wikimedia/mediawiki-vagrant,wikimedia/mediawiki-vagrant,wikimedia/mediawiki-vagrant,wikimedia/mediawiki-vagrant,wikimedia/mediawiki-vagrant
html+erb
## Code Before: <Directory <%= @upload_dir %>> Require all granted Header set Access-Control-Allow-Origin "*" </Directory> Alias <%= @upload_path %> <%= @upload_dir %> ## Instruction: Allow range requests on uploads; fixes 'commons' role video in Safari Adds a CORS allowance for the 'Range' header incoming and the 'Content-Range' header outgoing, which allows the ogv.js video shim for Safari and old Edge/IE11 to play video from the "commons" role on the other local sites. Bug: T225452 Change-Id: If6244027dfcb92009f604004a04bf82b9f43c206 ## Code After: <Directory <%= @upload_dir %>> Require all granted Header set Access-Control-Allow-Origin "*" Header set Access-Control-Allow-Headers "Range" Header set Access-Control-Expose-Headers "Content-Range" </Directory> Alias <%= @upload_path %> <%= @upload_dir %>
<Directory <%= @upload_dir %>> Require all granted Header set Access-Control-Allow-Origin "*" + Header set Access-Control-Allow-Headers "Range" + Header set Access-Control-Expose-Headers "Content-Range" </Directory> Alias <%= @upload_path %> <%= @upload_dir %>
2
0.333333
2
0
e75bd935b0197be728a53891b36cda4e1b1d446e
addon/components/form-controls/ff-radio.hbs
addon/components/form-controls/ff-radio.hbs
{{#each @values as |item|}} <div class="form-controls-ff-radio"> {{#let (compute this.idFor item) as |id|}} <input type="radio" name="{{@for}}" value="{{id}}" id="{{@for}}-{{id}}" ...attributes data-test-ff-control-radio data-test-ff-control-radio-option="{{id}}" {{on "change" this.handleChange}} /> <label for="{{@for}}-{{id}}"> {{compute this.labelFor item}} </label> {{/let}} </div> {{/each}}
{{#each @values as |item|}} <div class="form-controls-ff-radio"> {{#let (compute this.idFor item) as |id|}} <input type="radio" name="{{@for}}" value="{{id}}" id="{{@for}}-{{id}}" ...attributes data-test-ff-control-radio data-test-ff-control-radio-option="{{id}}" disabled={{@disabled}} {{on "change" this.handleChange}} /> <label for="{{@for}}-{{id}}"> {{compute this.labelFor item}} </label> {{/let}} </div> {{/each}}
Add disabled to radio button
Add disabled to radio button
Handlebars
mit
Foodee/ember-foxy-forms,Foodee/ember-foxy-forms
handlebars
## Code Before: {{#each @values as |item|}} <div class="form-controls-ff-radio"> {{#let (compute this.idFor item) as |id|}} <input type="radio" name="{{@for}}" value="{{id}}" id="{{@for}}-{{id}}" ...attributes data-test-ff-control-radio data-test-ff-control-radio-option="{{id}}" {{on "change" this.handleChange}} /> <label for="{{@for}}-{{id}}"> {{compute this.labelFor item}} </label> {{/let}} </div> {{/each}} ## Instruction: Add disabled to radio button ## Code After: {{#each @values as |item|}} <div class="form-controls-ff-radio"> {{#let (compute this.idFor item) as |id|}} <input type="radio" name="{{@for}}" value="{{id}}" id="{{@for}}-{{id}}" ...attributes data-test-ff-control-radio data-test-ff-control-radio-option="{{id}}" disabled={{@disabled}} {{on "change" this.handleChange}} /> <label for="{{@for}}-{{id}}"> {{compute this.labelFor item}} </label> {{/let}} </div> {{/each}}
{{#each @values as |item|}} <div class="form-controls-ff-radio"> {{#let (compute this.idFor item) as |id|}} <input type="radio" name="{{@for}}" value="{{id}}" id="{{@for}}-{{id}}" ...attributes data-test-ff-control-radio data-test-ff-control-radio-option="{{id}}" + disabled={{@disabled}} {{on "change" this.handleChange}} /> <label for="{{@for}}-{{id}}"> {{compute this.labelFor item}} </label> {{/let}} </div> {{/each}}
1
0.052632
1
0
6d6528182eb5dc21f41eb4ea5e4cfd08163edc96
sara_flexbe_states/src/sara_flexbe_states/Wonderland_Request.py
sara_flexbe_states/src/sara_flexbe_states/Wonderland_Request.py
import requests from flexbe_core import EventState, Logger class Wonderland_Request(EventState): ''' MoveArm receive a ROS pose as input and launch a ROS service with the same pose ># url string url to call <= response string Finish job. ''' def __init__(self): # See example_state.py for basic explanations. super(Wonderland_Request, self).__init__(outcomes=['done', 'error'], input_keys=['url'], output_keys=['response']) self._header = {'api-key': 'asdf'} def execute(self, userdata): # This method is called periodically while the state is active. # Main purpose is to check state conditions and trigger a corresponding outcome. # If no outcome is returned, the state will stay active. try: response = requests.get(userdata.url, headers=self._header) except requests.exceptions.RequestException as e: print e return 'error' userdata.response = response.content return 'done' # One of the outcomes declared above.
import requests from flexbe_core import EventState, Logger class Wonderland_Request(EventState): ''' Send requests to Wonderland server ># url string url to call <= response string Finish job. ''' def __init__(self): # See example_state.py for basic explanations. super(Wonderland_Request, self).__init__(outcomes=['done', 'error'], input_keys=['url'], output_keys=['response']) self._header = {'api-key': 'asdf'} def execute(self, userdata): # This method is called periodically while the state is active. # Main purpose is to check state conditions and trigger a corresponding outcome. # If no outcome is returned, the state will stay active. url = "http://192.168.0.46:8000/api/" + userdata.url try: response = requests.get(url, headers=self._header) except requests.exceptions.RequestException as e: print e return 'error' userdata.response = response.content return 'done' # One of the outcomes declared above.
Simplify state and save server URL
Simplify state and save server URL
Python
bsd-3-clause
WalkingMachine/sara_behaviors,WalkingMachine/sara_behaviors
python
## Code Before: import requests from flexbe_core import EventState, Logger class Wonderland_Request(EventState): ''' MoveArm receive a ROS pose as input and launch a ROS service with the same pose ># url string url to call <= response string Finish job. ''' def __init__(self): # See example_state.py for basic explanations. super(Wonderland_Request, self).__init__(outcomes=['done', 'error'], input_keys=['url'], output_keys=['response']) self._header = {'api-key': 'asdf'} def execute(self, userdata): # This method is called periodically while the state is active. # Main purpose is to check state conditions and trigger a corresponding outcome. # If no outcome is returned, the state will stay active. try: response = requests.get(userdata.url, headers=self._header) except requests.exceptions.RequestException as e: print e return 'error' userdata.response = response.content return 'done' # One of the outcomes declared above. ## Instruction: Simplify state and save server URL ## Code After: import requests from flexbe_core import EventState, Logger class Wonderland_Request(EventState): ''' Send requests to Wonderland server ># url string url to call <= response string Finish job. ''' def __init__(self): # See example_state.py for basic explanations. super(Wonderland_Request, self).__init__(outcomes=['done', 'error'], input_keys=['url'], output_keys=['response']) self._header = {'api-key': 'asdf'} def execute(self, userdata): # This method is called periodically while the state is active. # Main purpose is to check state conditions and trigger a corresponding outcome. # If no outcome is returned, the state will stay active. url = "http://192.168.0.46:8000/api/" + userdata.url try: response = requests.get(url, headers=self._header) except requests.exceptions.RequestException as e: print e return 'error' userdata.response = response.content return 'done' # One of the outcomes declared above.
import requests from flexbe_core import EventState, Logger class Wonderland_Request(EventState): ''' - MoveArm receive a ROS pose as input and launch a ROS service with the same pose + Send requests to Wonderland server ># url string url to call <= response string Finish job. ''' def __init__(self): # See example_state.py for basic explanations. super(Wonderland_Request, self).__init__(outcomes=['done', 'error'], input_keys=['url'], output_keys=['response']) self._header = {'api-key': 'asdf'} def execute(self, userdata): # This method is called periodically while the state is active. # Main purpose is to check state conditions and trigger a corresponding outcome. # If no outcome is returned, the state will stay active. + url = "http://192.168.0.46:8000/api/" + userdata.url try: - response = requests.get(userdata.url, headers=self._header) ? --------- + response = requests.get(url, headers=self._header) except requests.exceptions.RequestException as e: print e return 'error' userdata.response = response.content return 'done' # One of the outcomes declared above.
5
0.147059
3
2
1ee6a808cf5eb36901bc67718bd4ee5a00b0fa58
examples/address_book/app/controllers/application_controller.rb
examples/address_book/app/controllers/application_controller.rb
class ApplicationController < ActionController::Base protect_from_forgery around_filter :validate_schemas end
class ApplicationController < ActionController::Base protect_from_forgery around_filter :validate_schemas rescue_from_request_validation_error if Rails.env.development? end
Use request validation error handler.
Use request validation error handler.
Ruby
mit
nicolasdespres/respect-rails,nicolasdespres/respect-rails,nicolasdespres/respect-rails
ruby
## Code Before: class ApplicationController < ActionController::Base protect_from_forgery around_filter :validate_schemas end ## Instruction: Use request validation error handler. ## Code After: class ApplicationController < ActionController::Base protect_from_forgery around_filter :validate_schemas rescue_from_request_validation_error if Rails.env.development? end
class ApplicationController < ActionController::Base protect_from_forgery around_filter :validate_schemas + + rescue_from_request_validation_error if Rails.env.development? end
2
0.4
2
0
3874342b08c355251fdb4310c95a18f10bca183e
end2end-test-examples/echo-client/src/main/resources/logging.properties
end2end-test-examples/echo-client/src/main/resources/logging.properties
handlers = java.util.logging.ConsoleHandler java.util.logging.ConsoleHandler.level = ALL io.netty.handler.codec.http2.Http2FrameLogger.level = FINE .level = FINE io.grpc.netty.NettyClientHandler = ALL io.grpc.netty.NettyServerHandler = ALL
handlers = java.util.logging.ConsoleHandler java.util.logging.ConsoleHandler.level = ALL io.netty.handler.codec.http2.Http2FrameLogger.level = FINE .level = FINE io.grpc.netty.NettyClientHandler = ALL io.grpc.netty.NettyServerHandler = ALL java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter java.util.logging.SimpleFormatter.format=%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS.%1$tN %2$s%n%4$s: %5$s%6$s%n
Add nanoseconds to the logs timestamps
Add nanoseconds to the logs timestamps
INI
apache-2.0
GoogleCloudPlatform/grpc-gcp-java,GoogleCloudPlatform/grpc-gcp-java
ini
## Code Before: handlers = java.util.logging.ConsoleHandler java.util.logging.ConsoleHandler.level = ALL io.netty.handler.codec.http2.Http2FrameLogger.level = FINE .level = FINE io.grpc.netty.NettyClientHandler = ALL io.grpc.netty.NettyServerHandler = ALL ## Instruction: Add nanoseconds to the logs timestamps ## Code After: handlers = java.util.logging.ConsoleHandler java.util.logging.ConsoleHandler.level = ALL io.netty.handler.codec.http2.Http2FrameLogger.level = FINE .level = FINE io.grpc.netty.NettyClientHandler = ALL io.grpc.netty.NettyServerHandler = ALL java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter java.util.logging.SimpleFormatter.format=%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS.%1$tN %2$s%n%4$s: %5$s%6$s%n
handlers = java.util.logging.ConsoleHandler java.util.logging.ConsoleHandler.level = ALL io.netty.handler.codec.http2.Http2FrameLogger.level = FINE .level = FINE io.grpc.netty.NettyClientHandler = ALL io.grpc.netty.NettyServerHandler = ALL + java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter + java.util.logging.SimpleFormatter.format=%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS.%1$tN %2$s%n%4$s: %5$s%6$s%n
2
0.333333
2
0
57807924b4e4ec20b27a63f28b1277e373873c43
config/storage.yml
config/storage.yml
amazon: service: S3 access_key_id: <%= ENV['S3_REWARDS_ACCESS_KEY_ID'] %> secret_access_key: <%= ENV['S3_REWARDS_SECRET_ACCESS_KEY'] %> region: us-east-2 bucket: <%= ENV['S3_REWARDS_BUCKET_NAME'] %> local: service: Disk root: <%= Rails.root.join("storage") %> test: service: Disk root: <%= Rails.root.join("tmp/storage") %>
amazon: service: S3 access_key_id: <%= ENV['S3_REWARDS_ACCESS_KEY_ID'] %> secret_access_key: <%= ENV['S3_REWARDS_SECRET_ACCESS_KEY'] %> region: <%= ENV['S3_REWARDS_BUCKET_REGION'] %> bucket: <%= ENV['S3_REWARDS_BUCKET_NAME'] %> local: service: Disk root: <%= Rails.root.join("storage") %> test: service: Disk root: <%= Rails.root.join("tmp/storage") %>
Use S3 region based on env as opposed to hardcode
Use S3 region based on env as opposed to hardcode Closes #1251
YAML
mpl-2.0
brave/publishers,brave/publishers,brave/publishers
yaml
## Code Before: amazon: service: S3 access_key_id: <%= ENV['S3_REWARDS_ACCESS_KEY_ID'] %> secret_access_key: <%= ENV['S3_REWARDS_SECRET_ACCESS_KEY'] %> region: us-east-2 bucket: <%= ENV['S3_REWARDS_BUCKET_NAME'] %> local: service: Disk root: <%= Rails.root.join("storage") %> test: service: Disk root: <%= Rails.root.join("tmp/storage") %> ## Instruction: Use S3 region based on env as opposed to hardcode Closes #1251 ## Code After: amazon: service: S3 access_key_id: <%= ENV['S3_REWARDS_ACCESS_KEY_ID'] %> secret_access_key: <%= ENV['S3_REWARDS_SECRET_ACCESS_KEY'] %> region: <%= ENV['S3_REWARDS_BUCKET_REGION'] %> bucket: <%= ENV['S3_REWARDS_BUCKET_NAME'] %> local: service: Disk root: <%= Rails.root.join("storage") %> test: service: Disk root: <%= Rails.root.join("tmp/storage") %>
amazon: service: S3 access_key_id: <%= ENV['S3_REWARDS_ACCESS_KEY_ID'] %> secret_access_key: <%= ENV['S3_REWARDS_SECRET_ACCESS_KEY'] %> - region: us-east-2 + region: <%= ENV['S3_REWARDS_BUCKET_REGION'] %> bucket: <%= ENV['S3_REWARDS_BUCKET_NAME'] %> local: service: Disk root: <%= Rails.root.join("storage") %> test: service: Disk root: <%= Rails.root.join("tmp/storage") %>
2
0.142857
1
1
d8fff8b3627d406170455e957f18d2f924364d0a
app/Http/Controllers/QAController.php
app/Http/Controllers/QAController.php
<?php namespace RadDB\Http\Controllers; use Charts; use RadDB\Machine; use RadDB\TestDates; use RadDB\GenData; use RadDB\HVLData; use RadDB\RadSurveyData; use RadDB\RadiationOutput; use Illuminate\Http\Request; class QAController extends Controller { /** * Index page for QA/survey data section * * @return \Illuminate\Http\Response */ public function index() { // Show a table of machines with QA data in the database // Get a list of the survey IDs in the gendata table $surveys = GenData::select('survey_id')->distinct()->get(); $machines = TestDate::whereIn('id', $surveys->toArray())->get(); return view('qa.index', [ ]); } }
<?php namespace RadDB\Http\Controllers; use Charts; use RadDB\GenData; use RadDB\HVLData; use RadDB\Machine; use RadDB\TestDates; use RadDB\RadSurveyData; use RadDB\RadiationOutput; use Illuminate\Http\Request; class QAController extends Controller { /** * Index page for QA/survey data section * * @return \Illuminate\Http\Response */ public function index() { // Show a table of machines with QA data in the database // Get a list of the survey IDs in the gendata table $surveys = GenData::select('survey_id')->distinct()->get(); $machines = TestDate::whereIn('id', $surveys->toArray())->get(); return view('qa.index', [ 'surveys' => $surveys, 'machines' => $machines, ]); } }
Add variables to send to the view
Add variables to send to the view
PHP
mit
imabug/raddb,imabug/raddb,imabug/raddb
php
## Code Before: <?php namespace RadDB\Http\Controllers; use Charts; use RadDB\Machine; use RadDB\TestDates; use RadDB\GenData; use RadDB\HVLData; use RadDB\RadSurveyData; use RadDB\RadiationOutput; use Illuminate\Http\Request; class QAController extends Controller { /** * Index page for QA/survey data section * * @return \Illuminate\Http\Response */ public function index() { // Show a table of machines with QA data in the database // Get a list of the survey IDs in the gendata table $surveys = GenData::select('survey_id')->distinct()->get(); $machines = TestDate::whereIn('id', $surveys->toArray())->get(); return view('qa.index', [ ]); } } ## Instruction: Add variables to send to the view ## Code After: <?php namespace RadDB\Http\Controllers; use Charts; use RadDB\GenData; use RadDB\HVLData; use RadDB\Machine; use RadDB\TestDates; use RadDB\RadSurveyData; use RadDB\RadiationOutput; use Illuminate\Http\Request; class QAController extends Controller { /** * Index page for QA/survey data section * * @return \Illuminate\Http\Response */ public function index() { // Show a table of machines with QA data in the database // Get a list of the survey IDs in the gendata table $surveys = GenData::select('survey_id')->distinct()->get(); $machines = TestDate::whereIn('id', $surveys->toArray())->get(); return view('qa.index', [ 'surveys' => $surveys, 'machines' => $machines, ]); } }
<?php namespace RadDB\Http\Controllers; use Charts; + use RadDB\GenData; + use RadDB\HVLData; use RadDB\Machine; use RadDB\TestDates; - use RadDB\GenData; - use RadDB\HVLData; use RadDB\RadSurveyData; use RadDB\RadiationOutput; use Illuminate\Http\Request; class QAController extends Controller { /** * Index page for QA/survey data section * * @return \Illuminate\Http\Response */ public function index() { // Show a table of machines with QA data in the database // Get a list of the survey IDs in the gendata table $surveys = GenData::select('survey_id')->distinct()->get(); $machines = TestDate::whereIn('id', $surveys->toArray())->get(); - + return view('qa.index', [ - + 'surveys' => $surveys, + 'machines' => $machines, ]); } }
9
0.28125
5
4
efac484ce4ab514d4bfc5c97b303effa8f5cf69a
.travis.yml
.travis.yml
before_script: - "mysql -e 'create database sequelize_test;'" - "psql -c 'create database sequelize_test;' -U postgres" script: - "node_modules/.bin/gulp" notifications: irc: - "chat.freenode.net#sequelizejs" env: - DIALECT=mysql - DIALECT=postgres - DIALECT=postgres-native - DIALECT=sqlite - DIALECT=mariadb language: node_js node_js: - "0.10" sudo: false addons: postgresql: "9.3" cache: directories: - node_modules
before_script: - "mysql -e 'create database sequelize_test;'" - "psql -c 'create database sequelize_test;' -U postgres" - npm install js2coffee@$(echo $JS2COFFEE) script: - "node_modules/.bin/gulp" notifications: irc: - "chat.freenode.net#sequelizejs" env: - JS2COFFEE=0.3.5 DIALECT=mysql - JS2COFFEE=2.0.0 DIALECT=mysql - JS2COFFEE=0.3.5 DIALECT=sqlite - JS2COFFEE=2.0.0 DIALECT=sqlite language: node_js node_js: - "0.10" sudo: false addons: postgresql: "9.3" cache: directories: - node_modules
Add matrix for different js2coffee versions
Add matrix for different js2coffee versions
YAML
mit
ataube/cli,martinLE/cli,Americas/cli,brad-decker/cli,martinLE/cli,brad-decker/cli,timrourke/cli,brad-decker/cli,sequelize/cli,cogpie/cli,jteplitz602/cli,sequelize/cli,sequelize/cli,martinLE/cli,Americas/cli,fundon/cli,skv-headless/cli,Americas/cli,my-archives/cli,xpepermint/cli
yaml
## Code Before: before_script: - "mysql -e 'create database sequelize_test;'" - "psql -c 'create database sequelize_test;' -U postgres" script: - "node_modules/.bin/gulp" notifications: irc: - "chat.freenode.net#sequelizejs" env: - DIALECT=mysql - DIALECT=postgres - DIALECT=postgres-native - DIALECT=sqlite - DIALECT=mariadb language: node_js node_js: - "0.10" sudo: false addons: postgresql: "9.3" cache: directories: - node_modules ## Instruction: Add matrix for different js2coffee versions ## Code After: before_script: - "mysql -e 'create database sequelize_test;'" - "psql -c 'create database sequelize_test;' -U postgres" - npm install js2coffee@$(echo $JS2COFFEE) script: - "node_modules/.bin/gulp" notifications: irc: - "chat.freenode.net#sequelizejs" env: - JS2COFFEE=0.3.5 DIALECT=mysql - JS2COFFEE=2.0.0 DIALECT=mysql - JS2COFFEE=0.3.5 DIALECT=sqlite - JS2COFFEE=2.0.0 DIALECT=sqlite language: node_js node_js: - "0.10" sudo: false addons: postgresql: "9.3" cache: directories: - node_modules
before_script: - "mysql -e 'create database sequelize_test;'" - "psql -c 'create database sequelize_test;' -U postgres" + - npm install js2coffee@$(echo $JS2COFFEE) script: - "node_modules/.bin/gulp" notifications: irc: - "chat.freenode.net#sequelizejs" env: + - JS2COFFEE=0.3.5 DIALECT=mysql + - JS2COFFEE=2.0.0 DIALECT=mysql + - JS2COFFEE=0.3.5 DIALECT=sqlite + - JS2COFFEE=2.0.0 DIALECT=sqlite - - DIALECT=mysql - - DIALECT=postgres - - DIALECT=postgres-native - - DIALECT=sqlite - - DIALECT=mariadb language: node_js node_js: - "0.10" sudo: false addons: postgresql: "9.3" cache: directories: - node_modules
10
0.322581
5
5
9cddd25c7b56ece0325ab172a45061fa425e9773
README.md
README.md
Google Calendar Web App Script ============================== This is an Easter Egg for Nuvola Player 3, so it isn't shown in the services selector dialog, but you have to launch it from terminal: ``nuvolaplayer3 -a google_calendar`` Features -------- * Runs in background when the main window is closed. (This can be disabled in preferences.) * Propagates web app alerts (e.g. calendar event notifications) as desktop notifications. * Opens external links in your default web browser. * Tray icon support. Support ------- This web app script comes with no support. It's an Easter Egg! License ------- Files: icon.png src/icon.svg icons/*.png * Author: [Panomedia](https://www.iconfinder.com/paomedia) * Source: <http://www.iconfinder.com/icons/285665/calendar_icon#size=128> * License: [Creative Commons (Attribution 3.0 Unported)](http://creativecommons.org/licenses/by/3.0/) Files: * * Author: Copyright 2014-2015 Jiři Janoušek <janousek.jiri@gmail.com> * License: [BSD-2-Clause](./LICENSE)
Google Calendar Web App Script ============================== Integration of Google Calendar web app into your linux desktop via an experimental Nuvola Apps Alpha mode of [Nuvola Player](https://github.com/tiliado/nuvolaplayer). Features -------- * Runs in background when the main window is closed. (This can be disabled in preferences.) * Propagates web app alerts (e.g. calendar event notifications) as desktop notifications. * Opens external links in your default web browser. * Tray icon support. Support ------- Nuvola Apps Alpha mode of [Nuvola Player](https://github.com/tiliado/nuvolaplayer) is an experimental feature and comes with no support for now. We hope to improve this situation when [project funding](https://tiliado.eu/nuvolaplayer/funding/) gets better. Installation ------------ * Execute ``make help`` to get help. * Execute ``make build`` to build graphics. * Execute ``make install`` to install files to user's local directory. * Don't execute ``make uninstall``. Why would you do that? License ------- Files: icon.png src/icon.svg icons/*.png * Author: [Panomedia](https://www.iconfinder.com/paomedia) * Source: <http://www.iconfinder.com/icons/285665/calendar_icon#size=128> * License: [Creative Commons (Attribution 3.0 Unported)](http://creativecommons.org/licenses/by/3.0/) Files: * * Author: Copyright 2014-2015 Jiři Janoušek <janousek.jiri@gmail.com> * License: [BSD-2-Clause](./LICENSE)
Update description, support & installation texts
Update description, support & installation texts Signed-off-by: Jiří Janoušek <2a48236b6dcae98c8c0e90f4673742773ee17d91@gmail.com>
Markdown
bsd-2-clause
tiliado/nuvola-app-google-calendar
markdown
## Code Before: Google Calendar Web App Script ============================== This is an Easter Egg for Nuvola Player 3, so it isn't shown in the services selector dialog, but you have to launch it from terminal: ``nuvolaplayer3 -a google_calendar`` Features -------- * Runs in background when the main window is closed. (This can be disabled in preferences.) * Propagates web app alerts (e.g. calendar event notifications) as desktop notifications. * Opens external links in your default web browser. * Tray icon support. Support ------- This web app script comes with no support. It's an Easter Egg! License ------- Files: icon.png src/icon.svg icons/*.png * Author: [Panomedia](https://www.iconfinder.com/paomedia) * Source: <http://www.iconfinder.com/icons/285665/calendar_icon#size=128> * License: [Creative Commons (Attribution 3.0 Unported)](http://creativecommons.org/licenses/by/3.0/) Files: * * Author: Copyright 2014-2015 Jiři Janoušek <janousek.jiri@gmail.com> * License: [BSD-2-Clause](./LICENSE) ## Instruction: Update description, support & installation texts Signed-off-by: Jiří Janoušek <2a48236b6dcae98c8c0e90f4673742773ee17d91@gmail.com> ## Code After: Google Calendar Web App Script ============================== Integration of Google Calendar web app into your linux desktop via an experimental Nuvola Apps Alpha mode of [Nuvola Player](https://github.com/tiliado/nuvolaplayer). Features -------- * Runs in background when the main window is closed. (This can be disabled in preferences.) * Propagates web app alerts (e.g. calendar event notifications) as desktop notifications. * Opens external links in your default web browser. * Tray icon support. Support ------- Nuvola Apps Alpha mode of [Nuvola Player](https://github.com/tiliado/nuvolaplayer) is an experimental feature and comes with no support for now. We hope to improve this situation when [project funding](https://tiliado.eu/nuvolaplayer/funding/) gets better. Installation ------------ * Execute ``make help`` to get help. * Execute ``make build`` to build graphics. * Execute ``make install`` to install files to user's local directory. * Don't execute ``make uninstall``. Why would you do that? License ------- Files: icon.png src/icon.svg icons/*.png * Author: [Panomedia](https://www.iconfinder.com/paomedia) * Source: <http://www.iconfinder.com/icons/285665/calendar_icon#size=128> * License: [Creative Commons (Attribution 3.0 Unported)](http://creativecommons.org/licenses/by/3.0/) Files: * * Author: Copyright 2014-2015 Jiři Janoušek <janousek.jiri@gmail.com> * License: [BSD-2-Clause](./LICENSE)
Google Calendar Web App Script ============================== - This is an Easter Egg for Nuvola Player 3, so it isn't shown in the services selector dialog, - but you have to launch it from terminal: ``nuvolaplayer3 -a google_calendar`` + Integration of Google Calendar web app into your linux desktop via + an experimental Nuvola Apps Alpha mode of + [Nuvola Player](https://github.com/tiliado/nuvolaplayer). Features -------- * Runs in background when the main window is closed. (This can be disabled in preferences.) * Propagates web app alerts (e.g. calendar event notifications) as desktop notifications. * Opens external links in your default web browser. * Tray icon support. Support ------- - This web app script comes with no support. It's an Easter Egg! + Nuvola Apps Alpha mode of [Nuvola Player](https://github.com/tiliado/nuvolaplayer) is an + experimental feature and comes with no support for now. We hope to improve this situation when + [project funding](https://tiliado.eu/nuvolaplayer/funding/) gets better. + + Installation + ------------ + + * Execute ``make help`` to get help. + * Execute ``make build`` to build graphics. + * Execute ``make install`` to install files to user's local directory. + * Don't execute ``make uninstall``. Why would you do that? License ------- Files: icon.png src/icon.svg icons/*.png * Author: [Panomedia](https://www.iconfinder.com/paomedia) * Source: <http://www.iconfinder.com/icons/285665/calendar_icon#size=128> * License: [Creative Commons (Attribution 3.0 Unported)](http://creativecommons.org/licenses/by/3.0/) Files: * * Author: Copyright 2014-2015 Jiři Janoušek <janousek.jiri@gmail.com> * License: [BSD-2-Clause](./LICENSE)
17
0.53125
14
3
bc29cf18bdff21812b5a7a05d4ac30c45b709b85
serverspec/spec/monitoring/monitoring_configure_spec.rb
serverspec/spec/monitoring/monitoring_configure_spec.rb
require 'spec_helper' require 'zabbix_client' describe service('httpd') do it { should be_enabled } end describe service('mysqld') do it { should be_enabled } end describe service('zabbix_agentd') do it { should be_enabled } end describe service('zabbix_server') do it { should be_enabled } end describe 'zabbix server example' do params = property[:consul_parameters] if params[:zabbix] && param[:zabbix][:web] && param[:zabbix][:web][:fqdn] server = param[:zabbix][:web][:fqdn] else server = 'localhost' end if params[:zabbix] && param[:zabbix][:web] && param[:zabbix][:web][:login] user = param[:zabbix][:web][:login] else user = 'admin' end if params[:zabbix] && param[:zabbix][:web] && param[:zabbix][:web][:password] passwd = param[:zabbix][:web][:password] else passwd = 'zabbix' end zabbix_client = CloudConductor::ZabbixClient.new(server, user, passwd) servers = property[:servers] servers.each_key do |hostname| result = zabbix_client.exist_host("#{hostname}") it "#{hostname} is registered in zabbix" do result.should be_truthy end end end
require 'spec_helper' require 'zabbix_client' describe service('httpd') do it { should be_enabled } end describe service('mysqld') do it { should be_enabled } end describe service('zabbix_agentd') do it { should be_enabled } end describe service('zabbix_server') do it { should be_enabled } end describe 'zabbix server example' do before do @http_proxy = ENV['http_proxy'] ENV['http_proxy'] = nil end after do ENV['http_proxy'] = @http_proxy end params = property[:consul_parameters] if params[:zabbix] && param[:zabbix][:web] && param[:zabbix][:web][:fqdn] server = param[:zabbix][:web][:fqdn] else server = 'localhost' end if params[:zabbix] && param[:zabbix][:web] && param[:zabbix][:web][:login] user = param[:zabbix][:web][:login] else user = 'admin' end if params[:zabbix] && param[:zabbix][:web] && param[:zabbix][:web][:password] passwd = param[:zabbix][:web][:password] else passwd = 'zabbix' end zabbix_client = CloudConductor::ZabbixClient.new(server, user, passwd) servers = property[:servers] servers.each_key do |hostname| result = zabbix_client.exist_host("#{hostname}") it "#{hostname} is registered in zabbix" do result.should be_truthy end end end
Fix serverspec to ignore http_proxy.
Fix serverspec to ignore http_proxy.
Ruby
apache-2.0
cloudconductor-patterns/zabbix_pattern,cloudconductor-patterns/zabbix_pattern,cloudconductor-patterns/zabbix_pattern,cloudconductor-patterns/zabbix_pattern
ruby
## Code Before: require 'spec_helper' require 'zabbix_client' describe service('httpd') do it { should be_enabled } end describe service('mysqld') do it { should be_enabled } end describe service('zabbix_agentd') do it { should be_enabled } end describe service('zabbix_server') do it { should be_enabled } end describe 'zabbix server example' do params = property[:consul_parameters] if params[:zabbix] && param[:zabbix][:web] && param[:zabbix][:web][:fqdn] server = param[:zabbix][:web][:fqdn] else server = 'localhost' end if params[:zabbix] && param[:zabbix][:web] && param[:zabbix][:web][:login] user = param[:zabbix][:web][:login] else user = 'admin' end if params[:zabbix] && param[:zabbix][:web] && param[:zabbix][:web][:password] passwd = param[:zabbix][:web][:password] else passwd = 'zabbix' end zabbix_client = CloudConductor::ZabbixClient.new(server, user, passwd) servers = property[:servers] servers.each_key do |hostname| result = zabbix_client.exist_host("#{hostname}") it "#{hostname} is registered in zabbix" do result.should be_truthy end end end ## Instruction: Fix serverspec to ignore http_proxy. ## Code After: require 'spec_helper' require 'zabbix_client' describe service('httpd') do it { should be_enabled } end describe service('mysqld') do it { should be_enabled } end describe service('zabbix_agentd') do it { should be_enabled } end describe service('zabbix_server') do it { should be_enabled } end describe 'zabbix server example' do before do @http_proxy = ENV['http_proxy'] ENV['http_proxy'] = nil end after do ENV['http_proxy'] = @http_proxy end params = property[:consul_parameters] if params[:zabbix] && param[:zabbix][:web] && param[:zabbix][:web][:fqdn] server = param[:zabbix][:web][:fqdn] else server = 'localhost' end if params[:zabbix] && param[:zabbix][:web] && param[:zabbix][:web][:login] user = param[:zabbix][:web][:login] else user = 'admin' end if params[:zabbix] && param[:zabbix][:web] && param[:zabbix][:web][:password] passwd = param[:zabbix][:web][:password] else passwd = 'zabbix' end zabbix_client = CloudConductor::ZabbixClient.new(server, user, passwd) servers = property[:servers] servers.each_key do |hostname| result = zabbix_client.exist_host("#{hostname}") it "#{hostname} is registered in zabbix" do result.should be_truthy end end end
require 'spec_helper' require 'zabbix_client' describe service('httpd') do it { should be_enabled } end describe service('mysqld') do it { should be_enabled } end describe service('zabbix_agentd') do it { should be_enabled } end describe service('zabbix_server') do it { should be_enabled } end describe 'zabbix server example' do + before do + @http_proxy = ENV['http_proxy'] + ENV['http_proxy'] = nil + end + + after do + ENV['http_proxy'] = @http_proxy + end + params = property[:consul_parameters] if params[:zabbix] && param[:zabbix][:web] && param[:zabbix][:web][:fqdn] server = param[:zabbix][:web][:fqdn] else server = 'localhost' end if params[:zabbix] && param[:zabbix][:web] && param[:zabbix][:web][:login] user = param[:zabbix][:web][:login] else user = 'admin' end if params[:zabbix] && param[:zabbix][:web] && param[:zabbix][:web][:password] passwd = param[:zabbix][:web][:password] else passwd = 'zabbix' end zabbix_client = CloudConductor::ZabbixClient.new(server, user, passwd) servers = property[:servers] servers.each_key do |hostname| result = zabbix_client.exist_host("#{hostname}") it "#{hostname} is registered in zabbix" do result.should be_truthy end end end
9
0.1875
9
0
7d59b1f03e8398de2295339e7eb3569149ee993a
.travis.yml
.travis.yml
language: node_js node_js: - '5.5' - '5.2' - '4.1' - '4.0' script: gulp after_success: - cat ./docs/code-coverage/lcov.info | node node_modules/coveralls/bin/coveralls.js
language: node_js node_js: - '6.0' - '5.5' - '5.2' - '4.1' - '4.0' script: gulp after_success: - cat ./docs/code-coverage/lcov.info | node node_modules/coveralls/bin/coveralls.js deploy: provider: npm api_key: "$NPM_AUTH_KEY" email: eventsauce@cobaltsoftware.net skip_cleanup: true on: tags: true node_js: 6.0
Test on Node 6, and npm publish.
Test on Node 6, and npm publish.
YAML
mit
steve-gray/somersault
yaml
## Code Before: language: node_js node_js: - '5.5' - '5.2' - '4.1' - '4.0' script: gulp after_success: - cat ./docs/code-coverage/lcov.info | node node_modules/coveralls/bin/coveralls.js ## Instruction: Test on Node 6, and npm publish. ## Code After: language: node_js node_js: - '6.0' - '5.5' - '5.2' - '4.1' - '4.0' script: gulp after_success: - cat ./docs/code-coverage/lcov.info | node node_modules/coveralls/bin/coveralls.js deploy: provider: npm api_key: "$NPM_AUTH_KEY" email: eventsauce@cobaltsoftware.net skip_cleanup: true on: tags: true node_js: 6.0
language: node_js node_js: + - '6.0' - '5.5' - '5.2' - '4.1' - '4.0' script: gulp after_success: - cat ./docs/code-coverage/lcov.info | node node_modules/coveralls/bin/coveralls.js + + deploy: + provider: npm + api_key: "$NPM_AUTH_KEY" + email: eventsauce@cobaltsoftware.net + skip_cleanup: true + on: + tags: true + node_js: 6.0
10
1
10
0
cbec0d253d7b451cb5584329b21900dbbce7ab19
src/components/common/SourceOrCollectionWidget.js
src/components/common/SourceOrCollectionWidget.js
import PropTypes from 'prop-types'; import React from 'react'; import { Col } from 'react-flexbox-grid/lib'; import { DeleteButton } from './IconButton'; const SourceOrCollectionWidget = (props) => { const { object, onDelete, onClick, children } = props; const isCollection = object.tags_id !== undefined; const typeClass = isCollection ? 'collection' : 'source'; const objectId = object.id || (isCollection ? object.tags_id : object.media_id); const name = isCollection ? (object.name || object.label || object.tag) : (object.name || object.label || object.url); return ( <div className={`media-widget ${typeClass}`} key={`media-widget${objectId}`} > <Col> <a href="#" onClick={onClick}>{name}</a> {children} </Col> <Col> <DeleteButton onClick={onDelete} /> </Col> </div> ); }; SourceOrCollectionWidget.propTypes = { object: PropTypes.object.isRequired, onDelete: PropTypes.func, onClick: PropTypes.func, children: PropTypes.node, }; export default SourceOrCollectionWidget;
import PropTypes from 'prop-types'; import React from 'react'; import { Col } from 'react-flexbox-grid/lib'; import { DeleteButton } from './IconButton'; const SourceOrCollectionWidget = (props) => { const { object, onDelete, onClick, children } = props; const isCollection = object.tags_id !== undefined; const typeClass = isCollection ? 'collection' : 'source'; const objectId = object.id || (isCollection ? object.tags_id : object.media_id); const name = isCollection ? (object.name || object.label || object.tag) : (object.name || object.label || object.url); // link the text if there is a click handler defined let text = name; if (onClick) { text = (<a href="#" onClick={onClick}>{name}</a>); } return ( <div className={`media-widget ${typeClass}`} key={`media-widget${objectId}`} > <Col> {text} {children} </Col> <Col> {onDelete && <DeleteButton onClick={onDelete} />} </Col> </div> ); }; SourceOrCollectionWidget.propTypes = { object: PropTypes.object.isRequired, onDelete: PropTypes.func, onClick: PropTypes.func, children: PropTypes.node, }; export default SourceOrCollectionWidget;
Handle list of media/collections that aren't clickable
Handle list of media/collections that aren't clickable
JavaScript
apache-2.0
mitmedialab/MediaCloud-Web-Tools,mitmedialab/MediaCloud-Web-Tools,mitmedialab/MediaCloud-Web-Tools,mitmedialab/MediaCloud-Web-Tools
javascript
## Code Before: import PropTypes from 'prop-types'; import React from 'react'; import { Col } from 'react-flexbox-grid/lib'; import { DeleteButton } from './IconButton'; const SourceOrCollectionWidget = (props) => { const { object, onDelete, onClick, children } = props; const isCollection = object.tags_id !== undefined; const typeClass = isCollection ? 'collection' : 'source'; const objectId = object.id || (isCollection ? object.tags_id : object.media_id); const name = isCollection ? (object.name || object.label || object.tag) : (object.name || object.label || object.url); return ( <div className={`media-widget ${typeClass}`} key={`media-widget${objectId}`} > <Col> <a href="#" onClick={onClick}>{name}</a> {children} </Col> <Col> <DeleteButton onClick={onDelete} /> </Col> </div> ); }; SourceOrCollectionWidget.propTypes = { object: PropTypes.object.isRequired, onDelete: PropTypes.func, onClick: PropTypes.func, children: PropTypes.node, }; export default SourceOrCollectionWidget; ## Instruction: Handle list of media/collections that aren't clickable ## Code After: import PropTypes from 'prop-types'; import React from 'react'; import { Col } from 'react-flexbox-grid/lib'; import { DeleteButton } from './IconButton'; const SourceOrCollectionWidget = (props) => { const { object, onDelete, onClick, children } = props; const isCollection = object.tags_id !== undefined; const typeClass = isCollection ? 'collection' : 'source'; const objectId = object.id || (isCollection ? object.tags_id : object.media_id); const name = isCollection ? (object.name || object.label || object.tag) : (object.name || object.label || object.url); // link the text if there is a click handler defined let text = name; if (onClick) { text = (<a href="#" onClick={onClick}>{name}</a>); } return ( <div className={`media-widget ${typeClass}`} key={`media-widget${objectId}`} > <Col> {text} {children} </Col> <Col> {onDelete && <DeleteButton onClick={onDelete} />} </Col> </div> ); }; SourceOrCollectionWidget.propTypes = { object: PropTypes.object.isRequired, onDelete: PropTypes.func, onClick: PropTypes.func, children: PropTypes.node, }; export default SourceOrCollectionWidget;
import PropTypes from 'prop-types'; import React from 'react'; import { Col } from 'react-flexbox-grid/lib'; import { DeleteButton } from './IconButton'; const SourceOrCollectionWidget = (props) => { const { object, onDelete, onClick, children } = props; const isCollection = object.tags_id !== undefined; const typeClass = isCollection ? 'collection' : 'source'; const objectId = object.id || (isCollection ? object.tags_id : object.media_id); const name = isCollection ? (object.name || object.label || object.tag) : (object.name || object.label || object.url); + // link the text if there is a click handler defined + let text = name; + if (onClick) { + text = (<a href="#" onClick={onClick}>{name}</a>); + } return ( <div className={`media-widget ${typeClass}`} key={`media-widget${objectId}`} > <Col> - <a href="#" onClick={onClick}>{name}</a> + {text} {children} </Col> <Col> - <DeleteButton onClick={onDelete} /> + {onDelete && <DeleteButton onClick={onDelete} />} ? +++++++++++++ + </Col> </div> ); }; SourceOrCollectionWidget.propTypes = { object: PropTypes.object.isRequired, onDelete: PropTypes.func, onClick: PropTypes.func, children: PropTypes.node, }; export default SourceOrCollectionWidget;
9
0.25
7
2
da5da43aade285648038b5dac26c5cb64bbbd82d
app/controllers/stats_controller.rb
app/controllers/stats_controller.rb
class StatsController < ApplicationController newrelic_ignore def index period = 7.days.ago @new_projects = Project.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse @new_repos = GithubRepository.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse @new_github_users = GithubUser.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse @new_users = User.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse @new_subscriptions = Subscription.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse @new_readmes = Readme.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse end end
class StatsController < ApplicationController newrelic_ignore def index period = 7.days.ago.beginning_of_day @new_projects = Project.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse @new_repos = GithubRepository.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse @new_github_users = GithubUser.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse @new_users = User.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse @new_subscriptions = Subscription.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse @new_readmes = Readme.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse end end
Normalize the ends and beginnings of days
Normalize the ends and beginnings of days
Ruby
agpl-3.0
abrophy/libraries.io,abrophy/libraries.io,librariesio/libraries.io,abrophy/libraries.io,librariesio/libraries.io,tomnatt/libraries.io,librariesio/libraries.io,tomnatt/libraries.io,samjacobclift/libraries.io,samjacobclift/libraries.io,samjacobclift/libraries.io,tomnatt/libraries.io,librariesio/libraries.io
ruby
## Code Before: class StatsController < ApplicationController newrelic_ignore def index period = 7.days.ago @new_projects = Project.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse @new_repos = GithubRepository.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse @new_github_users = GithubUser.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse @new_users = User.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse @new_subscriptions = Subscription.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse @new_readmes = Readme.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse end end ## Instruction: Normalize the ends and beginnings of days ## Code After: class StatsController < ApplicationController newrelic_ignore def index period = 7.days.ago.beginning_of_day @new_projects = Project.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse @new_repos = GithubRepository.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse @new_github_users = GithubUser.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse @new_users = User.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse @new_subscriptions = Subscription.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse @new_readmes = Readme.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse end end
class StatsController < ApplicationController newrelic_ignore def index - period = 7.days.ago + period = 7.days.ago.beginning_of_day @new_projects = Project.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse @new_repos = GithubRepository.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse @new_github_users = GithubUser.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse @new_users = User.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse @new_subscriptions = Subscription.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse @new_readmes = Readme.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse end end
2
0.153846
1
1
213bcc300b36fbeb3cc2a5466dbec9c06a0cc0ec
conf/net/keys.json
conf/net/keys.json
{ "ssl_certificate" : "xxxxx-signed-cert.pem", "private_key" : "xxxxx_privkey.key", "client_key_old" : "Get from https://console.developers.google.com", "client_key" : "Get from https://console.developers.google.com", "__comment": "iOS client key to handle the fact that the google iOS API does not work. The open source API does not take the webclient app, so we have the iOS client ID here.", "ios_client_key" : "Get from https://console.developers.google.com", "ios_client_key_new" : "Get from https://console.developers.google.com", "moves" : { "client_id": "Get from https://dev.moves-app.com", "client_secret": "Get from https://dev.moves-app.com", "https_redirect_url": "Value registered at https://dev.moves-app.com", "ios_redirect_url": "Value registered at https://dev.moves-app.com" } }
{ "ssl_certificate" : "xxxxx-signed-cert.pem", "private_key" : "xxxxx_privkey.key", "client_key_old" : "Get from https://console.developers.google.com", "client_key" : "Get from https://console.developers.google.com", "__comment": "iOS client key to handle the fact that the google iOS API does not work. The open source API does not take the webclient app, so we have the iOS client ID here.", "ios_client_key" : "Get from https://console.developers.google.com", "ios_client_key_new" : "Get from https://console.developers.google.com", "token_list": "path/to/token/list/file, plain text, one token per line", "moves" : { "client_id": "Get from https://dev.moves-app.com", "client_secret": "Get from https://dev.moves-app.com", "https_redirect_url": "Value registered at https://dev.moves-app.com", "ios_redirect_url": "Value registered at https://dev.moves-app.com" } }
Add support to specify a token list file
Add support to specify a token list file This will be used by the new token list method
JSON
bsd-3-clause
shankari/e-mission-server,shankari/e-mission-server,sunil07t/e-mission-server,sunil07t/e-mission-server,e-mission/e-mission-server,e-mission/e-mission-server,e-mission/e-mission-server,shankari/e-mission-server,e-mission/e-mission-server,sunil07t/e-mission-server,shankari/e-mission-server,sunil07t/e-mission-server
json
## Code Before: { "ssl_certificate" : "xxxxx-signed-cert.pem", "private_key" : "xxxxx_privkey.key", "client_key_old" : "Get from https://console.developers.google.com", "client_key" : "Get from https://console.developers.google.com", "__comment": "iOS client key to handle the fact that the google iOS API does not work. The open source API does not take the webclient app, so we have the iOS client ID here.", "ios_client_key" : "Get from https://console.developers.google.com", "ios_client_key_new" : "Get from https://console.developers.google.com", "moves" : { "client_id": "Get from https://dev.moves-app.com", "client_secret": "Get from https://dev.moves-app.com", "https_redirect_url": "Value registered at https://dev.moves-app.com", "ios_redirect_url": "Value registered at https://dev.moves-app.com" } } ## Instruction: Add support to specify a token list file This will be used by the new token list method ## Code After: { "ssl_certificate" : "xxxxx-signed-cert.pem", "private_key" : "xxxxx_privkey.key", "client_key_old" : "Get from https://console.developers.google.com", "client_key" : "Get from https://console.developers.google.com", "__comment": "iOS client key to handle the fact that the google iOS API does not work. The open source API does not take the webclient app, so we have the iOS client ID here.", "ios_client_key" : "Get from https://console.developers.google.com", "ios_client_key_new" : "Get from https://console.developers.google.com", "token_list": "path/to/token/list/file, plain text, one token per line", "moves" : { "client_id": "Get from https://dev.moves-app.com", "client_secret": "Get from https://dev.moves-app.com", "https_redirect_url": "Value registered at https://dev.moves-app.com", "ios_redirect_url": "Value registered at https://dev.moves-app.com" } }
{ "ssl_certificate" : "xxxxx-signed-cert.pem", "private_key" : "xxxxx_privkey.key", "client_key_old" : "Get from https://console.developers.google.com", "client_key" : "Get from https://console.developers.google.com", "__comment": "iOS client key to handle the fact that the google iOS API does not work. The open source API does not take the webclient app, so we have the iOS client ID here.", "ios_client_key" : "Get from https://console.developers.google.com", "ios_client_key_new" : "Get from https://console.developers.google.com", + "token_list": "path/to/token/list/file, plain text, one token per line", "moves" : { "client_id": "Get from https://dev.moves-app.com", "client_secret": "Get from https://dev.moves-app.com", "https_redirect_url": "Value registered at https://dev.moves-app.com", "ios_redirect_url": "Value registered at https://dev.moves-app.com" } }
1
0.066667
1
0
f85a66591d9b02ba2053103f4afab6c9dd7260b7
libs/redis.js
libs/redis.js
/*eslint no-console: ["error", { allow: ["log"] }] */ // dependencies -------------------------------------------------- import Redis from 'ioredis'; import config from '../config'; export default { redis: new Redis(config.redis), }
/*eslint no-console: ["error", { allow: ["log"] }] */ // dependencies -------------------------------------------------- import Redis from 'ioredis'; export default { redis: null, connect(config, callback) { if (!this.redis) { console.log('Connecting to Redis "redis://%s:%d/0"', config.host, config.port); this.redis = new Redis(config); this.redis.on('connect', () => { if (callback) { callback(this.redis); } }.bind(this)); } else { if (callback) { callback(this.redis); } } } }
Rework Redis connection to support callback on connect.
Rework Redis connection to support callback on connect.
JavaScript
mit
poldracklab/crn_server,poldracklab/crn_server
javascript
## Code Before: /*eslint no-console: ["error", { allow: ["log"] }] */ // dependencies -------------------------------------------------- import Redis from 'ioredis'; import config from '../config'; export default { redis: new Redis(config.redis), } ## Instruction: Rework Redis connection to support callback on connect. ## Code After: /*eslint no-console: ["error", { allow: ["log"] }] */ // dependencies -------------------------------------------------- import Redis from 'ioredis'; export default { redis: null, connect(config, callback) { if (!this.redis) { console.log('Connecting to Redis "redis://%s:%d/0"', config.host, config.port); this.redis = new Redis(config); this.redis.on('connect', () => { if (callback) { callback(this.redis); } }.bind(this)); } else { if (callback) { callback(this.redis); } } } }
/*eslint no-console: ["error", { allow: ["log"] }] */ // dependencies -------------------------------------------------- import Redis from 'ioredis'; - import config from '../config'; export default { - redis: new Redis(config.redis), + redis: null, + + connect(config, callback) { + if (!this.redis) { + console.log('Connecting to Redis "redis://%s:%d/0"', config.host, config.port); + this.redis = new Redis(config); + this.redis.on('connect', () => { + if (callback) { + callback(this.redis); + } + }.bind(this)); + } else { + if (callback) { + callback(this.redis); + } + } + } }
19
2.111111
17
2
b955ccf31504d29bb5a6379caf27d16bb21a3d04
packages/common/src/server/utils/cleanGlobPatterns.ts
packages/common/src/server/utils/cleanGlobPatterns.ts
import * as Path from "path"; export function cleanGlobPatterns(files: string | string[], excludes: string[]): string[] { excludes = excludes.map((s: string) => "!" + s.replace(/!/gi, "")); return [] .concat(files as any) .map((file: string) => { if (!require.extensions[".ts"] && !process.env["TS_TEST"]) { file = file.replace(/\.ts$/i, ".js"); } return Path.resolve(file); }) .concat(excludes as any); }
import * as Path from "path"; export function cleanGlobPatterns(files: string | string[], excludes: string[]): string[] { excludes = excludes.map((s: string) => "!" + s.replace(/!/gi, "").replace(/\\/g, "/")); return [] .concat(files as any) .map((file: string) => { if (!require.extensions[".ts"] && !process.env["TS_TEST"]) { file = file.replace(/\.ts$/i, ".js"); } return Path.resolve(file).replace(/\\/g, "/"); }) .concat(excludes as any); }
Fix windows paths in scanner
fix(common): Fix windows paths in scanner Closes: #709
TypeScript
mit
Romakita/ts-express-decorators,Romakita/ts-express-decorators,Romakita/ts-express-decorators,Romakita/ts-express-decorators
typescript
## Code Before: import * as Path from "path"; export function cleanGlobPatterns(files: string | string[], excludes: string[]): string[] { excludes = excludes.map((s: string) => "!" + s.replace(/!/gi, "")); return [] .concat(files as any) .map((file: string) => { if (!require.extensions[".ts"] && !process.env["TS_TEST"]) { file = file.replace(/\.ts$/i, ".js"); } return Path.resolve(file); }) .concat(excludes as any); } ## Instruction: fix(common): Fix windows paths in scanner Closes: #709 ## Code After: import * as Path from "path"; export function cleanGlobPatterns(files: string | string[], excludes: string[]): string[] { excludes = excludes.map((s: string) => "!" + s.replace(/!/gi, "").replace(/\\/g, "/")); return [] .concat(files as any) .map((file: string) => { if (!require.extensions[".ts"] && !process.env["TS_TEST"]) { file = file.replace(/\.ts$/i, ".js"); } return Path.resolve(file).replace(/\\/g, "/"); }) .concat(excludes as any); }
import * as Path from "path"; export function cleanGlobPatterns(files: string | string[], excludes: string[]): string[] { - excludes = excludes.map((s: string) => "!" + s.replace(/!/gi, "")); + excludes = excludes.map((s: string) => "!" + s.replace(/!/gi, "").replace(/\\/g, "/")); ? ++++++++++++++++++++ return [] .concat(files as any) .map((file: string) => { if (!require.extensions[".ts"] && !process.env["TS_TEST"]) { file = file.replace(/\.ts$/i, ".js"); } - return Path.resolve(file); + return Path.resolve(file).replace(/\\/g, "/"); ? ++++++++++++++++++++ }) .concat(excludes as any); }
4
0.25
2
2
c5cb4be872ea36d1568f273a13aaccf34fb81e4a
spec/features/server_sends_daily_email_prompt_spec.rb
spec/features/server_sends_daily_email_prompt_spec.rb
require "rails_helper" feature "The server executes the prompt task", sidekiq: :inline do scenario "and all users are emailed" do first_user = create(:user) second_user = create(:user) third_user = create(:user) users = [first_user, second_user, third_user] PromptTask.new(users, PromptWorker).run users.each do |user| expect(emailed_addresses).to include(user.email) end end def emailed_addresses ActionMailer::Base.deliveries.map(&:to).flatten end end
require "rails_helper" feature "The server executes the prompt task", sidekiq: :inline do scenario "and all users are emailed" do first_user = create(:user) second_user = create(:user) third_user = create(:user) users = [first_user, second_user, third_user] PromptTask.new(User.pluck(:id), PromptWorker).run users.each do |user| expect(emailed_addresses).to include(user.email) end end def emailed_addresses ActionMailer::Base.deliveries.map(&:to).flatten end end
Fix test to match how the task is actually used
Fix test to match how the task is actually used
Ruby
mit
codecation/trailmix,codecation/trailmix,codecation/trailmix,codecation/trailmix
ruby
## Code Before: require "rails_helper" feature "The server executes the prompt task", sidekiq: :inline do scenario "and all users are emailed" do first_user = create(:user) second_user = create(:user) third_user = create(:user) users = [first_user, second_user, third_user] PromptTask.new(users, PromptWorker).run users.each do |user| expect(emailed_addresses).to include(user.email) end end def emailed_addresses ActionMailer::Base.deliveries.map(&:to).flatten end end ## Instruction: Fix test to match how the task is actually used ## Code After: require "rails_helper" feature "The server executes the prompt task", sidekiq: :inline do scenario "and all users are emailed" do first_user = create(:user) second_user = create(:user) third_user = create(:user) users = [first_user, second_user, third_user] PromptTask.new(User.pluck(:id), PromptWorker).run users.each do |user| expect(emailed_addresses).to include(user.email) end end def emailed_addresses ActionMailer::Base.deliveries.map(&:to).flatten end end
require "rails_helper" feature "The server executes the prompt task", sidekiq: :inline do scenario "and all users are emailed" do first_user = create(:user) second_user = create(:user) third_user = create(:user) users = [first_user, second_user, third_user] - PromptTask.new(users, PromptWorker).run ? ^ ^ + PromptTask.new(User.pluck(:id), PromptWorker).run ? ^ ^^^^^^^^^^^ users.each do |user| expect(emailed_addresses).to include(user.email) end end def emailed_addresses ActionMailer::Base.deliveries.map(&:to).flatten end end
2
0.1
1
1