This file contains hidden or 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
original = raw_input("Enter a word") | |
if len(original) >= 0 and original.isalpha(): | |
print original | |
else: | |
print "empty" |
This file contains hidden or 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 os | |
import json | |
TOKEN = os.environ['GH'] | |
NEW_BRANCH_NAME = '' | |
HASH = '' | |
AUTHOR= '' | |
REPO = '' |
This file contains hidden or 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 sys | |
from twisted.web.static import File | |
from twisted.python import log | |
from twisted.web.server import Site | |
from twisted.internet import reactor | |
from autobahn.twisted.websocket import WebSocketServerFactory, \ | |
WebSocketServerProtocol | |
from autobahn.twisted.resource import WebSocketResource |
This file contains hidden or 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 random | |
part1 = ["machine learning solution" , "recursive algorithm" , "e-portal" , "cross platform app" , "revolutionary supply chain management platform", "real-time code sharing tool" , "distributed solutions matrix", "backwards compatible hardware driver", "protocol suite"] | |
part2 = ["LGBT assylum seekers", "obese children", "the homeless" ,"the elderly", "rural communities" , "young people in disadvantaged areas", ] | |
part3 = ["bespoke twitter API","Big Data", "the Cloud", "open source software","obfuscated code" , "bitcoin mining", "a deep web neural network", "social media", "distributed networks", "node.js" ,] | |
rand1 = random.randrange(0,len(part1)) | |
rand2 = random.randrange(0,len(part2)) | |
rand3 = random.randrange(0,len(part3)) |
This file contains hidden or 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.client import Client | |
intercom = Client(personal_access_token='my_personal_access_token') | |
intercom.messages.create(**{ | |
"message_type": "inapp", | |
"body": "What's up :)", | |
"from": { | |
"type": "admin", | |
"id": "1234" | |
}, |
This file contains hidden or 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 io.intercom.api.Intercom; | |
import io.intercom.api.User; | |
public class Test { | |
public static void main(String[] args){ | |
Intercom.setToken("super_Secret_token"); | |
// Create a user | |
User user = new User() |
This file contains hidden or 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
# get a user | |
user = intercom.users.find(email: "[email protected]") | |
# add a company to that user | |
user.companies = [{company_id: 6, name: "Intercom"},] | |
intercom.users.save(user) | |
puts user.companies[0].name # "Intercom" | |
#remove the same company | |
user.companies = [{company_id: 6, name: "Intercom", remove: true},] |
This file contains hidden or 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
<script> | |
window.intercomSettings = { | |
app_id: "hy4aeebl", | |
name: "{{current_user.name}}", // Full name | |
email: "{{current_user.email}}", // Email address | |
created_at: {{current_user.created_at | date: "%s" }} | |
}; | |
(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/hy4aeebl';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})() |
This file contains hidden or 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 slackclient import SlackClient | |
from flask import Flask, request | |
# Slack config | |
BOT_TOKEN = os.environ['BOTKEY'] | |
CHANNEL_NAME = "intercom-event-notifications" | |
app = Flask(__name__) | |
@app.route('/', methods=['POST']) |
This file contains hidden or 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
URL = window.location.href; | |
if (URL.includes("terms")){ | |
termsPage = true; | |
} else { | |
termsPage = false; | |
} | |
var intercomSettings = { |