Skip to content

Instantly share code, notes, and snippets.

View chrome-to-ie.md
.example {
    display: grid; 
    grid-template-rows: auto auto auto auto auto; 
    grid-template-columns: 3fr 2fr; 
    grid-template-areas: 
        "title notes_title" 
        "policy_information notes_editor" 
        "loss_info_form notes_editor" 
@AndrewGardhouse
AndrewGardhouse / generator-recursion.js
Created Oct 3, 2018
Write a function that uses recursion to return the total value of a generator
View generator-recursion.js
function * gen() {
for (let i = 0 ; i < 5; i++) yield i;
}
const myGen = gen()
const getTotal = (gen) => {
let total = 0;
const add = (gen) => {
const currentGen = gen.next();
if (!currentGen.done) {
@AndrewGardhouse
AndrewGardhouse / .gitattributes
Created Oct 18, 2017
Dealing with compiled files in Git
View .gitattributes
# -diff will keep git from showing compiled assets in diffs
# merge=ours tells git to use the merge driver we added in .git/config on our compiled assets
path/of/compiled/assets/script.js -diff merge=ours
path/of/compiled/assets/script.min.js -diff merge=ours
path/of/compiled/assets/style.css -diff merge=ours
path/of/compiled/assets/style.min.css -diff merge=ours
View gist:da6eecae9cd5476a4ff0
vagrant [vagrant]> pry
[1] pry(main)> def say_hi(name)
[1] pry(main)* puts "hi, #{name}"
[1] pry(main)* end
=> nil
[2] pry(main)> say_hi "Andrew"
hi, Andrew
=> nil
[3] pry(main)> number = 23
=> 23