Skip to content

Instantly share code, notes, and snippets.

@wwwisie
wwwisie / mysql-error.md
Created September 2, 2020 21:40
Mysql2::Error: All parts of a PRIMARY KEY must be NOT NULL

This happens in ruby 2.0.0 Error: ActiveRecord::StatementInvalid: Mysql2::Error: All parts of a PRIMARY KEY must be NOT NULL;

Solution: Create file in config/initializers/abstract_mysql2_adapter.rb

` class ActiveRecord::ConnectionAdapters::Mysql2Adapter

@wwwisie
wwwisie / show.md
Last active August 31, 2020 21:03
Add :show to database

Console: rails g migration add_show_to_section_elements show:integer

Adentro del migration file, es agregar: , :default => 0, :null => false

` class AddShowToSectionElements < ActiveRecord::Migration[5.2]

@wwwisie
wwwisie / index.html.erb
Created February 27, 2020 21:06
Random Coordinate Emoji Placement on Images
<div id="parallax-container">
<% @inicio_gallery.assets.each_slice(12).with_index do |slice, index| %>
<div class="parallax" id="parallax-lvl-<%= index %>">
<% slice.each_with_index do |asset, i| %>
<div class="<%= @gallery_array[i % 3] %> rellax img-wrap" data-rellax-speed="<%=rand(3)%>">
<img src="<%= asset.asset.url %>">
<div class="absolute-wrap">
</div>
</div>
<% end %>
@wwwisie
wwwisie / plink-plonk.js
Created February 17, 2020 17:34 — forked from tomhicks/plink-plonk.js
Listen to your web pages
@wwwisie
wwwisie / _animation.scss
Last active January 15, 2020 18:29
scroll animations with css
.fade-on-scroll,
.animate-on-scroll {
opacity: 0;
}
.fade-on-scroll.animate {
animation-name: d;
animation-fill-mode: forwards;
animation-duration: 1.5s;
transition-timing-function: cubic-bezier(0.39, 0.575, 0.565, 1);
@wwwisie
wwwisie / index.html
Last active January 7, 2020 23:00
Example starter JavaScript for disabling form submissions if there are invalid fields
<button type="submit" id="submit-btn" class="btn btn-primary btn-block d-flex align-items-center justify-content-center">
<div class="text">
Solicitar cita
</div>
<div>
<img src="/assets/ens/svg/checkmark.svg" alt="">
</div>
</button>
@wwwisie
wwwisie / ico.js
Created November 11, 2019 21:17
Changing website favicon dynamically
(function() {
var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
link.type = 'image/x-icon';
link.rel = 'shortcut icon';
link.href = '/favicon02.png';
document.getElementsByTagName('head')[0].appendChild(link);
})();
@wwwisie
wwwisie / Solution.md
Created November 7, 2019 16:35
Downloading binary from node-sass: HTTP error 404 Not Found
Cannot download "https://github.com/sass/node-sass/releases/download/v3.13.1/darwin-x64-72_binding.node": 

HTTP error 404 Not Found````

*** ERROR SOLUTION
`package.json:`
```  "dependencies": {
    "node-sass": "4.13.0",
  }
@wwwisie
wwwisie / debugger.css
Created September 26, 2019 22:22
CSS debugger
/******DEBUGG******/
body > * {
// border: 1px solid rgba(255, 0, 0, 0.5);
box-sizing: border-box !important;
outline: 1px solid rgba(255, 0, 0, 0.5);
}
body div {
// border: 1px solid rgba(0, 123, 255, 0.5);
box-sizing: border-box !important;
@wwwisie
wwwisie / index.css
Created September 20, 2019 16:26
css index menu comments
/* Global
Global styles that can be added to all pages.
*/
/* ----- NOTES:
To find something of the index CTRL+F -> " i. "
add a number after that to find exact title ex. " i. 4. "
* Anagrama 2019
* https://www.anagrama.com/