Skip to content

Instantly share code, notes, and snippets.

View martinleblanc's full-sized avatar
🏠
Working from home

Martin LeBlanc martinleblanc

🏠
Working from home
View GitHub Profile
Process: Logic Pro X [487]
Path: /Applications/Logic Pro X.app/Contents/MacOS/Logic Pro X
Identifier: com.apple.logic10
Version: 10.0.4 (2911.63)
Build Info: MALogic-2911063000000000~16
App Item ID: 634148309
App External ID: 73352631
Code Type: X86-64 (Native)
Parent Process: launchd [254]
Responsible: Logic Pro X [487]
@martinleblanc
martinleblanc / api.php
Created August 28, 2017 11:33
Iconfinder API example
--------- index.php:
<?php
include("settings.php");
include("helpers/token.php");
include("helpers/curl.php");
// Get token.
[INFO]
[INFO] --- maven-thrift-plugin:0.1.10:compile (thrift-sources) @ bender ---
[INFO]
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ bender ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /code/bender/src/main/resources
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ bender ---
Downloading: http://maven.twttr.com/org/apache/maven/shared/maven-shared-utils/0.1/maven-shared-utils-0.1.pom
{
'organizationId': 2,
'memberships': [{
'user': {
'username': u 'iconfinder',
'emailMd5Hash': '9edff23a1c02e5209045436a5f3293ae',
'company': u '123123',
'vatNumber': u 'dk-33778899',
'userId': 4 L,
'address': {
category: [17]
style: [2]
icon_type: 1
author_user_id: 42743
downloads: 55
popularity: 25.3263910172
license_scope: 2
id: 1272808
is_premium: True
tag: [u'artificial', u'intelligence', u'robot']
[{'username': u'intercom1000', 'user_id': 79L, 'name': u'dsfadfa sdfasdfsadf', 'unsubscribed_from_emails': False, 'signed_up_at': 1529412641L, 'email': u'[email protected]', 'custom_attributes': {'deposited_last_30_days': 0, 'is_screened': False, 'is_eu_citizen': 'Maybe', 'country_code': None, 'timemachine_49': False, 'asset_spending_total': 0, 'last_synced_with_nextfinder': 1529394660L, 'is_contributor': False, 'timemachine_discount': 0, 'pro_billing_interval': None, 'timemachine_19': False, 'pro_subscription': None, 'deleted': False, 'deposited_total': 0, 'icons_downloaded': 0L, 'pro_subscription_owner': None, 'timemachine_stock_asset_spending': 0, 'pro_subscription_cancelled': None, 'pro_subscription_created': None, 'is_frozen': False, 'asset_spending_last_30_days': 0, 'balance': 0}, 'id': 79L}]
@martinleblanc
martinleblanc / question2.py
Last active August 27, 2018 14:51
Question 2
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))
@martinleblanc
martinleblanc / question1.py
Last active August 27, 2018 14:12
question1.py
# module1
import module2
def function1():
module2.function2()
def function3():
print('Goodbye, World!')
@martinleblanc
martinleblanc / question1-error.py
Created August 27, 2018 13:41
Question 1 error
$ 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()
@martinleblanc
martinleblanc / question1-2.py
Created August 27, 2018 14:13
question1-2.py
# module2
import module1
def function2():
print('Hello, World!')
module1.function3()