Skip to content

Instantly share code, notes, and snippets.

View looneym's full-sized avatar
🐧
im in ur ifra breakin ur services

Micheál Looney looneym

🐧
im in ur ifra breakin ur services
View GitHub Profile
module IntercomUtil
require 'intercom'
TOKEN = ENV["INTERCOM_PAT"]
@intercom = Intercom::Client.new(token: TOKEN)
def self.get_all_conversations
open_convos = @intercom.conversations.find_all(open: true)
closed_convos = @intercom.conversations.find_all(open: false)
@looneym
looneym / docker-compose.yml
Created July 9, 2017 02:48 — forked from EloB/docker-compose.yml
Docker compose yml hello world example
helloworld:
image: ubuntu:14.04
command: /bin/echo 'Hello world'
<details>
<summary>Summary Goes Here</summary>
```
lol
```
</details>
original = raw_input("Enter a word")
if len(original) >= 0 and original.isalpha():
print original
else:
print "empty"
@looneym
looneym / main.py
Created May 14, 2017 16:37
Create a branch in a remote repo using the Github API. Uses token auth.
import requests
import os
import json
TOKEN = os.environ['GH']
NEW_BRANCH_NAME = ''
HASH = ''
AUTHOR= ''
REPO = ''
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
@looneym
looneym / generator.py
Created April 4, 2017 21:20
Hackathon Ideas Generator
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))
@looneym
looneym / create_admin_conversation.py
Created April 3, 2017 12:46
How to create an admin initiated conversation in Intercom using the Python SDK
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"
},
@looneym
looneym / Test.java
Last active February 22, 2017 16:30
Base scoped token API operations
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()