This file contains hidden or 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 base64 | |
| import os | |
| import rsa | |
| def load_priv_key(path): | |
| path = os.path.join(os.path.dirname(__file__), path) | |
| with open(path, mode='rb') as privatefile: | |
| keydata = privatefile.read() | |
| return rsa.PrivateKey.load_pkcs1(keydata) |
This file contains hidden or 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
| WITH RECURSIVE file_depth | |
| AS ( | |
| SELECT | |
| id, | |
| parent_folder_id, | |
| 1 AS depth | |
| FROM files | |
| WHERE files.parent_folder_id = '0' | |
| UNION |
This file contains hidden or 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 intercom import Intercom, User, errors | |
| import requests | |
| _APP_ID = "arst234" | |
| _APP_KEY = "arsttsrdhwfpgj3245rdsrsp2453rstd" | |
| _DBNAME = "arst" | |
| _DBUSER = "arst" | |
| _DBHOST = "localhost" | |
| _DBPASS = "arst" |
This file contains hidden or 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
| #! /bin/bash | |
| HOST_IP=`/sbin/ip route | awk '/default/ { print $3 }'` | |
| sudo apt update | |
| sudo apt install php-xdebug | |
| echo "zend_extension=/usr/lib/php/20131226/xdebug.so" > /etc/php/5.6/fpm/conf.d/20-xdebug.ini | |
| echo "xdebug.remote_handler=dbgp" >> /etc/php/5.6/fpm/conf.d/20-xdebug.ini | |
| echo "xdebug.remote_mode=req" >> /etc/php/5.6/fpm/conf.d/20-xdebug.ini | |
| echo "xdebug.var_display_max_data = 2048" >> /etc/php/5.6/fpm/conf.d/20-xdebug.ini | |
| echo "xdebug.var_display_max_depth = 128" >> /etc/php/5.6/fpm/conf.d/20-xdebug.ini | |
| echo "xdebug.max_nesting_level = 500" >> /etc/php/5.6/fpm/conf.d/20-xdebug.ini |
This file contains hidden or 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 requests | |
| import sys | |
| import urllib | |
| from pprint import pprint | |
| url = "http://ws.audioscrobbler.com/2.0/" | |
| body = { | |
| 'method': "user.gettopartists", | |
| 'user': "alairock", | |
| 'api_key': '301a3a6d4301644d5a078e7f1fac0e78', |
This file contains hidden or 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 random | |
| from PIL import Image, ImageDraw, ImageFont | |
| import requests | |
| import sys | |
| import urllib | |
| from pprint import pprint | |
| url = "http://ws.audioscrobbler.com/2.0/" | |
| body = { | |
| 'method': "user.gettopartists", |
This file contains hidden or 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
| cd(){ | |
| venvactifile=./venv/bin/activate | |
| builtin cd "$@"; | |
| if [ -e "$venvactifile" ]; then | |
| source $venvactifile | |
| export PYTHONPATH=$(pwd) | |
| echo "IN LIKE FLYNN" | |
| else | |
| if type deactivate >/dev/null 2>&1 | |
| then |
This file contains hidden or 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
| git+git://github.com/pyslackers/sir-bot-a-lot.git@master | |
| git+https://github.com/pyslackers/sirbot-slack.git@master | |
| git+https://github.com/pyslackers/sirbot-plugins.git@master |
This file contains hidden or 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 TooManyTriesException(BaseException): | |
| pass | |
This file contains hidden or 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 asyncio | |
| async def meow(number): | |
| print(f'starting {number}') | |
| await asyncio.sleep(1) | |
| print(f'stopping {number}') | |
| async def run(): |