Skip to content

Instantly share code, notes, and snippets.

@rpavlik
rpavlik / fix_homebrew.rb
Created January 6, 2011 20:32 — forked from mxcl/install_homebrew.markdown
Fix permissions on /usr/local for Homebrew
#!/usr/bin/ruby
#
# This script fixes /usr/local only.
#
# 6th January 2010:
# Modified the script to just fix, rather than install. - rpavlik
#
# 30th March 2010:
# Added a check to make sure user is in the staff group. This was a problem
# for me, and I think it was due to me migrating my account over several
@kimakunc
kimakunc / Liferay global and guest group
Last active July 29, 2022 16:26
Retrieve "Global" or "Guest" scope groups from Liferay API
// get the global group
Group globalGroup = GroupLocalServiceUtil.getCompanyGroup(companyId);
//get the guest group
Group guestGroup = GroupLocalServiceUtil.getGroup(companyId, GroupConstants.GUEST);
@jgoldhammer
jgoldhammer / alfresco policies root object example.js
Last active July 4, 2018 06:55
shows how to temporarly disable and enable the policy behaviours of a node
var node = search.findNode(<nodeRefOfADocumentOrFolder>);
var modified = node.properties.modified;
policies.disableForNode(node);
node.setName("C10");
node.save();
node.reset();
policies.enableForNode(node);
var modifiedAfter = node.properties.modified;
<#-- dump.ftl
--
-- Generates tree representations of data model items.
--
-- Usage:
-- <#import "dump.ftl" as dumper>
--
-- <#assign foo = something.in["your"].data[0].model />
--
-- <@dumper.dump foo />
@dougireton
dougireton / recruiter_response.md
Last active January 11, 2020 22:52
I've started responding to recruiters with this list of requirements

Company Requirements

I'm definitely not looking for work. However to provide some helpful guidance for hiring like-minded engineers, I would only consider working for a company if it met these requirements:

  1. Fewer than 250 employees.
  2. Concrete, measurable plan to increase the number of women and minorities in engineering roles.
  3. Commitment to using and contributing to open source.
  4. Collaborative, friendly atmosphere where pair programming is encouraged.
  5. Meaningful work with clear linkage between work and company goals.
  6. Demonstrated commitment to ethical business practices, e.g. B corp certification.
@yuchi
yuchi / Liferay_Web_Resources.md
Last active February 5, 2020 20:40
Runtime Front-end (Web) Resources and Dependencies

Runtime Front-end (Web) Resources and Dependencies

During Liferay DEVCON 2015 some interesting topics spurred out of the new Liferay Theme build process.

This document, and the expected following discussion, is here to understand how we can guarantee for web front-end engineers a friendly development environment and a de-facto standards adherent runtime.

Synopsis

At Liferay DEVCON 2015 a [new way to build Liferay Themes][ltt] has been announced. It is built around [gulp][gulp] tasks and offers the concept of Themelets, composable features distributable through [npm][npm]. Themelets are then merged in your own theme at build time.

user name: liferay passwod : liferay

Commands:

Setting keyboard:

setxkbmap en_US
var MIN_MISS_PERCENTAGE = 10;
var fields = [ "CacheType", ".Bean", "ObjectCount", "CacheHits", "CacheMisses", "CacheMissPercentage" ];
var padding30 = Array(30).join(' '), padding12 = Array(12).join(' '), padding20 = Array(20).join(' ');
var platformMBeanServer = Packages.java.lang.management.ManagementFactory.getPlatformMBeanServer();
function printInColumns(values) {
var beanName = values[1];
@jgoldhammer
jgoldhammer / alfresco-start-temporary-job-in-repository.js
Last active December 19, 2016 12:18
Create a temporary (not persisted) job in alfresco to run javascript code in the backend
jobs.scheduleTemporaryJob({
jobName: 'SimpleAuthorModificationJob',
runAs: 'system',
cronExpression: '0 0/1 * 1/1 * ? *',
script: function(){
batchExecuter.processFolderRecursively({
'root': repository.getCompanyHome(),
onNode: function(node) {
if (node.isDocument) {
node.properties['cm:author'] = 'Alfresco';
@kconner
kconner / macOS Internals.md
Last active July 7, 2024 19:42
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options: