Skip to content

Instantly share code, notes, and snippets.

@andyhuey
andyhuey / ZohoCrmSample.cs
Created August 24, 2012 00:42 — forked from anonymous/ZohoCrmSample.cs
Sample C# code to create a lead with the Zoho CRM API.
/*
* Sample C# code to create a lead with the Zoho CRM API.
* ajh 2012-08-23
*/
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Dynamic;
using System.Linq;
using System.Net;
@andyhuey
andyhuey / Mandrill.cs
Created August 24, 2012 00:43
sample code showing how to use the Mandrill API
/*
* Code/Mandrill.cs
* These are calls to the Mandrill email service.
* Reference: https://mandrillapp.com/api/docs/
*
* ajh 2012-08-09: new
*/
using System;
using System.Collections.Generic;
using System.Linq;
@andyhuey
andyhuey / my_query_alter.php
Created August 28, 2012 01:02
alter a view query
<?php
/**
* implements hook_query_alter().
*/
function MY_MODULE_query_alter(QueryAlterableInterface $query) {
if ($query->hasAllTags('views', 'views_university_search')) {
$ord =& $query->getOrderBy();
if (array_key_exists('location_country', $ord)) {
public static AjhDevLaunchStartupProjects construct()
{
return new AjhDevLaunchStartupProjects();
}
private str getStartProjFileName()
{
str myDocsPath;
#WinAPI
myDocsPath = WinAPI::getFolderPath(#CSIDL_PERSONAL);
return myDocsPath + @"\axStartProjects.txt";
}
private Array getProjectList()
{
// get the project list from a file.
str startProjFileName;
TextBuffer tbProjList;
Array projects = new Array(Types::String);
int nProjects;
startProjFileName = this.getStartProjFileName();
tbProjList = new TextBuffer();
private void addProject(str newProject)
{
// add a new project to the list.
Array projects;
int i;
projects = this.getProjectList();
// make sure it's not already there...
for (i=1; i <= projects.lastIndex(); i++)
public void openAllProjects()
{
// get the project list, and open all projects.
Array projects;
int i;
ProjectNode sharedProjects, privateProjects, projectNode;
projects = this.getProjectList();
sharedProjects = Infolog.projectRootNode().AOTfindChild('Shared');
public static void main(Args args)
{
AjhDevLaunchStartupProjects obj = AjhDevLaunchStartupProjects::construct();
SysContextMenu contextMenu;
str projectName, x;
;
// should always be called from a menu item.
if (!args.menuItemName())
{
// ajh 2013-04-03: my own startup project thing...
case menuitemActionStr(AjhDevStartupProjectAdd):
case menuitemActionStr(AjhDevStartupProjectRemove):
if (firstNode.handle() != classNum(ProjectNode) || !match(#pathProjects, firstNode.treeNodePath()))
{
return 0;
}
return 1;