Skip to content

Instantly share code, notes, and snippets.

View willywg's full-sized avatar
🏠
Working from home

William Wong Garay willywg

🏠
Working from home
View GitHub Profile
@willywg
willywg / README.md
Last active July 13, 2017 22:40
Add Bulma Saas to Nuxt via npm

Add sass pre-procesor:

yarn add node-sass sass-loader -D

Add bulma

yarn add bulma
@willywg
willywg / _flash_messages.html.slim
Created May 10, 2018 21:06
Rails flash messages helper for bootstrap 4 with slim
- flash.each do |type, msg|
div class=("alert #{bootstrap_class_for_flash(type)} alert-dismissable fade show")
= msg
button.close data-dismiss="alert" ×
1. Iniciar clover con opcion -s en el booteo (borrar cualquier otra opcion presente). Esto inciiará en Single-User mode
2. En terminal correr mount -uw /
3. Eliminar comprobador de cuenta nueva en Mac: rm /var/db/.AppleSetupDone
4. reboot
5. Crear un usuario nuevo (no usar el nombre del mismo usuario a recuperar)
6. Al inicar la cuenta nueva (nuevo admin) en prefeencias crear un usuario con el mismo nombre, elegir usar la carpeta existente
7. Cambiar a la cuenta del usuario recuperado dos veces. Pedira recuperar algunos accesos.
8. Resolver permisos: sudo chown -R willywg:admin /usr/local/var/
Fuente:
@willywg
willywg / rspec_model_testing_template.rb
Created September 4, 2018 15:53 — forked from SabretWoW/rspec_model_testing_template.rb
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:
@willywg
willywg / administrate_dashboard_to_moduled_model.md
Last active April 25, 2019 15:08
How create an admistrate dashboard with a moduled model
  1. If our model is Faq::UserType, then we generates the dashboard with:

rails generate administrate:dashboard faq/user_type

This generates:

Running via Spring preloader in process 21074
      create  app/dashboards/user_type_dashboard.rb
      create  app/controllers/admin/user_types_controller.rb
@willywg
willywg / form.html
Created July 1, 2019 17:33
Prevent multiple submits when clicked a submit button
<form action='/'>
<button class="prevent-multiple-submit" type="submit">Create</button>
</form>