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
>> require 'pdf/reader' | |
=> true | |
>> receiver = PDF::Reader::RegisterReceiver.new | |
=> #<PDF::Reader::RegisterReceiver:0x00000100a5b5a0 @callbacks=[]> | |
>> pdf = PDF::Reader.file("somefile.pdf", receiver) | |
TypeError: can't convert nil into String | |
from /opt/local/lib/ruby/gems/1.9.1/gems/pdf-reader-0.8.5/lib/pdf/reader/parser.rb:140:in `block in hex_string' | |
from /opt/local/lib/ruby/gems/1.9.1/gems/pdf-reader-0.8.5/lib/pdf/reader/parser.rb:137:in `loop' | |
from /opt/local/lib/ruby/gems/1.9.1/gems/pdf-reader-0.8.5/lib/pdf/reader/parser.rb:137:in `hex_string' | |
from /opt/local/lib/ruby/gems/1.9.1/gems/pdf-reader-0.8.5/lib/pdf/reader/parser.rb:55:in `parse_token' |
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 sqlalchemy import create_engine, Column, Integer, String, Text, ForeignKey | |
from sqlalchemy.orm import sessionmaker, scoped_session, relationship | |
from sqlalchemy.ext.declarative import declarative_base | |
Session = scoped_session(sessionmaker()) | |
class Model(object): |
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 sqlalchemy import create_engine, Column, Integer, String, Text, ForeignKey | |
from sqlalchemy.orm import sessionmaker, scoped_session, relationship | |
from sqlalchemy.ext.declarative import declarative_base | |
engine = create_engine('postgresql://test:test@localhost/test', echo=True) | |
Session = scoped_session(sessionmaker(bind=engine)) | |
Base = declarative_base(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
def retry(tries): | |
def decorator(function): | |
def decorated_function(*args, **kwargs): | |
tried = 0 | |
while tried <= tries: | |
try: | |
return function(*args, **kwargs) | |
except Exception, exc: | |
tried += 1 | |
raise exc |
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
@retry(3) | |
def fails_sometimes(): | |
... |
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 unittest | |
from sqlalchemy import create_engine | |
from sqlalchemy import Column, Integer | |
from sqlalchemy import String | |
from sqlalchemy import Text | |
from sqlalchemy import ForeignKey | |
from sqlalchemy.orm import sessionmaker | |
from sqlalchemy.orm import scoped_session | |
from sqlalchemy.orm import relationship |
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
require 'balanced' | |
# create a test marketplace | |
api_key = Balanced::ApiKey.new.save | |
Balanced.configure(api_key.secret) | |
marketplace = Balanced::Marketplace.new.save | |
# charge $100.00 on a card | |
buyer = Balanced::Account.new( | |
:email_address => "[email protected]", |
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
/* month / year expiry stuff */ | |
.select { | |
height: 24px; | |
border: 1px solid #ccc; | |
border-top: 1px solid #888; | |
padding: 0px 0 0 0px; | |
background: url(https://www.poundpay.com/images/dropdown.png) no-repeat right #fff; | |
-webkit-appearance: none; | |
-moz-appearance: none; | |
overflow: hidden; |
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
### Keybase proof | |
I hereby claim: | |
* I am matin on github. | |
* I am matin (https://keybase.io/matin) on keybase. | |
* I have a public key ASCViy2GV3VMclPpFPFveI1Nh2vpy4uUw_60r4P7LML9-Ao | |
To claim this, I am signing this object: |
OlderNewer