A URL shortening service transforms long URLs into concise, easy-to-share links. Think of services like TinyURL or Bitly. This project provides a RESTful API and a simple web interface for creating, managing, and tracking short URLs.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# frozen_string_literal: true | |
require 'rails/all' | |
# Basic Application Setup | |
class RecipeSharingApp < Rails::Application | |
config.load_defaults 6.1 | |
config.api_only = true | |
end |
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
package main | |
import ( | |
"encoding/json" | |
"github.com/astaxie/beego" | |
"github.com/astaxie/beego/orm" | |
"time" | |
) | |
// BookController handles operations related to books |
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 | |
// Enable CORS and set content type | |
header('Access-Control-Allow-Origin: *'); | |
header('Content-Type: application/json'); | |
// SQLite database connection | |
$db = new PDO('sqlite:blog.db'); | |
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | |
// Initialize tables |
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 hashlib | |
import json | |
from time import time | |
import binascii | |
from collections import OrderedDict | |
from uuid import uuid4 | |
from cryptography.hazmat.primitives import hashes | |
from cryptography.hazmat.primitives.asymmetric import ec | |
from cryptography.hazmat.primitives import serialization | |
from cryptography.exceptions import InvalidSignature |
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 transformers import pipeline, T5Tokenizer | |
def summarize_text(text, max_length=130, min_length=30, model_name='t5-small'): | |
""" | |
Summarizes long texts using a pre-trained model from Hugging Face's Transformers. | |
This enhanced version includes functionality to handle large texts by breaking them | |
into manageable chunks, addressing the token limit constraint of the model. | |
Parameters: | |
- text: The text to be summarized. |
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 os | |
def batch_rename_files(directory, prefix): | |
""" | |
Renames all files in the given directory with the given prefix followed by a sequential number, | |
keeping their original file extensions intact. This can be useful for organizing a large number | |
of files in a systematic way, such as photos from an event, downloaded files, etc. | |
Parameters: | |
- directory: The path to the directory containing the files to be renamed. |
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
const twoLetterCountryCodes = [ | |
{ name: 'Afghanistan', code: 'AF' }, | |
{ name: 'Albania', code: 'AL' }, | |
{ name: 'Algeria', code: 'DZ' }, | |
{ name: 'American Samoa', code: 'AS' }, | |
{ name: 'Andorra', code: 'AD' }, | |
{ name: 'Angola', code: 'AO' }, | |
{ name: 'Anguilla', code: 'AI' }, | |
{ name: 'Antarctica', code: 'AQ' }, | |
{ name: 'Antigua and Barbuda', code: 'AG' }, |
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
const twoLetterLangCodes = [ | |
{ "code": "aa", "name": "Afar" }, | |
{ "code": "ab", "name": "Abkhazian" }, | |
{ "code": "ae", "name": "Avestan" }, | |
{ "code": "af", "name": "Afrikaans" }, | |
{ "code": "ak", "name": "Akan" }, | |
{ "code": "am", "name": "Amharic" }, | |
{ "code": "an", "name": "Aragonese" }, | |
{ "code": "ar", "name": "Arabic" }, | |
{ "code": "as", "name": "Assamese" }, |
NewerOlder