Skip to content

Instantly share code, notes, and snippets.

@dmayo2
dmayo2 / sp-workflow-4
Created April 18, 2018 18:45
Terminal running processes
ps -ax | grep Acrobat
@dmayo2
dmayo2 / sp-workflow-3
Last active April 18, 2018 18:44
AppleScript System Events close Adobe
tell application "System Events"
try
tell process "Acrobat"
try
click button "Close" of window "Convert-2b-file"
end try
try
tell application "Adobe Acrobat Pro"
quit
end tell
@dmayo2
dmayo2 / sp-workflow-2
Created April 18, 2018 18:39
AppleScript System Events click
click the menu item "Convert-2b-file" of menu 1 of menu item "Action Wizard" of the menu "File" of menu bar 1
@dmayo2
dmayo2 / sp-workflow-1
Created April 18, 2018 18:37
AppleScript to invoke Adobe Acrobat
tell application "Adobe Acrobat Pro"
activate
open theFile // 'theFlie' references the current file Hazel processing
end tell
tell application "System Events"
tell process "Acrobat"
click the menu item "Convert-2b-file" of menu 1 of menu item "Action Wizard" of the menu "File" of menu bar 1
end tell
end tell
@dmayo2
dmayo2 / sp-awesome-24
Created March 20, 2018 16:11
Code for Making Dumb Components Smart
import React from 'react';
import PropTypes from 'prop-types';
import { Table, Alert, Button } from 'react-bootstrap';
import { Meteor } from 'meteor/meteor';
import { withTracker } from 'meteor/react-meteor-data';
import UploadsCollection from '/api/Uploads/Uploads'; // mongo schema
import DatePicker from 'react-datepicker';
import 'react-datepicker/dist/react-datepicker.css';
import Loading from '../../components/Loading/Loading';
@dmayo2
dmayo2 / sp-awesome-23
Created March 20, 2018 15:03
Code for Making Dumb Components Smart
images = [];
images.push(imageObject1);
images.push(imageObject2);
@dmayo2
dmayo2 / sp-awesome-22
Last active March 20, 2018 15:13
Code for Making Dumb Components Smart
<tbody>
{images.map(({ _id, fileName, createdAt, src, deleteDate, }) => (
<CustomRow id={_id} key={_id}
fileName={fileName}
createdAt={createdAt}
url={src}
deleteDate={deleteDate}
/>
))}
</tbody>
@dmayo2
dmayo2 / sp-awesome-21
Created March 13, 2018 17:32
Code for Making Dumb Components Smart
changeFontAwesome() {
this.setState({ editDate: !this.state.editDate });
}
@dmayo2
dmayo2 / sp-awesome-20
Last active March 20, 2018 15:12
Code for Making Dumb Components Smart
<tr key={_id}>
<td><img src={src}{fileName} height=50" /> {fileName}</td>
<td>{src}</td>
<td>{createdAt}</td>
<td>{deleteDate}
{ this.state.editDate
? <FontAwesomeIcon icon={faPencilAlt} onClick={() => this.changeFontAwesome()} />
: <span>
<DatePicker
onChange={(event) => this.handleDateChange(event)}
@dmayo2
dmayo2 / sp-awesome-19
Last active March 20, 2018 14:55
Code for Making Dumb Components Smart: Refactoring
function Footer(props){
var year = props.year;
var output = "
<div>Footer Info</div>
<div>&copy; 2004 - " + year + "</div>";
return output;
}