Skip to content

Instantly share code, notes, and snippets.

Martin LeBlanc martinleblanc

Block or report user

Report or block martinleblanc

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
View new
3AAS0pizzgeQAM4ASlhkAdwAGs5oj1tXwsDA3AAd0scaYgmXzgZ0PP3ECkNvcGVuaGFnZW7EAkRLxAQxMjAwwMQbSMO4amJybyBwbGFkcyA4LCBPZmZpY2UgMjEwkIrEGHB1YmxpY19jb2xsZWN0aW9uc19jb3VudBbEDmZvbGxvd2VyX2NvdW50zL/EEnB1YmxpY19pY29uc19jb3VudM0W08QUaGFzX3ByZW1pdW1faWNvbnNldHPDxA5pY29uc2V0c19jb3VudGjEFXB1YmxpY19mYW1pbGllc19jb3VudAfEEXB1YmxpY19pY29uX2NvdW50zR2YxBVwdWJsaWNfaWNvbnNldHNfY291bnRoxB5oYXNfcHVibGlzaGVkX3ByZW1pdW1faWNvbnNldHPDxBdhbGxvd3NfcHJpdmF0ZV9tZXNzYWdlc8PEDkljb25maW5kZXIgQXBTxB1tYXJ0aW4ubGVibGFuY0BpY29uZmluZGVyLmNvbcDEBk1hcnRpbsPDwsLCwsPDwsQPTGVCbGFuYyBFaWd0dmVkxBNDb3BlbmhhZ2VuLCBEZW5tYXJrB5fNB9oEAwwhFQCXzQfiCgEHNQrNZWrAl80H4wcIDiUGzgADK6PEEUV1cm9wZS9Db3BlbmhhZ2VuwA7ECmljb25maW5kZXLECDMzMjc4OTY5kJDADc4AAj3bAcQOYXNkZmRhc2Zhc2RmYXPDw8DEDkFTREZkYXNmYXNkZmFzgsQKbWFza19jb2xvcsDEEGJhY2tncm91bmRfY29sb3LEByNmZmZmZmaRls4EFjWmm85Ni3nCwMQFYmFzaWPCR8QNQmFzaWMgbGljZW5zZQKXzQfcCQsRIiTOAAxAuJfNB+MHCBQmIc4ACKpQwJEAkwCTAgAA/pMAlAEAAAD+kwCUBgAAAP6QAAEKkJfNB+MHCBUHB84AA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JlIGRlc2lnbmVk
View Request token
<?php
/**
* Send a POST requst using cURL
* @param string $CLIENT_ID the client ID
* @param string $CLIENT_SECRET the client secret
* @return string
*/
function get_token($CLIENT_ID, $CLIENT_SECRET, $AUTH_URL) {
View gist:ea77c307decf5d3a5b405c42e65461ee
root@0922dbc392b8:/app# ./bin/nextfinder reindex_all
INFO 2019-01-03 06:50:27,480 nf_search 784 140636375549696 Updating indexes for all icons
DEBUG 2019-01-03 06:50:27,482 urllib3.connectionpool 784 140636375549696 Starting new HTTP connection (1): elasticsearch:9200
DEBUG 2019-01-03 06:50:27,500 urllib3.connectionpool 784 140636375549696 http://elasticsearch:9200 "PUT /if_public_icons_v2 HTTP/1.1" 400 453
WARNING 2019-01-03 06:50:27,502 elasticsearch 784 140636375549696 PUT http://elasticsearch:9200/if_public_icons_v2 [status:400 request:0.020s]
DEBUG 2019-01-03 06:50:27,502 elasticsearch 784 140636375549696 > {"mappings":{"icon_v2":{"properties":{"author_user_id":{"type":"long"},"downloads":{"type":"long","store":true},"is_premium":{"type":"boolean"},"tag":{"type":"keyword","fielddata":true,"index_options":"docs"},"scores":{"type":"object","store":true},"impressions":{"type":"long","store":true},"iconset_id":{"type":"long"},"packed":{"type":"binary","store":true},"size":{"type":"long"},"category":{"type":"
View token.php
<?php
/**
* Send a POST requst using cURL
* @param string $CLIENT_ID the client ID
* @param string $CLIENT_SECRET the client secret
* @return string
*/
function get_token($CLIENT_ID, $CLIENT_SECRET, $AUTH_URL) {
View question1-3.py
#init.py
import module1
module1.function1()
View question1-2.py
# module2
import module1
def function2():
print('Hello, World!')
module1.function3()
View question1-error.py
$ python __init__.py
Hello, World!
Traceback (most recent call last):
File "__init__.py", line 3, in <module>
module1.function1()
File "/Users/scott/projects/sandbox/python/circular-dep-test/module1/__init__.py", line 5, in function1
module2.function2()
File "/Users/scott/projects/sandbox/python/circular-dep-test/module2/__init__.py", line 6, in function2
module1.function3()
View question1.py
# module1
import module2
def function1():
module2.function2()
def function3():
print('Goodbye, World!')
View question2.py
class CheckoutView(View):
def post(self, request, card, amount, *args, **kwargs):
try:
credit_card_service.charge_credit_card(card, amount)
except InsufficientFundsError:
self.errors.append('Insufficient funds')
except NotForSaleError:
self.errors.append('Asset is not for sale under the given circumstances')
except AssetAlreadyPurchasedException, e:
self.errors.append("You already purchased {}(id={})".format(e.reference_identifier, e.reference_primary_key))
You can’t perform that action at this time.