Skip to content

Instantly share code, notes, and snippets.

View awrowse's full-sized avatar

Andy Rowse awrowse

  • AW Rowse Solutions
  • Bozeman, MT
View GitHub Profile
@awrowse
awrowse / SoapClient.cs
Created November 29, 2012 14:38
SOAP Client RN
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.ServiceModel.Channels;
using RightNow.AddIns.AddInViews;
using RightNow.AddIns.Common;
using System.AddIn;
using System.Windows.Forms;
@awrowse
awrowse / post-build.ps1
Created November 26, 2012 23:12
AddIn Post-Build commands
mkdir "%USERPROFILE%\RightNowDev"
mkdir "%USERPROFILE%\RightNowDev\AddIns"
mkdir "%USERPROFILE%\RightNowDev\AddIns\$(TargetName)"
copy /Y "$(TargetDir)$(TargetName).*" "%USERPROFILE%\RightNowDev\AddIns\$(TargetName)\"
@awrowse
awrowse / search_turn_page.php
Created October 29, 2012 22:47
Force Page Turn on CP Search
<?php $urlRefresh = sprintf("/app/answers/list/refresh/%d", !(getUrlParm('refresh') == '1')); ?>
<rn:widget path="search/SearchButton2" report_id="XXXX" report_page_url="#rn:php:$urlRefresh#" />
@awrowse
awrowse / autoload_mobile.php
Created October 5, 2012 20:21
include autoload.js on mobile pages
<html lang="#rn:language_code#">
<head>
<meta name="viewport" content="width=device-width; initial-scale=1.0; minimum-scale=1.0; maximum-scale=1.0; user-scalable=no;"/>
<meta charset="utf-8"/>
<title><rn:page_title/></title>
<rn:theme path="/euf/assets/themes/mobile" css="site.css"/>
<rn:head_content/>
<link rel="icon" href="images/favicon.png" type="image/png">
<?php
/* Manually include autoload.js
@awrowse
awrowse / tar.sh
Created September 25, 2012 18:33
Tar.gz files from BASH
tar -cvzf ~/stuff.tar.gz folder_name file_name.txt
#To Zip:
tar czvf myfolder.tar.gz abcfolder/
#To Unzip:
tar -zxvf extractme.tar.gz
@awrowse
awrowse / php_object_sort.php
Created September 12, 2012 21:47
PHP Object Sort Numeric
usort($navItems, function($x, $y){
if ($x->LinkOrder == $y->LinkOrder) { return 0; }
return ($x->LinkOrder < $y->LinkOrder) ? -1 : 1;
});
@awrowse
awrowse / CPHPUtil.php
Created July 23, 2012 19:02
Connect PHP Utility
<?php
class CPHPUtil {
/**
* Find a LookupName's ID in Connect PHP
* @param string $label Label to find as lookup name
* @param string $field_name Field name to compare label against lookup names.
* @param string $object Object that contains the field to search
* @return int|boolean Returns ID if found, false otherwise
*/
@awrowse
awrowse / dev_errors.php
Created July 2, 2012 15:16
PHP Dev Error Reporting
//Error Reporting for debugging. Comment out for deployment
ini_set('display_errors',1);
error_reporting(E_ALL ^ E_NOTICE);
@awrowse
awrowse / ui_alert.m
Created July 2, 2012 03:11
UI Alert Box
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Alert" message:@"You pushed cancel" delegate:nil cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
[alert show];
@awrowse
awrowse / DemoApp.java
Created June 22, 2012 21:28
Java CWS Demo
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.rightnow.ps.example;
import com.rightnow.ws.base.*;
import com.rightnow.ws.faults.*;
import com.rightnow.ws.messages.*;
import com.rightnow.ws.objects.*;