Skip to content

Instantly share code, notes, and snippets.

View bhochieng's full-sized avatar
🤪
Stay Productive

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

🤪
Stay Productive
  • Remote
  • Nairobi Kenya
  • 20:54 (UTC -12:00)
  • X @bhochieng
View GitHub Profile
@bradmontgomery
bradmontgomery / python_projects.md
Last active January 22, 2021 20:27
How I start and manage my python projects.

How I organize my python projects

This is applicable to both OS X and Linux. I use the same tools on both systems. In this guide, I'm going to set up an environment for a Flask app.

Setup

  1. I start by installing pip, virtualenv, then virtualenvwrapper. I seldom use virtualenv directly; I use the wrapper tools instead.
  2. I create a virtualenv for my project:
@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 / 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 / my_sacrifice.md
Created July 28, 2017 12:19
The motherf*cking way the get Oracle access in PHP5 over Ubuntu
@techsharif
techsharif / PYTHON_store_and_search_data_for_start_learning_using_DATABASE.py
Last active May 17, 2023 13:36
Python Database CRUD Sqlite basic using simple student management system
"""
importent links:
http://sebastianraschka.com/Articles/2014_sqlite_in_python_tutorial.html
http://www.pythoncentral.io/introduction-to-sqlite-in-python/
"""
import sqlite3
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;
class AppServiceProvider extends ServiceProvider
{
/**
public function index(Request $request)
{
$sortBy = 'id';
$orderBy = 'desc';
$perPage = 20;
$q = null;
if ($request->has('orderBy')) $orderBy = $request->query('orderBy');
if ($request->has('sortBy')) $sortBy = $request->query('sortBy');
if ($request->has('perPage')) $perPage = $request->query('perPage');