Skip to content

Instantly share code, notes, and snippets.

🕳
[ o o ]

Brian Abelson abelsonlive

🕳
[ o o ]
Block or report user

Report or block abelsonlive

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@abelsonlive
abelsonlive / cachelib.py
Last active Aug 29, 2015
Abstract Cache With Class
View cachelib.py
import hashlib
import s3plz
import os
import requests
class Cache(object):
"""
An Abstract class for caching
urls.
"""
@abelsonlive
abelsonlive / wait_browser.py
Last active Jun 18, 2019
Waiting For responses in selenium
View wait_browser.py
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
class WaitBrowser(object):
def __init__(self, **kw):
self.browser = webdriver.PhantomJS()
def readystate_complete(self):
View us_detentions.py
from suds.xsd.doctor import ImportDoctor, Import
from suds.client import Client
def connect_to_soap_service():
url = 'https://cgmix.uscg.mil/xml/PSIXData.asmx?WSDL'
imp = Import('http://www.w3.org/2001/XMLSchema', location='http://www.w3.org/2001/XMLSchema.xsd')
imp.filter.add('http://cgmix.uscg.mil')
doctor = ImportDoctor(imp)
return Client(url, doctor=doctor)
@abelsonlive
abelsonlive / demands.py
Created Sep 16, 2014
decorator for catching uncaught request errors.
View demands.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from functools import wraps
import requests
from requests import Session, ConnectionError
from requests.exceptions import MissingSchema
from requests.packages.urllib3.exceptions import ProtocolError, LocationParseError
from socket import error as SocketError
View gist:13c213ddf9fa744e7dc1
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from functools import wraps
import requests
from requests import Session, ConnectionError
from requests.exceptions import MissingSchema
from requests.packages.urllib3.exceptions import ProtocolError, LocationParseError
from socket import error as SocketError
View Performance of Flask, Tornado, GEvent, and their combinations.md

Performance of Flask, Tornado, GEvent, and their combinations

Wensheng Wang, 10/1/11

Source: http://blog.wensheng.org/2011/10/performance-of-flask-tornado-gevent-and.html

When choosing a web framework, I pretty much have eyes set on Tornado. But I heard good things about Flask and Gevent. So I tested the performance of each and combinations of the three. I chose something just a little more advanced than a "Hello World" program to write - one that use templates. Here are the codes:

1, Pure Flask (pure_flask.py)

View gist:0973e97ab859438ee754
Thanks for stopping on our website and dropping your request. I am <name>, your point of contact to help turn your idea to a Mobile App.
I would like to share that our team has develop a Demo app that is a combination of Yo/SnapChat in iOS 8 to test the features/functionality. Following is the video for reference: https://www.dropbox.com/s/fowvyi8a48ur0cz/YoME.MOV
As I see that you would like to develop an app that is similar to Yo! with some additional feature, to provide you a ball-park an app similar to Yo! would roughly cost between $3500 - $5000 USD for iPhone and it would take approx 4 - 6 weeks.
Above estimation includes.
-- Development of UI/UX design for iOS app
-- Development of iOS application.
@abelsonlive
abelsonlive / srccon-word-counts.json
Created Jul 31, 2014
Word counts from SRCCON transcripts.
View srccon-word-counts.json
[
{
"word": "people",
"count": 999
},
{
"word": "data",
"count": 749
},
{
@abelsonlive
abelsonlive / abelsonlive.zsh-theme
Last active Aug 29, 2015
my custom zsh theme
View abelsonlive.zsh-theme
# Based on `kennethreitz.zsh-theme`: https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/themes/kennethreitz.zsh-theme
ZSH_THEME_GIT_PROMPT_PREFIX="🐙 %{$purple%}"
ZSH_THEME_GIT_PROMPT_SUFFIX=""
ZSH_THEME_GIT_PROMPT_CLEAN="%{$reset_color%} ✅ "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$reset_color%} ❗ "
PROMPT='🏡 %{$limegreen%}%c%{$reset_color%} \
$(git_prompt_info) \
👉 '
@abelsonlive
abelsonlive / calc_per_rank.py
Last active Aug 29, 2015
given a histogram and the parameters used to construct it, return the percentile rank of of a given value
View calc_per_rank.py
import math
def calc_per_rank(val, hist, min_, max_, n_bins):
# determine how large each bin is
bin_interval = ( max_ - min_ ) / float( n_bins)
# identify which bin the value falls in
bin_index = int( math.floor( ( float( val ) - min_ ) / bin_interval ) )
You can’t perform that action at this time.