Skip to content

Instantly share code, notes, and snippets.

View bhochieng's full-sized avatar
🤪
Stay Productive

Humphrey ブライアン | ハンフリー bhochieng

🤪
Stay Productive
  • Remote
  • Nairobi Kenya
  • 15:31 (UTC -12:00)
  • X @bhochieng
View GitHub Profile
@bhochieng
bhochieng / Calculator.java
Last active June 30, 2017 08:15
Java simple calculator
//By Freezie Ule Msee
import java.util.Scanner;
public class Calculator {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
@bhochieng
bhochieng / include_list_viewpager.xml
Created June 7, 2017 05:33 — forked from iPaulPro/include_list_viewpager.xml
CollapsingToolbarLayout with TabLayout
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (C) 2015 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
@bhochieng
bhochieng / dlAttachments.py
Created July 11, 2017 08:06 — forked from baali/dlAttachments.py
Python script to download all gmail attachments.
# Something in lines of http://stackoverflow.com/questions/348630/how-can-i-download-all-emails-with-attachments-from-gmail
# Make sure you have IMAP enabled in your gmail settings.
# Right now it won't download same file name twice even if their contents are different.
import email
import getpass, imaplib
import os
import sys
detach_dir = '.'
@bhochieng
bhochieng / gmail.py
Created July 11, 2017 13:38 — forked from jasonrdsouza/gmail.py
Python script to access a gmail account and download particular emails
import email, getpass, imaplib, os
detach_dir = '.' # directory where to save attachments (default: current)
user = raw_input("Enter your GMail username:")
pwd = getpass.getpass("Enter your password: ")
# connecting to the gmail imap server
m = imaplib.IMAP4_SSL("imap.gmail.com")
m.login(user,pwd)
m.select("cs2043") # here you a can choose a mail box like INBOX instead
@bhochieng
bhochieng / gmail_imap_example.py
Created July 11, 2017 14:04 — forked from robulouski/gmail_imap_example.py
Very basic example of using Python and IMAP to iterate over emails in a gmail folder/label. http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/
#!/usr/bin/env python
#
# Very basic example of using Python and IMAP to iterate over emails in a
# gmail folder/label. This code is released into the public domain.
#
# RKI July 2013
# http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/
#
import sys
import imaplib
@bhochieng
bhochieng / get_attachments_modified.py
Created July 17, 2017 11:36
Fetch emails from Gmail using python (modified code)
import os
import email
import cPickle
import getpass
import imaplib
import datetime
IMAP_SERVER = 'imap.gmail.com'
def process_inbox(mail, email_address):
return_value, emails = mail.search(None, "ALL")
@bhochieng
bhochieng / LICENCE SUBLIME TEXT
Created July 19, 2017 16:53 — forked from RoseySoft/LICENCE SUBLIME TEXT
Sublime Text 3 Serial key build is 3103
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
B085E65E 2F5F5360 8489D422 FB8FC1AA
93F6323C FD7F7544 3F39C318 D95E6480
FCCC7561 8A4A1741 68FA4223 ADCEDE07
@bhochieng
bhochieng / my_sacrifice.md
Created July 28, 2017 12:19
The motherf*cking way the get Oracle access in PHP5 over Ubuntu
Sublime text 3 (Build 3100 to 3114) - license key [ tested on Mac OS ]
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
B085E65E 2F5F5360 8489D422 FB8FC1AA
@bhochieng
bhochieng / perfectelementary.bash
Last active April 11, 2018 07:41
HowTo Install the perfect Elementary-OS
sudo apt-get update && sudo apt-get dist-upgrade
#Install Google Chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable