Skip to content

Instantly share code, notes, and snippets.

Avatar

Angelika Tyborska angelikatyborska

View GitHub Profile
@angelikatyborska
angelikatyborska / myphoenixapp.service
Created Mar 10, 2021
Phoenix app serviced service file
View myphoenixapp.service
# /etc/systemd/system/myphoenixapp.service
[Unit]
Description=Runner for My Phoenix App
After=network.target
StartLimitIntervalSec=500
StartLimitBurst=5
[Service]
WorkingDirectory=/path/to/myphoenixapp
@angelikatyborska
angelikatyborska / hello.md
Last active Nov 29, 2020
Exercism Elixir maintainers Slack channel welcome message
View hello.md

Hello!

So you want to help out with the Elixir track on Exercism? That's awesome! 💜

There are plenty of tasks that you can help with.

If you have any questions, if you're unsure where to start or you're stuck, do not hesitate to ask for help in our #maintaining-elixir Slack channel.

View gist:6f7d2fe7df779ff87082af115093eda2
git ls-files | egrep '\.erl|\.ex[s]$' | xargs cat | sed '/^$/d' | wc -l
View angelika.zsh-theme
# requires the git-prompt zsh plugin, which in turn requires python2
PROMPT="%{$fg[blue]%}%n%{$reset_color%} in "
PROMPT+='%{$fg[cyan]%}%~%{$reset_color%} $(git_super_status)'
PROMPT+='
%(?:%{$fg_bold[green]%}$ :%{$fg_bold[red]%}$ )%{$reset_color%}'
RPROMPT=''
ZSH_THEME_GIT_PROMPT_CHANGED="%{$fg[red]%}%{∙%G%}"
ZSH_THEME_GIT_PROMPT_CONFLICTS="%{$fg[red]%}%{×%G%}"
@angelikatyborska
angelikatyborska / index.html
Last active Aug 6, 2020
Custom validation messages - 3 inputs
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Form Validation</title>
<style>
body { padding: 10px; }
</style>
</head>
<body>
View gist:db66261f876d4047fba35bdcf244d790
for E in `cat ~/some/file/with/email/addresses`
do
swaks --to $E --quit-after RCPT --hide-all
[ $? -ne 0 ] && echo $E
done
@angelikatyborska
angelikatyborska / post-checkout
Created May 14, 2020
post-checkout git hook to stash deps and _build
View post-checkout
#!/bin/sh
# Set this to a list of space-separated paths to files/directories,
# which will be stashed away, when the current branch is changed
ARTIFACT_PATHS="deps _build"
# Set this to a directory where you would like the build artifacts of
# other branches to be stashed
ARTIFACT_STASH_PATH=".artifacts-stash"
PREVIOUS_HEAD="$1"
CURRENT_HEAD="$2"
IS_BRANCH_CHECKOUT="$3"
@angelikatyborska
angelikatyborska / index.html
Last active Feb 13, 2021
Providing custom error messages for built-in HTML5 form validation
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Form Validation</title>
<style>
body { padding: 10px; }
</style>
</head>
<body>
<form>
@angelikatyborska
angelikatyborska / sock.rb
Created Jul 2, 2019
HTTP(S) request via socket in Ruby
View sock.rb
# HTTP
sock = TCPSocket.new('example.com', 80);
sock.write("GET /path HTTP/1.1\r\nHost: example.com\r\nConnection: close\r\n\r\n");
puts sock.read;
sock.close;
# HTTPS
sock = TCPSocket.new('example.com', 443)
sslsock = OpenSSL::SSL::SSLSocket.new(sock)
sslsock.connect
@angelikatyborska
angelikatyborska / fd.sh
Created Jun 28, 2019
file descriptors commands
View fd.sh
# check number of used FDs per process
ls /proc/$pid/fd | wc -l
# check number of used FDs system-wide
# returns: 1. allocated, 2. allocated but free (usually 0), 3. system max
sysctl fs.file-nr
# check FD per user limit
ulimit -a