Skip to content

Instantly share code, notes, and snippets.

View c3ry5's full-sized avatar

Cerys Williams c3ry5

  • London, United Kingdom
View GitHub Profile
@padenot
padenot / stream.js
Created October 29, 2011 16:33
How to serve media on node.js
var http = require('http');
var path = require('path');
var fs = require('fs');
var AUDIOFILE = "./audio.ogg";
function serveWithRanges(request, response, content) {
var range = request.headers.range;
var total = content.length;
var parts = range.replace(/bytes=/, "").split("-");
@fabrizioc1
fabrizioc1 / akamai_debug_headers.txt
Last active May 24, 2023 08:23
Akamai debug headers
Pragma: akamai-x-cache-on, akamai-x-cache-remote-on, akamai-x-check-cacheable, akamai-x-get-cache-key, akamai-x-get-extracted-values, akamai-x-get-nonces, akamai-x-get-ssl-client-session-id, akamai-x-get-true-cache-key, akamai-x-serial-no
@shyiko
shyiko / pom.xml
Created February 12, 2012 18:06
Sonar & JaCoCo & Maven 3 integration
<project ...>
...
<properties>
<sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<sonar.jacoco.reportPath>${user.dir}/target/jacoco.exec</sonar.jacoco.reportPath>
</properties>
...
<build>
<plugins>
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
@toodooleedoo
toodooleedoo / README.md
Last active May 9, 2017 17:24
#AEM #SIGHTLY #SSJS JavaScript Use-API to append parameters and attributes to anchors

##Description

  1. Append two custom parameters to specific URL's entered by an Author.
  2. Open all links pointing outside your site inside a new window
  3. Add .html to links entered through the GUI pathfield widget (@adobe why is this not OOTB?)

##Use case When an Author selects a link via pathfield I found AEM is not adding the extension. I was going to add some Client Side JavaScript to my dialog windows to handle this on save however I also had the following business requests so I leveraged Server Side JavaScript to take care of all of this.

##Requirements

  • When a request is to domain1name.com or domain2name.com append 2 author controllable URL parameters used for Tracking which the authors could control Globally per site.
@toodooleedoo
toodooleedoo / README.md
Last active April 21, 2016 13:43
#AEM #SIGHTLY #JAVASCRIPT ACS Commons Generic List get a value
@toodooleedoo
toodooleedoo / README.md
Last active June 23, 2017 13:38
#AEM #Sightly #SSJS Server Side JavaScript Use-API Breadcrumbs

###Description Retrieve a Page Object from all pages which are in the Site root then build a breadcrumb component and display the current pages title in a submenu.

###Use case Display a bar under eg a menu which displays the current pages title and functional breadcrumb components o the right.

##Requirements

  • Responsive and which works on all mobile devices and desktop.
  • Current pages title on the left
  • Breadcrumbs on the right
@gabrielwalt
gabrielwalt / logic.js
Last active May 17, 2021 14:09
Read AEM runmodes from Sightly
var SlingSettingsService = Packages.org.apache.sling.settings.SlingSettingsService;
use(function () {
// Get runmodes and transform them into an object that is easier to read for Sightly
var runmodesObj = {};
var runmodesSet = sling.getService(SlingSettingsService).getRunModes();
var iterator = runmodesSet.iterator();
while (iterator.hasNext()) {
runmodesObj[iterator.next()] = true;
@cpilsworth
cpilsworth / post.POST.html
Last active April 21, 2016 13:42
Using acs-aem-commons forms functionality with Sightly
<sly data-sly-use.form="test.js"></sly>
sly data-sly-test.errors="${form.validate}"></sly>
<sly data-sly-test="${errors}">${form.renderForm}</sly>
<sly data-sly-test="${!errors}">${form.redirectSuccess}</sly>
@Atlas7
Atlas7 / remove_postgres_on_mac_os.md
Last active March 23, 2023 13:02
Note - How completely uninstall PostgreSQL 9.X on Mac OSX

This blog post has helped me clean up my postgres development environment on Mac. So making a copy!

How completely uninstall PostgreSQL 9.X on Mac OSX

This article is referenced from stackoverflow:

If installed PostgreSQL with homebrew , enter brew uninstall postgresql

If you used the EnterpriseDB installer , follow the following step.