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 os | |
import asyncio | |
import json | |
import logging | |
import traceback | |
import requests | |
from datetime import datetime | |
from tortoise import Tortoise | |
from web3 import Web3, HTTPProvider, exceptions |
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
//three class definitions for: | |
// - Primitive variables (W) | |
// - Conservative variables (U) | |
// - Conservative fluxes (F) | |
class Prim{ | |
public: | |
Prim(double, double, double, double, double, double); | |
double rho1; | |
double rho2; |
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
const mongoose = require('mongoose'); | |
const Schema = mongoose.Schema; | |
let Article = new Schema({ | |
content: { | |
type: String | |
}, | |
author: { | |
type: String | |
} | |
}); |
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
#include <bits/stdc++.h> | |
using namespace std; | |
#define ll long long | |
int main() { | |
ll t; | |
cin>>t; | |
while(t--){ | |
ll n; | |
cin>>n; | |
if(n <= 4) { cout<<-1<<endl; break; } |
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 flask import Flask, render_template, request | |
import json | |
from flask_cors import CORS | |
import numpy as np | |
import cv2 # Library for image processing | |
from math import floor | |
import threading | |
from http.server import BaseHTTPRequestHandler,HTTPServer | |
from socketserver import ThreadingMixIn | |
from io import StringIO,BytesIO |
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
# /etc/nginx/sites-enabled/some.domain | |
# Change the server name {some.domain} | |
# Change the {host.of.notebook} and {port} in the following locations | |
server { | |
listen 80; | |
# Change the server name {some.domain} | |
server_name some.domain; | |
location / { | |
# Change the {host.of.notebook} and {port} | |
proxy_pass http://host.of.notebook:port; |
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
Apple Inc. is an American multinational technology company headquartered in Cupertino, California, that designs, develops, and sells consumer electronics, computer software, and online services. The company's hardware products include the iPhone smartphone, the iPad tablet computer, the Mac personal computer, the iPod portable media player, the Apple Watch smartwatch, the Apple TV digital media player, and the HomePod smart speaker. Apple's software includes the macOS and iOS operating systems, the iTunes media player, the Safari web browser, and the iLife and iWork creativity and productivity suites, as well as professional applications like Final Cut Pro, Logic Pro, and Xcode. Its online services include the iTunes Store, the iOS App Store and Mac App Store, Apple Music, and iCloud. | |
Apple was founded by Steve Jobs, Steve Wozniak, and Ronald Wayne in April 1976 to develop and sell Wozniak's Apple I personal computer. It was incorporated as Apple Computer, Inc., in January 1977, and sales of its computers, i |
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
function isChatMessage(message) { | |
if (message.__x_isSentByMe) { | |
return false; | |
} | |
if (message.__x_isNotification) { | |
return false; | |
} | |
if (!message.__x_isUserCreatedType) { | |
return false; | |
} |
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
test_files = os.listdir(f'{PATH}/test') | |
import re | |
def atoi(text): | |
return int(text) if text.isdigit() else text | |
def natural_keys(text): | |
return [ atoi(c) for c in re.split('(\d+)', text) ] | |
test_files.sort(key=natural_keys) |
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
$("#icon_color").spectrum({ | |
showInput: true, | |
className: "full-spectrum", | |
showInitial: true, | |
showPalette: true, | |
showSelectionPalette: true, | |
maxSelectionSize: 10, | |
preferredFormat: "hex", | |
localStorageKey: "spectrum.demo", | |
move: function (color) { |
NewerOlder