Skip to content

Instantly share code, notes, and snippets.

View lgzarturo's full-sized avatar
🥷
Trabajando con React, SpringBoot y Marketing Digital

lgzarturo lgzarturo

🥷
Trabajando con React, SpringBoot y Marketing Digital
View GitHub Profile
@lgzarturo
lgzarturo / one-to-many-relationship-with-jpa
Last active February 24, 2024 19:24
Relación OneToMany para obtener la lista de elementos de la relación con JPA o EntityManager
// Clase Usuario
@Entity
@Table(name = "usuarios")
public class Usuario {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

Keybase proof

I hereby claim:

  • I am lgzarturo on github.
  • I am lgzarturo (https://keybase.io/lgzarturo) on keybase.
  • I have a public key ASD1WXe4pOppjFbIVrRmQ8_whlBVSdWp0vylzPjnc60xrAo

To claim this, I am signing this object:

using System.Net;
using System.IO;
namespace Example
{
class Program
{
public static void functionOne() {
var client = new RestClient("https://api.twilio.com/json/send");
client.Authenticator = new SimpleAuthenticator("username", "myusername", "password", "mypassword");
#!/usr/bin/env python
#_*_ coding:utf-8 _*_
import requests
import argparse
parser = argparse.ArgumentParser(description='Data:')
parser.add_argument('-u', '--url', help='url', required=True)
parser = parser.parse_args()
dict_headers = {}
import json
from googleapiclient.discovery import build
from google.oauth2.service_account import Credentials
def get_service_using_client_id(api_name, api_version, scopes, key_file_location):
credentials = Credentials.from_service_account_info(key_file_location, scopes=scopes)
service = build(api_name, api_version, credentials=credentials)
return service
import colorama
import requests
import time
from console_progressbar import ProgressBar
from urllib.parse import urlparse, urljoin
from bs4 import BeautifulSoup
url = "https://arthurolg.com"
colorama.init()
GREEN = colorama.Fore.GREEN
#!/usr/bin/env python
from pathlib import Path
from watchdog.events import FileSystemEventHandler
from watchdog.observers import Observer
import time
import os
import uuid
python3 -m venv ./venv
source venv/bin/activate
pip3 install -r requirements.txt
docker run -itd --rm --name django_api \
--workdir /home --user $(id -u):$(id -g) \
--mount type=bind,source="$(pwd)/api",target=/home/api \
python:3.9
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Test</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"
integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
function slugify(string) {
const a = 'àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;'
const b = 'aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------'
const p = new RegExp(a.split('').join('|'), 'g')
return string.toString().toLowerCase()
.replace(/\s+/g, '-')
.replace(p, c => b.charAt(a.indexOf(c)))
.replace(/&/g, '-and-')
.replace(/[^\w\-]+/g, '')