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 | |
| class Transaction::Create | |
| def self.call(params, transaction) | |
| new(params, transaction).call | |
| end | |
| def call | |
| perform | |
| end |
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
| INSERT INTO CURSOS(DESCRIPCION) VALUES('MATEMATICA'); | |
| INSERT INTO CURSOS(DESCRIPCION) VALUES('COMPILADORES'); | |
| INSERT INTO CURSOS(DESCRIPCION) VALUES('ARQUITECTURA'); | |
| INSERT INTO CURSOS(DESCRIPCION) VALUES('ELECTRONICA'); | |
| INSERT INTO CURSOS(DESCRIPCION) VALUES('CONTABILIDAD'); | |
| INSERT INTO CLIENTES(NOMBRE) VALUES('Cristian'); | |
| INSERT INTO CLIENTES(NOMBRE) VALUES('Rodrigo'); | |
| INSERT INTO CLIENTES(NOMBRE) VALUES('Saul'); |
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() { | |
| var dataTable = null; | |
| document.addEventListener("turbolinks:before-cache", function() { | |
| if (dataTable !== null) { | |
| dataTable.destroy(); | |
| dataTable = null; | |
| } | |
| }); | |
| }); |
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
| You want to use backtick not regular tick: | |
| sudo kill `sudo lsof -t -i:9001` | |
| If that doesn't work you could also use $() for command interpolation: | |
| sudo kill $(sudo lsof -t -i:9001) | |
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
| So i was using Rails 4.1 with Unicorn v4.8.2 and when i tried to deploy my app it doesn't start properly and into the unicorn.log file i found this error message: | |
| "app error: Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml` (RuntimeError)" | |
| After a little research i found that Rails 4.1 change the way to manage the secret_key, so if we read the secrets.yml file located at exampleRailsProject/config/secrets.yml (you need to replace "exampleRailsProject" for your project name) you will find something like this: | |
| # Do not keep production secrets in the repository, | |
| # instead read values from the environment. | |
| production: | |
| secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> |
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
| /* | |
| * Copyright (C) 2017 The Android Open Source Project | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
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
| # app/views/models/_model.json.jbuilder | |
| json.(model, :id, :attr1, :attr2) | |
| # app/views/models/show.json.jbuilder | |
| json.partial! "model/model", model: @model | |
| # app/views/models/index.json.jbuilder | |
| json.array! @models, partial: 'model/model', as: :model |
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
| https://www.git-tower.com/learn/git/faq/ignore-tracked-files-in-git |
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
| $(document).ready(function() { | |
| $("#txtboxToFilter").keydown(function (e) { | |
| // Allow: backspace, delete, tab, escape, enter and . | |
| if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 || | |
| // Allow: Ctrl/cmd+A | |
| (e.keyCode == 65 && (e.ctrlKey === true || e.metaKey === true)) || | |
| // Allow: Ctrl/cmd+C | |
| (e.keyCode == 67 && (e.ctrlKey === true || e.metaKey === true)) || | |
| // Allow: Ctrl/cmd+X | |
| (e.keyCode == 88 && (e.ctrlKey === true || e.metaKey === true)) || |
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
| class String | |
| def another_titlecase | |
| self.split(" ").collect{|word| word[0] = word[0].upcase; word}.join(" ") | |
| end | |
| end | |
| "john mark McMillan".another_titlecase | |
| => "John Mark McMillan" |