Are you over 18 and want to see adult content?
More Annotations
A complete backup of aa-digitalphoto.gr
Are you over 18 and want to see adult content?
A complete backup of aquaponic.com.au
Are you over 18 and want to see adult content?
A complete backup of private-patient.com
Are you over 18 and want to see adult content?
A complete backup of customerthink.com
Are you over 18 and want to see adult content?
A complete backup of dubaishishalounge.ch
Are you over 18 and want to see adult content?
Favourite Annotations
A complete backup of https://panamza.com
Are you over 18 and want to see adult content?
A complete backup of https://sydsvenskan.se
Are you over 18 and want to see adult content?
A complete backup of https://causefreudienne.net
Are you over 18 and want to see adult content?
A complete backup of https://ikitesurf.com
Are you over 18 and want to see adult content?
A complete backup of https://openhousechicago.org
Are you over 18 and want to see adult content?
A complete backup of https://safecomputingtips.com
Are you over 18 and want to see adult content?
A complete backup of https://wsbonline.com
Are you over 18 and want to see adult content?
A complete backup of https://carnifest.com
Are you over 18 and want to see adult content?
A complete backup of https://kittenrescue.org
Are you over 18 and want to see adult content?
A complete backup of https://nibblesbynic.com
Are you over 18 and want to see adult content?
A complete backup of https://timbertax.org
Are you over 18 and want to see adult content?
A complete backup of https://mvdinform.ru
Are you over 18 and want to see adult content?
Text
TREPMAL.COM
1. Get out more. I’m fortunate to work remotely. That is, I’m not bound to a physical office. Other people in this position use co-working spaces to make it easier to focus, or to have backdrops for video calls that don’t include pets or dirty laundry. ADD NEW DEFAULT AVATAR Installation. Upload kl_addnewdefaultavatar.php to the /wp-content/plugins/. Activate the plugin through the ‘Plugins’ menu in WordPress. Go to Settings > Discussion > Avatars. Supply the name and URL for the avatar you’d rather use. Save. (Some themes won’t resize your image to fit, so it’s best to use an image that’s already the THINGS I’VE LEARNED BY WORKING FROM HOME I’ve been working from home full-time for most of the past 4.5 years. I haven’t reached any special milestone, but nevertheless I’m going to compile a list of some of the things I’ve learned, some bits of advice, and general observations. In no particular order, numbered for reference: Playing fetch is a good way to get out of thehouse
GETTING STARTED WITH WP-CLI Download. First, we need to download the application. WP-CLI is available as phar file, that is, a php archive – all of the files needed bundled into one easy to manage file. You may also clone the git repo if you wish, but I’m not covering that here. Go to the STRONGER THAN DIRT… I MEAN AJAX Stronger than dirt. I mean Ajax. I first learned about Ajax at a WordCamp (yay!), but I didn’t fully grasp how to implement it. There was a helper script provided, and I figured out how to make it work for my plugins, but all I really knew was copy & paste. It was at least a good 6 months before I dug in and looked at the WordPress AjaxAPI.
THINGS YOU SHOULD KNOW ABOUT THE COMMAND LINE Things You Should Know About the Command Line. The command line is really powerful and there are a quite a few things made easier by using it. When I started learning things, I did a lot of copy-and-paste. It got the job done (usually), but I rarely understood what I was doing or why it worked. So I want to outline a handful ofbasic
K.TREPMAL.COM
Search for: Recent Comments. Kailey Lampert on truck-on-ice.jpg; April 2021; S M T W T F S : 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:15: 16: 17: 18: 19
AUTOMATING BACKUPS TO AMAZON S3 Lastly, we need to sync these backups to S3. /usr/local/bin/aws s3 sync /var/www/_backups s3://BUCKET-NAME. I find using the full path to aws to be more helpful. sync with no options will only add or update files, passing --delete will remove files from the S3 bucket that are not in your backup directory. ADD THE “LOST PASSWORD?” LINK TO WP_LOGIN_FORM() OUTPUT Add the “Lost Password?”. Link to wp_login_form () Output | trepmal*. Add the “Lost Password?”. Link to wp_login_form () Output. If you’re using the handy wp_login_form () function to create a custom log in page, you may have noticed that you don’t get the “Lost Password?” link. Doesn’t take much to add it back: LUCY'S & BIKER'S PUPS Ducky’s First Litter. Bruiser. ShaboobooTREPMAL.COM
1. Get out more. I’m fortunate to work remotely. That is, I’m not bound to a physical office. Other people in this position use co-working spaces to make it easier to focus, or to have backdrops for video calls that don’t include pets or dirty laundry. ADD NEW DEFAULT AVATAR Installation. Upload kl_addnewdefaultavatar.php to the /wp-content/plugins/. Activate the plugin through the ‘Plugins’ menu in WordPress. Go to Settings > Discussion > Avatars. Supply the name and URL for the avatar you’d rather use. Save. (Some themes won’t resize your image to fit, so it’s best to use an image that’s already the THINGS I’VE LEARNED BY WORKING FROM HOME I’ve been working from home full-time for most of the past 4.5 years. I haven’t reached any special milestone, but nevertheless I’m going to compile a list of some of the things I’ve learned, some bits of advice, and general observations. In no particular order, numbered for reference: Playing fetch is a good way to get out of thehouse
GETTING STARTED WITH WP-CLI Download. First, we need to download the application. WP-CLI is available as phar file, that is, a php archive – all of the files needed bundled into one easy to manage file. You may also clone the git repo if you wish, but I’m not covering that here. Go to the STRONGER THAN DIRT… I MEAN AJAX Stronger than dirt. I mean Ajax. I first learned about Ajax at a WordCamp (yay!), but I didn’t fully grasp how to implement it. There was a helper script provided, and I figured out how to make it work for my plugins, but all I really knew was copy & paste. It was at least a good 6 months before I dug in and looked at the WordPress AjaxAPI.
THINGS YOU SHOULD KNOW ABOUT THE COMMAND LINE Things You Should Know About the Command Line. The command line is really powerful and there are a quite a few things made easier by using it. When I started learning things, I did a lot of copy-and-paste. It got the job done (usually), but I rarely understood what I was doing or why it worked. So I want to outline a handful ofbasic
K.TREPMAL.COM
Search for: Recent Comments. Kailey Lampert on truck-on-ice.jpg; April 2021; S M T W T F S : 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:15: 16: 17: 18: 19
AUTOMATING BACKUPS TO AMAZON S3 Lastly, we need to sync these backups to S3. /usr/local/bin/aws s3 sync /var/www/_backups s3://BUCKET-NAME. I find using the full path to aws to be more helpful. sync with no options will only add or update files, passing --delete will remove files from the S3 bucket that are not in your backup directory. ADD THE “LOST PASSWORD?” LINK TO WP_LOGIN_FORM() OUTPUT Add the “Lost Password?”. Link to wp_login_form () Output | trepmal*. Add the “Lost Password?”. Link to wp_login_form () Output. If you’re using the handy wp_login_form () function to create a custom log in page, you may have noticed that you don’t get the “Lost Password?” link. Doesn’t take much to add it back: LUCY'S & BIKER'S PUPS Ducky’s First Litter. Bruiser. Shabooboo THINGS YOU SHOULD KNOW ABOUT THE COMMAND LINE Things You Should Know About the Command Line. The command line is really powerful and there are a quite a few things made easier by using it. When I started learning things, I did a lot of copy-and-paste. It got the job done (usually), but I rarely understood what I was doing or why it worked. So I want to outline a handful ofbasic
THE BASICS OF GIT
Here’s a video that goes over the very basics of using git. It doesn’t go over installation though, so if you haven’t yet installed git, go do that first. From nothing, to a local repo, to a remote repo, to undoing local and pushed commits. ADD THE “LOST PASSWORD?” LINK TO WP_LOGIN_FORM() OUTPUT Add the “Lost Password?”. Link to wp_login_form () Output | trepmal*. Add the “Lost Password?”. Link to wp_login_form () Output. If you’re using the handy wp_login_form () function to create a custom log in page, you may have noticed that you don’t get the “Lost Password?” link. Doesn’t take much to add it back: REMOVING MS-FILES.PHP DEPENDENCY Once you’ve confirmed that nothing has exploded, you can remove the ms-files.php rules from your htaccess or nginx config files. To help out with the database edits, I wrote a plugin. It helped me get this network away from ms-files.php, but I haven’t done a fresh run on any other pre-3.5 network. READ THE SOURCE, USE WITH CAUTION, DON’T NOTES: RENAMING AND RELOCATING DIRECTORIES IN WORDPRESS Methods were initially tested on a multisite-with-subdirectories installation, but are generally applicable to single and subdomain installations as well.HIDING CUSTOM META
“Hiding custom fields: DO use the protected_meta filter. DON’T prefix the key with an underscore.” — me This post assumes you’re familiar with building plugins that TURN THAT SNIPPET INTO A PLUGIN This post is sort of a recap of a talk I gave a couple years ago. Whenever you get a WordPress code snippet, where do you put it? It’s not uncommon all those bits of code to end up cluttering up the functions.php file of your theme, whether out of habit or suggested bytutorials.
ADDING MORE CLASSES TO WP_LIST_PAGES() Download If you’re trying to style nested items in wp_list_pages() the task can be daunting. You’ll apply a style to an * then have to unapply those styles for CHANGE THE VIRTUAL ROBOTS.TXT FILE Hi. I just launched my website and saw that Google webmaster tools is giving me 332 warnings saying my URL’s are blocked by Robots.txt. There is no robots.txt file in my wordpress directory which means virtual robots.txt is used. REDIRECT WHEN SEARCH QUERY ONLY RETURNS ONE MATCH Be careful when using this, as users may not expect this functionality. If there’s only one match for a particular search query, you can save users the* trepmal*
WP_LOCALIZE_SCRIPT(): WHAT CAN YOU DO WITH THAT THIRD ARG? Posted on December 21, 2018// By Kailey Lampert // Tell me what you think Let’s start with this, the param descriptions for wp_localize_script(): * @param string $handle Script handle the data will be attached to. * @param string $object_name Name for the JavaScript object. Passed directly, so it should be qualified JS variable. * Example: '/+/'. * @param array $l10n The data itself. The data can be either a single or multi-dimensional array. * @return bool True if the script was successfully localized, false otherwise.*/
function wp_localize_script( $handle, $object_name, $l10n ) {source
So you’re passing an array, right? Good. If you’re not, tsk tsk. But let’s take a look at the good and thebad…
ARRAY. EXPECTED USAGE, YOU’RE OKAY HERE: wp_localize_script( 'jquery', 'exampleObject1', ); // var exampleObject1 = {"key":"value"}; wp_localize_script( 'jquery', 'exampleObject2', ); // var exampleObject2 = ; STRING. HIT AND MISS: wp_localize_script( 'jquery', 'exampleObject3', 'string' ); // var exampleObject3 = "string"; Above works by coincidence. This shouldn’t be relied upon. wp_localize_script( 'jquery', 'exampleObject4', '' ); // var exampleObject4 = ""; Above throws a warning: > PHP Warning: Cannot assign an empty string to a string offset Reduced example of the difference:$l10n = 'string';
$l10n = $l10n; // okay$l10n = '';
$l10n = $l10n; // warning. There's no character at the zeroth place to replace SCALAR. MISS (MAYBE HIT BECAUSE PHP IS WACKO): wp_localize_script( 'jquery', 'exampleObject5', true ); // var exampleObject5 = true; Above throws warning: > Cannot use a scalar value as an array wp_localize_script( 'jquery', 'exampleObject6', false ); // no error // var exampleObject6 = ; However, the above does not. Reduced example, though it won’t really clarify things:$true = true;
$false = false;
var_dump( is_scalar( $true ) ); // true var_dump( is_scalar( $false ) ); // true $true = 'adsf'; // Cannot use a scalar value as an array $false = 'jkl'; // okay why not var_dump( $true ); // true var_dump( $false ); // Why? No really, I’m asking. ------------------------- So listen to the docs, and use an array. WP-CLI: REQUIRE CONFIRMATION FOR SEARCH-REPLACE Posted on September 20, 2018// By Kailey Lampert // Tell me what you think Worried about accidentally running a real search-replace command? Here’s how you can require confirmation for live-runs: In your config file,add this:
require:
- /path/to/search-replace-confirmation.php In /path/to/search-replace-confirmation.php, add this:$configurator = \WP_CLI::get_configurator(); $argv = array_slice( $GLOBALS, 1 ); list( $args, $assoc_args, $runtime_config ) = $configurator->parse_args( $argv ); $help = array_search( 'help', $args ); $searchreplace = array_search( 'search-replace', $args ); $dry_run = array_search( 'dry-run', $assoc_args ); if (
false !== $searchreplace && // is search-replace false === $dry_run && // isn't already dry run ( false === $help || $help > $searchreplace ) // isn't help command ) {
WP_CLI::confirm( 'Proceed with live run?' ); }
DON’T SHORTCUT HOOK REPLICATION Posted on March 6, 2018// By Kailey Lampert // Tell me what you think A short post in the same vein as my last post, Don’t name form fields “update” or “link” .
We’ve probably all done something like this in one of our plugins: $thing_title = apply_filters( 'the_title', $thing_title ); We want our thing’s title to get the same treatment as any other post title, so we use core’s filter. No big deal, right? Not so much.
In core, it’s actually used like this: return apply_filters( 'the_title', $title, $id ); Importantly, it has an additional argument, $id, passed to it. _source _
Like with the accidental hook duplication in my last post, this means that callbacks expecting 2 arguments will end up throwing errors when the poorly-duplicated hook only provides one. Make sure when duplicating core hooks, all the expected arguments are passed. DON’T NAME FORM FIELDS “UPDATE” OR “LINK” // By Kailey Lampert // Tell me what you think
In WordPress, every form field on the post edit screen results in a hook named pre_post_{$field} on save. Here’s how: * All POSTed fields become part of the $post_data variable: https://xref.trepmal.com/wp/wp-admin/includes/post.php.source/#l191 * $post_data is passed to wp_update_post(): https://xref.trepmal.com/wp/wp-admin/includes/post.php.source/#l377 * wp_update_post() passes that on to wp_insert_post(): https://xref.trepmal.com/wp/wp-includes/post.php.source/#l3654 * wp_insert_post() passes that on to sanitize_post(): https://xref.trepmal.com/wp/wp-includes/post.php.source/#l3073 * sanitize_post() then calls sanitize_post_field() on each item: https://xref.trepmal.com/wp/wp-includes/post.php.source/#l1940 * sanitize_post_field() then creates a variable hook based on the key of each item:
https://xref.trepmal.com/wp/wp-includes/post.php.source/#l2062 That means a field named “update” results in a variable filter hook named pre_post_update with 1 argument passed. However, there’s a core action with that name already, and it passes 2 arguments:
https://xref.trepmal.com/wp/wp-includes/post.php.source/#l3371 Similarly with link, there’s a core filter by that name already: https://xref.trepmal.com/wp/wp-includes/link-template.php.source/#l163 THE PROBLEM?
If I have a form field named “update”, and I (or any plugin I’m running) hook into the core action like this: add_action( 'pre_post_update', 'myplugin_pre_post_update', 10, 2 ); function myplugin_pre_post_update( $post_id, $data ) { // do stuff
}
Then the variable hook will call myplugin_pre_post_update but only pass the 1 argument. As of PHP 7.1, this will cause a fatal error Besides, names as generic as ‘update’ and ‘link’ run the risk of conflict with another plugin. POSSIBLE SOLUTION
If changing the field names isn’t feasible, you can adjust your callback:
add_action( 'pre_post_update', 'myplugin_pre_post_update', 10, 2 ); function myplugin_pre_post_update( $post_id, $data = null ) { if ( is_null( $data ) ) { // null $data means we're on the wrong hook instance, bail! return;
}
// do stuff
}
WORK-LIFE BALANCE AND OTHER RELATED GOALS Posted on March 5, 2018// By Kailey Lampert // 1 response
1. GET OUT MORE.
I’m fortunate to work remotely. That is, I’m not bound to a physical office. Other people in this position use co-working spaces to make it easier to focus, or to have backdrops for video calls that don’t include pets or dirty laundry. Unfortunately, there are no such options where I live. There are a few coffee shops with seating, but the atmosphere isn’t great. As a result, I spend all day every day at home. Really.
My car is currently sitting in the garage, has about a quarter tank of fuel. I last filled it at the beginning of November (2017). I’m not confident that if I tried to go anywhere right now that my car would start. I’m not withing walking distance of anything (well, I’ve definitely taken walks into town, but it’s a couple hours), including the nearest bus stop. No Uber around here either. My circumstances are simply that I don’t need to leave much, when I do, I can often carpool. I almost used my car yesterday, but I was blocked in by a guest so I borrowed someone else’s car for the errand. The goal to get out more isn’t just about weekends. Though that’s certainly something I should do more. But even during the week, grab my laptop, drive to the waterfront, work a bit. Grab a coffee, top off the battery, drive to a viewpoint, work a bit. I’m really only limited by my cell reception (which admittedly, isn’t super great around here).
2. ERGONOMICS
This might seem a little ironic given the goal of getting out more, but I want my work space at home to be more comfortable. It’s not exactly _uncomfortable_, it was just never really intended to be used so much for so long. I wonder if my productivity would see an improvement if I had a space that seemed more _intentional_, if that makes sense.
I currently have a fixed standing desk, with a tall tractor-seat stool/chair because I get lazy. The desk is homemade (thanks Dad!), but never had any finish applied, so it’s showing its age more and more with every drop of coffee. I’ve been eyeing the options out there, and I’m oddly excited for getting a monitor arm accessory. I have dreams of reducing the clutter on my desk, and it starts with not needing the monitor stand. After the desk, I’ll look for a chair. Ideally I’d be able to try some out at local office supply stores, but their options may be limited, and there are some really neat ones online only. We’ll see. 3. SETTING STRICTER “WORK HOURS” Sometimes there is a _need_ to work evenings and weekends. That’s okay, I often work better later in the day anyway. But does this stop me from being around during the mornings, or weekends when I’m not officially covering any shifts? Rarely. I need to truly step away from work when it’s not work time. It probably starts with being more mindful of my Slack status. But it likely needs to graduate to things like quitting Slack over weekends, closing the work email tab, closing all my other work-related tabs, and starting fresh on Mondays, or whenever my week begins. Since I don’t have kids or a spouse or any other similar requirements, I tend to let myself “be available” for off hours, but then I’m also available during regular hours because, well, they’re regular hours. So my mind spends a lot of time work-mode, even if I’m not actively on a task. I need to take real breaks _and_ do so without feeling somehow guilty. Make no mistake, it’s purely an internal guilt, no one is putting this pressure on me. In fact, I wholly expect some coworkers to see this post and tell me to take a day off.
------------------------- I shall stop at 3 goals for now, if only because I ended up with more words than I expected AMBIGUOUS RELATIVE DATES Posted on January 29, 2018// By Kailey Lampert // 1 response
Using relative dates like “next Thursday” can be confusing. (Is that this Thursday? Then why didn’t they say “this Thursday”?) Try these polls for fun: Today is Friday, when is "next Tuesday"? 4 days from now
11 days from now
VoteView Results
Crowdsignal.com
Take Our Poll
Does removing the weekend change things? Today is Monday, when is "next Friday"? 4 days from now
11 days from now
VoteView Results
Crowdsignal.com
Take Our Poll
COOKIE-NONCE AUTHENTICATION FOR REST API CURL REQUESTS Posted on January 26, 2018// By Kailey Lampert // Tell me what you think The WordPress REST API is quite a feature, but it can be a struggle to deal with authentication .
One option is Basic Auth . But can we leverage the built-in cookie authentication? If you look at rest_cookie_check_errors() ,
you’ll see where it’s checking for an authentication cookie and valid nonce. Using WP-CLI, we can carefully piece together a cURL command that passes those values appropriately. Remember, cookies and nonces have a limited lifetime, so be sure to generate new commands as time goes by.
EXAMPLE
RUN WP-CLI COMMAND
$ wp curl-rest --user=admin Output:
curl -H 'X-WP-NONCE: ooO0o00o00' --cookie \ 'wordpress_logged_in_wwWwwwWwwwWWwwwwwWwwwWWwwWWWwwwww=admin|xxxxxxxxxx|YYyyYyyyyYyYyYYYYYyyyYYyyyyYyyYYyyyyyyYYyyY|zZzzzzzZzZzzzzzZZzzzZzzzZzzZZzzzzzzZZzZzzzZZZzzZzZzzzZZzzzzzZzzz' \ 'http://local.wordpress.local/wp-json/wp/v2/settings' RUN CURL COMMAND
$ curl -H 'X-WP-NONCE: ooO0o00o00' --cookie \ 'wordpress_logged_in_wwWwwwWwwwWWwwwwwWwwwWWwwWWWwwwww=admin|xxxxxxxxxx|YYyyYyyyyYyYyYYYYYyyyYYyyyyYyyYYyyyyyyYYyyY|zZzzzzzZzZzzzzzZZzzzZzzzZzzZZzzzzzzZZzZzzzZZZzzZzZzzzZZzzzzzZzzz' \ 'http://local.wordpress.local/wp-json/wp/v2/settings' Output:
(prettified, I recommend the jq command line tool) {
"title": "wordpress.local", "description": "Just another WordPress site", "url": "http://local.wordpress.local", "email": "admin@example.com", "timezone": "",
"date_format": "F j, Y", "time_format": "g:i a", "start_of_week": 1, "language": "",
"use_smilies": true, "default_category": 1, "default_post_format": "0", "posts_per_page": 10, "default_ping_status": "open", "default_comment_status": "open" }
view raw
readme.md
hosted with by GitHub if ( !defined( 'WP_CLI' ) ) return; /**
*/
class trepmal_cURL_REST extends WP_CLI_Command { /**
* Generate cURL command for REST API *
* ## EXAMPLES
*
* # Generare command for fetching all administrators * $ wp curl-rest --user=1 wp/v2/users?role=administrator *
* @synopsis --user= *
*/
function __invoke( $args, $assoc_args ) { $args = wp_parse_args( , $args ); list( $route ) = $args; $route = trim( $route, '/'); if ( substr( $route, 0, 5 ) !== 'wp/v2' ) { $route = "wp/v2/$route"; }
if ( ! $user_id = get_current_user_id() ) { WP_CLI::error( 'Please pass --user' ); }
$expiration = time() + DAY_IN_SECONDS; $manager = WP_Session_Tokens::get_instance( $user_id ); $token = $manager->create( $expiration ); $logged_in_cookie = wp_generate_auth_cookie( $user_id, $expiration, 'logged_in', $token ); $_COOKIE = $logged_in_cookie; // for nonce creation
$url = rest_url( $route ); $nonce = wp_create_nonce( 'wp_rest' ); $cookie = LOGGED_IN_COOKIE . "={$logged_in_cookie}"; $nonce_header = "X-WP-NONCE: $nonce"; $curl = "curl -H '$nonce_header' --cookie '$cookie' '$url'"; $split_curl = _split_str_by_whitespace( $curl, 100 ); $curl = implode( "\\\n ", $split_curl ); WP_CLI::line( $curl ); }
}
WP_CLI::add_command( 'curl-rest', 'trepmal_cURL_REST' ); view raw
curl-rest-cli.php
hosted with by GitHub THINGS I’VE LEARNED BY WORKING FROM HOME Posted on January 24, 2018// By Kailey Lampert // 13 responses
I’ve been working from home full-time for most of the past 4.5 years. I haven’t reached any special milestone, but nevertheless I’m going to compile a list of some of the things I’ve learned, some bits of advice, and general observations. In no particular order, numbered for reference: * Not commuting is awesome * Sometimes your car battery will die if you don’t drive for a while
* I’m possibly _too_ comfortable not leaving my house for days on end
* Getting a dog is probably healthy * Playing fetch is a good way to get out of the house when you don’t really want to do anything * I don’t worry about someone stealing my packages * I’m pretty sure the UPS man thinks I’m unemployed, and possibly a recluse
* It’s easy to forget you’re still wearing pajamas at 2pm * Comfy slippers are worth it * Roosters are loud
* If you leave a window open, people on your video call are likely to hear some crowing, or even mooing * Pets have no concept of work hours * Pets have no concept of personal space * A cat is likely to send at least one Slack message * Check for nearby cats before entering any commands in a production terminal
* If you can’t be work productive, be personally productive * A decluttered desk can mend a cluttered mind * If you’re in the zone, don’t worry about the 4 coffee cups you’ve acquired next to your keyboard * Someone in your life will believe you’re unemployed no matter how many times you tell them you work, just at home * It’s easy to use “sorry I’m working” as an excuse to avoid social events, even on evenings and weekends * Don’t do that. At least not too often * It’s hard to take a sick day unless you’re at a high risk of literally vomiting on your keyboard * Hardly anyone steals my lunch * Sometimes I don’t eat lunch as much as snack between breakfast and dinner
* Taking an actual lunch _break_ is hard * Don’t forget to wash that hoodie * Regular video meetings, even if sometimes unproductive work-wise, are good for recalibrating your teammates’ sarcasm levels * Sarcasm is likely to backfire once in a while in text based communication
* Emoticons and emoji can actually be helpful in setting tone * Imposter syndrome is very real * People you look up to are also asking so-called stupid questions, they’re just in one of the other 2839416 Slack channels you haven’t stumbled into * Don’t forget to stretch * Sometimes the scenery gets boring * Working from a coffee shop is tricky * Working from the couch is cozy * Mind your posture
* A second laptop charger is worth it * No rules against sitting outside * Working from a hammock is logistically challenging * It’s hard to ignore work stuff during off-hours * I’ve saved so much money by not commuting past fast food and coffee stands everyday. Oh, and the gas… * Drink more water
* It’s hard to take “unnecessary” days off, but they are necessary
* I bet real office chairs are nicer than hard plastic, I should consider this
* The less you drive, the more handy a key hook is * You’ll forget how tall/short your coworkers are * Document everything * I will never be able to convert UTC to PST in my head * Yes, I know it’s just add 8 hours * Video chat will never remember the proper audio/video settings COMMAND LINE SHORTCUTS Posted on September 5, 2016// By Kailey Lampert // Tell me what you think Some command line shortcuts that might make your life easier. They’ve helped me, but sometimes I forget so I decided to group some of my favorites here. _To be specific, we’re talking BASH. As a common default shell, there’s a good chance it’s what you’re using. So a lot of this can be found inside the bash manpage . If you’re using something else, I can’t say what of this might be compatible…_ EVENT DESIGNATORS
Ever need to repeat the last command? Easy, just use !! $ echo some super-duper-annoy-to-retype command some super-duper-annoy-to-retype command $ !!
echo some super-duper-annoy-to-retype command some super-duper-annoy-to-retype command $ echo "!!" > what-was-that.txt echo "echo some super-duper-annoy-to-retype command" > what-was-that.txt $ cat what-was-that.txt echo some super-duper-annoy-to-retype command This is extremely handy if you meant to run the last command as sudo, just run sudo !!
(more…)
NOTES: RENAMING AND RELOCATING DIRECTORIES IN WORDPRESS Posted on August 11, 2016// By Kailey Lampert // Tell me what you think This is not a guide (yet?). These are just notes for personal reference which may be expanded upon later. Site owners/developers/administrators may find useful hints below, but please do not get mad at me if you break your site. ------------------------- Methods were initially tested on a multisite-with-subdirectories installation, but are generally applicable to single and subdomain installations as well. STANDARD INSTALLATION familiar structure, e.g. ├── wp-config.php └── wp-content/ └── plugins/
NGINX (SUBDIRECTORY MULTISITE) if (!-e $request_filename) { rewrite ^(/+)?(/wp-.*) $2 last; rewrite ^(/+)?(/.*\.php) $2 last; }
(more…)
⟨ Older posts
trepmal*
twitter github
wordpress
instagram
user mail
* that's "Lampert" spelled backwards
/**
*/
class trepmal_cURL_REST extends WP_CLI_Command {/**
* Generate cURL command for REST API*
* ## EXAMPLES
*
* # Generare command for fetching all administrators * $ wp curl-rest --user=1 wp/v2/users?role=administrator*
* @synopsis --user=*
*/
function __invoke( $args, $assoc_args ) { $args = wp_parse_args( , $args ); list( $route ) = $args; $route = trim( $route, '/'); if ( substr( $route, 0, 5 ) !== 'wp/v2' ) { $route = "wp/v2/$route";}
if ( ! $user_id = get_current_user_id() ) { WP_CLI::error( 'Please pass --user' );}
$expiration = time() + DAY_IN_SECONDS; $manager = WP_Session_Tokens::get_instance( $user_id ); $token = $manager->create( $expiration ); $logged_in_cookie = wp_generate_auth_cookie( $user_id, $expiration, 'logged_in', $token ); $_COOKIE = $logged_in_cookie; // for noncecreation
$url = rest_url( $route ); $nonce = wp_create_nonce( 'wp_rest' ); $cookie = LOGGED_IN_COOKIE . "={$logged_in_cookie}"; $nonce_header = "X-WP-NONCE: $nonce"; $curl = "curl -H '$nonce_header' --cookie '$cookie' '$url'"; $split_curl = _split_str_by_whitespace( $curl, 100 ); $curl = implode( "\\\n ", $split_curl ); WP_CLI::line( $curl );}
}
WP_CLI::add_command( 'curl-rest', 'trepmal_cURL_REST' );view raw
curl-rest-cli.php
hosted with by GitHub THINGS I’VE LEARNED BY WORKING FROM HOME Posted on January 24, 2018// By Kailey Lampert// 13 responses
I’ve been working from home full-time for most of the past 4.5 years. I haven’t reached any special milestone, but nevertheless I’m going to compile a list of some of the things I’ve learned, some bits of advice, and general observations. In no particular order, numbered for reference: * Not commuting is awesome * Sometimes your car battery will die if you don’t drive for awhile
* I’m possibly _too_ comfortable not leaving my house for days onend
* Getting a dog is probably healthy * Playing fetch is a good way to get out of the house when you don’t really want to do anything * I don’t worry about someone stealing my packages * I’m pretty sure the UPS man thinks I’m unemployed, andpossibly a recluse
* It’s easy to forget you’re still wearing pajamas at 2pm * Comfy slippers are worth it* Roosters are loud
* If you leave a window open, people on your video call are likely to hear some crowing, or even mooing * Pets have no concept of work hours * Pets have no concept of personal space * A cat is likely to send at least one Slack message * Check for nearby cats before entering any commands in a productionterminal
* If you can’t be work productive, be personally productive * A decluttered desk can mend a cluttered mind * If you’re in the zone, don’t worry about the 4 coffee cups you’ve acquired next to your keyboard * Someone in your life will believe you’re unemployed no matter how many times you tell them you work, just at home * It’s easy to use “sorry I’m working” as an excuse to avoid social events, even on evenings and weekends * Don’t do that. At least not too often * It’s hard to take a sick day unless you’re at a high risk of literally vomiting on your keyboard * Hardly anyone steals my lunch * Sometimes I don’t eat lunch as much as snack between breakfastand dinner
* Taking an actual lunch _break_ is hard * Don’t forget to wash that hoodie * Regular video meetings, even if sometimes unproductive work-wise, are good for recalibrating your teammates’ sarcasm levels * Sarcasm is likely to backfire once in a while in text basedcommunication
* Emoticons and emoji can actually be helpful in setting tone * Imposter syndrome is very real * People you look up to are also asking so-called stupid questions, they’re just in one of the other 2839416 Slack channels you haven’t stumbled into * Don’t forget to stretch * Sometimes the scenery gets boring * Working from a coffee shop is tricky * Working from the couch is cozy* Mind your posture
* A second laptop charger is worth it * No rules against sitting outside * Working from a hammock is logistically challenging * It’s hard to ignore work stuff during off-hours * I’ve saved so much money by not commuting past fast food and coffee stands everyday. Oh, and the gas…* Drink more water
* It’s hard to take “unnecessary” days off, but they arenecessary
* I bet real office chairs are nicer than hard plastic, I shouldconsider this
* The less you drive, the more handy a key hook is * You’ll forget how tall/short your coworkers are * Document everything * I will never be able to convert UTC to PST in my head * Yes, I know it’s just add 8 hours * Video chat will never remember the proper audio/video settings COMMAND LINE SHORTCUTS Posted on September 5, 2016// By Kailey Lampert // Tell me what you think Some command line shortcuts that might make your life easier. They’ve helped me, but sometimes I forget so I decided to group some of my favorites here. _To be specific, we’re talking BASH. As a common default shell, there’s a good chance it’s what you’re using. So a lot of this can be found inside the bash manpage . If you’re using something else, I can’t say what of this might be compatible…_EVENT DESIGNATORS
Ever need to repeat the last command? Easy, just use !! $ echo some super-duper-annoy-to-retype command some super-duper-annoy-to-retype command$ !!
echo some super-duper-annoy-to-retype command some super-duper-annoy-to-retype command $ echo "!!" > what-was-that.txt echo "echo some super-duper-annoy-to-retype command" > what-was-that.txt $ cat what-was-that.txt echo some super-duper-annoy-to-retype command This is extremely handy if you meant to run the last command as sudo,just run sudo !!
(more…)
NOTES: RENAMING AND RELOCATING DIRECTORIES IN WORDPRESS Posted on August 11, 2016// By Kailey Lampert // Tell me what you think This is not a guide (yet?). These are just notes for personal reference which may be expanded upon later. Site owners/developers/administrators may find useful hints below, but please do not get mad at me if you break your site. ------------------------- Methods were initially tested on a multisite-with-subdirectories installation, but are generally applicable to single and subdomain installations as well. STANDARD INSTALLATION familiar structure, e.g. ├── wp-config.php └── wp-content/└── plugins/
NGINX (SUBDIRECTORY MULTISITE) if (!-e $request_filename) { rewrite ^(/+)?(/wp-.*) $2 last; rewrite ^(/+)?(/.*\.php) $2 last;}
(more…)
⟨ Older posts
trepmal*
twitter github
wordpress
user mail
* that's "Lampert" spelled backwardsDetails
Copyright © 2024 ArchiveBay.com. All rights reserved. Terms of Use | Privacy Policy | DMCA | 2021 | Feedback | Advertising | RSS 2.0