I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
function countCSSRules() { | |
var results = '', | |
log = ''; | |
if (!document.styleSheets) { | |
return; | |
} | |
for (var i = 0; i < document.styleSheets.length; i++) { | |
countSheet(document.styleSheets[i]); | |
} | |
function countSheet(sheet) { |
######################### | |
# .gitignore file for Xcode4 and Xcode5 Source projects | |
# | |
# Apple bugs, waiting for Apple to fix/respond: | |
# | |
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation? | |
# | |
# Version 2.6 | |
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects | |
# |
/* Side notes for calling out things | |
-------------------------------------------------- */ | |
/* Base styles (regardless of theme) */ | |
.bs-callout { | |
margin: 20px 0; | |
padding: 15px 30px 15px 15px; | |
border-left: 5px solid #eee; |
I fell in love with CoffeeScript a couple of years ago. Javascript has always seemed something of an interesting curiosity to me and I was happy to see the meteoric rise of Node.js, but coming from a background of Python I really preferred a cleaner syntax.
In any fast moving community it is inevitable that things will change, and so today we see a big shift toward ES6, the new version of Javascript. It incorporates a handful of the nicer features from CoffeeScript and is usable today through tools like Babel. Here are some of my thoughts and issues on moving away from CoffeeScript in favor of ES6.
While reading I suggest keeping open a tab to Babel's learning ES6 page. The examples there are great.
Holy punctuation, Batman! Say goodbye to your whitespace and hello to parenthesis, curly braces, and semicolons again. Even with the advanced ES6 syntax you'll find yourself writing a lot more punctuatio
// Existing commands that used to be 'pane:split-*' | |
'pane:split-left-and-copy-active-item' | |
'pane:split-right-and-copy-active-item' | |
'pane:split-up-and-copy-active-item' | |
'pane:split-down-and-copy-active-item' | |
// New commands to create splits | |
'pane:split-left' | |
'pane:split-right' | |
'pane:split-up' |
For reference, this is the way I managed to do it as of March 2016 starting with the link mentioned in this comment:
-
Added
HEROKU_API_LOGIN
(fromheroku auth:whoami
) andHEROKU_API_KEY
(fromheroku auth:token
) as protected ENV variables in the travis.org build settings. Alternatively, they can be added in the.travis.yml
with:travis encrypt HEROKU_API_LOGIN ="$(heroku auth:whoami)" --add travis encrypt HEROKU_API_KEY="$(heroku auth:token)" --add
-
Added following lines to the
.travis.yml
: