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/env bash | |
# -l flag uses last command from history file instead | |
if [ $1 == -l ] | |
then | |
full=`awk 'END{print}' ~/.bash_history` | |
echo "Enter the short command to alias" | |
read short | |
echo "alias "$short"='$full'" >> ~/.bash_profile | |
source ~/.bash_profile |
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
// Author: Micheal Looney | |
// | |
// This script hits the list conversations endpoint of the API and subsequently traverses each pages of results by | |
// recursivly calling the handleResponse() function when the pagination object contains a next parameter. | |
// | |
// For each conversation it simply extracts the conversation_id and pushes it to an array | |
var Intercom = require('intercom-client'); | |
// set your Personal Access 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
// Author: Micheal Looney | |
// | |
// Script to test default ordering of list conversations endpoint on Intercom | |
var Intercom = require('intercom-client'); | |
// set your Personal Access Token here | |
var token = ""; | |
var client = new Intercom.Client({ token: token }); |
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
import requests | |
import urllib | |
import commentjson | |
""" | |
Install dependancies with: | |
pip install commentjson requests | |
""" |
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
from imdb import IMDb | |
from os import listdir | |
import os | |
from os.path import isfile, join | |
ia = IMDb() | |
def get_name(f): | |
result = ia.search_movie(f, results=1) | |
try: |
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
# client code | |
require 'intercom' | |
#replace with your values | |
intercom = Intercom::Client.new(token: 'my_token') | |
convos = intercom.conversations.find_all(user_id: 'some_user_id', type: 'user') | |
convos.each { |x| puts x.id } | |
# sample output one | |
===> looneym ~/ruby-api-test ruby test.rb |
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 Car: | |
cars = [] | |
def __init__(self, num, cheap, red, broken): | |
self.num = num | |
self.cheap = cheap | |
self.red = red | |
self.broken = broken |
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
from intercom import Intercom, User | |
# Standard configuration using an app_id and API Key | |
Intercom.app_id = "my_app_id" | |
Intercom.app_api_key = "my-super-secret-api-key" | |
# Usng a Personal Access Token (jus replace the app_id and leave the key blank) | |
Intercom.app_id = "my-super-secret-PAT" | |
# Do whatever |
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
from flask import Flask, request | |
app = Flask(__name__) | |
@app.route('/', methods=['POST']) | |
def get_body(): | |
req = request.get_data() | |
print req | |
return req |
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
if (CurrentUser.loggedIn)){ | |
window.intercomSettings = { | |
app_id: APP_ID, | |
name: CurrentUser.Name, | |
email: CurrentUser.Email, | |
user_id: CurrentUser.userID, | |
}; | |
} else { | |
window.intercomSettings = { | |
app_id: APP_ID, |
OlderNewer