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
# -*- coding: utf-8 -*- | |
# This alphabet is handpicked to be visually distinctive | |
_alphabet = ['☕️', '🐜', '✉️', '🎋', '👟', '📺', '😅', '✌️', '🌰', '🍇', | |
'🐶', '👢', '💉', '💈', '⚡️', '🌹', '🗽', '👌', '💔', '🎈', | |
'🥑', '⌚️', '🚿', '🐫', '🔧', '🔌', '😈', '💳', '😊', '👍', | |
'🍞', '😘', '🎯', '⛄️', '🔦', '🐳', '🍌', '‼️', '🥝', '✂️', | |
'🎄', '💥', '🍷', '🚦', '📬', '🎡', '🎆', '🔍', '🍻', '🏭', | |
'🎶', '💡', '🏄', '👂', '🗡️', '🍒', '👑', '🚃', '🙏', '❌', | |
'💾', '🙋', '👸', '🔪', '👎', '🌊', '🍕', '⚽️', '🎁', '🏈', |
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
pragma solidity ^0.4.0; | |
contract Ownable { | |
/// @dev `owner` is the only address that can call a function with this | |
/// modifier | |
modifier onlyOwner() { | |
require(msg.sender == owner); | |
_; | |
} |
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 re | |
import sys | |
from datetime import datetime | |
from b2.api import B2Api | |
def parse(inp, mformat=None, thing=None): | |
if thing is None: | |
thing = 'th' | |
if mformat is None: |
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 telegram.ext import Updater, CommandHandler, MessageHandler | |
from sqlalchemy import Column, BigInteger | |
from sqlalchemy import create_engine | |
from sqlalchemy.orm import scoped_session, sessionmaker | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlite3 import IntegrityError | |
import logging | |
import random |
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 sqlalchemy import Column, PickleType | |
def upsert(obj): | |
"""Inserts the `obj` or updates if it already exists | |
Postgresql is the only database that supports upserts like this, but sqlite is used locally so a "hack" is used to support | |
an alternative check and update/insert method. This cannot be used when multithreading.""" | |
# SQLalchemy model objects have the table object in __table__ | |
table = obj.__table__ | |
# Filter out private values from the object |
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
extern crate tokio; | |
extern crate dhcp_proto; | |
use std::io; | |
use tokio::codec::{Decoder, Encoder}; | |
use bytes::{BytesMut}; | |
use dhcp_proto::{DHCPMessage, nom, parse_dhcp}; | |
use dhcp_proto::builder::DHCPMessageBuilder; |
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
let | |
wireguardPort = 51820; | |
tunnels = [ { | |
ipv4Addr = { addr = "195.201.249.203"; suffix = 32; }; | |
ipv6Addr = { addr = "2a01:4f8:c2c:2b57::2"; suffix = 128; }; | |
wgPublicKey = "3WWr1zr3ry6KeAwr3Cw3mQsnBeLLUYs1DGa7iEwyAWA="; | |
} ]; | |
mkAddrWithSuffix = (x: "${x.addr}/${toString x.suffix}" ); |
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
#!/usr/local/bin/bash | |
# Donations are always apreciated: 337tQLpE6u7itDzju1d3zdnWBr1qR9mNNW | |
# Can be changed to any currency both Bisq and Coinbase support (usd, eur are tested) | |
currency="eur" | |
alt_currency="usd" | |
tickers=$(curl -sS "https://markets.bisq.network/api/ticker/") | |
coinbase=$(curl -sS "https://api.coinbase.com/v2/prices/BTC-${currency}/buy") |
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
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity ^0.7.0; | |
import "Owner.sol"; | |
/** | |
* Track habits with a financial stake if you fail. | |
*/ | |
contract Habits is Owner { | |
struct Habit { |