Skip to content

Instantly share code, notes, and snippets.

const fizzBuzzToN = (n) => {
let array = []
for ( let i = 1; i <= n ; i++){
if ( i % 3 === 0 && i % 5 === 0) {
array.push("FizzBuzz")
}
else if ( i % 3 === 0) {
array.push("Fizz")
}
else if (i % 5 === 0){
@anxhe
anxhe / git.md
Created May 7, 2017 14:50 — forked from joiggama/git.md
My git tips & tricks

Git

Remove all merged branches:

$ git branch --merged | awk '{ print $NF }' | xargs git branch -d
@anxhe
anxhe / capybara cheat sheet
Created January 31, 2017 19:04 — forked from joiggama/capybara cheat sheet
capybara cheat sheet
=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')
@anxhe
anxhe / tmux.md
Created January 21, 2017 03:27 — forked from joiggama/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@anxhe
anxhe / auth_helper.rb
Created January 19, 2017 04:29
Capybara Cheatsheet
module AuthHelper
def sign_in_with_cookie(name, value)
case page.driver.class
when Capybara::RackTest::Driver
# Set session cookie using Rack::Test
page.driver.browser.env "rack.session", { name => value }
else
# Set session cookie using railsware/rack_session_access gem
page.set_rack_session(name => value)
end