Skip to content

Instantly share code, notes, and snippets.

View reinhardt021's full-sized avatar
☁️
🍁

Reinhardt reinhardt021

☁️
🍁
View GitHub Profile
@reinhardt021
reinhardt021 / .bash_profile
Created November 30, 2016 22:14
bash setup within home directory (~/ aka /Users/reinhardtcagara) that makes the 'ls' command pretty and shows pwd and current git branch
alias ls="ls -FG"
export PATH=/usr/local/devops/bin:"$(brew --prefix homebrew/php/php56)/bin:$PATH"
export PATH=/usr/local/devtools:/usr/local/devops/bin:/usr/local/opt/php56/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
@reinhardt021
reinhardt021 / css_specificity.txt
Created December 7, 2015 05:47
CSS Specificity Questions
- QUESTION 01
- How do you think the word "cascading" in "Cascading Style Sheets" relates to specificity?
- Cascading relates to specificity of the selectors used to style the web page
- Styling is applied starting at the most specific then goes to apply the less specific selectors when there is nothing specified for the element
- order of specificity is inline / style attribute, then ID, then Class / attribute / pseudo-class, then element / pseudo-element
- QUESTION 02
- Given the following HTML and CSS fragments, we expect the text in the H1 to appear green, but it shows up black. What could be the issue? Describe at least three scenarios
- CSS
- body { color: blue; } // specificity = 0001
- #main h1.alt { color: green; } // specificity = 0111
@reinhardt021
reinhardt021 / application.js
Created November 30, 2015 20:02
Array of Light
var arrayOfLight = function (x) {
// note that x must be a positive number
// prints from 0 to that number
var result = [];
for (var i = 0; i <= x; i++) {
result.push(i);
}
return result;
};
@reinhardt021
reinhardt021 / gist:5e78b54b5dd0c1716dd7
Created October 31, 2015 01:29 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
Last login: Tue Oct 27 08:43:36 on ttys000
Reinhardts-MacBook-Air:lighthouse rhcgr$ vim longest.rb
Reinhardts-MacBook-Air:lighthouse rhcgr$ ruby longest.rb
longest.rb:6:in `count': wrong number of arguments (0 for 1+) (ArgumentError)
from longest.rb:6:in `block in find_longest'
from longest.rb:5:in `each'
from longest.rb:5:in `find_longest'
from longest.rb:13:in `<main>'
Reinhardts-MacBook-Air:lighthouse rhcgr$ vim longest.rb
Reinhardts-MacBook-Air:lighthouse rhcgr$ ruby longest.rb