Skip to content

Instantly share code, notes, and snippets.

View rolandinsh's full-sized avatar
🧔
Remote developer (LEMP, Node.js, Neo4j [graph])

Rolands rolandinsh

🧔
Remote developer (LEMP, Node.js, Neo4j [graph])
View GitHub Profile
@rolandinsh
rolandinsh / get_meta_values.php
Created November 11, 2018 15:04 — forked from nciske/get_meta_values.php
WordPress Getting all values for a custom field key
// http://wordpress.stackexchange.com/questions/9394/getting-all-values-for-a-custom-field-key-cross-post
function get_meta_values( $key = '', $type = 'post', $status = 'publish' ) {
global $wpdb;
if( empty( $key ) )
return;
$r = $wpdb->get_col( $wpdb->prepare( "
SELECT pm.meta_value FROM {$wpdb->postmeta} pm
LEFT JOIN {$wpdb->posts} p ON p.ID = pm.post_id
WHERE pm.meta_key = '%s'
<?php
function get_url_contents($url){
if (function_exists('file_get_contents')) {
$result = @file_get_contents($url);
}
if ($result == '') {
$ch = curl_init();
$timeout = 30;
curl_setopt($ch, CURLOPT_URL, $url);
@rolandinsh
rolandinsh / namedays-extended.json
Last active March 25, 2022 16:39 — forked from laacz/namedays-extended.json
Vārdadienas JSON (par prieku Sergejam)
{
"01-01": ["Afra", "Afrodīte", "Agunda", "Agurs", "Januārija", "Laimstars", "Soleda", "Solita", "Solveta"],
"01-02": ["Induls", "Īva", "Ivaise", "Ivija", "Īvija", "Ivika", "Īvis", "Ivisa", "Ivs"],
"01-03": ["Ambrozijs", "Ammonārija", "Ammunārija", "Mežvaldis", "Mieriņš", "Miermīlis", "Miernesis", "Miervalds", "Ringla", "Ringo", "Rinolds"],
"01-04": ["Amina", "Amīna", "Amirans", "Amirs", "Blāzma", "Ilveta", "Ilvis", "Spodrīte"],
"01-05": ["Amrita", "Amunds", "Anarita", "Saimona", "Saimons", "Seimanis", "Semions", "Semjons", "Simeons", "Simions", "Zintauts", "Zinturs"],
"01-06": ["Arams", "Aranta", "Arfa", "Arnīda", "Arnija", "Arnika"],
"01-07": ["Julians", "Jūlians", "Jūliāns", "Sigmars", "Sigmārs", "Zigmāra", "Zigmāris", "Zigmars"],
"01-08": ["Ants", "Aristarhs", "Aristida", "Aristīda", "Aristids", "Aristīds", "Aristons", "Aristrīds", "Arjana", "Arlands", "Arleta", "Arlēna", "Arlijs", "Arlita", "Gatiņš", "Īvande", "Ivanna", "Ivase", "Ivena"],
"01-09": ["Aksela", "Akselis",
@rolandinsh
rolandinsh / PHP-CURL-Tor-Tutorial.md
Last active August 11, 2023 18:44 — forked from megaxorg/PHP-CURL-Tor-Tutorial.md
PHP: CURL Requests with Tor

#CURL Connections with Tor

Install Apache, PHP, CURL & Tor with apt-get

sudo apt-get install -y apache2 php php-curl tor

Tor creates a proxy on your mashine with port 9050 for SOCKS5 connections.