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
// see: https://stackoverflow.com/questions/3597116/insert-html-after-a-selection | |
// see: https://stackoverflow.com/questions/16662393/insert-html-into-text-node-with-javascript | |
var s = window.getSelection(); | |
//insert start span at selection.anchorOffset within selection.anchorNode + closing tag at selection.focusOffset within selection.focusNode | |
// inserts a new node containing selection and returns reference to this node | |
var wrapSelectionInElement = function(s, e) { | |
var start = s.getRangeAt(s.anchorNode); | |
var startOffset = s.anchorOffset; |
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
question_questions = \ | |
Table('question_to_questions', core.Base.metadata, | |
Column('question_parent_id', BigInteger, ForeignKey('questions.id'), | |
primary_key=True, nullable=False), | |
Column('question_child_id', BigInteger, ForeignKey('questions.id'), | |
primary_key=True, nullable=False), | |
created = Column(DateTime(timezone=False), default=datetime.utcnow, | |
nullable=False), | |
UniqueConstraint('question_parent_id', 'question_child_id', | |
name='question_parent_child_uix') |
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
# Getting Started | |
**Installing Open Library** | |
For instructions on setting up a local developer's instance of Open Library, please refer to https://github.com/internetarchive/openlibrary#installation. Also, refer to the Quickstart Guide: https://github.com/internetarchive/openlibrary/blob/master/Quickstart.md | |
**Resources for Contributors** | |
Look through our issues related to `contributing`: | |
https://github.com/internetarchive/openlibrary/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3Acontributing | |
**Want to Participate in the Community?** |
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
{ | |
} |
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
[ | |
{ | |
"author": "Aeschines", | |
"language": "Wrote in Greek", | |
"years": ["390 B.C.E", "314 B.C.E."] | |
}, | |
{ | |
"author": "Aeschylus", | |
"language": "Wrote in Greek", | |
"years": ["525 B.C.E", "456 B.C.E."] |
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
---------------------------------------- | |
127.0.0.1 - - [29/Jul/2014 01:05:43] "GET / HTTP/1.1" 200 - | |
---------------------------------------- | |
Exception happened during processing of request from ('127.0.0.1', 59305) | |
Traceback (most recent call last): | |
File "/usr/lib/python2.7/SocketServer.py", line 295, in _handle_request_noblock | |
self.process_request(request, client_address) | |
File "/usr/lib/python2.7/SocketServer.py", line 321, in process_request | |
self.finish_request(request, client_address) | |
File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request |
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 datetime | |
from sqlalchemy import create_engine | |
from sqlalchemy.orm import sessionmaker, scoped_session | |
from sqlalchemy import Column, String, BigInteger, DateTime | |
# DB = {'dbn' ... } assume DB is defined with correct engine (k,v)'s | |
engine = create_engine('%(dbn)s://%(user)s:%(pw)s@%(host)s/%(db)s' % DB, echo=True) | |
DBSession = scoped_session(sessionmaker(bind=engine)) |
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
class Bar(object): | |
@classmethod | |
def b(cls, _Foo): | |
print(_Foo.TBL) |
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
+--------------------+--------+--------+--------+ | |
| Distro | Ubuntu | Debian | Mint | | |
+--------------------+--------+--------+--------+ | |
| Low Learning Curve | 4 | 3 | 4 | | |
| Ease of Install | 5 | 3 | ? | | |
| Driver Support | 4 | 3 | ? | | |
| Package Mngmt | 4 | 4 | 3 | -- apt=4, dpkg=3, portage=5 | |
| Def. Graphical Env | 2 | 3 | 4 | -- gnome+unity=2, xfce=3 | |
| Bloat-free? | 1 | 3 | 2 | -- 5 being LFS (linux from scratch) | |
| Performance | 2 | 3 | 2 | -- compared to gentoo, damn small linux, et al |
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 time | |
class profile(object): | |
__history = [] | |
__synopsis = {} | |
__total = 0 | |
def __init__(self, f): | |
self.__f = f |