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
<?php | |
// convenience theming function for taxonomy lists -- ead 6.10.10 | |
function taxonomy_node_list_terms_by_vocabulary($nid, $voc_id, $link = FALSE, $ul = FALSE) { | |
/* loads a "dummy" node in order to use taxonomy_node_get_terms_by_vocabulary() | |
to get an array of taxonomy terms */ | |
$node = new stdClass(); | |
$node->vid = db_result(db_query("SELECT MAX(vid) FROM {node_revisions} WHERE nid = %d", $nid)); | |
$terms = taxonomy_node_get_terms_by_vocabulary($node, $voc_id); | |
if(!isset($terms) || !is_array($terms) || empty($terms)) { return ''; } | |
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
<?php | |
// $Id$ | |
/** | |
* @file | |
* On behalf implementation of Feeds mapping API for location_cck.module (Location CCK). | |
*/ | |
/** | |
* Implementation of hook_feeds_node_processor_targets_alter(). |
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
@isTest | |
private class TestCityvisionScheduledTasks { | |
// just tests whether the scheduled classes run. | |
static testMethod void testRunsScheduled() { | |
CityvisionScheduledLeadScorer cvSLS = new CityvisionScheduledLeadScorer(); | |
String sch = '0 0 23 * * ?'; | |
Test.startTest(); | |
Id jobId = System.schedule('City Vision Lead Scoring', sch, cvSLS); | |
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
/* Class */ | |
public with sharing class CityvisionContactAssigner { | |
static final Id OWNER_NYOUNG; | |
static final Id OWNER_AWEBB; | |
static { | |
List<User> users = [SELECT Id, Alias FROM User WHERE Alias = 'nyoung' OR Alias = 'awebb' OR Alias = 'MOmori' OR Alias = 'ASears']; | |
for(User u : users) { | |
// Switch which user to use based on whether we are in production environment, since partner users don't carry across to sandboxes. | |
if((CityvisionConstants.onProduction == true && u.Alias == 'nyoung') |
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
// leadsRoundRobin.trigger: | |
trigger leadRoundRobin on Lead (before insert, before update) { | |
// | |
//Check if assignment owner has changed | |
// | |
Map<Integer,Id> queueIds = new Map<Integer,Id>(); //Trigger index --> Queue ID | |
Integer idx = 0; | |
for (Lead l : Trigger.new) |
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
## Task class | |
require 'mysql' | |
module OrgSocGraph | |
FIELDS = { | |
"orgs.csv" => [ | |
Class.new(Object) do | |
def name | |
:description | |
end |
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
class JobExecutor | |
attr_reader :data_store, :fields | |
def initialize(fields) | |
@jobs = [] | |
@threads_working = 0 | |
@lock = Mutex.new | |
@data_store = DataStore.new(fields) | |
@fields = fields |
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
module DMOZ | |
FIELDS = { | |
"dmoz.csv" => [ | |
Class.new(Object) do | |
def name | |
:title | |
end | |
end.new, | |
Class.new(Object) do | |
def name |
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
#! /bin/bash | |
# set user | |
USER="usr" | |
# set port | |
PORT="22" | |
# set remote IP (put yours here) | |
HOST="127.0.0.1" |
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
#!/usr/bin/expect -f | |
# exp_internal 1 ;# uncomment to turn on expect debugging | |
set timeout -1 | |
USER="user" | |
HOST="127.0.0.1" | |
SRC="/src/dir/here" | |
DST="/dst/dir/here" | |
# creates an rsync process that will rsync with excluded directories |