Skip to content

Instantly share code, notes, and snippets.

View vinikira's full-sized avatar

Vinícius da Costa Simões vinikira

View GitHub Profile
@vinikira
vinikira / build.sh
Created January 20, 2022 22:12
Using CURL with Ziglang
#!/bin/sh
set -xe
zig build-exe main.zig -O ReleaseSmall --library curl --library c $(pkg-config --cflags libcurl)
@vinikira
vinikira / build.sh
Created January 19, 2022 14:35
HTTP server using only system sockets in C
#!/bin/sh
set -xe
cc -Wall -Werror -std=c11 -pedantic -c common.c
cc -Wall -Werror -std=c11 -pedantic -o main main.c common.o
@vinikira
vinikira / build.sh
Created January 17, 2022 22:29
TCP socket consumption in C
#!/bin/sh
set -xe
cc -Wall -Werror -std=c11 -pedantic -o main main.c
@vinikira
vinikira / build.sh
Last active January 14, 2022 19:11
Curl request and JSON Parsing in C
#!/bin/sh
set -xe
cc -Wall -Werror -std=c11 -pedantic -lcurl -ljson-c -o main main.c
@vinikira
vinikira / .dir-locals.el
Created September 12, 2020 00:04
Adivice emacs exunit to use a custom mix command (e.g a docker container)
((elixir-mode . ((my/use-exunit-custom . t)
(my/exunit-custom-mix-cmd . "docker exec -it <container_id_or_name> mix"))))

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r <session_name>
@vinikira
vinikira / elixir_stuff.ex
Created August 3, 2020 13:03
Snippets utilizados durante a aprensetação "Introdução ao Phoenix LiveView".
# Filter event
@impl true
def handle_event("filter", %{"director" => director, "rating" => rating}, socket) do
params = [director: director, rating: rating]
movies = Movies.list_movies(params)
socket =
assign(
socket,
params ++ [movies: movies]
@vinikira
vinikira / Dockerfile
Created June 30, 2020 14:03 — forked from nirev/Dockerfile
Elixir docker deployment
ARG OTP_VERSION=22.0
##################################################
# Base - setup project and docker cache for build
FROM erlang:${OTP_VERSION}-alpine as base
# elixir expects utf8.
ENV ELIXIR_VERSION="v1.9.1" \
LANG=C.UTF-8
@vinikira
vinikira / .Xmodmap
Created June 22, 2020 13:24
Motospeed ck62 - remapped keys via software with xmodmap. In order to work put this file in your home folder. If doesn't work, run in your terminal `xmodmap .Xmodmap`.
! Motospeed CK62 - layout remaped
! Caps as Ctrl, Menu as Hyper_L
clear lock
clear control
clear mod1
clear mod2
clear mod3
clear mod4
clear mod5
@vinikira
vinikira / clean.el
Created May 13, 2020 12:25 — forked from rougier/clean.el
A very minimal but elegant emacs configuration file
(require 'org)
(setq-default indent-tabs-mode nil)
(setq org-display-inline-images t)
(setq org-redisplay-inline-images t)
(setq org-startup-with-inline-images "inlineimages")
(setq default-frame-alist
(append (list '(width . 72) '(height . 40))))