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
version: '3.4' | |
# This is an example docker-compose file for IPFS Cluster | |
# It runs two Cluster peers (cluster0, cluster1) attached to two | |
# IPFS daemons (ipfs0, ipfs1). | |
# | |
# It expects a "compose" subfolder as follows where it will store configurations | |
# and states permanently: | |
# | |
# compose/ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>IPFS Tree builder Example</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqtree/1.4.12/jqtree.css" integrity="sha256-HXkFXoUJm+hZNZftCzYGMRpnrDf9JVQK6Zzsm5czcRo=" crossorigin="anonymous" /> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqtree/1.4.12/tree.jquery.js" integrity="sha256-MVNe3e6Cast71iAc+Jy+z9+BhDfh7y5iz8GBz8mBZ9M=" crossorigin="anonymous"></script> | |
</head> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>IPFS Vannila JavaScript Example</title> | |
<form id="form"> | |
<label for="avatar">Choose a JSON file</label> | |
<input type="file" id="input"> | |
<div id="hash" style="margin-top: 50px"></div> | |
<a href="" style="margin-top: 50px" id="link"></a> |
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 django.conf import settings | |
from django.db.models import ( | |
CharField, ForeignKey, CASCADE, PositiveSmallIntegerField | |
) | |
from django.utils.translation import ugettext_lazy as _ | |
from django.utils.functional import cached_property | |
from example.core.models import Base, HashableModel | |
from example.wallets.services import ( | |
generate_new_address, |
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 django.db.models import ForeignKey, CASCADE, SET_NULL, ManyToManyField | |
from django.utils.translation import ugettext_lazy as _ | |
from model_utils.fields import StatusField | |
from model_utils import Choices | |
from example.core.models import BaseModel, HashableModel | |
class Order(BaseModel, HashableModel): # type: ignore |
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 django.db import ProgrammingError, models | |
from django.db.models.constants import LOOKUP_SEP | |
from django.db.models.query import normalize_prefetch_lookups | |
from rest_framework import serializers | |
from rest_framework.utils import model_meta | |
class OptimizeRelatedModelViewSetMetaclass(type): | |
""" | |
This metaclass optimizes the queryset using `prefetch_related` and `select_related`. |
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
.custom-loader { | |
animation: loader 1s infinite; | |
display: flex; | |
} | |
@-moz-keyframes loader { | |
from { | |
transform: rotate(0); | |
} | |
to { | |
transform: rotate(360deg); |
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 time | |
from currency import get_currency_info, get_currency_list | |
import telepot | |
from telepot.namedtuple import ReplyKeyboardMarkup, KeyboardButton | |
BOT_API_KEY = "" # ADD YOUR TOKEN !!! | |
MARKUP_ROW_COLS = 5 |
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
function getRuntimeData() { | |
var roomId = "11338:jnynj5hc0"; | |
var xhr = new XMLHttpRequest(); | |
xhr.open("GET", "https://start.bizon365.ru/admin/room/" + roomId + "/getruntimedata", false); | |
xhr.withCredentials = true; | |
xhr.onreadystatechange = function () { | |
if (xhr.readyState == 4 && xhr.status == 200) { |
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
var cScriptLoader = (function () { | |
function cScriptLoader(files) { | |
var _this = this; | |
this.log = function (t) { | |
console.log("ScriptLoader: " + t); | |
}; | |
this.withNoCache = function (filename) { | |
if (filename.indexOf("?") === -1) | |
filename += "?no_cache=" + new Date().getTime(); | |
else |