This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
class Note: | |
def __init__(self, id): | |
self.id = id | |
self.note = None | |
def get_note(self, refresh=False): | |
if refresh or self.note is None: | |
text = requests.get('http://notepad.cc/'+self.id).content |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
import json | |
import urllib | |
import requests | |
base= 'http://www.google.com/reader/api/0/stream/contents/feed/' | |
url = 'http://scturtle.me/atom.xml' | |
url = urllib.quote(url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
import requests | |
from urllib import quote_plus | |
from bs4 import BeautifulSoup | |
def get_html(url): | |
text = requests.get('http://www.instapaper.com/text?u='+ | |
quote_plus(url)).content | |
soup = BeautifulSoup(text) | |
title = soup.find('div',{'id':'titlebar'}).find('h1').get_text() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import re | |
import os | |
import sys | |
import urllib | |
if len(sys.argv) <= 1: | |
print 'Usage: {} [video | videourl]'.format(sys.argv[0]) | |
sys.exit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c=(0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8, | |
31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9) | |
def num_of_last_0_in_32bit(v): | |
return c[(0xffffffff & ((v&-v) * 0x077CB531)) >> 27] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
import oauth2 as oauth | |
import json | |
CONSUMER_KEY = "yT577ApRtZw51q4NPMPPOQ" | |
CONSUMER_SECRET = "3neq3XqN5fO3obqwZoajavGFCUrC42ZfbrLXy5sCv8" | |
ACCESS_KEY = "" | |
ACCESS_SECRET = "" | |
consumer = oauth.Consumer(key=CONSUMER_KEY, secret=CONSUMER_SECRET) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, request, session, redirect, url_for | |
import urllib | |
import requests | |
app = Flask(__name__) | |
app.secret_key = 'iwonttellyou' | |
redirect_uri = 'http://localhost:5000/callback' | |
client_id = '' # get from https://code.google.com/apis/console | |
client_secret = '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set DARKGREEN 2b6003 | |
set LIGHTGREEN b7da2d | |
set DARKBLUE 2f6f93 | |
set LIGHTBLUE 87d6fc | |
set SPARATOR \u2b80 | |
set SPARATOR_THIN \u2b81 | |
function fish_prompt | |
# first line | |
set_color -o $DARKGREEN -b $LIGHTGREEN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
#import httplib | |
#httplib.HTTPConnection.debuglevel = 1 | |
import gevent | |
from gevent import monkey, Greenlet | |
monkey.patch_all() | |
from gevent.pool import Pool | |
import requests | |
import re |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
type Fetcher interface { | |
Fetch(url string) (body string, urls []string, err error) | |
} |