Skip to content

Instantly share code, notes, and snippets.

View hiteshjoshi's full-sized avatar
🎯
Focusing

Hitesh Joshi hiteshjoshi

🎯
Focusing
View GitHub Profile
@hiteshjoshi
hiteshjoshi / httputils.py
Created May 7, 2019 11:06 — forked from rizkyabdilah/httputils.py
simple wrapper for httplib, provide simple High Level API trough python httplib
import re
import urllib
import httplib
import mimetypes
import os
regex_url = re.compile("^(?:(?P<scheme>http|ftps?):\/\/)?(?:(?:(?P<username>[\w\.\-\+%!$&'\(\)*\+,;=]+):*(?P<password>[\w\.\-\+%!$&'\(\)*\+,;=]+))@)?(?P<host>[a-z0-9-]+(?:\.[a-z0-9-]+)*(?:\.[a-z\.]{2,6})+)(?:\:(?P<port>[0-9]+))?(?P<path>\/(?:[\w_ \/\-\.~%!\$&\'\(\)\*\+,;=:@]+)?)?(?:\?(?P<query>[\w_ \-\.~%!\$&\'\(\)\*\+,;=:@\/]*))?(?:(?P<fragment>#[\w_ \-\.~%!\$&\'\(\)\*\+,;=:@\/]*))?$")
def parse_url(url):
match = re.match(regex_url, url, re.IGNORECASE)
@hiteshjoshi
hiteshjoshi / golang-twilio-voice.go
Created November 24, 2016 20:08 — forked from mickstevens/golang-twilio-voice.go
Twilio Voice App using Golang
package main
import (
"encoding/xml"
"net/http"
"net/url"
"fmt"
"strings"
"io/ioutil"
"encoding/json"
@hiteshjoshi
hiteshjoshi / uiappearance-selector.md
Created July 13, 2016 15:04 — forked from mattt/uiappearance-selector.md
A list of methods and properties conforming to `UIAppearance` as of iOS 8.0

Generate the list yourself:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep -H UI_APPEARANCE_SELECTOR ./* | sed 's/ __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_5_0) UI_APPEARANCE_SELECTOR;//'

UIActivityIndicatorView

@hiteshjoshi
hiteshjoshi / nodejs-app.conf
Last active September 8, 2015 10:14 — forked from louischatriot/nodejs-app.conf
Upstart script to launch a nodejs application as a service
description "Upstart script to run a nodejs app as a service"
author "Louis Chatriot"
env NODE_BIN=/usr/local/bin/node
env APP_DIR=/path/to/app/dir
env SCRIPT_FILE="scriptfile.js" # Entry point for the nodejs app
env LOG_FILE=/path/to/logfile.log
env RUN_AS="anyuser" # Upstart can only be run nicely as root, need to drop privileges
env SERVER_ENV="anything" # Usual apps can be run in different environments (development, test, production ...)
# I typically use the environment variable NODE_ENV (see below)
@hiteshjoshi
hiteshjoshi / zsh.md
Last active August 29, 2015 14:24 — forked from tsabat/zsh.md