Skip to content

Instantly share code, notes, and snippets.

View 5minpause's full-sized avatar

Holger Frohloff 5minpause

View GitHub Profile
@5minpause
5minpause / capybara cheat sheet
Created May 2, 2022 10:50 — forked from zhengjia/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')
@5minpause
5minpause / de.yml
Last active November 3, 2022 08:21 — forked from anny-goerl/de.yml
German: Formal Sie for Devise 4.6.2
de:
activerecord:
attributes:
user:
confirmation_sent_at: Bestätigung gesendet am
confirmation_token: Bestätigungs-Token
confirmed_at: Bestätigt am
created_at: Erstellt am
current_password: Bisheriges Passwort
current_sign_in_at: Aktuelle Anmeldung vom
@5minpause
5minpause / YouTube Playlist Script
Created February 3, 2021 09:25
This is the code for a YouTube playlist script for Scriptable.app
let playlistID, startDay, API_KEY
if (args.widgetParameter) {
[playlistID, startDay, API_KEY] = args.widgetParameter.split(",")
}
const url = `https://youtube.googleapis.com/youtube/v3/playlistItems?part=snippet%2CcontentDetails&maxResults=30&playlistId=${playlistID}&key=${API_KEY}`
const getCurrentDay = () => {
const today = new Date()
const startDate = new Date(startDay)
const differenceInTime = today.getTime() - startDate.getTime()
@5minpause
5minpause / rspec.rb
Created March 7, 2018 12:19
how to use sessions with capybara
# support/setup.rb
def in_browser(name)
old_session = Capybara.session_name
Capybara.session_name = name
yield
ensure
Capybara.session_name = old_session
end
chflags nohidden ~/Library
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
defaults write com.apple.dock autohide -bool true
defaults write com.apple.dock autohide-delay -float 0
defaults write com.apple.dock launchanim -bool false
defaults write com.apple.dock magnification -bool false
defaults write com.apple.dock mru-spaces -bool false
defaults write com.apple.dock show-process-indicators -bool true
defaults write com.apple.dock size-immutable -bool true
alias migrate="rake db:migrate && cd test/dummy && rake db:test:prepare && cd ..."
alias remigrate="rake db:migrate && rake db:migrate:redo && rake db:schema:dump db:test:prepare"
alias remongrate="rake mongoid:migrate && rake mongoid:migrate:redo"
alias gu='gu'
alias g="git"
alias gcoma="git commit -a"
alias s="bundle exec rspec"
alias cuc="bundle exec cucumber"
alias gi="gem install"
alias giv="gem install -v"
Plug 'flazz/vim-colorschemes'
Plug 'MarcWeger/vim-addon-mw-utils'
Plug 'tomtom/tlib_vim'
Plug 'garbas/vim-snipmate'
Plug 'isRuslan/vim-es6'
set hlsearch " Highlihgt search results while searching
set relativenumber " show relative line numbers
set encoding=utf-8
set ignorecase " Case insensitive pattern matching when searching
set smartcase " Overrides ignorecase when pattern contains upcase
nnoremap <Leader>a :call RunAllSpecs()<CR>
:command W w
add_index :attachments, :parent_id
add_index :attachments, :asset_id
add_index :domain_names, :user_id
add_index :domain_names, :event_id
add_index :event_memberships, :user_id
add_index :event_memberships, :event_id
remove_index :attachments, :parent_id
remove_index :attachments, :asset_id
remove_index:domain_names, :user_id
remove_index:domain_names, :event_id
var jwt = JwtStore.jwt();
var otp = JwtStore.otp();
$.ajax({
url: '/api/v1/affiliates',
headers: {
'Authorization': 'Bearer ' + jwt,
'Otp': otp,
'Accept': 'application/json',
'Content-Type': 'application/json'
},