Skip to content

Instantly share code, notes, and snippets.

View Cyclonecode's full-sized avatar
🏠
Working from home

Krister Andersson Cyclonecode

🏠
Working from home
View GitHub Profile
@Cyclonecode
Cyclonecode / wordpress-language-codes.csv
Created June 14, 2023 15:06 — forked from danielbachhuber/wordpress-language-codes.csv
Language / locale codes used in WordPress
language english_name native_name
af Afrikaans Afrikaans
ar Arabic العربية
ary Moroccan Arabic العربية المغربية
as Assamese অসমীয়া
az Azerbaijani Azərbaycan dili
azb South Azerbaijani گؤنئی آذربایجان
bel Belarusian Беларуская мова
bg_BG Bulgarian Български
bn_BD Bengali (Bangladesh) বাংলা
# get repository content
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.github.com/repos/$this->username/$this->repository/contents/README.md");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Accept: application/vnd.github+json',
'X-Github-Api-Version: 2022-11-28',
'Authorization: Bearer ' . $this->token,
]);
curl_setopt($ch, CURLOPT_USERAGENT, 'my-user-agent');
// Example on how to reuse options between curl requests: https://stackoverflow.com/a/28301110/1047662
#include <curl.h>
#include <vector>
#include <string>
size_t writeCallback(char* contents, size_t size, size_t nmemb, std::string* buffer) {
size_t realsize = size * nmemb;
if(buffer == NULL) {
return 0;
}