You're taking your first steps into Ruby
A good introduction to programming in general. Easy on newer programmers.
@executor = Concurrent::ThreadPoolExecutor.new min_threads: min_threads, | |
max_threads: max_threads | |
def connection_pool | |
@connection_pool ||= ConnectionPool.new size: @pool_size, timeout: @pool_timeout do | |
HTTP.auth("Bearer #{access_token}") | |
.persistent(HOST) | |
.timeout(@http_timeout) | |
.headers(accept_encoding: ACCEPT_ENCODING) | |
.use(:auto_inflate) |
#!/bin/bash | |
set -e | |
CURRENT_NAME="Zauberantrag" | |
CURRENT_OTP="zauberantrag" | |
NEW_NAME="Wunderantrag" | |
NEW_OTP="wunderantrag" |
{ | |
"Statement": [ | |
{ | |
"Action": [ | |
"apigateway:*", | |
"cloudformation:CancelUpdateStack", | |
"cloudformation:ContinueUpdateRollback", | |
"cloudformation:CreateChangeSet", | |
"cloudformation:CreateStack", | |
"cloudformation:CreateUploadBucket", |
public function showProducts(){ | |
$products = DB::table('products')->paginate(9); | |
return view('products', ['products' => $products]); | |
} |
You're taking your first steps into Ruby
A good introduction to programming in general. Easy on newer programmers.
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" | |
" " | |
" __ _ _ _ __ ___ _ __ ___ " | |
" \ \ / / | '_ ` _ \| '__/ __| " | |
" \ V /| | | | | | | | | (__ " | |
" \_/ |_|_| |_| |_|_| \___| " | |
" " | |
" " | |
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" |
# lazyload nvm | |
# all props goes to http://broken-by.me/lazy-load-nvm/ | |
# grabbed from reddit @ https://www.reddit.com/r/node/comments/4tg5jg/lazy_load_nvm_for_faster_shell_start/ | |
lazynvm() { | |
unset -f nvm node npm npx | |
export NVM_DIR=~/.nvm | |
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm | |
if [ -f "$NVM_DIR/bash_completion" ]; then | |
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion |
def meth &block | |
block | |
end | |
block = meth { 42 } | |
prok = proc { 42 } | |
lamb = lambda { 42 } | |
block.call | |
#=> 42 | |
prok.call |
<?xml version="1.0" encoding="utf-8"?> | |
<!-- Copyright (C) 2014 The Android Open Source Project | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
# Model | |
expect(@user).to have(1).error_on(:username) # checks whether there is an error in username | |
expect(@user.errors[:username]).to include("can't be blank") # check for the error message | |
# Rendering | |
expect(response).to render_template(:index) | |
# Redirecting |