Skip to content

Instantly share code, notes, and snippets.

@joemaffia
joemaffia / AEM cURL
Last active July 18, 2023 00:09
AEM cURL commands
Uninstall a bundle (use http://localhost:4505/system/console/bundles to access the Apache Felix web console)
curl -u admin:admin -daction=uninstall http://localhost:4505/system/console/bundles/"name of bundle"
Install a bundle
curl -u admin:admin -F action=install -F bundlestartlevel=20 -F
bundlefile=@"name of jar.jar" http://localhost:4505/system/console/bundles
Build a bundle
curl -u admin:admin -F bundleHome=/apps/centrica/bundles/name of bundle -F
descriptor=/apps/centrica/bundles/com.centrica.cq.wcm.core-bundle/name_of_bundle.bnd
@joemaffia
joemaffia / git-clear-cache.sh
Last active November 13, 2022 12:50
Clear git cache
git rm -r --cached .
git add .
git commit -m 'git cache cleared'
git push
@joemaffia
joemaffia / bash_profile
Last active December 6, 2021 17:14
Set $JAVA_HOME Environment Variable On Mac OS X
# OSX 10.5 or later Apple recommends to set the $JAVA_HOME variable to /usr/libexec/java_home
# so just export $JAVA_HOME in file ~/.bash_profile or ~/.profile or ~/.zshrc
# /usr/libexec/java_home return the Java version specified in Java Preferences for the current user.
export JAVA_HOME=$(/usr/libexec/java_home)
#specific version
#export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
@joemaffia
joemaffia / slackbot_reminder_bitbucket_pullrequests.py
Created July 19, 2017 08:37
Slack Bot reminder for Bitbucket pull requests
import os
import sys
import requests
import json
from datetime import tzinfo, timedelta, datetime
from dateutil.parser import parse
POST_URL = 'https://slack.com/api/chat.postMessage'
@joemaffia
joemaffia / AEM Querybuilder | not Active pages
Created December 16, 2015 10:11
AEM Querybuilder | not Active pages
http://localhost:4502/bin/querybuilder.json?
type=cq:Page&
path=/content/geometrixx/en/products/triangle&
group.p.or=true&
group.1_property=jcr:content/cq:lastReplicationAction&
group.1_property.value=Deactivate&
group.2_property=jcr:content/cq:lastReplicationAction&
group.2_property.operation=not
@joemaffia
joemaffia / git-delete-merged.sh
Last active June 28, 2017 08:03
Delete git merged branches
#local
git branch --merged | grep -v '\*\|master\|develop' | xargs -n 1 git branch -d
#remote
git branch -r --merged | grep -v '\*\|master\|develop' | sed 's/origin\///' | xargs -n 1 git push --delete origin
@joemaffia
joemaffia / aem-content-refresh.sh
Created December 1, 2016 12:50
AEM Content Refresh via packmgr
#!/bin/bash
############ log file configuration ##############
LOG_DIR="./"
today=$(date +"%Y-%m-%d")
logfile="$LOG_DIR/aem-content-refresh.log.$today"
############ Environment connections ##############
# Source Author Slave
SOURCE_AUTH_LOGIN="admin"
@joemaffia
joemaffia / app.js
Created March 24, 2011 18:16
foursquare OAuth in Titanium
/**
*
*
* Copyright 2011 Aaron K. Saunders, Clearly Innovative Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>
@joemaffia
joemaffia / GoodbyeWorldServlet.java
Created October 16, 2013 09:12
Adobe CQ Servlet that will expose the GoodbyeWorldService
package com.company.cq.servlets;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Properties;
import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.Service;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
import org.apache.sling.api.servlets.SlingAllMethodsServlet;
import org.slf4j.Logger;
@joemaffia
joemaffia / GoodbyeWorldService.java
Last active December 25, 2015 16:19
Adobe CQ OSGi service using SCR annotations.
package com.company.cq.services;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Properties;
import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.Service;
import org.osgi.framework.Constants;
/**