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
<img src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pjxzdmcgdmlld0JveD0iMCAwIDI0IDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjx0aXRsZS8+PGcgZGF0YS1uYW1lPSIwMSIgaWQ9Il8wMSI+PHBhdGggZD0iTTE4LDEzSDZhMSwxLDAsMCwxLDAtMkgxOGExLDEsMCwwLDEsMCwyWiIvPjxwYXRoIGQ9Ik0xOCw4SDZBMSwxLDAsMCwxLDYsNkgxOGExLDEsMCwwLDEsMCwyWiIvPjxwYXRoIGQ9Ik0xOCwxOEg2YTEsMSwwLDAsMSwwLTJIMThhMSwxLDAsMCwxLDAsMloiLz48L2c+PC9zdmc+">
@martinleblanc
martinleblanc / File downloader
Last active August 18, 2021 14:47
icon-download.php
<?php
function prettyPrint( $json )
{
$result = '';
$level = 0;
$in_quotes = false;
$in_escape = false;
$ends_line_level = NULL;
3AAS0pizzgeQAM4ASlhkAdwAGs5oj1tXwsDA3AAd0scaYgmXzgZ0PP3ECkNvcGVuaGFnZW7EAkRLxAQxMjAwwMQbSMO4amJybyBwbGFkcyA4LCBPZmZpY2UgMjEwkIrEGHB1YmxpY19jb2xsZWN0aW9uc19jb3VudBbEDmZvbGxvd2VyX2NvdW50zL/EEnB1YmxpY19pY29uc19jb3VudM0W08QUaGFzX3ByZW1pdW1faWNvbnNldHPDxA5pY29uc2V0c19jb3VudGjEFXB1YmxpY19mYW1pbGllc19jb3VudAfEEXB1YmxpY19pY29uX2NvdW50zR2YxBVwdWJsaWNfaWNvbnNldHNfY291bnRoxB5oYXNfcHVibGlzaGVkX3ByZW1pdW1faWNvbnNldHPDxBdhbGxvd3NfcHJpdmF0ZV9tZXNzYWdlc8PEDkljb25maW5kZXIgQXBTxB1tYXJ0aW4ubGVibGF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pc2xhdsPDwsPCwsPCwsQJS2hvZHpoYWV2wAKXzQfdBBAPLinOAAMgE5fNB+IKEREZMM4ADeQXwJfNB+MHBwMOEM4ACAyHxA1FdXJvcGUvTW9zY293wM2m98QGSWNvamFtxACQkpfS0kBK7x3EFW5ldHdvcmstY29tbXVuaWNhdGlvbsQYTmV0d29yayAmIGNvbW11bmljYXRpb25zxBdOZXR3b3JrICYgY29tbXVuaWNhdGlvbpfNB94CCQAAAACQl9LSQErvJMQHc2VvLXdlYsQJU0VPICYgd2VixAlTRU8gJiB3ZWKXzQfeAgkAAAAAkNwAEtLMo+11wMUBACoqSWNvbnMgZm9yIG9uYm9hcmRpbmcgVUksIGxhbmRpbmcgcGFnZXMgYW5kIHdpemFyZCBzY3JlZW5zIGluIGFwcGxpY2F0aW9ucy4qKg0KDQpTY2VuYXJpdW0gaWNvbnMgYXJlIGRlc2lnbmVk
<?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) {
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":"
<?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) {
@martinleblanc
martinleblanc / question1-3.py
Created August 27, 2018 14:14
question1-3.py
#init.py
import module1
module1.function1()
@martinleblanc
martinleblanc / question1-2.py
Created August 27, 2018 14:13
question1-2.py
# module2
import module1
def function2():
print('Hello, World!')
module1.function3()
@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()