Skip to content

Instantly share code, notes, and snippets.

View todomagichere's full-sized avatar
🎯
Focusing

Roberto Pérez todomagichere

🎯
Focusing
View GitHub Profile
@Yizack
Yizack / countries.json
Last active April 27, 2024 07:19
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 2023
{
"countries" : [
{
"name_en": "Afghanistan",
"name_es": "Afganistán",
"continent_en": "Africa",
"continent_es": "África",
"capital_en": "Kabul",
"capital_es": "Kabul",
"dial_code": "+93",
@johnjreiser
johnjreiser / downloadFakePeople.sh
Created June 12, 2019 16:04
Download Fake People - quick script to grab images from This Person Does Not Exist
#!/bin/bash
MAX=10
if [[ ! -z "$1" ]]; then
MAX=$1
fi
for i in $( seq $MAX ); do
FILE=image${i}.jpg
curl 'https://thispersondoesnotexist.com/image' -H 'authority: thispersondoesnotexist.com' -H 'pragma: no-cache' -H 'cache-control: no-cache' -H 'upgrade-insecure-requests: 1' -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36' -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3' -H 'referer: https://thispersondoesnotexist.com/' -H 'accept-encoding: gzip, deflate, br' -H 'accept-language: en-US,en;q=0.9' --compressed -o $FILE
@arfaram
arfaram / FieldValue_translation.md
Last active January 11, 2021 12:24
Get a current translated field data using different way in eZ Platform.

Assume we want to get the translated value of a Text Line (ezstring) field with identifier title.

Using content object

        $contentService = $this->get('ezpublish.api.service.content');
        $content = $contentService->loadContent('<CONTENT-ID>');
        $language = $content->versionInfo->initialLanguageCode;  
        $title = $content->fields['title'][$language]->text;
        //Or