This file contains 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 instagram_private_api import Client, ClientCompatPatch | |
u = '' | |
p = '' | |
api = Client(u, p) | |
# https://www.instagram.com/{username}/?__a=1 | |
print(api.friendships_create('user_id')) |
This file contains 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 instaloader | |
import sqlite3 | |
L = instaloader.Instaloader() | |
L.login('', '') | |
profile = instaloader.Profile.from_username(L.context, '') | |
This file contains 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
public class OrderService { | |
public void calculateTotal(Order order) { | |
if (order == null) { | |
throw new IllegalArgumentException("order must not be null"); | |
} | |
BigDecimal total = BigDecimal.ZERO; | |
List<OrderItem> items = order.getItems(); | |
This file contains 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
public class Order { | |
private BigDecimal total = BigDecimal.ZERO; | |
private List<OrderItem> items = new ArrayList<OrderItem>(); | |
public BigDecimal getTotal() { | |
return total; | |
} | |
public void setTotal(BigDecimal total) { | |
this.total = total; |
This file contains 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 scrapy | |
class ImgItem(scrapy.Item): | |
image_urls = scrapy.Field() | |
images = scrapy.Field() |
This file contains 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
Interface GameObject() { | |
increaseSpeed() {}; | |
} | |
class Rabbit implements GameObject { | |
increaseSpeed() { | |
//increase speed by 3 | |
} | |
} | |
class Bear implements GameObject { | |
increaseSpeed() { |
This file contains 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 Handler | |
{ | |
public void increaseSpeed(GameObject go1) | |
{ | |
if(typeOf(go1) == Rabbit ) | |
{ | |
// increase speed by 3 | |
} | |
else if(typeOf(go1) == Bear) | |
{ |
This file contains 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
n = int(input('enter number: ')) | |
lines_count = n * 2 - 1 | |
for line in range(1, lines_count+1): | |
tabs = (n-line) * -1 if n-line < 0 else n-line | |
for tab in range(tabs): | |
print('\t', end='') | |
for col in range(n-tabs): |
This file contains 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
{"lastUpload":"2020-01-01T04:35:52.146Z","extensionVersion":"v3.4.3"} |
This file contains 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 ReportFormat(object): | |
PDF = 0 | |
TEXT = 1 | |
class Report(object): | |
def __init__(self, format_): | |
self.title = 'title' | |
self.format_ = format_ |
NewerOlder