This file contains 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://gist.github.com/steveclarke/ba73c6b2e198f14f1b729ad6825c04ca | |
" Leader is <space> | |
let mapleader = ' ' | |
nnoremap <Space> <Nop> | |
" nobody wants that bell! | |
set visualbell | |
set incsearch |
This file contains 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 ApplicationComponent < ViewComponent::Base | |
private | |
# Reference: https://www.youtube.com/watch?v=YVYRus_2KZM&t=302s | |
def fetch_or_fallback(allowed_values, given_value, fallback) | |
if allowed_values.include?(given_value) | |
given_value | |
else |
This file contains 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
{% comment %} | |
Place at bottom of DOM, before </body> | |
{% endcomment %} | |
{% comment %} | |
Article structured data | |
https://developers.google.com/search/docs/data-types/articles | |
{% endcomment %} | |
{% if template contains 'article' %} |
This file contains 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 original_method(a, b) | |
puts "Called with #{a} and #{b}" | |
if block_given? | |
puts "Calling the block" | |
yield | |
end | |
end | |
def wrapper1(*args) # WRONG: doesn't pass the block | |
puts "Hi I'm wrapper1" |
- Website: https://stimulusjs.org/
- GitHub repo: https://github.com/stimulusjs/stimulus
- Handbook: https://stimulusjs.org/handbook/introduction
- Discourse: https://discourse.stimulusjs.org/
initialize
: once, when the controller is first instantiatedconnect
: anytime the controller is connected to the DOM
###rpush - https://github.com/rpush/rpush
Follow the steps in rpush to add the gem to your rails project
####PushNotificationDevice
rails g model PushNotificationDevice device_type:integer:index device_token:string
class CreatePushNotificationDevices < ActiveRecord::Migration
This file contains 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
source :rubygems | |
# We are not loading Active Record, nor Active Resources etc. | |
# We can do this in any app by simply replacing the rails gem | |
# by the parts we want to use. | |
gem "actionpack", "~> 4.0" | |
gem "railties", "~> 4.0" | |
gem "tzinfo" | |
# Let's use thin |
When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.
Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008
…………………………
NewerOlder