Skip to content

Instantly share code, notes, and snippets.

Avatar

Jim Frenette jimfrenette

View GitHub Profile
@Fuxy22
Fuxy22 / bash_aliases.sh
Last active Aug 28, 2020
Bash Script functions to Manage /etc/hosts file for adding/removing hostnames.
View bash_aliases.sh
# remove specified host from /etc/hosts
function removehost() {
if [[ "$1" ]]
then
HOSTNAME=$1
if [ -n "$(grep $HOSTNAME /etc/hosts)" ]
then
echo "$HOSTNAME Found in your /etc/hosts, Removing now...";
sudo sed -i".bak" "/$HOSTNAME/d" /etc/hosts
@schatterjee4
schatterjee4 / AEMDevResources
Created Nov 21, 2017 — forked from MikeNats/AEMDevResources
Adobe Experience Manager Resources for Developers
View AEMDevResources
Documentation
-------------
AEM: http://docs.adobe.com
Recent updates: https://docs.adobe.com/docs/en/aem/recent-documentation-updates.html
AEM Docs daily changes: http://adobedocsdiff.headwire.com/sitediff/
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
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@kuckmc01
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="http://sling.apache.org/jcr/sling/1.0"
xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 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">
<content
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/container">
<layout
@refo
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
floriankraft / JcrQueryLibrary.md
Last active Sep 8, 2020
Some useful JCR queries (XPATH, SQL2) for AEM/CQ development.
View JcrQueryLibrary.md

SQL2

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
un33k / sed cheatsheet
Created Aug 22, 2011
magic of sed -- find and replace "text" in a string or a file
View sed cheatsheet
FILE SPACING:
# 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 (http://www.markembling.info/)
#
# 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.