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
| language: node_js | |
| node_js: | |
| - "9" | |
| dist: trusty | |
| sudo: required | |
| branches: | |
| only: | |
| - master | |
| before_script: | |
| - npm install -g @angular/cli |
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
| curl -0L https://raw.githubusercontent.com/instagrambot/instabot/master/examples/stories/watch_user_likers_stories.py --output watch_user_likers_stories.py |
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
| """ | |
| More Just Store (https://www.producthunt.com/posts/morejust-store) can store your files for free. | |
| BUT: | |
| 1) Your files will be publicly available | |
| 2) Max file size 100 Mb. | |
| Can be very useful for your Indie/Hackathon projects. | |
| """ | |
| import requests |
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
| language: python | |
| cache: | |
| - pip | |
| python: | |
| - "3.6" | |
| install: | |
| - pip install -r requirements.txt | |
| script: | |
| - python bot.py |
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 os | |
| import time | |
| import random | |
| from instabot import Bot | |
| def like_media_likers(bot, media, nlikes=2): | |
| for user in bot.get_media_likers(media): | |
| bot.like_user(user, nlikes) | |
| return True |
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
| def resumetable(df): | |
| print(f"Dataset Shape: {df.shape}") | |
| summary = pd.DataFrame(df.dtypes,columns=['dtypes']) | |
| summary = summary.reset_index() | |
| summary['Name'] = summary['index'] | |
| summary = summary[['Name','dtypes']] | |
| summary['Missing'] = df.isnull().sum().values | |
| summary['Uniques'] = df.nunique().values | |
| summary['First Value'] = df.loc[0].values | |
| summary['Second Value'] = df.loc[1].values |
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 os | |
| import logging | |
| import telegram | |
| from flask import Flask, jsonify, request | |
| app = Flask(__name__) | |
| @app.route('/api', methods=['POST']) | |
| def api(): | |
| bot = telegram.Bot(token=os.getenv("TELEGRAM_TOKEN")) |
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
| { | |
| "builds": [{ | |
| "src": "index.py", "use": "@now/python" | |
| }], | |
| "routes": [ | |
| { "src": "/(.*)", "dest": "index.py" } | |
| ], | |
| "env": { | |
| "TELEGRAM_TOKEN": "@telegram-token" | |
| } |
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
| # your_app/admin.py | |
| # ... imports | |
| @admin.register(User) | |
| class UserAdmin(admin.ModelAdmin): | |
| actions = ['broadcast'] # register method as action | |
| def broadcast(self, request, queryset): | |
| if 'apply' in request.POST: # if user pressed 'apply' on intermediate page |
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
| <!-- my_django_app/templates/admin/broadcast_message.html --> | |
| <!-- This block will be included to django admin basic template --> | |
| {% extends "admin/base_site.html" %} | |
| {% block content %} | |
| <form action="" method="post">{% csrf_token %} | |
| <!-- The code of the form with all input fields will be automatically generated by Django --> | |
| {{ form }} | |
| <!-- Show the list of selected objects on the previous step --> |