Skip to content

Instantly share code, notes, and snippets.

David Díaz dgdavid

Block or report user

Report or block dgdavid

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dgdavid
dgdavid / My first Ansible playbook.md
Last active Aug 29, 2015
My first playbook for provisioning Ubuntu vagrant machine to test Aurelia JavasScript framework
View My first Ansible playbook.md
@dgdavid
dgdavid / css-ene-letter.markdown
Last active Aug 29, 2015
Ñ for CSS Sans Font
View css-ene-letter.markdown
@dgdavid
dgdavid / normalize-svg-icons
Last active Jul 5, 2017
WIP - normalize svg icons script
View normalize-svg-icons
#!/bin/bash
size="$1"
NC='\033[0m' # No Color
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
BLUE='\033[0;34m'
View gist:e84b748223138da5ddb0775df0adfc31

Doing

Done

@dgdavid
dgdavid / get_version_id_from_os_release.sh
Last active Sep 18, 2018
Simple example of how to get the VERSION_ID from /etc/os-release in a shell script
View get_version_id_from_os_release.sh
#!/usr/bin/env bash
# See https://www.freedesktop.org/software/systemd/man/os-release.html
version_id=$(grep "^ID=" /etc/os-release | cut -d'=' -f2 | tr -d '"')
echo $version_id
@dgdavid
dgdavid / working_with_functions_in_bash.sh
Last active Sep 18, 2018
Testing how to work with functions in a shell script
View working_with_functions_in_bash.sh
#!/usr/bin/env bash
function this_and_that_are_equals () {
this="me"
that="you"
if [ $this = $that ]; then
return 0
else
return 1
@dgdavid
dgdavid / btrfs_checker.rb
Last active Jan 30, 2019
Check if the given path is in a btrfs filesystem
View btrfs_checker.rb
require 'yast'
require 'yast2/execute'
require 'pathname'
# Returns if the given path is placed in a btrfs
#
# @param path [String, Pathname]
#
# @return [Boolean]
def btrfs_available_for?(path)
You can’t perform that action at this time.