This file contains hidden or 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
| """Extract nested values from a JSON tree.""" | |
| def json_extract(obj, key): | |
| """Recursively fetch values from nested JSON.""" | |
| arr = [] | |
| def extract(obj, arr, key): | |
| """Recursively search for values of key in JSON tree.""" | |
| if isinstance(obj, dict): |
This file contains hidden or 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
| { | |
| "id": "printrbot_simple_metal", | |
| "name": "Printrbot Simple Metal", | |
| "version": 1, | |
| "manufacturer": "Other", | |
| "inherits": "fdmprinter.json", | |
| "machine_settings": { | |
| "machine_width": { | |
| "default": 250 | |
| }, |
This file contains hidden or 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 | |
| // Allow subscribers to see Private posts and pages | |
| $subRole = get_role( 'subscriber' ); | |
| $subRole->add_cap( 'read_private_posts' ); | |
| $subRole->add_cap( 'read_private_pages' ); | |
| // Redirect to home page on login | |
| function loginRedirect( $redirect_to, $request_redirect_to, $user ) { | |
| if ( is_a( $user, 'WP_User' ) && $user->has_cap( 'edit_posts' ) === false ) { |