Skip to content

Instantly share code, notes, and snippets.

View emmanuelrosa's full-sized avatar

Emmanuel Rosa emmanuelrosa

View GitHub Profile
@emmanuelrosa
emmanuelrosa / bspwmrc
Created November 18, 2021 15:09
bspwmrc and sxhkdrc
#! /run/current-system/sw/bin/sh
. "${HOME}/.cache/wal/colors.sh"
pgrep -x sxhkd > /dev/null || sxhkd &
pgrep -x udiskie > /dev/null || udiskie &
pgrep -x picom > /dev/null || picom &
pgrep -x dunst > /dev/null || dunst &
killall xmobar > /dev/null ; (bspc subscribe report | awk -v ulcolor="$color4" -v tcolor="$color7" -v fcolor="$color2" -f $HOME/.config/bspwm/desktops.awk | xmobar -B $color0 -F $color7 $HOME/.config/bspwm/xmobarrc) &
@emmanuelrosa
emmanuelrosa / pomodoro.sh
Created April 7, 2021 22:47
A custom rofi mode which provides 20 and 5 minute timers.
#! /run/current-system/sw/bin/env bash
# POMODORO: A custom rofi mode which provides 20 and 5 minute timers.
# USAGE: rofi -combi-modi window,drun,pomo -show combi -modi combi,pomo:$HOME/bin/pomodoro
OPT_START_TASK="20 minute timer"
OPT_START_BREAK="5 minute timer"
SLEEP_TASK=1200
SLEEP_BREAK=300
@emmanuelrosa
emmanuelrosa / installer.nix
Created December 7, 2019 15:05
Example custom NixOS installer
# This module defines a small custom NixOS installation CD. It does not
# contain any graphical stuff.
{ stdenv, pkgs, ... }:
{
imports =
[ ./installation-cd-base.nix
];
// ==UserScript==
// @name Disable copy-paste blocking
// @version 1
// @grant none
// @description Removes the onpaste event handlers on the user name and password fields at https://ibanking.bangkokbank.com/SignOn.aspx, allowing user name and password to be copy-pasted in.
// @match https://ibanking.bangkokbank.com/SignOn.aspx
// ==/UserScript==
document.getElementById("txtID").removeAttribute("onpaste");
document.getElementById("txtPwd").removeAttribute("onpaste");

Keybase proof

I hereby claim:

  • I am emmanuelrosa on github. * I am emmanuelrosa (https://keybase.io/emmanuelrosa) on keybase. * I have a public key ASDEC6l1SEsPTMKc-YxX4mIRAuP-riwAbaW0QYMR6JWUYQo

To claim this, I am signing this object:

{
@emmanuelrosa
emmanuelrosa / malware-hosts.nix
Created June 29, 2018 23:20
Hosts to block in /etc/hosts
{ stdenv, pkgs, lib }:
let
rawHosts = builtins.fetchurl http://winhelp2002.mvps.org/hosts.txt;
cleanedHosts = stdenv.mkDerivation {
name = "mvps-hosts";
phases = [ "installPhase" ];
installPhase = ''
cat ${rawHosts} | tr -s '\r' '\n' | sed -e '/^#/ d' | cut -d ' ' -f 1,2 | sed -e '/localhost/ d' > $out
'';
@emmanuelrosa
emmanuelrosa / myriad-pro-font.nix
Last active September 10, 2020 16:48
Nix package for Myriad Pro font
{ stdenv, fetchurl }:
let
fetchfont = name: num: sha:
fetchurl {
url = "https://fontsup.com/download/${builtins.toString num}.html";
sha256 = sha;
name = "${name}";
};
in stdenv.mkDerivation rec {
@emmanuelrosa
emmanuelrosa / mpd.nix
Created June 9, 2018 21:51
WIP code for a NixOS MPD (Music Player Daemon) module which supports systemd user services.
{ config, lib, pkgs, ... }:
with lib;
let
name = "mpd";
uid = config.ids.uids.mpd;
gid = config.ids.gids.mpd;
@emmanuelrosa
emmanuelrosa / folding.elm
Created June 3, 2018 04:23
Why does folding arrays differ from folding lists?
import Html exposing (text)
import Array as A
import List as L
main =
let
a = A.length <| flattenA arrays
b = L.length <| flattenL lists
in
text <| toString (a == b)
@emmanuelrosa
emmanuelrosa / default.nix
Created January 8, 2018 19:11
Upwork package (work-in-progress) for Nix
{ stdenv, fetchurl, dpkg, makeWrapper, buildEnv,
gtk2, atk, glib, cairo, pango, gdk_pixbuf, freetype, fontconfig, gtkglext, xorg, nss, nspr,
gconf, alsaLib, dbus, cups, mesa_glu, systemd, expat, pciutils
}:
let
version = "4_2_153_0_tkzkho5lhz15j08q";
platform = {
x86_64-linux = {