This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var | |
| a = [1,2,3,4,5], | |
| b = [2,3], | |
| subset_of = function(arr, arr_sub) { return new RegExp("-" + arr_sub.join('-') + "-").test("-" + arr.join('-') + "-"); }; | |
| console.log(subset_of(a, b)); // true | |
| console.log(subset_of(a, b.reverse())); // false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| user nginx; | |
| worker_processes 5; | |
| error_log /var/log/nginx.error.log; | |
| pid /var/run/nginx.pid; | |
| events { | |
| worker_connections 1024; | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Index: sapi/cli/config.w32 | |
| =================================================================== | |
| --- sapi/cli/config.w32 (revision 308839) | |
| +++ sapi/cli/config.w32 (working copy) | |
| @@ -6,7 +6,8 @@ | |
| ARG_ENABLE('cli-win32', 'Build console-less CLI version of PHP', 'no'); | |
| if (PHP_CLI == "yes") { | |
| - SAPI('cli', 'php_cli.c', 'php.exe'); | |
| + SAPI('cli', 'php_cli.c php_http_parser.c php_cli_server.c', 'php.exe'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var body = document.body; | |
| if (body.requestFullScreen) { | |
| body.requestFullScreen(); | |
| } else if (body.mozRequestFullScreen) { | |
| body.mozRequestFullScreen(); | |
| } else if (body.webkitRequestFullScreen) { | |
| body.webkitRequestFullScreen(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function($) { | |
| $.extend($.expr[':'], { | |
| inline: function(a) { | |
| return $(a).css('display') == 'inline'; | |
| }, | |
| block: function(a) { | |
| return $(a).css('display') == 'block'; | |
| } | |
| }); | |
| })(jQuery); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| find . -iname "*.php" > /tmp/my_php_files.txt | |
| # new template | |
| xgettext --from-code=utf-8 -d my_dir -f /tmp/my_php_files.txt -o languages/my_theme.pot | |
| # update template | |
| xgettext --from-code=utf-8 -d my_dir -j -f /tmp/my_php_files.txt -o languages/my_theme.pot | |
| # To update the already translated .po files and add new strings to them, run: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # frozen_string_literal: true | |
| # Main Backoffice | |
| class Backoffice::AdminsController < BackofficeController | |
| before_action :set_admin, only: %i[edit update destroy] | |
| after_action :verify_authorized, only: :new | |
| after_action :verify_policy_scoped, only: :index | |
| def index | |
| @admins = policy_scope(Admin) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def create | |
| @block_edit = false | |
| debit_params = BankDebit.new(permitted_params[:bank_debit]) | |
| .attributes.symbolize_keys.merge(user_id: current_user.id) | |
| Bank.transaction do | |
| current_user.up_score!(1.3) if current_user.Potencial? | |
| create_plot_debits!(debit_params) | |
| create_debits!(debit_params) | |
| redirect_to cash_path, notice: 'Lançamento realizado com sucesso' |
OlderNewer