Skip to content

Instantly share code, notes, and snippets.

View umrashrf's full-sized avatar

Umair Ashraf umrashrf

View GitHub Profile
Botswana
Namibia
St. Kitts and Nevis
St. Lucia
St. Vincent
Samoa -> Western Samoa
Swaziland
@umrashrf
umrashrf / push-toggl-to-redmine.py
Created April 8, 2015 14:05
Pushes Toggl entries to Redmine. Supports --dry-run to print Toggl entries without sending them to Redmine. TIP: Use this format in Toggl "#issue_id [comment]".
#!/usr/bin/env python
import re
import sys
import json
import logging
import argparse
import requests
@umrashrf
umrashrf / git_watch_duster.bash
Last active August 23, 2021 11:11
Unwatch github repositories in shell
#!/bin/bash
read -p "Github Username: " username;
read -p "Github Token (https://github.com/settings/tokens): " token;
echo "Fetching your repositoreis...";
echo;
repos=$(curl -i -u "$username:$token" "https://api.github.com/user/subscriptions" |\
grep -Po '(?<="full_name": ").*(?=\")');
0 236 254 249 362 243 316 225 270 297 379 312 260 305 335 272 258 321 306 352 315 371 286 338 207 352 355 264 298 324 250 289 313 269 269 313 319 276 204 288 248 362 352 235 251 319 334 335 270 269 265 282 303 276 245 303 302 332 280 294 244 280 305 234 264 358 339 362 275 301 256 253 242 300 285 292 281 256 327 238 212 304 353 266 325 320 297 352 293 325 290 332 306 255 335 341 317 278 303 281
236 0 295 226 371 245 381 325 266 272 264 229 374 271 222 317 359 295 264 253 327 233 224 292 311 378 307 356 323 317 365 297 340 306 316 253 312 279 244 291 342 278 315 249 315 286
@umrashrf
umrashrf / aws_ses.bash
Created July 26, 2016 19:05
Amazon AWS CLI - SES SEND EMAIL
sudo pip install awscli
aws configure
aws ses send-email \
--from "john@gmail.com" \
--destination "ToAddresses=mike@gmail.com" \
--message "Subject={Data=from ses,Charset=utf8},Body={Text={Data=ses says hi,Charset=utf8},Html={Data=,Charset=utf8}}"
@umrashrf
umrashrf / extract_attachments.py
Last active February 18, 2019 13:48
Download emails from GMail API and extract files from each email using Python and GYB
import os
import sys
import email
for line in sys.stdin:
fle = line.strip()
if str.lower(fle[-3:]) == "eml":
msg = email.message_from_file(open(fle))
attachments = msg.get_payload()
for attachment in attachments:
This file has been truncated, but you can view the full file.
../../../../include/QtGui -I../../../../include/QtXml -I../../../../include/QtScript -I../../../../include -Iextension -Isdk -Iuilib -Ishared -I../../../shared/qtpropertybrowser -I../../../shared/deviceskin -I../../../../src/tools/rcc -I../../../shared/findwidget -I../../../shared/qtgradienteditor -I.moc/release-shared -I.uic/release-shared -o .obj/release-shared/qtgradientutils.o ../../../shared/qtgradienteditor/qtgradientutils.cpp
g++ -c -include .pch/release-shared/QtDesigner -pipe -O2 -D_REENTRANT -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -fPIC -DQDESIGNER_SDK_LIBRARY -DQDESIGNER_EXTENSION_LIBRARY -DQDESIGNER_UILIB_LIBRARY -DQDESIGNER_SHARED_LIBRARY -DQT_DESIGNER -DQT_NO_DEBUG -DQT_SCRIPT_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_HAVE_SSE3 -DQT_HAVE_SSSE3 -DQT_HAVE_SSE4_1 -DQT_HAVE_SSE4_2 -DQT_HAVE_AVX -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_SHARED -I../../../../mkspecs/linux-g++ -I. -I../../../../incl
[vagrant@localhost qt-everywhere-opensource-src-4.8.6]$ yes | ./configure -opensource -no-webkit -fast
This is the Open Source Edition.
You are licensed to use this software under the terms of
the Lesser GNU General Public License (LGPL) versions 2.1.
You are also licensed to use this software under the terms of
the GNU General Public License (GPL) versions 3.
Type '3' to view the GNU General Public License version 3.
"""
Generalized browser module for selenium web driver
"""
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from . import settings
@umrashrf
umrashrf / kijiji_photos.py
Created August 4, 2019 23:04
Kijiji photo downloader in Python
photos = [
'https://i.ebayimg.com/00/s/MTA2N1gxNjAw/z/kXAAAOSwqYxdHbfJ/$_59.JPG',
]
import re
import urllib
basename = re.compile('/z/(.*)')
def fname(url):