<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>
-
URL
<The URL Structure (path only, no root url)>
-
Method:
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import urllib2 | |
gh_url = 'https://api.github.com' | |
req = urllib2.Request(gh_url) | |
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm() |
from flask import Flask | |
from flask.ext.sqlalchemy import SQLAlchemy | |
app = Flask(__name__) | |
db = SQLAlchemy(app) | |
class Author(db.Model): | |
id = db.Column(db.Integer, primary_key=True) | |
name = db.Column(db.Text) |
Elasticsearch was created in 2010 by Shay Banon after forgoing work on another search solution, Compass, also built on Lucene and created in 2004.
""" | |
Two things are wrong with Django's default `SECRET_KEY` system: | |
1. It is not random but pseudo-random | |
2. It saves and displays the SECRET_KEY in `settings.py` | |
This snippet | |
1. uses `SystemRandom()` instead to generate a random key | |
2. saves a local `secret.txt` |
import cv2.cv as cv | |
import tesseract | |
gray = cv.LoadImage('captcha.jpeg', cv.CV_LOAD_IMAGE_GRAYSCALE) | |
cv.Threshold(gray, gray, 231, 255, cv.CV_THRESH_BINARY) | |
api = tesseract.TessBaseAPI() | |
api.Init(".","eng",tesseract.OEM_DEFAULT) | |
api.SetVariable("tessedit_char_whitelist", "0123456789abcdefghijklmnopqrstuvwxyz") | |
api.SetPageSegMode(tesseract.PSM_SINGLE_WORD) | |
tesseract.SetCvImage(gray,api) | |
print api.GetUTF8Text() |
# Small Python Script to scrape websites for | |
# email addresses and phone numbers(not a very great RE) | |
# Author: Dhruv Baldawa (@dhruvbaldawa on twitter) | |
# Github: http://www.github.com/dhruvbaldawa | |
import urllib,re | |
f = urllib.urlopen("http://www.example.com") | |
s = f.read() | |
re.findall(r"\+\d{2}\s?0?\d{10}",s) | |
re.findall(r"[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}",s) |
******************************************************************** Set up Django, Nginx and Gunicorn in a Virtualenv controled by Supervisor********************************************************************
Steps with explanations to set up a server using:
People
:bowtie: |
😄 :smile: |
😆 :laughing: |
---|---|---|
😊 :blush: |
😃 :smiley: |
:relaxed: |
😏 :smirk: |
😍 :heart_eyes: |
😘 :kissing_heart: |
😚 :kissing_closed_eyes: |
😳 :flushed: |
😌 :relieved: |
😆 :satisfied: |
😁 :grin: |
😉 :wink: |
😜 :stuck_out_tongue_winking_eye: |
😝 :stuck_out_tongue_closed_eyes: |
😀 :grinning: |
😗 :kissing: |
😙 :kissing_smiling_eyes: |
😛 :stuck_out_tongue: |