Skip to content

Instantly share code, notes, and snippets.

View douglascrp's full-sized avatar

Douglas C. R. Paes douglascrp

View GitHub Profile
@Daniel15
Daniel15 / 1_README.md
Last active May 6, 2024 06:40
Complete Google Drive File Picker example

Google Drive File Picker Example

This is an example of how to use the Google Drive file picker and Google Drive API to retrieve files from Google Drive using pure JavaScript. At the time of writing (14th July 2013), Google have good examples for using these two APIs separately, but no documentation on using them together.

Note that this is just sample code, designed to be concise to demonstrate the API. In a production environment, you should include more error handling.

See a demo at http://stuff.dan.cx/js/filepicker/google/

@kylefernandadams
kylefernandadams / SimpleDynamicAuthority
Created July 14, 2014 14:57
Alfresco - Simple Dynamic Authority
package org.alfresco.extension;
import java.util.Set;
import org.alfresco.repo.security.permissions.DynamicAuthority;
import org.alfresco.repo.security.permissions.PermissionReference;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.namespace.QName;
@jmsaavedra
jmsaavedra / ffmpeg_install.md
Last active June 7, 2024 17:33
Install FFmpeg on a Linux Box

Install FFmpeg via CLI on Linux box

These steps walk through installing a static binary of any ffmpeg version on to your linux machine. If you want to compile from source, there are several ways to do so. Here's the official guide. Tested and works on an AWS EC2 Ubuntu instance, but should work on any Linux machine.

  • SSH into your instance and become root
@ESWBitto
ESWBitto / resources.css
Last active September 30, 2015 12:43
Alfresco Login Background Image Version 5.0.d
.form-fields.login .form-field > span.yui-button {
border-color: #2598d0 !important;
}
.form-fields.login .form-field > span.yui-button > .first-child {
border-color: #2598d0 !important;
background-color: #2598d0 !important;
}
.alfresco-guest .sticky-wrapper {
background: url("images/abstract.png") no-repeat center center fixed;
@AFaust
AFaust / printAlfrescoLog.js
Last active January 18, 2024 16:52
Useful Alfresco JavaScript console scripts
var loggerRepository, rootLogger, appender, path, lines, idx;
loggerRepository = Packages.org.apache.log4j.LogManager.getLoggerRepository();
rootLogger = loggerRepository.rootLogger;
appender = rootLogger.getAppender('File');
path = appender.file;
lines = Packages.java.nio.file.Files.readAllLines(Packages.java.nio.file.Paths.get(path));
@CesarCapillas
CesarCapillas / Importing JS
Last active December 5, 2023 04:12
Alfresco Javascript Console Recipes
Import a script from the repository using a name-based path:
<import resource="/Company Home/Data Dictionary/Scripts/library.js">
Import a script from the repository using a NodeRef reference:
<import resource="workspace://SpacesStore/6f73de1b-d3b4-11db-80cb-112e6c2ea048">
Import a script from a Java classpath location:
@douglascrp
douglascrp / alfresco logs analysis.txt
Last active October 20, 2020 12:37
Some useful commands to help analyse logs and understand what is going on with your Alfresco server
How to get a list errors:
=========================
cat catalina.out | egrep "(WARN|ERROR|Caused by)" | uniq > output.txt
How to count the errors by type:
================================
$ grep ERROR solr.log| awk '{print $4}'| sort | uniq -c
63 [org.alfresco.solr.tracker.AbstractTracker]
135 [org.apache.solr.core.SolrCore]
/**
* Script to locate error nodes from solr error report, and do something with them.
*
* @author Younes Regaieg <y.regaieg@gmail.com>
* @version 1.0
**/
//----- Solr error report to be fetched from solr /solr4/alfresco/query?q=EXCEPTIONMESSAGE:*&wt=json&rows=<number-of-rows-to-fetch>
//----- Swap this dummy object with a real object from the output of the endpoint mentionned above.
var solrErrorsReport = {