Skip to content

Instantly share code, notes, and snippets.

View smoaddeli's full-sized avatar

Saeed Moaddeli smoaddeli

View GitHub Profile
@smoaddeli
smoaddeli / pd-incidents.py
Created March 24, 2014 13:27
A simple class for getting incidents from Pagerduty API
import urllib
import pycurl
import simplejson as json
from StringIO import StringIO
class GetIncidents:
def __init__(self,subdomain,token,fields,sortField,order,limit):
''' initiate the information needed for the api call'''
self.url = "https://" + subdomain + ".pagerduty.com/api/v1/incidents"
# -*- coding: utf-8 -*-
import os
import re
import codecs
fo = open("allHashtags.tsv", "w")
fpath = 'tail.tsv'
source = codecs.open(fpath,'rb',encoding='utf-8')
pattern = re.compile("#\w+", re.UNICODE)
@smoaddeli
smoaddeli / getPersianHashtag.py
Created July 7, 2014 05:37
This code can match a unicode persian/arabic word in a file. That is how far it is tested for.
# -*- coding: utf-8 -*-
import os
import re
import codecs
#
# This code can match a unicode persian/arabic word in a file
# That is how far it is tested for
#
@smoaddeli
smoaddeli / .vimrc
Created August 21, 2015 15:31
my .vimrc
" SOURCE: http://amix.dk/vim/vimrc.html
" Use case insensitive search, except when using capital letters
set ignorecase
set smartcase
" Highlight search results
set hlsearch
" Makes search act like search in modern browsers