Skip to content

Instantly share code, notes, and snippets.


Jim Frenette jimfrenette

View GitHub Profile
Fuxy22 /
Last active Aug 28, 2020
Bash Script functions to Manage /etc/hosts file for adding/removing hostnames.
# remove specified host from /etc/hosts
function removehost() {
if [[ "$1" ]]
if [ -n "$(grep $HOSTNAME /etc/hosts)" ]
echo "$HOSTNAME Found in your /etc/hosts, Removing now...";
sudo sed -i".bak" "/$HOSTNAME/d" /etc/hosts
schatterjee4 / AEMDevResources
Created Nov 21, 2017 — forked from MikeNats/AEMDevResources
Adobe Experience Manager Resources for Developers
View AEMDevResources
Recent updates:
AEM Docs daily changes:
API References
View app.dockerfile
FROM php:7.0.4-fpm
RUN apt-get update && apt-get install -y libmcrypt-dev \
mysql-client libmagickwand-dev --no-install-recommends \
&& pecl install imagick \
&& docker-php-ext-enable imagick \
&& docker-php-ext-install mcrypt pdo_mysql
View .editorconfig
root = true
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
kuckmc01 / AEM-Touch-UI-Tab-Dialog-sample.xml
Last active May 27, 2020
AEM Touch UI Tab Dialog sample that has placeholders for adding tab content
View AEM-Touch-UI-Tab-Dialog-sample.xml
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling=""
xmlns:cq="" xmlns:jcr=""
xmlns:nt="" jcr:primaryType="nt:unstructured"
jcr:title="Compare Products Services" sling:resourceType="cq/gui/components/authoring/dialog"
mode="edit" helpPath="style-guide.html#compare-rows-services">
refo / remove-leading-slash
Created Jun 5, 2015
javascript - Remove leading slashes
View remove-leading-slash
'/example/string/'.replace(/^\/+/g, '');
// Should remove all leading slashes and return 'example/string/'
floriankraft /
Last active Sep 8, 2020
Some useful JCR queries (XPATH, SQL2) for AEM/CQ development.


All nodes with a specific name

SELECT * FROM [nt:unstructured] AS node
WHERE ISDESCENDANTNODE(node, "/search/in/path")
AND NAME() = "nodeName"

All pages below content path

un33k / sed cheatsheet
Created Aug 22, 2011
magic of sed -- find and replace "text" in a string or a file
View sed cheatsheet
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
View ssh-agent-utils.ps1
# SSH Agent Functions
# Mark Embling (
# How to use:
# - Place this file into %USERPROFILE%\Documents\WindowsPowershell (or location of choice)
# - Import into your profile.ps1:
# e.g. ". (Resolve-Path ~/Documents/WindowsPowershell/ssh-agent-utils.ps1)" [without quotes]
# - Enjoy
# Note: ensure you have ssh and ssh-agent available on your path, from Git's Unix tools or Cygwin.
You can’t perform that action at this time.