Skip to content

Instantly share code, notes, and snippets.

View AndrewGardhouse's full-sized avatar

Andrew Gardhouse AndrewGardhouse

View GitHub Profile
@AndrewGardhouse
AndrewGardhouse / .gitattributes
Created October 18, 2017 18:20
Dealing with compiled files in Git
# -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
@AndrewGardhouse
AndrewGardhouse / chrome-to-ie.md
Created October 30, 2019 17:32
CSS Grid Chrome to IE
.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 October 3, 2018 20:41
Write a function that uses recursion to return the total value of a generator
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 / gist:da6eecae9cd5476a4ff0
Created September 30, 2014 18:40
Interactive Ruby (practice)
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