profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/shadyvb/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Shady Sharaf shadyvb @humanmade Cairo, Egypt http://sharaf.me

Chassis/Chassis 613

📦 Chassis is a virtual server for your WordPress site, built using Vagrant.

humanmade/hm-content-import 18

Migration framework for WordPress, attempts to reduce overhead in migrating content from differing data sources

NapsterAhmed/Latitude 1

Latitude is based on Google API Latitude service to get Google users location and history

shadyvb/42us-stupidity 1

a tool set for spawning a set of checker files to check against the output of a student's exercises

shadyvb/ajax-chosen 1

A complement to the jQuery library Chosen that adds ajax autocomplete

shadyvb/Chassis 1

Chassis is a virtual server for your WordPress site, built using Vagrant.

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commenthumanmade/altis-enhanced-search

Add note about protected meta and how to index it

 Content that is indexed in the search index by default: - Terms - Term Meta +**Note:** Post meta that is "protected"--i.e. has a key beginning with `_`--will not be indexed automatically. To index these fields, use the `ep_prepare_meta_allowed_protected_keys` filter. It will accept a value of boolean `true` (which will index *all* protected meta) or an array containing the keys of specific protected meta fields you want to index.

ie, replacing ie with eg

alwaysblank

comment created time in 21 hours

PullRequestReviewEvent

Pull request review commenthumanmade/altis-enhanced-search

Add note about protected meta and how to index it

 Content that is indexed in the search index by default: - Terms - Term Meta +**Note:** Post meta that is "protected"--i.e. has a key beginning with `_`--will not be indexed automatically. To index these fields, use the `ep_prepare_meta_allowed_protected_keys` filter. It will accept a value of boolean `true` (which will index *all* protected meta) or an array containing the keys of specific protected meta fields you want to index.

It is worth noting that protected meta keys doesn't necessarily start with an underscore ?

alwaysblank

comment created time in 21 hours

PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commenthumanmade/aws-analytics

Search specific indexes rather than wildcard query

 function query( array $query, array $params = [], string $path = '_search', stri 	// Sanitize path. 	$path = trim( $path, '/' ); +	$index_paths = [ 'analytics-*' ];++	// Try to extract specific index names to query if possible.+	if ( isset( $query['query']['bool']['filter'] ) && is_array( $query['query']['bool']['filter'] ) ) {+		foreach ( $query['query']['bool']['filter'] as $filter ) {+			if ( ! isset( $filter['range']['event_timestamp'] ) ) {+				continue;+			}++			// Reset index paths.+			$index_paths = [];++			// Prevent fatal errors if an index doesn't exist.+			$params['ignore_unavailable'] = 'true';++			$from = absint( $filter['range']['event_timestamp']['gte'] ?? $filter['range']['event_timestamp']['gt'] ?? 0 );+			$to = absint( $filter['range']['event_timestamp']['lte'] ?? $filter['range']['event_timestamp']['lt'] ?? milliseconds() );++			$available_indices = get_indices();++			foreach ( $available_indices as $index ) {+				$day = strtotime( str_replace( 'analytics-', '', $index ) ) * 1000;+				if ( $day >= $from && $day <= $to ) {+					$index_paths[] = $index;+				}+			}++			// Revert to all index if there are no matches.+			if ( empty( $index_paths ) ) {+				$index_paths[] = 'analytics-*';+			}++			break;+		}+	}+ 	// Get URL.-	$url = add_query_arg( $params, get_elasticsearch_url() . '/analytics*/' . $path );+	$url = add_query_arg( $params, sprintf(+		'%s/%s/%s',+		get_elasticsearch_url(),+		implode( ',', $index_paths ),

If it exceeds the cap we can query for the wildcard instead, otherwise we'd still have the error/null return.

roborourke

comment created time in 3 days

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commenthumanmade/aws-analytics

Search specific indexes rather than wildcard query

 function query( array $query, array $params = [], string $path = '_search', stri 	// Sanitize path. 	$path = trim( $path, '/' ); +	$index_paths = [ 'analytics-*' ];++	// Try to extract specific index names to query if possible.+	if ( isset( $query['query']['bool']['filter'] ) && is_array( $query['query']['bool']['filter'] ) ) {+		foreach ( $query['query']['bool']['filter'] as $filter ) {+			if ( ! isset( $filter['range']['event_timestamp'] ) ) {+				continue;+			}++			// Reset index paths.+			$index_paths = [];++			// Prevent fatal errors if an index doesn't exist.+			$params['ignore_unavailable'] = 'true';++			$from = absint( $filter['range']['event_timestamp']['gte'] ?? $filter['range']['event_timestamp']['gt'] ?? 0 );+			$to = absint( $filter['range']['event_timestamp']['lte'] ?? $filter['range']['event_timestamp']['lt'] ?? milliseconds() );++			$available_indices = get_indices();++			foreach ( $available_indices as $index ) {+				$day = strtotime( str_replace( 'analytics-', '', $index ) ) * 1000;+				if ( $day >= $from && $day <= $to ) {+					$index_paths[] = $index;+				}+			}++			// Revert to all index if there are no matches.+			if ( empty( $index_paths ) ) {+				$index_paths[] = 'analytics-*';+			}++			break;+		}+	}+ 	// Get URL.-	$url = add_query_arg( $params, get_elasticsearch_url() . '/analytics*/' . $path );+	$url = add_query_arg( $params, sprintf(+		'%s/%s/%s',+		get_elasticsearch_url(),+		implode( ',', $index_paths ),

Should we add any guards against too many selected indices here ?

roborourke

comment created time in 3 days

Pull request review commenthumanmade/aws-analytics

Search specific indexes rather than wildcard query

 function get_elasticsearch_version() : ?string { 	return $version; } +/**+ * Fetch available analytics indices.+ *+ * @return array+ */+function get_indices() : array {+	$cache = wp_cache_get( 'analytics-indices', 'altis' );+	if ( $cache ) {+		return $cache;+	}++	$indices_response = wp_remote_get( get_elasticsearch_url() . '/analytics-*?filter_path=*.aliases' );++	if ( is_wp_error( $indices_response ) ) {+		trigger_error( sprintf(+			'Analytics: Could not fetch analytics indexes: %s',+			// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped+			$indices_response->get_error_message()+		), E_USER_WARNING );+		return [];+	}++	if ( wp_remote_retrieve_response_code( $indices_response ) !== 200 ) {+		trigger_error( sprintf(+			"Analytics: ElasticSearch index deletion failed:\n%s",

This was carried over and probably needs to be reconsidered now.

roborourke

comment created time in 3 days

PullRequestReviewEvent

pull request commenthumanmade/altis-cloud

Check inline index settings option to bypass package creation

In hindsight, I should've explained my question better 😅 that it is about the package data not the indexed data. But yeah, glad we aligned eventually.

roborourke

comment created time in 3 days

release humanmade/authorship

0.2.8

released time in 7 days

push eventhumanmade/authorship

Shady Sharaf

commit sha a031a91773e209d2d981055ac1368423b97e4a63

Allow filtering user collection params like core

view details

Shady Sharaf

commit sha f46348dbacb40cbb72c2df605368b42c8d05b356

Merge pull request #86 from humanmade/filter-rest-collection-params

view details

Shady Sharaf

commit sha 968c4823cbdbf5e9f6a466092e37758e04399dc0

The v0.2.8 release

view details

push time in 7 days

push eventhumanmade/authorship

Shady Sharaf

commit sha a031a91773e209d2d981055ac1368423b97e4a63

Allow filtering user collection params like core

view details

Shady Sharaf

commit sha f46348dbacb40cbb72c2df605368b42c8d05b356

Merge pull request #86 from humanmade/filter-rest-collection-params

view details

Shady Sharaf

commit sha 968c4823cbdbf5e9f6a466092e37758e04399dc0

The v0.2.8 release

view details

push time in 7 days

push eventhumanmade/authorship

Shady Sharaf

commit sha 968c4823cbdbf5e9f6a466092e37758e04399dc0

The v0.2.8 release

view details

push time in 7 days

push eventhumanmade/authorship

Shady Sharaf

commit sha a031a91773e209d2d981055ac1368423b97e4a63

Allow filtering user collection params like core

view details

Shady Sharaf

commit sha f46348dbacb40cbb72c2df605368b42c8d05b356

Merge pull request #86 from humanmade/filter-rest-collection-params

view details

push time in 7 days

delete branch humanmade/authorship

delete branch : filter-rest-collection-params

delete time in 7 days

create barnchhumanmade/authorship

branch : filter-rest-collection-params

created branch time in 7 days

pull request commenthumanmade/altis-cloud

Check inline index settings option to bypass package creation

Hmmmm, trying to think what happens to existing data on activation of inline settings 🤔 Do we need to consider a migration path here ?

roborourke

comment created time in 7 days

create barnchhumanmade/altis-sso

branch : backport-71-to-v5-branch

created branch time in 9 days

pull request commenthumanmade/altis-sso

Update docs on SSO metadata file location and per-env handling

@roborourke Interesting, I guess I didn't get how it all works, assumed this will merge to master so the current version is covered, but can see now that this isn't the case.

shadyvb

comment created time in 9 days

pull request commenthumanmade/altis-enhanced-search

Default to inline index settings

@roborourke I thought about that, but decided to keep it in place so the switching happens on the software side, rather than cloud. Can't see a downside to keeping it uploading packages, so if the switch happens here ( due to filesize limits, etc ) the package will already be stored in Cloud.

Does that make sense ?

shadyvb

comment created time in 9 days

push eventhumanmade/altis-sso

Shady Sharaf

commit sha 5eb74d7038f84fb94a18c71d323fe36a72bdf138

Update docs on SSO metadata file location and per-env handling

view details

Shady Sharaf

commit sha bdb1b2fe28f20f325df31379312cd972fc6f6715

Merge branch 'altis-sso-69/update-docs-on-metadata-files-docs-only' into altis-sso-69/update-docs-on-metadata-files # Conflicts: # docs/saml-2-0.md

view details

push time in 9 days