This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashlib as hasher | |
class Block: | |
def __init__(self, index, timestamp, data, previous_hash): | |
self.index = index | |
self.timestamp = timestamp | |
self.data = data | |
self.previous_hash = previous_hash | |
self.hash = self.hash_block() | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* BuddyPress User Blog - Post Create | |
* | |
* @package WordPress | |
* @subpackage BuddyPress User Blog | |
*/ | |
$theme = wp_get_theme(); // gets the current theme | |
$theme_name = $theme->template; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component, Fragment } from 'react' | |
import { | |
NavLink, | |
Link, | |
BrowserRouter as Router, | |
Route, | |
Switch, | |
Redirect, | |
} from 'react-router-dom' | |
import FeedPage from './FeedPage' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'graphql_init', function() { | |
add_filter( 'graphql_user_fields', function( $fields ) { | |
$fields['userBadges'] = [ | |
'type' => \WPGraphQL\Types::String(), | |
'description' => __( 'The badges of the user', 'gqlbadges' ), | |
'resolve' => function( \WP_User $user ) { | |
// $user = new WP_User($user->ID); | |
// Or... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
php | |
class SubscriptionType extends \WPGraphQL\Type\WPObjectType { | |
private static $fields; | |
public function __construct() { | |
$config = [ | |
'name' => 'SubscriptionType', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class SubscriptionType extends \WPGraphQL\Type\WPObjectType { | |
private static $fields; | |
public function __construct() { | |
$config = [ | |
'name' => 'SubscriptionType', | |
'fields' => self::fields(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react' ; | |
import { | |
NavLink, | |
withRouter | |
} from 'react-router-dom'; | |
import { ApolloProvider } from 'react-apollo'; | |
import ApolloClient from 'apollo-boost'; | |
import { Query } from 'react-apollo'; | |
import { bitesQuery } from './Query'; | |
import Pagination from 'components/Pagination/pagination.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$fields['seriesPart'] = [ | |
'type' => \WPGraphQL\Types::int(), | |
'description' => __( 'The number of the post within its series.' ), | |
'resolve' => function( \WP_Post $post ) { | |
$series_number = get_post_meta( $post->ID, '_series_part', true ); | |
return ! empty ( $series_number ) ? $series_mumber : null; | |
}, | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Medium; | |
class Citation { | |
const SHORTCODE = 'medium-editor'; | |
private $url; | |
public function __construct() | |
{ | |
ini_set( 'display_errors', 1 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { Form } from 'semantic-ui-react'; | |
class Filter extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
searchTerm: '' | |
} | |
this.updateSearchTerm = this.updateSearchTerm.bind(this); |
OlderNewer