Skip to content

Instantly share code, notes, and snippets.

View jgermade's full-sized avatar
🎨
Working from home

Jesús Germade jgermade

🎨
Working from home
View GitHub Profile
@jgermade
jgermade / shadow-dom.md
Created June 6, 2020 02:31 — forked from praveenpuglia/shadow-dom.md
Everything you need to know about Shadow DOM

I am moving this gist to a github repo so more people can contribute to it. Also, it makes it easier for me to version control.

Please go to - https://github.com/praveenpuglia/shadow-dom-in-depth for latest version of this document. Also, if you find the document useful, please shower your love, go ⭐️ it. :)

Shadow DOM

Heads Up! It's all about the V1 Spec.

In a nutshell, Shadow DOM enables local scoping for HTML & CSS.

@jgermade
jgermade / get-toolbox.sh
Created August 2, 2016 16:25 — forked from jacobtomlinson/get-toolbox.sh
Docker toolbox for linux
#!/bin/bash
# A quick script to install Docker Engine and Compose
# Run with sudo
# Install Docker Engine
curl -sSL https://get.docker.com/ | sh
# Start Docker
# TODO update to handle multiple distros
service docker start
@jgermade
jgermade / parse_yaml.sh
Last active August 9, 2016 22:13 — forked from pkuczynski/LICENSE
Read YAML file from Bash script
#!/bin/sh
parse_yaml() {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}
@jgermade
jgermade / install-pre-commit.sh
Last active August 27, 2015 09:12 — forked from stefansundin/install-pre-commit.sh
Git pre-commit check to stop accidental commits to master and develop branches. There is also a variant with a core.whitespace check.
#!/bin/sh
# This script will install a Git pre-commit hook that stop accidental commits to master and develop branches.
# There is also a variant that includes a core.whitespace check. See pre-commit-2 below.
# Install in current Git repo:
# curl -fL https://gist.githubusercontent.com/stefansundin/9059706/raw/install-pre-commit.sh | sh
# Install with core.whitespace check:
# curl -fL https://gist.githubusercontent.com/stefansundin/9059706/raw/install-pre-commit.sh | sh -s pre-commit-2
# Install with core.whitespace check and EOF-newline-check:
# curl -fL https://gist.githubusercontent.com/stefansundin/9059706/raw/install-pre-commit.sh | sh -s pre-commit-3
# Install only core.whitespace check:
@jgermade
jgermade / _service.md
Last active August 29, 2015 14:25 — forked from naholyr/_service.md

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@jgermade
jgermade / .gitconfig
Last active August 29, 2015 14:17 — forked from pksunkara/config
[user]
name = Pavan Kumar Sunkara
email = [email protected]
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
#!/bin/bash
# slanger daemon
# chkconfig: 345 20 80
# description: slanger daemon
# processname: slanger
. /etc/rc.d/init.d/functions
# Location of a non-daemon application to be daemonized
BIN="/home/xxx/.rvm/gems/ruby-1.9.2-p290/bin/slanger --app_key XXXX --secret YYYY --api_host 0.0.0.0:4568 --websocket_host 0.0.0.0:8081"
@jgermade
jgermade / .htaccess
Last active August 29, 2015 14:16 — forked from revolunet/.htaccess
# with AJAX withCredentials=false (cookies NOT sent)
Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Methods "POST, GET, PUT, OPTIONS, PATCH, DELETE"
Header always set Access-Control-Allow-Headers "X-Accept-Charset,X-Accept,Content-Type"
RewriteEngine On
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [R=200,L,E=HTTP_ORIGIN:%{HTTP:ORIGIN}]]
# with AJAX withCredentials=true (cookies sent, SSL allowed...)
SetEnvIfNoCase ORIGIN (.*) ORIGIN=$1