Skip to content

Instantly share code, notes, and snippets.

@thewheat
thewheat / style.css
Created April 4, 2018 10:31
Intercom - fix print invoices
@media print{
div.js__main-container > div.o__has-columns > div.submenu.layout__box {
display: none;
}
.beta__left-nav-colors .main__content-outlet{
overflow: visible;
height: 1000px;
}
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
test 123 test
<script>
var APP_ID = "qji82zks";
[
[
[
"Official",
"SDK",
"API"
],
" PHP SDK library: ",
[
"https://github.com/intercom/intercom-php"
@thewheat
thewheat / instructions.md
Created September 13, 2017 10:06
Integrating Intercom with Weebly

Simple Setup

  • Settings > SEO > Footer Code

Advanced Setup

  • Theme > Edit HTML/CSS
  • Modify appropriate file in "Header Type" section (typically header.html)

Intercom Snippet Code to use

@thewheat
thewheat / js_intercom.js
Created June 5, 2017 15:23
Sample Drupal 8 installation for Intercom. This is a very rough way of how to install Intercom in Drupal (as I'm not too familiar with Drupal in general). Requires an existing theme in Drupal so replace "themename" in the following files with the actual theme being used
// create this file js/intercom.js
(function ($, Drupal, drupalSettings) {
'use strict';
Drupal.behaviors.attach_intercom = {
attach: function (context, settings) {
window.intercomSettings = drupalSettings.intercom;
// log out of Intercom when logout button clicked
@thewheat
thewheat / index.php
Created June 4, 2017 15:24
Intercom integration with Joomla. Simple integration that just modifies the index.php of your current template. Add the following code at the bottom of your current index.php file
<?php
////////////////////////////////////////////////////////////////////////////////////////////////
// Intercom integration
////////////////////////////////////////////////////////////////////////////////////////////////
// - Supports logged out users / visitors
// - Supports logged in users and has logout as well (NOTE: customise logout behaviour based on your theme)
//----------------------------------------------------------------------------------------------
// IMPORTANT
// - Customise logout behaviour based on your theme (used "protostar" theme on a standard install of Joomla! 3.7.2 Stable [ Amani ] 22-May-2017 09:46 GMT as a test)
// - Unsure how best to santize PHP code so using addslashes in this instance. Do comment if there is a better way (did not want to use htmlentities as would want to keep raw values)
@thewheat
thewheat / 404.php
Last active July 19, 2018 15:36
Custom domain implementation with manual URL redirection for Intercom's Educate Help Center using a reverse proxy. Select appropriate configuration for your setup. Normal instructions on setting up custom domain will SSL detailed here https://developers.intercom.com/docs/set-up-your-custom-domain
<?php
/*
#############################################################################################
# Manually handle URL redirections when transferring from an old custom domain to the new one
#############################################################################################
- This will allow you to manually redirect URLs if you move systems
- Likely not the best for performance reasons but is a workable solution
################
@thewheat
thewheat / redirect.php
Created May 30, 2017 12:56
Allows redirection of URLs from an old path to a new one
<?php
/*
#############################################################################################
# Manually handle URL redirections when transferring from an old custom domain to the new one
#############################################################################################
- This will allow you to manually redirect URLs if you move systems
- Likely not the best for performance reasons but is a workable solution
################
@thewheat
thewheat / apache.conf
Last active November 20, 2018 01:42
Custom domain implementation for Intercom's Educate Help Center using a reverse proxy. Select appropriate configuration for your setup. Normal instructions on setting up custom domain will SSL detailed here https://developers.intercom.com/docs/set-up-your-custom-domain
# Step 1: set up normal server with HTTPS https://letsencrypt.org/
# Step 2: set up proxy settings as shown below
# Step 3: set custom domain in Intercom Help Center settings
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName your-help-site.custom-domain.com # specify your custom domain here
SSLEngine on
SSLProxyVerify none
test text file