Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / 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 / brew
Created July 13, 2015 08:47
Homebrew permissions & multiple users needing to brew update
chgrp -R admin /usr/local
chmod -R g+w /usr/local
chgrp -R admin /Library/Caches/Homebrew
chmod -R g+w /Library/Caches/Homebrew
@joemaffia
joemaffia / lwip.js
Last active August 29, 2015 14:18
Node ExpressJS using LWIP
var app = require('express')();
var multer = require('multer')
var lwip = require('lwip')
app.use(multer({inMemory: true}))
app.post('/', function (req, res) {
var fileBuffer = req.files.file.buffer
lwip.open(fileBuffer, 'jpg', function(err, image) {
@joemaffia
joemaffia / toggle-touch-classic.js
Created February 6, 2015 13:52
Bookmarklet to switch between Touch & Classic edit mode in AEM
javascript:(function(){
var TOUCH = '/editor.html';
var CLASSIC = '/cf';
var createURL = function(path, qs, hash) {
var url = path;
if(qs.length != 0 && !(qs.length == 1 && qs[0] == '')) {
url += '?' + qs.join('&');
}
url += hash;
@joemaffia
joemaffia / aem-import-json.sh
Created February 4, 2015 13:26
Import json to JCR via bash
#!/bin/bash
if (( $# < 1 ))
then
echo "You should add more stuff ;)"
echo "example: $0 ~/Desktop/file.json http://localhost:4502/content/copy"
exit 1
fi
j="$1"