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
# This file is maintained as an up-to-date snapshot of the default | |
# homeserver.yaml configuration generated by Synapse. You can find a | |
# complete accounting of possible configuration options at | |
# https://element-hq.github.io/synapse/latest/usage/configuration/config_documentation.html | |
# | |
# It is *not* intended to be copied and used as the basis for a real | |
# homeserver.yaml. Instead, if you are starting from scratch, please generate | |
# a fresh config using Synapse by following the instructions in | |
# https://element-hq.github.io/synapse/latest/setup/installation.html. | |
# |
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
--[[ | |
Neovim configuration file using Packer.lua | |
This configuration includes support for: | |
- Git | |
- Rust language | |
- JavaScript | |
- LaTeX |
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
use axum::{ | |
extract::{Extension, Json, State}, | |
http::StatusCode, | |
middleware::{self, Next}, | |
response::{IntoResponse, Response}, | |
routing::{get, post}, | |
Router, | |
}; | |
use jsonwebtoken::{decode, encode, Algorithm, DecodingKey, EncodingKey, Header, Validation}; | |
use serde::{Deserialize, Serialize}; |
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
<?php | |
if (class_exists('Memcache')) { | |
// Create a new Memcache instance | |
$memcache = new Memcache(); | |
// Add a Memcache server | |
$memcache->connect('127.0.0.1', 11211); | |
// Test storing a value | |
$key = 'test_key'; |
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
xclip -selection c < file_name.extension | |
sometimes the content of the file get too big and it's not easy to select the text you want to copy with mouse. this command | |
is a handy way to do that. |
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 flask import Flask, request, jsonify, make_response, send_from_directory | |
from werkzeug.utils import secure_filename | |
import os | |
import secrets # For secure random filename generation | |
app = Flask(__name__) | |
UPLOAD_FOLDER = "uploads" # Change this to your desired upload folder | |
ALLOWED_EXTENSIONS = set(['mkv', 'txt', 'pdf', 'jpg', 'png']) # Allowed file extensions |
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
> php -S localhost:8000 | |
to run php in a directory. | |
> SELECT user FROM mysql. user; | |
> or SELECT user,host FROM mysql. user; | |
in mysql to list users. | |
Docker: | |
$ docker system df | |
to run df (viewing filesystem usage) on docker. |
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
#include<iostream> | |
#include<queue> | |
#include<cassert> | |
using namespace std; | |
int main() { | |
queue<int>myQueue; | |
int n, k; | |
int temp; | |
scanf( "%d %d", &k, &n); | |
int MAX_K = 1000000000; |