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
// from the Node library: aos | |
// syntax | |
<div | |
data-aos="fade-up" | |
data-aos-offset="200" | |
data-aos-delay="50" | |
data-aos-duration="1000" | |
data-aos-easing="ease-in-out" | |
data-aos-mirror="true" | |
data-aos-once="false" |
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
# Module can be used by any controller instead of helper.rb which is only for associated controller | |
### make sure to add | |
### config.autoload_paths += %W(#{config.root}/lib) | |
### to config/application.rb | |
# and don't forget to make the file in /lib/ with this format: modelname.rb | |
module MODULENAME | |
def METHODNAME | |
end |
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
namespace :NAMESPACE do | |
desc "ENTER DESCRIPTION HERE" | |
task :start => [ :environment ] do | |
end #end task | |
end | |
### to run from shell "rails task_name" |
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
bundle install --path vendor/bundle |
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
#Navigating | |
visit articles_path | |
#Clicking links and buttons | |
click_on 'Link Text' | |
click_button | |
click_link | |
#Interacting with forms | |
attach_file 'Image', '/path/to/image.jpg' |
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
codesign --force --deep --sign - /Applications/CHIRP.app |
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
// adding all the elements of a limitless nested array | |
function arraySum(anArr) { | |
let sum = 0; | |
for (let i = 0; i < anArr.length; i++) { | |
let element = anArr[i]; | |
if (Array.isArray(element)) { | |
sum += arraySum(element); | |
} else | |
sum += element; | |
} return sum; |
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
// loop through string | |
let letters = 'abcdefg'; | |
// initial: let i=0 | |
// conditional: i<letters.length | |
// final: i++ | |
for (let i=0; i < letters.length; i++) { | |
let currentLetter = letters[i]; | |
console.log(currentLetter); |
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
### GEM | |
rails gem new GEM_NAME | |
### PLUGIN / ENGINE | |
### use for rails extensions that don't require | |
### full application-like setup. but, | |
### since it's still a rails-specific setup | |
rails plugin new PLUGIN_NAME | |
### options for plugin |
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
<%= select_tag "NAME", options_for_select(@options, @selected_options), id: "ID_NAME" %> |
OlderNewer