This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var path = require('path'); | |
if (typeof exports === 'undefined') var exports = {}; | |
exports.exists = function(filename) { | |
try { | |
return (fs.lstatSync(filename) ? true : false); | |
} | |
catch (err) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# taken from http://macscripter.net/viewtopic.php?id=17655 | |
# be sure to replace [username] with your username folder! | |
using terms from application "Mail" | |
on perform mail action with messages theMessages | |
tell application "Finder" to set ptd to (path to desktop folder) as string | |
tell application "Finder" to set pathToAttachments to "iMac:Users:[username]:Desktop:" & "Attachments:" | |
tell application "Mail" | |
repeat with theMessage in theMessages | |
set theText to (all headers of theMessage & content of theMessage) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Basic Pipedrive person renamer (splits person's names into 2 and flips the sides, giving the ability to flip first names and last names of persons) | |
* | |
* Usage | |
* ===== | |
* First, install pipedrive npm module: | |
* npm install pipedrive | |
* | |
* Then run the script: | |
* node personNamer.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Pipedrive people phone fields merger script | |
It can be used to combine existing, multiple separate phone field values inside the single, multi-valued phone field. | |
MIT Licence. | |
*/ | |
var P = require('pipedrive'); | |
var _ = require('lodash'); | |
var p = new P.Client('PUT_YOUR_API_TOKEN_HERE'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You need to have licensecheck npm module installed globally in order this to work. | |
# Install it via: npm install -g licensecheck | |
find . -name "package.json" | sed 's/package.json$//g' | xargs licensecheck |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Pipedrive person type field as participants linker | |
MIT Licence. | |
*/ | |
var Pipedrive = require('pipedrive'); | |
var pipedrive = new Pipedrive.Client('PUT_YOUR_API_TOKEN_HERE'); | |
var personTypeFields = ['0196e433d44471e3cad7306209bc70ed623abd95','dd0e6438e2082ed2a6cdced28aeb7aff3557d3c6'], | |
batchSize = 200, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Pipedrive = require('pipedrive'), | |
pipedrive = new Pipedrive.Client('YOUR_API_TOKEN_HERE'), | |
async = require('async'), | |
q = [], | |
pageSize = 500, | |
transformDeal = function(deal) { | |
// Only update deals in BYR currency that have 0 products attached: | |
if (deal.currency === 'BYR' && !deal.products_count) { | |
console.log('Updating ' + deal.title + '...'); |