Skip to content

Instantly share code, notes, and snippets.

View jg-valdes's full-sized avatar

Juan Gabriel Valdés Díaz jg-valdes

View GitHub Profile
@Yizack
Yizack / countries.json
Last active June 9, 2024 17:10
List of countries and territories in English and Spanish: name, continent, capital, dial code, country codes, TLD, and area in sq km. Lista de países y territorios en Inglés y Español: nombre, continente, capital, código de teléfono, códigos de país, dominio y área en km cuadrados. Updated 2024
{
"countries" : [
{
"name_en": "Afghanistan",
"name_es": "Afganistán",
"continent_en": "Africa",
"continent_es": "África",
"capital_en": "Kabul",
"capital_es": "Kabul",
"dial_code": "+93",
@charlwillia6
charlwillia6 / translate.py
Last active May 26, 2023 02:21 — forked from vonNiklasson/translate.py
Management script for Django to easily run the 'makemessages'-command for all files in your Django application. #django #translations
'''
translate.py
Management script for Django to easily run the
'makemessages'-command and 'compilemessages'-command for all
files in your Django application.
Put in any registered django app in the location
<app>/management/commands/translate.py
and then use python manage.py translate
to run makemessages on all files in your project
@iNaD
iNaD / request_no_curl.php
Last active February 29, 2024 09:37
Sending a GET/POST Request via PHP without CURL (fopen needs to be enabled)
<?php
$url = 'http://server.com/path';
$data = array('key1' => 'value1', 'key2' => 'value2');
// use key 'http' even if you send the request to https://...
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($data),