Skip to content

Instantly share code, notes, and snippets.

View angelikatyborska's full-sized avatar

Angelika Tyborska angelikatyborska

View GitHub Profile

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@angelikatyborska
angelikatyborska / script.sh
Created May 20, 2019 08:17
Copy a gpg key from pubring.kbx to pubring.gpg
gpg --keyring pubring.kbx --armor --export somebody@example.com > some-key
gpg --no-default-keyring --keyring pubring.gpg --import < some-key
@angelikatyborska
angelikatyborska / fd.sh
Created June 28, 2019 05:23
file descriptors commands
# 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
@angelikatyborska
angelikatyborska / sock.rb
Created July 2, 2019 15:19
HTTP(S) request via socket in Ruby
# 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 / post-checkout
Created May 14, 2020 06:48
post-checkout git hook to stash deps and _build
#!/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 / gist:db66261f876d4047fba35bdcf244d790
Created June 2, 2020 13:46
Verify emails from a list with swaks
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 / index.html
Last active August 6, 2020 15:25
Custom validation messages - 3 inputs
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Form Validation</title>
<style>
body { padding: 10px; }
</style>
</head>
<body>
# 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 / gist:6f7d2fe7df779ff87082af115093eda2
Created September 14, 2020 15:48
Count LOC in an Elixir project
git ls-files | egrep '\.erl|\.ex[s]$' | xargs cat | sed '/^$/d' | wc -l
@angelikatyborska
angelikatyborska / hello.md
Last active November 29, 2020 15:37
Exercism Elixir maintainers Slack channel welcome message

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.