Skip to content

Instantly share code, notes, and snippets.

View ericdouglas's full-sized avatar

Eric Douglas ericdouglas

View GitHub Profile
@ericdouglas
ericdouglas / wezterm.lua
Last active November 24, 2023 11:59
wezterm config
local wezterm = require 'wezterm'
local act = wezterm.action
local config = {}
if wezterm.config_builder then
config = wezterm.config_builder()
end
-- configs
@ericdouglas
ericdouglas / Cargo.toml
Created November 19, 2022 16:55
quickreplace exercise program from programming rust v2 book
[package]
name = "quickreplace"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
text-colorizer = "1"
regex = "1"
@ericdouglas
ericdouglas / .gitconfig
Created December 10, 2020 09:31
.gitconfig file
[user]
email = eric.douglas.mail@gmail.com
name = Eric Douglas
[core]
editor = vim
[push]
followTags = true
[alias]
c = !git add --all && git commit -m
s = !git status -s
@ericdouglas
ericdouglas / keyboard.md
Last active April 15, 2024 10:58
Cedilla under C (ç) in 'US international' keyboard layout in Linux

Add English (US, alt. intl.)

It's because the cedilla module isn't loaded by default when the locale is set to en, so you have to change the configuration files for gtk to add them:

  1. Edit configuration files:
sudo vim /usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules.cache

sudo vim /usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules.cache
@ericdouglas
ericdouglas / remove-branches.sh
Created May 12, 2020 16:54
Remove all your local git branches but keep master
git branch | grep -v "master" | xargs git branch -D
# src: https://coderwall.com/p/x3jmig/remove-all-your-local-git-branches-but-keep-master
@ericdouglas
ericdouglas / first.erl
Last active May 8, 2020 13:40
Functional Programmin with Erlang exercises
-module(first).
-export([area/3, double/1, mult/2, square/1, treble/1]).
mult(X, Y) -> X * Y.
double(X) -> mult(2, X).
area(A, B, C) ->
S = (A + B + C) / 2,
@ericdouglas
ericdouglas / write-an-open-source-js-lib.md
Created August 28, 2019 10:19 — forked from oncode/write-an-open-source-js-lib.md
How to Write an Open Source JavaScript Library
@ericdouglas
ericdouglas / settings.json
Last active March 2, 2023 12:39
VSCode User Settings
{
"workbench.colorTheme": "vaporwave *bold*",
"workbench.iconTheme": "file-icons",
"vim.insertModeKeyBindings": [
{
"before": ["k", "j"],
"after": ["<Esc>"]
}
],
@ericdouglas
ericdouglas / install_font_adobe_source_code_pro.sh
Created March 23, 2018 15:25 — forked from enzinier/install_font_adobe_source_code_pro.sh
Install font Adobe Source Code Pro on Ubuntu 16.04 LTS
#!/bin/sh
# Userland mode (~$USER/), (~/).
# ~/.fonts is now deprecated and that
#FONT_HOME=~/.fonts
# ~/.local/share/fonts should be used instead
FONT_HOME=~/.local/share/fonts
echo "installing fonts at $PWD to $FONT_HOME"
mkdir -p "$FONT_HOME/adobe-fonts/source-code-pro"
@ericdouglas
ericdouglas / scheduler.js
Created January 17, 2018 09:29
Review system generator/scheduler
const today = new Date().getTime();
const day = 24 * 60 * 60 * 1000; // 1 day in miliseconds
console.log('TODAY', (new Date(today)).toISOString().split('T')[0]);
console.log('+1', (new Date(today + (day * 1))).toISOString().split('T')[0]);
console.log('+3', (new Date(today + (day * 3))).toISOString().split('T')[0]);
console.log('+7', (new Date(today + (day * 7))).toISOString().split('T')[0]);
console.log('+15', (new Date(today + (day * 15))).toISOString().split('T')[0]);
console.log('+30', (new Date(today + (day * 30))).toISOString().split('T')[0]);
console.log('+60', (new Date(today + (day * 60))).toISOString().split('T')[0]);