Skip to content

Instantly share code, notes, and snippets.

View marclundgren's full-sized avatar

Marc Lundgren marclundgren

View GitHub Profile

##Javascript order of operations

*
       /
       %

          +
          -
          <<

##Chris/Sarah Friedman 7033 Stewart & Gray Rd., #14 Downey 90241

##Phyllis Lundgren 10602 Elmcrest El Monte 91731

##Kevin/Kerry Kilmurray 1482 Carlisle Ct.

@marclundgren
marclundgren / diffsearch.sh
Last active August 29, 2015 14:01
git diff search
function diffsearch () {
local key="$1"
if [[ -z "$key" ]]; then
key="key"
fi;
echo "Searching for diffs with $key...this could take a while..."
nohup git log -S$key
@marclundgren
marclundgren / storage-used.sh
Created May 7, 2014 19:37
Mac OS X (Mavericks) storage used script
function storageUsed () {
df -h | awk '{print $5}' | awk 'NR==2'
}
@marclundgren
marclundgren / traits-of-a-leader
Created June 10, 2014 16:00
traits of a leader
Honesty
Passion
Engagement
Focus
Respect
Excellent persuasion abilities
Confidence
Clarity
Care
Integrity
@marclundgren
marclundgren / announce-progress.js
Last active August 29, 2015 14:02
Liferay Upload & Document Library Upload class abstraction
/*******************************************
* These items are in progress...
*
* Leave feedback in the comments section.
*******************************************/
@marclundgren
marclundgren / folder-upload.js
Last active August 29, 2015 14:04
My App Upload Folder example
// add Liferay Upload UI to your App
AUI().use('my-app', 'liferay-upload-base', function(A) {
var app = new Liferay.MyApp(),
uploadConfig = app.get('uploadConfig'),
// instanciate Upload
upload = new Liferay.Upload(uploadConfig);
// add folder upload capability
@marclundgren
marclundgren / liferay-upload-folders.js
Last active August 29, 2015 14:04
Liferay Upload Folders javascript
var URL_DL_ADD_FOLDER = '/dlapp/add-folder';
var uploader = this._getUploader();
var uploadFileTree = function(treeNode, folderId) {
return new A.Promise(function(resolve, reject) {
if (treeNode.isFile) {
treeNode.file(
function(file) {
var fileHTML5 = new A.FileHTML5(file);
function uploadFileTree(treeNode, folderId) {
/*
return a Promise *(first Promise)*
if treeNode is a file...
create an html5 file
resolve the promise on `uploadcomplete`
reject the promise on `uploaderror`