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
@looneym
looneym / main.py
Created November 29, 2016 00:05
Shitty script to rename files for plex
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:
@looneym
looneym / main.py
Created November 28, 2016 13:13
Using the request library with the Intercom REST API.
import requests
import urllib
import commentjson
"""
Install dependancies with:
pip install commentjson requests
"""
@looneym
looneym / updated_at.js
Created November 16, 2016 10:53
Script to test default ordering of list conversations endpoint on Intercom
// 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 });
@looneym
looneym / main.js
Created November 15, 2016 14:40
Example showing how to use pagination when retrieving a list of conversations from the Intercom API
// 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
@looneym
looneym / make_alias.sh
Last active September 29, 2016 11:54
Utility for easily creating aliases from the command line. Can manually specify commands or use -l flag to read last item in bash_history
#!/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