Skip to content

Instantly share code, notes, and snippets.

View AleksandarJeftic's full-sized avatar

Aleksandar Jeftic AleksandarJeftic

View GitHub Profile
@AleksandarJeftic
AleksandarJeftic / run_tests.sh
Created November 1, 2022 14:00
Run multiple commands in one docker container shell script
#!/bin/bash
# run with docker compose run --rm --use-aliases web bin/run_tests -c
# with -c option it runs without tests
code_check_flag=
while getopts c name
do
case $name in
c) code_check_flag=1;;
?) printf "Usage: %s: [-c]\n" $0
@AleksandarJeftic
AleksandarJeftic / strip HTML tags
Created October 18, 2022 15:02 — forked from awesome/strip HTML tags
ruby strip HTML tags
# copied from (thanks!): http://codesnippets.joyent.com/posts/show/615
str = <<HTML_TEXT
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<body>
<h1>Application error</h1>
<p>Change this error message for exceptions thrown outside of an action (like
in Dispatcher setups or broken Ruby code) in public/500.html</p>
@AleksandarJeftic
AleksandarJeftic / rails http status codes
Created September 23, 2022 16:45 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing