Skip to content

Instantly share code, notes, and snippets.

View bhochieng's full-sized avatar
🤪
Stay Productive

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

🤪
Stay Productive
  • Remote
  • Nairobi Kenya
  • 16:41 (UTC -12:00)
  • X @bhochieng
View GitHub Profile
@bhochieng
bhochieng / gist:0dda2e5b4a4d9989880ab1d825886fbf
Created November 24, 2021 05:14
split comma delimited string
SELECT REGEXP_SUBSTR ('23,34,45,56','[^,]+',1,1) as "token"
FROM DUAL
/
SELECT REGEXP_SUBSTR ('23,34,45,56','[^,]+',1,2) as "token"
FROM DUAL
@bhochieng
bhochieng / kmskeys10.txt
Created November 1, 2017 05:17 — forked from CHEF-KOCH/kmskeys10.txt
Windows 10 KMS Keys
Windows.10.and.Office.2016.gVLK
#####################################################################
# Install/Uninstall keys #
#####################################################################
1.) Uninstall the current product by entering the “uninstall product key” extension:
slmgr.vbs /upk
2.) Install the key that you obtained above for “Windows Srv 2012R2 DataCtr/Std KMS for Windows 10”
@bhochieng
bhochieng / Android Studio hacks
Created October 6, 2017 11:40
Android studio hacks and mods for low memory systems
I found that disabling VCS in android studio and using an external program to handle VCS helped a lot. You can disable VCS by going to File->Settings->Plugins and disable the following:
CVS Integration
Git Integration
GitHub
Google Cloud Testing
Google Cloud Tools Core
Google Cloud Tools for Android Studio
hg4idea
Subversion Integration
@bhochieng
bhochieng / linux network solutions
Last active February 10, 2018 14:29
Linux network solutions for Ubuntu
$ rfkill list
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
1: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
$ hciconfig
hci0: Type: BR/EDR Bus: USB
@bhochieng
bhochieng / wb_to_dict.py
Created August 18, 2017 11:08 — forked from stuaxo/wb_to_dict.py
Output an excel workbook as a python dict.Information about the formatting/colour of cells is lost - which is OK if the sheet is sensible.Individual rows are output horizontally.Types are converted to python types.This is not comprehensive + just enough for the sheet I happen to be working with today.
import datetime
import xlrd
from pprint import PrettyPrinter
def trim_nones(li):
""" remove trailing Nones from a list """
while li and li[-1] is None:
li.pop()
@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
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 / my_sacrifice.md
Created July 28, 2017 12:19
The motherf*cking way the get Oracle access in PHP5 over Ubuntu
@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 / 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")