An example that shows the difference between creating a JavaScript class and subclass in ES5 and ES6.
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
| <%# views/layouts/external_pages.html.erb %> | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>GentelellaOnRails</title> | |
| <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> | |
| <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => 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 AddUserNameForAuthenticationToUsers < ActiveRecord::Migration | |
| def up | |
| add_column :users, :username, :string, null: false, default: "" | |
| add_index :users, :username, unique: true | |
| add_column :users, :encrypted_email, :string | |
| remove_column :users, :email, :string | |
| add_index :users, :encrypted_email | |
| end | |
| def down | |
| remove_column :users, :username |
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
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
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
| package main | |
| import ( | |
| "crypto/rand" | |
| "crypto/rsa" | |
| "crypto/tls" | |
| "crypto/x509" | |
| "crypto/x509/pkix" | |
| "errors" | |
| "log" |
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
| ==> Installing kafka | |
| ==> Downloading http://mirrors.ibiblio.org/apache/kafka/0.8.2.1/kafka-0.8.2.1-src.tgz | |
| ######################################################################## 100.0% | |
| ==> gradle | |
| ==> gradle jar | |
| ==> Caveats | |
| To start Kafka, ensure that ZooKeeper is running and then execute: | |
| kafka-server-start.sh /usr/local/etc/kafka/server.properties |
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
| yum update | |
| #Install for compiling and configuring needs | |
| yum install nano bzip2 gcc git pkgconfig autoconf automake libtool gperf byacc libxslt bison flex | |
| #If in a VM you will need to install files for kernel dev to load Guest additions (VirtualBox) | |
| yum install kernel-devel | |
| #Mount the guest additions CD and install | |
| sudo mount /dev/sr0 /media |
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
| This gist is the update of this post https://u.osu.edu/hasnan.1/2014/03/30/rails-4-multiple-file-upload-with-carrierwave-nested-form-and-jquery-file-upload/ | |
| License MIT |
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
| :javascript | |
| $(document).ready(function() { | |
| window.loadIngredientSuggestionsEditor(#{@ingredients}); | |
| }); | |
| %h1 Edit ingredient suggestions | |
| #js-ingredient-suggestions-editor |
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
| import java.security.Key; | |
| import java.util.Properties; | |
| import javax.crypto.Cipher; | |
| import javax.crypto.spec.SecretKeySpec; | |
| import javax.persistence.AttributeConverter; | |
| import javax.persistence.Converter; | |
| import org.slf4j.Logger; |