Skip to content

Instantly share code, notes, and snippets.

View emaphp's full-sized avatar

Emmanuel Antico emaphp

View GitHub Profile
@emaphp
emaphp / hex-to-rgba.el
Created February 22, 2020 18:41
Hex color to RGBA conversion
(defun dotspacemacs/user-config ()
"Configuration for user code:
This function is called at the very end of Spacemacs startup, after layer
configuration.
Put your configuration code here, except for variables that should be set
before packages are loaded."
(defun hex-to-list (hex)
(mapcar (lambda (z)
(number-to-string (string-to-number z 16)))
(mapcar (lambda (y)
@emaphp
emaphp / profile.sh
Created February 19, 2020 19:07
Personal profile file (partial)
# Rust binaries
export PATH="$HOME/.cargo/bin:$PATH"
# Flutter
export PATH="$HOME/flutter/bin:$PATH"
# Dart SDK
export PATH="$HOME/flutter/bin/cache/dart-sdk/bin:$PATH"
# Dart binaries
export PATH="$PATH":"$HOME/.pub-cache/bin"
@emaphp
emaphp / aliases.sh
Created February 19, 2020 19:04
Personal Bash aliases
# Refreshes the mpd song list
function mpdupdate() {
sudo killall mpd
rm ~/.mpd/mpd.log && rm ~/.mpd/mpdstate && rm ~/.mpd/mpd.db
mpd && sleep 30
# mpc ls | grep "^[A-Z]" | mpc add
}
alias mpcupdate="mpdupdate"
alias music="mpd; ncmpcpp"
@emaphp
emaphp / index.js
Created April 10, 2019 22:41
transform + reduce
function readPosX(stream, acc) {
let val = stream.substr(0, 2);
acc.posX = val;
return stream.substr(2);
}
function readPosY(stream, acc) {
let val = stream.substr(0, 2);
acc.posY = val;
return stream.substr(2);