Skip to content

Instantly share code, notes, and snippets.

Christy Lewis cmlewis

Block or report user

Report or block cmlewis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cmlewis
cmlewis / calculateDurationOfATask.java
Created Oct 30, 2014
Create a 'timer' in Java to measure the duration of some code in milliseconds and minutes.
View calculateDurationOfATask.java
// Get the current system time to calculate duration
long startTime = System.currentTimeMillis();
// Do logic here
// Get the end time and calculate duration
long endTime = System.currentTimeMillis();
long durationInMs = endTime - startTime;
long durationInMins = durationInMs/60000;
@cmlewis
cmlewis / AlfrescoExecuteUnlimitedSearch.java
Created Oct 30, 2014
Execute an Alfresco search with unlimited results and permissions checks. Bypasses the configured max search limit (default is 1000).
View AlfrescoExecuteUnlimitedSearch.java
// Set up search params with unlimited results
SearchParameters sp = new SearchParameters();
sp.setLanguage(SearchService.LANGUAGE_LUCENE); // Can be lucene, FTS, CMIS, etc.
sp.setQuery(query);
sp.addStore(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
sp.setMaxItems(Integer.MAX_VALUE);
sp.setMaxPermissionChecks(Integer.MAX_VALUE);
// Execute query.
ResultSet resultSet = searchService.query(sp);
@cmlewis
cmlewis / Alfresco module (AMP) depends on another module
Created Sep 4, 2014
Make an Alfresco module/AMP depend on another module. When installing, the mmt install will require that the other modules are installed first.
@cmlewis
cmlewis / Using Alfresco RegexQNamePattern to get associations.md
Created Aug 29, 2014
Various methods using Alfresco's RegexQNamePattern to get associations
View Using Alfresco RegexQNamePattern to get associations.md

Various methods using Alfresco's RegexQNamePattern to get associations using:

  1. RegexQnamePattern.MATCH_ALL to get all associations
  2. Getting associations by name without a namespace
  3. Getting all associations in a particular namespace
@cmlewis
cmlewis / Delete SOLR index
Created Aug 14, 2014
Delete a SOLR index
View Delete SOLR index
http://HOST:PORT/solr/update?stream.body=<delete><query>*:*</query></delete>&commit=true
or
http://HOST:PORT/solr/CORE/update?stream.body=<delete><query>*:*</query></delete>&commit=true
@cmlewis
cmlewis / Trim video with ffmpeg - without reencoding.bat
Last active Aug 29, 2015
How to trim a video using ffmpeg (without reencoding)
View Trim video with ffmpeg - without reencoding.bat
rem Tell ffmpeg to copy the video and audio codecs and specify the start time (ss) and duration (t).
ffmpeg -i video.avi -vcodec copy -acodec copy -ss 00:00:00 -t 00:00:04 trimmed_video.avi
@cmlewis
cmlewis / Alfresco Content Model depends on a model from another AMP or module
Last active Aug 29, 2015
When deploying multiple AMPs/modules in Alfresco, content models may have dependencies on content models in other modules. Set up the proper dependencies using the dictionary bootstrap and 'depends-on' in your module-context.xml.
@cmlewis
cmlewis / Alfresco Share Action - View Object in Node Browser
Last active Aug 29, 2015
Alfresco Share action to view any object in Alfresco repository in the Share node browser. Admins can click this action to automatically bring up the node in the Share node browser instead of having to copy, paste, and search the noderef in the node browser.
View Alfresco Share Action - View Object in Node Browser
Alfresco Share action that creates an action in the document library and document/folder details pages called 'View in Node Browser.' Admins can click this action to automatically bring up the node in the Share node browser instead of having to copy, paste, and search the noderef in the node browser.
@cmlewis
cmlewis / Rotate Videos using ffmpeg
Last active Sep 24, 2019
Rotate videos 90 or 180 degrees using ffmpeg
View Rotate Videos using ffmpeg
Rotate videos 90 or 180 degrees using ffmpeg.
You can’t perform that action at this time.