Skip to content

Instantly share code, notes, and snippets.

View leite's full-sized avatar
🎉
it is happening

Francisco Leite leite

🎉
it is happening
View GitHub Profile
@leite
leite / plenary.lua
Created December 21, 2023 23:03
enables crystal language highlighting in nvim & telescope preview
-- after/plugin/plenary.lua
require('plenary.filetype').add_table({
extension = {
cr = 'ruby'
}
})
@leite
leite / devices.c
Created August 11, 2023 12:04
list devices and events of key and button release
#include <X11/Xlib.h>
#include <X11/extensions/XInput.h>
#include <stdio.h>
/**
* libs needed: libx11-dev libxi-dev
* $ gcc devices.c -o devices -lX11 -lXi && ./devices
*/
static int key_release_type = -1;
@leite
leite / windows.c
Created August 10, 2023 09:45
list windows, coordinates, geometry and title
#include <stdio.h>
#include <X11/Xutil.h>
/**
* $ gcc windows.c -o windows -lX11 && ./windows
*/
int main () {
Atom actual_type;
int format;
@leite
leite / mon.sh
Created June 9, 2023 13:50
check if files change timestamp in path
#!/usr/bin/env bash
declare -A cached_paths
declare -A processed_paths
cache=$(echo ${TMPDIR:-/tmp})
err () {
>&2 echo "$1"
exit 1
@leite
leite / neighbourhoods.ex
Created July 24, 2020 21:22
get list of municipalities with neighbourhoods ...
defmodule CEP.Neighbourhoods do
@moduledoc """
Documentation for `CEP.Neighbourhoods`.
"""
alias CEP.{Utils, Neighbourhoods}
defstruct has_neighbourhoods?: false,
neighbourhoods: %{},
timeout: 900,
@leite
leite / neighbourhoods.ex
Created July 24, 2020 21:22
get list of municipalities with neighbourhoods ...
defmodule CEP.Neighbourhoods do
@moduledoc """
Documentation for `CEP.Neighbourhoods`.
"""
alias CEP.{Utils, Neighbourhoods}
defstruct has_neighbourhoods?: false,
neighbourhoods: %{},
timeout: 900,
@leite
leite / municipalities.ex
Last active July 23, 2020 05:36
list all municipalities of brazil by state
defmodule CEP.Municipalities do
@moduledoc """
Documentation for `CEP.Municipalities`.
"""
alias CEP.{Utils, Municipalities}
defstruct has_municipalities?: false,
states: %{},
municipalities: [],
@leite
leite / weather.ex
Last active November 12, 2020 17:02
weather responder ...
defmodule Docinho.Responders.Weather do
@moduledoc false
use Bitwise, only_operators: true
use Hedwig.Responder
require Logger
@openweathermap "http://api.openweathermap.org/data/2.5/weather"
@appid "fa821a2bed0d38581d64585d8e1ef3cc"
@moon_phases ["🌑", "🌒", "🌓", "🌔", "🌕", "🌖", "🌗", "🌘"]
FROM ubuntu:14.04
RUN apt-get update && apt-get upgrade -y && apt-get install -y bison build-essential curl dh-autoreconf apache2-dev \
doxygen flex g++ geoip-bin git libcurl4-gnutls-dev libgd-dev libgd3 libgeoip-dev libgeoip1 libpcre++-dev \
libpcre3 libpcre3-dev libperl-dev libtool libxml2 libxml2-dev libxslt1-dev libxslt1.1 libyajl-dev perl zlib1g-dev \
libgoogle-perftools-dev \
&& cd /opt \
&& curl -L -O https://www.openssl.org/source/old/0.9.x/openssl-0.9.8zh.tar.gz \
&& curl -L -O https://github.com/SpiderLabs/ModSecurity/releases/download/v2.9.3/modsecurity-2.9.3.tar.gz \
&& curl -L -O http://nginx.org/download/nginx-1.6.2.tar.gz \
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.