Skip to content

Instantly share code, notes, and snippets.

View dmvianna's full-sized avatar

Daniel Vianna dmvianna

View GitHub Profile
@dmvianna
dmvianna / .dir-locals.el
Created June 7, 2024 04:47
.dir-locals.el for Haskell cabal projects with unusual setups
;;; Package --- dir-locals.el -*- lexical-binding: t; -*-
;;; Summary: This project's configurations for emacs.
;;;
;;; Commentary:
;;;
;;; If you don't use the `emacs` editor, you can safely ignore this file.
;;; If you do use it, you may want to copy it to `.dir-locals.el`. It will
;;; set up some configuration variables that will only work when Emacs is
;;; visiting this project.
;;;
@dmvianna
dmvianna / rust_repl.bash
Last active May 10, 2024 06:39
rust repl via jupyter
#!/bin/env bash
set -euox pipefail
python -m venv .venv
source .venv/bin/activate
pip install jupyterlab plotly
cargo install evcxr_jupyter
evcxr_jupyter --install
# and then...

Keybase proof

I hereby claim:

  • I am dmvianna on github.
  • I am dmvianna (https://keybase.io/dmvianna) on keybase.
  • I have a public key ASAfmvS2jxgUS7nQKFY5c_rmy8RRQHuy1gaOUzT0tQI1xwo

To claim this, I am signing this object:

@dmvianna
dmvianna / emacsclient.desktop
Last active November 16, 2022 04:22
~/.local/share/applications/emacsclient.desktop
[Desktop Entry]
Name=Emacs (Client)
GenericName=Text Editor
Comment=Edit text
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
Exec=emacsclient -c --alternate-editor="" %F
Icon=emacs
Type=Application
Terminal=false
Categories=Development;TextEditor;
#!/usr/bin/env bash
set -e
#
# This script uses poetry to bundle all the dependencies
# found in `pyproject.toml` into a zip file that can be
# then uploaded to AWS Lambda.
#
@dmvianna
dmvianna / ThinkLight
Created October 26, 2019 11:13 — forked from vzaliva/ThinkLight
This script controll keyboard backlight on IBM ThinkPad X-series
#!/bin/bash
# Vadim Zaliva [email protected]
# based on https://gist.github.com/hadess/6847281
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
@dmvianna
dmvianna / thinkfan.nix
Created October 26, 2019 10:36 — forked from truthadjustr/thinkfan.nix
nixos: thinkfan configuration in /etc/nixos/configuration.nix
# Thinkpad T440
# postconditions:
# 1) status should be enabled:
# cat /proc/acpi/ibm/fan
# 2) No errors in systemd logs:
# journalctl -u thinkfan.service -f
services = {
thinkfan = {
planet data search --item-type PSScene4Band --geom 'planet/test.geojson' --date acquired gt 2018-04-01 --date acquired lt 2018-04-08 --range cloud_cover lt 0.2 > planet/response.json
planet data download --item-type PSScene4Band --geom 'planet/test.geojson' --date acquired gt 2018-04-01 --date acquired lt 2018-04-08 --range cloud_cover lt 0.2 --asset-type 'analytic' --dest 'planet/data'
# run with
# $ nix-env -iA userPackages -f '<nixpkgs>'
# to install packages functionally
with (import <nixpkgs> {});
{
packageOverrides = pkgs: with pkgs; {
userPackages = buildEnv {
inherit ((import <nixpkgs/nixos> {}).config.system.path)
@dmvianna
dmvianna / configuration.nix
Last active February 16, 2018 08:09
configuration.nix
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix