Tumgik
#ymls concept
cupid-styles · 13 days
Text
yours (ymls check-in)
Tumblr media Tumblr media Tumblr media
in which y/n just wants to be harry's — officially.
word count: 3.8k
content warnings: parenting/family stuff (y/n and harry are parents), smut (breeding kink, slight size kink, literal one "mommy" mention, dirty talk)
ymls masterlist | main masterlist
talk to me
. . .
Parenthood is difficult.
It doesn’t take a rocket scientist to figure that out, so it takes Harry and Y/N approximately two minutes of bringing Clementine into the world to come to the same realization. Her loud wails break their hearts every time, sleep becomes a luxury, and breastfeeding takes an incredible toll on Y/N’s physical and mental health.
But in the same way that parenting is hard and filled with tears and confusion, it’s just as — if not more — rewarding.
Clementine is the best thing that’s ever happened to each of them. Harry can’t remember a version of his life where he wasn’t head-over-heels in love with his sweet baby girl, and Y/N has softened up a considerable amount now that she spends most of her day cooing to her daughter. 
It’s not perfect by any means — Clem is a tried-and-true daddy’s girl and sometimes it hurts Y/N’s feelings. Clementine also inherited her mom’s grumpy exterior and, in the middle of a visit from Harry’s parents or Y/N’s sister, will starfish her body, going completely rigid until one of her parents takes her. (Harry always thinks it’s funny while Y/N is embarrassed by it. It’s something they’re working on as a family.)
Beyond their little trio, though, lies a larger situation that’s been conveniently tucked away since Clementine was born: Harry and Y/N’s relationship. 
They never decided what they were after confessing feelings for one another. One day, they lived separately and were going the route of platonic co-parenting. The next, Harry moved all his things into Y/N’s, ended the lease on his own apartment, and painted the guest room a pretty pastel pink. 
At first, it didn’t seem like that big of a deal. Y/N has never cared for labels on relationships, and their devotion to each other was blatant — they were parenting a child together, after all. He kissed her good morning, they held hands on family walks, and at the end of the day, they were crawling into bed together. She didn’t need a ring or a title to reiterate where she stood in Harry’s life.
Until… well, until the supermarket incident.
It was a rainy day, but Y/N wanted to pop into the store before they rounded the corner to head back home. Now that Clementine’s pediatrician gave them the okay to start trying out solid foods — or, as solid as baby food can be — Harry had gotten really into making it from scratch. Currently, their kitchen was a mess of sweet potato, apple, and green bean purees, but Y/N was trying to be supportive, even if the noise of the blender sometimes woke Clem up from her afternoon nap. She remembered him mentioning a new recipe he found for carrots, mangos, and bananas, so she figured they could grab the ingredients on their way home. 
Clementine looked adorable in her cute little rain jacket and matching hat. Harry couldn’t stop taking pictures of her, and as they dipped into the produce aisle, stroller in tow, she remembered they needed another gallon of milk since they were trying to wean Clem off of Y/N’s breast milk. 
“You guys can stay right here, it’s just in the next aisle,” Y/N said, arms stuffed with produce bags. Harry nodded, though his attention primarily laid on Clementine’s gummy smile. Y/N snorted to herself as she quickly shuffled off to the dairy section — the duo were two peas in a pod, but she didn't think she would want it any other way. 
Glancing down at her watch, she put a pep in her step as she walked back to the produce aisle. They had about 15 minutes before Clem started getting antsy and whiney about her pre-dinner nap, and she didn’t want her to get upset on their walk home. 
Only, when she turned the aisle, Harry and Clementine weren’t alone anymore — no, there were two women standing with them, cooing over their daughter. 
“She’s so precious! How old is she?” one of them asked.
“Ah, almost eight months,” Harry replied bashfully, petting down the tuft of brown curls at the top of Clementine’s head. Y/N clenched her jaw. Why had he taken her hat off? It was supposed to protect her from the rain! 
“So sweet,” the other woman grinned, reaching out to thumb over Clementine’s puffy cheek. The vision sent a pang of jealousy through Y/N’s chest — her baby wasn’t some kind of doll that anyone could just touch! Clutching the produce and container of milk in her hands, Y/N all but marched over to the stroller and threw them in the bottom compartment. 
“Ready to go, honey?” 
Harry blinked at Y/N, a world of confusion swirling in the green eyes he shared with his daughter. She stayed silent and still, knuckles white from gripping the stroller handle so tightly. 
“Yeah,” he finally replied, leaning down to gently place Clementine back in her seat, “This is Y/N, Clementine’s mum.”
“Oh, your baby is so sweet! Harry was just raving about you!” one of the women nearly squealed. Y/N smiled tightly as she watched him buckle Clementine in.
“Okay, say bye bye, Clem,” Harry murmured. They’d been trying to teach her how to wave hello and goodbye, but Y/N would rather scoop her own eyeballs out than watch her do it for the first time with these women. 
In fact, she was already pushing the stroller down the end of the aisle before they could even get the word “bye” out.
Since that day about two weeks ago, it’s been constantly replaying in the back of Y/N’s brain. Even though Harry didn’t think much of it (she knows this because he immediately started talking about nonsense on the walk home), for the first time, it plucked at a chord of insecurity that she didn’t even know she had. She’d always felt fairly secure in her relationship with Harry — he’d all but begged her for this life together, and he’d been incredibly involved from the moment she got pregnant — so how is that two random strangers at the supermarket tore this out of her? 
It bothered her so deeply to the point where she did something she’d never done before: Ask Lea for relationship advice. 
“In the years I’ve known you, you have never asked me for help with a man,” Lea had said, her eyebrows raised so high they nearly met her hairline. Y/N grumbled as she wrapped her hand around her matcha, avoiding eye contact with her friend. She’d been able to sneak out for an afternoon coffee date with her while Harry took Clementine to the park. “You’re always so… sure of yourself. And you have a literal child with Harry. What gives?”
Y/N shrugged as she rubbed her lips together nervously. “You should’ve seen the way those girls were all over him. It was… gross.”
“It’s normal to feel jealous, if that’s what you’re concerned about.”
“I am not jealous,” she muttered, “I just… he introduced me as Clementine’s mom. Don’t you think I’m a bit… more than that to him?”
“Of course you are. But you’ve never had that conversation, have you?”
“Like you said, we have a baby together. What else could you need?”
Lea smirked, “That’s all that you need. But he probably needs a bit more confirmation than that.”
Y/N bristled as she stuck her straw between her lips, taking a long sip. 
“He knows we’re in a relationship, doesn’t he?” 
“I don’t know,” she replied honestly, “Dom and I used to hear all the gossip about you two before Clem was born, but since then, I think he’s just been focused on making sure you and her are both taken care of.”
“So what do I do?” Y/N asked through a sigh, leaning back against the worn leather of the booth. 
“Talk to him,” Lea said easily, “But… maybe don’t do it in your rough-and-tough-Y/N way. Maybe… make it a little special. He likes that, y’know? Little romantic gestures?”
Y/N scrunched her face. Lea was right — Harry was all about the little things, like surprising her with flowers or waking her up with breakfast in bed on the weekends. And while Y/N was positive she didn’t have a romantic bone in her body, she’d certainly attempt to find one if it meant making Harry happy. 
. . .
A few days later, Harry walks into his shared apartment with Y/N to the scent of something delicious. 
“Y/N?” he calls as he toes his shoes off in the entryway. They weren’t due for company, were they? He doesn’t think so, but with eight months straight of four to five hours of sleep each night, he had trouble remembering anything that wasn’t Clementine-related. 
He follows the fragrance into the kitchen, where Y/N is standing over the stove, stirring a bubbling pot of some sort of sauce. She jumps, hand over her heart, when he goes to greet her. 
“Jesus fuck, you scared me!” she exclaims, the wooden spoon nearly clattering to the floor. He smirks and lets out an amused laugh as he walks towards her, observing the array of pans on the stovetop. 
“What’s all this for?” he asks. Y/N presses a hand to his muscular chest and attempts to block him from seeing anything. 
“I’m making you dinner,” she mumbles, nibbling on her bottom lip, “Clem’s with my sister for the night.”
“Oh?”
She nods. 
“Did I forget a special occasion?”
She shakes her head.
“Then how come I’m getting spoiled tonight?”
Her cheeks warm at that, but they both pretend her blush is invisible. “I just wanted to do something… romantic for you.” 
“Romantic?” he repeats the word like it’s a bizarre concept and it makes a pit form in Y/N’s stomach, “That’s… sweet of you. Thank you.”
She nods, albeit a bit robotically. “Um. Yeah. It’ll be ready in like 5 minutes.”
“Sounds good,” he replies, “Do you want me to set the table?”
She shakes her head bashfully and Harry raises an eyebrow. “I already did that.”
Her demure nature makes a smile form at the edges of his lips and he reaches out to press a hand to her hip, squeezing gently. 
“Y’okay?” he asks softly, tilting his head to look at her. “You seem nervous.”
Y/N shrugs and it supplies him with a tepid answer. “I just wanna make this nice for you.”
His heart breaks a bit at that and he ducks lower to catch her lips in a short, sweet kiss. PDA isn’t irregular for them — not with touch being Harry’s primary love language — so it’s unsurprising to be on the receiving end of one of his dizzying kisses, even if it ends quicker than she’d like. 
“This is already so special to me. I do miss Clem, though.”
She snorts at that as he brushes his nose against hers. “Of course you do. She’s your mini me.”
“Except when she’s making that grumpy little face. That’s all you.”
Y/N lightly bats at his chest before mumbling out to go sit down in the dining room. 
Harry’s eyes widen when he sees the candlelit table — he can’t remember the last time they ate on actual plates, always opting for take-out containers or paper plates for the sake of convenience. He swallows as he sits down and listens to Y/N shuffle around the kitchen. He hears her curse, followed by what sounds like her emptying pasta into a colander — she always burns herself whenever she does that, and he can envision the slight grimace that appears on her face. 
Just as he’s getting antsy and preparing himself to ask if she needs any help, Y/N appears from the kitchen with a big bowl of pasta. She nibbles on her bottom lip as she places it on the table, then stands up straight. She looks like a soldier waiting to be told to return to their duties.
“Um… I made us that roasted red pepper pasta you like.” she says, wringing her hands out in front of her. “I hope that’s fine.”
“That’s great,” Harry nods, gesturing to the seat across from him, “Sit down. You look like you’re gonna have an aneurysm. Are you sure you’re alright?”
“Yes,” Y/N grumbles as she sits down, and the sound of her grouchy voice makes him chuckle as he grabs her bowl to serve her, “I know I’m not, like… the most romantic person, or even the easiest person to be around, so it’s important to me that I make this really good for you.”
“I hate when you say that,” he murmurs before placing her full bowl in front of her. He moves to serve himself, “You’re the easiest person I’ve ever been around. You’re a great mum and I love being a parent with you.”
Y/N swallows as she listens to him, leaving her food untouched. He watches her and takes a bite of his pasta, chewing slowly. 
“Is that… all I am to you?” she asks softly with low eyes. Harry furrows his eyebrows.
“What do you mean?”
“Like… am I still just a co-parent to you?” 
He sets his fork down and uses his napkin to wipe his mouth. “Well, we never really talked about it, I guess. But you know you’re more than that to me.”
“You’re more than just Clem’s dad to me,” she continues. “And it kinda hurt my feelings when you introduced me to those girls as ‘Clementine’s mom’ a few weeks back.”
Harry raises his eyebrows, “Oh. I didn’t think anything of it.”
“I know.”
His heart strains at the thought of hurting her feelings, but he also knows that what happened in the supermarket was weeks ago. Had she been sitting on it and thinking about it all this time?
“I never want to make you uncomfortable, Y/N. To be honest, I don’t know how to refer to you but… I’d say you’re my partner, yeah? You’re my teammate in raising our beautiful girl and I love getting to live life with you.”
Her heart thumps rapidly in her chest. “But what if… what if you called me your girlfriend, too?”
Harry’s silent for a moment. He reaches out to place his hand on her knee, squeezing softly.
“Would you want that?” he asks. “I’ll only do it if that’s what you want.”
She looks up at him and nods. Her eyes are glassy and it makes Harry’s chest tighten. Suddenly, he needs to be closer to her, so he stands up and scoops her into his arms. At first she rejects his touch, mumbling out sentiments about still having postpartum weight, but Harry shushes her and pulls her into his lap. 
“Tell me what you’re feeling, Y/N.” he murmurs. He leans up and presses a chaste kiss to the side of her neck. She shivers and he keeps his hands as solid anchors on her hips. 
“I want you to call me your girlfriend,” she says, lifting her gaze to look at him. “I don’t want you to entertain any other person or let them flirt with you or touch our baby. I just want it to be the three of us, always.”
If Harry’s being honest, he would have been content with living in this gray, in-between area with Y/N for the rest of their lives. He was happy — so incredibly happy to be in her life, to sleep next to her every night, to raise a gorgeous baby girl with her. He felt fortunate to be there for every moment, good and bad — but he would be a liar if he said he hadn’t been waiting for the day where she told him what was really going on in that pretty head of hers.
He presses a chaste kiss to her temple. “I’m sorry I hurt your feelings,” he says quietly, soft fingertips smoothing over the expanse of her hip, “You’re my girlfriend, okay? Not just Clemmie’s mum. You’re so much more than that.”
She nods her head and Harry smiles gently at how flustered she continues to be — it’s a side of her that he rarely sees, and the sight makes a low chuckle sound from deep in his chest. 
“You’re silly,” he mumbles against the shell of her ear. “Isn’t that what you are? A silly baby desperate to be mine?”
Y/N bristles and swallows harshly, keeping her gaze low in his lap. His smirk only grows as he begins to press slow kisses along her jaw and down to her neck. Her eyes flutter closed. 
“Everyone thinks you’re this pretty, grumpy girl, but I know better than that,” he continues, sliding his hands beneath her tee-shirt to feel her warm skin, “You’re loving and kind. The best mum I’ve ever seen. The best partner and the best girlfriend, too. Isn’t that right, mama?”
She gasps wetly and he feels her thighs threaten to clench, but his hips prevent her from getting any relief. He hums, satisfied with her response and, in a quick movement, pulls her shirt from her body and tosses it to the floor. Her swollen breasts sit prettily on her chest and he tries his best not to groan at the sight. 
“Don’t tease,” she mewls. He chuckles as she grasps at the fabric of his own tee-shirt, the soft material in the tight clutch of her knuckles. 
“Need me to fill you up?” he asks, though he knows the answer is an obvious and resounding yes. They haven’t had actual sex in at least a month, not with Clementine occupying 99% of their time. Even if he’s attempting to play it cool, his cock is hard and throbbing beneath layers of his clothing. He swears he can even feel the warmth of her pussy through her own clothes and it’s taking everything in him not to thrust up and grind against her. 
“Yes,” Y/N pants, shaky fingers digging beneath the waistband of his trousers to pull his length out, “S-stop playing around. You know it’s been too long.”
Harry laughs lowly and lifts his hips up to grant her enough space so she can retrieve his cock. She doesn’t even bother pushing his pants or briefs down, swallowing tightly at the sight of the ruddy tip already leaking with pre-cum. 
“Relax, baby,” he mumbles, grabbing one of her trembling hands and intertwining their fingers together, “Breathe, yeah? I’ll take care of my girl.”
Her pussy clenches at that — my girl — and she nibbles on her bottom lip eagerly when he pushes her soft shorts to the side to reveal her pussy. He wishes he had more willpower to look at what he’s been missing out on and his throat bobs when his eyes flicker down to the puffy clit tucked between her lips. He thinks they’ll both explode if he doesn’t get inside of her in the next two seconds, so he gives his cock a pump before he positions himself beneath her and slowly pushes in. 
Immediately, she whimpers out and he stalls, his free hand pressing rigidly into the skin of her thigh. 
“Y’alright?” 
“Yeah,” she whispers, “Tight fit.”
“I know.” he mutters, glancing up at her to read her expression. “Do you need me to pull out?”
She instantly shakes her head, “No, no. Keep going.”
Harry leans up to seal their lips in a messy, wet kiss as he continues pushing in as slowly as he can. He supposes he should’ve spent more time stretching her out, but if there’s one thing he’s learned about Y/N over the past year, it’s that she’s always eager and ever determined to take him, even if it’s been weeks since their last time together.
When he’s finally all the way in, his balls snug against her bum, their kiss slows, though it doesn’t seem like Y/N has any plans to separate their mouths. He doesn’t move a muscle, even if he knows his cock is throbbing from the tightness of her pussy. And then, after what seems like an eternity, she nods.
Slowly, he begins to fuck up inside of her and breathy moans depart from her swollen lips. Harry’s mouth catches each one, punctuating every whimper with a gentle peck. 
“There you go, mama, take my cock. You’re doing so good, aren’t you?”
She only responds with a lilting whimper and he moans, feeling the way her pussy clenches around his length. It’s not the dirtiest sex they’ve had — not by a long shot — but god, if it doesn’t feel incredible knowing that they’re completely devoted to one another.
“You make me feel so good,” she mewls, making his eyes nearly roll back, “I love your cock— ‘s so good, Harry, want— want you to give me another baby.”
“Jesus Christ,” he mutters, squeezing her hips hard, “Can’t just fucking say that stuff, baby. I’ll bust before you even cum.”
“D-don’t care,” she shudders, but he can tell she’s reaching her peak by the way her thighs begin to tremble, each of her muscles tightening. “Cum inside me, m-make me a mommy again.”
His chest vibrates with a deep groan and he reaches between them to pinch at her pearly clit, rubbing it in quick, tight circles. He’s seconds away from bursting himself, but he refuses to finish before she has a chance to. 
It barely takes a few loops around the bundle of nerves before she’s shaking in his lap, her pussy tensing around his length as she moans out his name over and over again. It’s the most beautiful sound he’s ever heard and he presses his forehead against her sweaty shoulder, shuddering as her orgasm triggers his own. As requested, he pumps his cock deep inside of her as he comes, pushing his seed as far as it’ll go. She whimpers from the sensation as pants fall from her lips, shivering every time he thrusts another rope of cum into her.
They’re both shaking by the time both of their orgasms taper off. Harry wraps his arms around her sweaty form, pulling her chest against his. 
“You’re mine, yeah?” he murmurs, pressing a kiss to her shoulder. “You and Clem. We’re a family.”
Y/N nods, echoing his words. “Yours.”
They settle into a comfortable silence; Harry’s softening cock still inside. He’s unsure of how how long they stay there, but he does know that they’ll have to move eventually so he can clean her up. It’s only then that she sits up to look at him, her eyes soft and tired. 
“Harry?”
“Yeah?” 
“Will you get me Plan B tomorrow?” she asks, biting her lip. “I think Clem is… more than enough for me right now.”
He laughs and nods his head. 
“Yeah, sweetheart. I’ll pick some up for you tomorrow.”
874 notes · View notes
Text
 APACHE WEBSERVER CONFIGURATION IN DOCKER USING ANSIBLE ⚜
Tumblr media
Now the question is what is docker and what is ansible ???
Tumblr media
Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications.
Tumblr media
Ansible is a radically simple IT automation engine that automates cloud provisioning, configuration management, application deployment, intra-service orchestration, and many other IT needs.   
SO basically our task is : 
🔰Write an Ansible PlayBook that does the following operations in the managed nodes: 🔹 Configure Docker 🔹 Start and enable Docker services 🔹 Pull the httpd server image from the Docker Hub 🔹 Run the docker container and expose it to the public 🔹 Copy the html code in /var/www/html directory and start the web server
Lets do it :)))) 
So lets know some of the concept of ansible first : 
Ansible Playbooks :
Ordered lists of tasks, saved so you can run those tasks in that order repeatedly. Playbooks can include variables as well as tasks. Playbooks are written in YAML and are easy to read, write, share and understand.
♦️ Inventory :
A list of managed nodes. An inventory file is also sometimes called a “hostfile”. Your inventory can specify information like IP address for each managed node. An inventory can also organize managed nodes.
♦️ Control Node:
Any machine with Ansible installed is known as controller node. You can run Ansible commands and playbooks by invoking the ansible or ansible-playbook command from any control node. You can use any computer that has a Python installation as a control node - laptops, shared desktops, and servers can all run Ansible. However, you cannot use a Windows machine as a control node. You can have multiple control nodes.
If you want to install ansible use below commands : 
pip3 install ansible
yum install sshpass
ansible --version >> TO check version
Lets do the project :: 
So this is my managed nodes where we will use ansible book to automate docker  using ansible : 
so In this picture you can clearly see we dont have docker , HTTPD and hostname is Managed_node so  Lets automate : 
IP : 192.168.147.139 
Tumblr media
And this is my controller nodes from where we will automate the managed Node : 
IP : 192.168.147.138 
So Let do :: 
If this shows its means you are ready to go : 
Tumblr media
Lets create yaml file and automate the managed Node : 
Tumblr media
Finally created the yml file :) 
And now if we are trying to go to this url we will reach to our destination :)  : http://192.168.147.139:32771/Search/index.html  
Tumblr media
So we come to the end of our task : 
Thanku || hope you all enjoy my task | 
Github link for this project : https://github.com/ROHITkumaw/Search_Capital 
linkedln : https://www.linkedin.com/in/rohit-kumar-4b5183181/ 
1 note · View note
karonbill · 3 years
Text
IBM C1000-109 Real Questions And Answers
If you are worried about how you can prepare for your C1000-109 IBM Cloud Professional Developer v4 exam, PassQuestion provides C1000-109 Real Questions And Answers that cover all the aspects of the actual exam. It can help you a lot to crack the IBM C1000-109 exam with a top scoring rate.You will be able to receive high quality and validated C1000-109 Real Questions And Answers that are created by the experts. Our experts are regularly updating exam content according to the market trend which helps you to pass the IBM C1000-109 exam easily.
IBM Cloud Professional Developer v4 C1000-109 Exam
An IBM Certified Developer - Cloud v4 technical professional understands concepts essential to the development and operations of secure Cloud applications. They will have experience creating and maintaining applications on IBM Cloud. They understand how to build applications by deploying their code on Cloud platforms and extending them through managed services. This individual can perform these tasks with little to no assistance from product documentation, support, or peers.
Exam Details
Number of questions: 64 Number of questions to pass: 43 Time allowed: 90 mins Languages: English Certifications: IBM Certified Professional Developer - Cloud v4
Exam Topics
IBM Cloud Compute Options   17% Security and Identity   13% Modern Integration   17% Data Services    11% DevOps and Continuous Delivery    14% Using IBM Services     11% Managing a Running Cloud Applications    13% Overview IBM Cloud Paks    4%
View Online IBM Cloud Professional Developer v4 C1000-109 Free Questions
Which two of the following are benefits of a Content Delivery Network (CDN)? A.Connects high speed direct links between your account and theirs to provide reliable low latency connections B.Mitigates distributed denial of service (DDoS) attacks, man-in-the-middle attacks, and other common attacks on web sites C.Copies web sites to a central location to deliver fast responses to improve customer satisfaction D.Provides infrastructure and bandwidth in planned remote locations at a predefined hourly rate E.Decreases impacts to website performance by reducing the effects of spikes or surges in demand Answer: AB
How can a developer change the Redis Configuration using the Cloud Database API? A.Send the settings as a JSON object in the request body of a POST request B.Send the settings as a JSON object in the request body of a PATCH request C.Send the settings as a Name-value pair in the request body of a PATCH request D.Send the settings as a Name-value pair in the request body of an UPDATE request Answer: A
A Mobile application developer is using IBM Mobile Foundation for the backend services. The application end users need access to the application data even when there is no network and the application is running offline. Which of the following IBM Mobile Foundation features will help in this scenario? A.JSONStore B.Mobile Foundation SDK C.AES 256 encryption and Data storage D.Mobile Foundation Adapters Answer: D
In the Devliery Pipeline tool, which of the following is a valid Deployer type of job in the Deploy stage workflow? A.Serverless B.Open Shift C.Microservice D.Kubernetes Answer: D
What is an option for a developer tasked to create APIs for a business service using the API Gateway on IBM Cloud? A.Submitting a WAR/JAR file to a static analysis tool to autocreate APIs based on business logic B.Importing APIs using Swagger/OpenAPI definitions stored on .json. .yml and .yaml files C.Creating Kubernetes services resources that will automatically create API for each Service resource on API Connect D.Importing APIs stored in .zip files Answer: B
0 notes
aperturedevops · 3 years
Text
Quản lý tài nguyên cho cluster Kubernetes
Đặt vấn đề
Một trong những thiếu sót khi sử dụng k8s trong môi trường production là không thiết đặt giới hạn tài nguyên cho hệ thống. Khi bạn không giới hạn tài nguyên cho các pod trong k8s, không sớm thì muộn sẽ có một thời điểm server của bạn sẽ hết sạch tài nguyên (điển hình là hết CPU và RAM). Việc này rất dễ xảy ra chạy các workload nặng trên nhiều node có cấu hình khác nhau. Cuối cùng server của bạn sẽ crash, hoặc là chạy rất chậm, khiến hệ thống trở nên kém ổn định, thậm chí là mất mát dữ liệu, gây tổn thất về uy tín và tiền bạc. Vậy một trong những việc đầu tiên khi một đưa bất kì thứ gì lên k8s là phải thiết đặt tài nguyên cho nó.
Ý tưởng về cấp phát và giới hạn tài nguyên
Mặc định k8s chỉ có thể kiểm soát tài nguyên về CPU và RAM của hệ thống. Component chịu trách nhiệm kiểm soát tài nguyên và deploy pod lên các node được gọi là kube-scheduler. Có hai thuộc tính quan trọng để cấp phát và giới hạn tài nguyên được định nghĩa lúc bạn tạo workload:
Requests: Bảo đảm về lượng tài nguyên mà một pod trong workload sẽ được cấp. Mặc định các thuộc tính này sẽ để trống hoặc lấy theo yêu cầu mặc định của namespace (sẽ được đề cập sau). Tài nguyên request tối đa phải nhỏ hơn lượng tài nguyên mà một server mạnh nhất trong cluster có thể tải được.
Ví dụ: request: 100mCPU, 256MiB RAM mang ý nghĩa bạn sẽ luôn đảm bảo rằng k8s sẽ cấp cho bạn ít nhất 100 mCPU và 256MiB RAM. Hệ thống sẽ chỉ deploy pod của bạn trên node có đủ số lượng tài nguyên như trên. Tất nhiên kube-scheduler có đánh dấu lượng tài nguyên này đã bị chiếm dụng.
Giả sử bạn có 2 node, node 1 có 2 vCore và 8GiB RAM, node 2 có 4 vCore 16GiB RAM, nếu workload của bạn yêu cầu request: 2500mCPU, 8GiB RAM thì server sẽ chỉ deploy pod của workload này vào node 2.
Trong trường hợp cũng với cấu hình trên mà bạn yêu cầu tài nguyên request: 4000mCPU, 8GiB RAM, sẽ không có pod nào được deploy cả.
Limits: Giới hạn lượng tài nguyên mà một pod trong workload sẽ được sử dụng
Ví dụ: limits: 1000mCPU, 2GiB RAM mang ý nghĩa rằng bạn chỉ có thể dùng tối đa 1 CPU và 2GiB RAM.
Để thiết đặt chúng khi tạo một deployment, đây là YML ví dụ tạo deployment ubuntu:
apiVersion: apps/v1 kind: Deployment metadata: name: ubuntu-test labels: app: ubuntu spec: replicas: 1 selector: matchLabels: app: ubuntu template: metadata: labels: app: ubuntu spec: containers: - name: ubuntu image: ubuntu:bionic ports: - containerPort: 80 # chú ý mục resources này resources: limits: cpu: 1 memory: 2Gi requests: cpu: 500 memory: 2Gi
Bạn để ý ở mục spec.template.spec.containers[0].resource, sẽ thấy có hai setting là limits và requests. Đây chính là nơi thay đổi về lượng tài nguyên đảm bảo và giới hạn.
Qua 2 ví dụ trên, cần phải lưu ý hai điều sau:
k8s hoàn toàn có thể deploy pod của bạn vào một node mà lượng tài nguyên còn lại ít hơn lượng tài nguyên giới hạn. Ví dụ k8s sẽ có thể deploy workload request: 100 mCPU, 256MiB RAM, limits: 1000mCPU, 2GiB RAM vào một server chỉ còn trống 700 mCPU và 1 GiB RAM. Vậy nên nếu nếu workload của bạn yêu cầu nhiều tài nguyên hơn thì bạn cần chú ý cấp phát thêm tài nguyên cho chúng, vì trong trường hợp xấu, một pod dùng quá số lượng tài nguyên request mà node đã hết tài nguyên, node sẽ crash và buộc k8s phải kill một số pod khác hoặc tệ hơn là cả node đó sẽ không thể nào truy cập được nữa. Cơ chế kill pod đòi lại tài nguyên của k8s sẽ được đề cập ở mục dưới.
Kể cả khi bạn không dùng thì một pod cũng đã k8s đã tính pod của bạn đã chiếm dụng lượng tài nguyên bằng với lượng tài nguyên yêu cầu.
Tính chất tài nguyên CPU và RAM là khác nhau. Nếu pod của bạn vượt quá lượng tài nguyên CPU, k8s có thể "hãm" pod của bạn lại và không cho nó vượt quá giới hạn. Nhưng tài nguyên về bộ nhớ không thể bị giới hạn như vậy. Ngay khi pod của bạn vượt quá tài nguyên RAM cho phép, k8s sẽ kill luôn pod đó. Vậy nên cần chú ý về yêu cầu bộ nhớ của workload để tránh trường hợp pod bị kill ngoài ý muốn.
Việc deploy pod vào các node còn phải tùy việc server đó còn bao nhiêu tài nguyên (khá hiển nhiên nhưng vẫn phải đề cập). Giả sử một node có 4 vCore và 16GiB RAM nhưng đã bị nhiều pod chiếm dụng mất 3 vCore thì khi bạn request lượng tài nguyên request: 2500mCPU, 8GiB RAM thì pod của bạn cũng sẽ không bao giờ được deploy lên đó.
Cơ chế deploy và kill của kube-scheduler
Nếu bạn tạo một cluster k8s từ các công cụ như k3s, kubeadm hay từ các bên cung cấp nền tảng như AKS (của Azure), EKS (của Amazon) thì mặc định cluster đó sẽ sử dụng kube-scheduler để kiểm soát việc quản lý tài nguyên và deploy pod. Việc deploy hay kill pod của kube-scheduler đều hoạt động theo hai bước: Lọc và Chấm điểm.
Trường hợp k8s deploy một pod vào cluster:
Bước Lọc: kube-scheduler sẽ liệt kê tất cả các node thỏa mãn điều kiện tối thiểu của workload (tức thỏa mãn lượng tài nguyên request). Nếu trong danh sách đó không có node nào, pod của bạn sẽ không bao giờ được deploy. Các pod chưa được deploy vẫn sẽ có cơ hội được chạy do kube-scheduler sẽ thực hiện việc chấm điểm này liên tục.
Bước Chấm điểm: kube-scheduler sẽ đánh giá các node thông qua nhiều tiêu chí khác nhau, từ đó đưa ra điểm số của node đó. kube-scheduler sẽ deploy vào node có điểm số cao nhất. Nếu có nhiều hơn 1 node có cùng một điểm số, pod sẽ được deploy ngẫu nhiên vào một trong các node đó.
Còn trường hợp k8s cần kill pod để thu hồi lại tài nguyên:
Bước Lọc: kube-scheduler sẽ liệt kê tất cả các pod đang hoạt động trong node đang bị quá tải.
Bước Chấm điểm: kube-scheduler sẽ đánh giá các pod đó thông qua độ ưu tiên của pod (Pod Priority). Pod nào có điểm ưu tiên thấp hơn sẽ bị kill, các pod có điểm ưu tiên ngang nhau sẽ được kill ngẫu nhiên. Việc này sẽ lặp đi lặp lại đến khi server đủ tài nguyên thì thôi. Nhưng thông thường chúng ta thường bỏ quên mất tính năng này, nên các pod sẽ có điểm ưu tiên ngang nhau, vì vậy các pod sẽ bị chấm điểm thông qua lượng tài nguyên sử dụng. Các pod vượt quá tài nguyên yêu cầu càng nhiều, thì pod đó càng có khả năng bị kill. Việc này cũng sẽ lặp đi lặp lại đến khi server đủ tài nguyên thì thôi.
Trong trường hợp bạn có đặt mức độ ưu tiên cho pod, nếu bạn đặt cho pod của mình có độ ưu tiên cao hơn các pod hệ thống như kubelet, k8s có thể kill luôn các pod đó để thu hồi bộ nhớ. Tất nhiên việc này vừa có lợi điểm và hại điểm.
Điểm tốt: Node của bạn vẫn sẽ chạy và mọi thứ sẽ được deploy trở lại khi pod của bạn trả lại tài nguyên cho hệ thống.
Hại điểm: Khiến bạn lo lắng khi node được thông báo là đã crash và không có thông tin nào được cập nhật về. Tệ hơn nữa, node fail quá lâu sẽ khiến cho hệ thống bên thứ ba tưởng node của bạn đã sập (node tained), node sẽ bị xoá đi và thay thế bằng node mới, mất toàn bộ những gì mà node của bạn đang thực hiện (ví dụ như GKE autoscaler sẽ thay node đang sập bằng node mới sau một khoảng thời gian).
Việc Lọc và Chấm điểm sẽ được định đoạt bằng một trong hai quy cách: Thông qua các quy chế đã quy định (Policies) hoặc thông qua các profile quy chế (Profiles) nhưng trong phạm vi bài viết này, chúng ta sẽ không đề cập kĩ đến hai quy cách phức tạp trên mà sẽ xoáy vào cơ chế tài nguyên CPU và RAM.
Phân chia tài nguyên của cluster cho các namespace
Việc phân chia tài nguyên cho namespace (Resource Quota) được coi là TỐI QUAN TRỌNG đối với bất kì một người làm hệ thống nào. Thường một hệ thống sử dụng k8s sẽ không chỉ dành cho một mình DevOps hay SysAdmin sử dụng, mà sẽ được chia ra cho mỗi team (hiện tại đang trong một project) nắm một hoặc một vài namespace. Họ hoàn toàn có thể cung cấp quá ít tài nguyên cho workload để pod có thể hoạt động, hoặc đặt tài nguyên giới hạn quá cao khiến chúng chiếm hết tài nguyên hệ thống, vân vân. Tất cả đều sẽ dẫn đến một kết cục cuối cùng: sập server. Vậy nên với góc độ là người làm hệ thống, bạn cần phải phân chia tài nguyên của các namespace lại để đảm bảo server không bị quá tải. Khi họ vượt quá lượng tài nguyên yêu cầu, các pod nằm trong namespace sẽ bị kill nhưng sẽ không ảnh hưởng
Ý tưởng của việc phân chia tài nguyên cũng rất đơn giản như sau:
Mặc định các namespace sẽ không được định nghĩa gì về phân chia tài nguyên, các pod trong namespace sẽ thoải mái đặt ra bất kì yêu cầu tài nguyên nào mà mình muốn.
Khi thiết đặt phân chia tài nguyên, các pod trong namespace đó chỉ có thể yêu cầu hoặc giới hạn lượng tài nguyên nhỏ hơn hoặc bằng số lượng tài nguyên phân chia, tương tự như cấp phát và giới hạn tài nguyên của pod, cũng có các thông số như sau:
Request: Tổng lượng tài nguyên yêu cầu mà các pod có thể sử dụng khi deploy vào namespace. Vượt quá lượng tài nguyên trên pod sẽ không thể deploy
Ví dụ: Một namespace được cấp phát request: 4CPU, 8GiB RAM có ý nghĩa tổng tất cả lượng tài nguyên request của các pod phải nhỏ hơn hoặc bằng 4CPU và 8192MiB RAM. Ví dụ bạn có thể deploy 4 pod yêu cầu request: 1CPU, 2GiB RAM, 2 pod yêu cầu request: 2CPU, 4GiB RAM hoặc một pod yêu cầu request: 4CPU, 8GiB RAM
Limits: Tổng lượng tài nguyên giới hạn mà các pod có thể đạt được trong namespace. Các pod khi chạy mà tổng vượt quá giới hạn này, chúng sẽ bị kill theo cơ chế đã được nêu ra ở mục trên.
Qua đây chúng ta có thể đảm bảo rằng, khi một team chẳng may gây ra sự cố ở namespace của họ, tất cả hệ thống vẫn sẽ chạy bình thường chứ không hề gây ra sự cố hỏng hóc gì cho toàn hệ thống. Đặc biệt trong các cluster dev, việc này là quan trọng để tránh một team sẽ phá hỏng tiến độ làm việc cho các team khác. Việc thiết đặt cấp phát tài nguyên này cũng là một phương pháp để các team có thể ước lượng được lượng tài nguyên họ sẽ sử dụng rồi đưa những thông số này vào áp dùng lên product.
Kết thúc bài viết và các tài liệu tham khảo
Mong rằng thông qua bài viết này, mọi người có thể hiểu được cơ chế quản lý và deploy, kill pod của kube-scheduler, cũng như sự quan trọng của việc giới hạn và cấp phát tài nguyên trong hệ thống.
Các tài liệu tham khảo:
Setting Resource Requests and Limits in Kubernetes - https://www.youtube.com/watch?v=xjpHggHKm78
Kubernetes Scheduler - https://kubernetes.io/docs/concepts/scheduling-eviction/kube-scheduler/
Pod Priority and Preemption - https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
Resource Quotas - https://kubernetes.io/docs/concepts/policy/resource-quotas/
0 notes
suzanneshannon · 4 years
Text
Building a Blog with Next.js
In this article, we will use Next.js to build a static blog framework with the design and structure inspired by Jekyll. I’ve always been a big fan of how Jekyll makes it easier for beginners to setup a blog and at the same time also provides a great degree of control over every aspect of the blog for the advanced users.
With the introduction of Next.js in recent years, combined with the popularity of React, there is a new avenue to explore for static blogs. Next.js makes it super easy to build static websites based on the file system itself with little to no configuration required.
The directory structure of a typical bare-bones Jekyll blog looks like this:
. ├─── _posts/          ...blog posts in markdown ├─── _layouts/        ...layouts for different pages ├─── _includes/       ...re-usable components ├─── index.md         ...homepage └─── config.yml       ...blog config
The idea is to design our framework around this directory structure as much as possible so that it becomes easier to  migrate a blog from Jekyll by simply reusing the posts and configs defined in the blog.
For those unfamiliar with Jekyll, it is a static site generator that can transform your plain text into static websites and blogs. Refer the quick start guide to get up and running with Jekyll. This article also assumes that you have a basic knowledge of React. If not, React’s getting started page is a good place to start.
Installation
Next.js is powered by React and written in Node.js. So we need to install npm first, before adding next, react and react-dom to the project.
mkdir nextjs-blog && cd $_ npm init -y npm install next react react-dom --save
To run Next.js scripts on the command line, we have to add the next command to the scripts section of our package.json.
"scripts": {   "dev": "next" }
We can now run npm run dev on the command line for the first time. Let’s see what happens.
$ npm run dev > [email protected] dev /~user/nextjs-blog > next ready - started server on http://localhost:3000 Error: > Couldn't find a `pages` directory. Please create one under the project root
The compiler is complaining about a missing pages directory in the root of the project. We’ll learn about the concept of pages in the next section.
Concept of pages
Next.js is built around the concept of pages. Each page is a React component that can be of type .js or .jsx which is mapped to a route based on the filename. For example:
File                            Route ----                            ----- /pages/about.js                 /about /pages/projects/work1.js        /projects/work1 /pages/index.js                 /
Let’s create the pages directory in the root of the project and populate our first page, index.js, with a basic React component.
// pages/index.js export default function Blog() {   return <div>Welcome to the Next.js blog</div> }
Run npm run dev once again to start the server and navigate to http://localhost:3000 in the browser to view your blog for the first time.
Tumblr media
Out of the box, we get:
Hot reloading so we don’t have to refresh the browser for every code change.
Static generation of all pages inside the /pages/** directory.
Static file serving for assets living in the/public/** directory.
404 error page.
Navigate to a random path on localhost to see the 404 page in action. If you need a custom 404 page, the Next.js docs have great information.
Tumblr media
Dynamic pages
Pages with static routes are useful to build the homepage, about page, etc. However, to dynamically build all our posts, we will use the dynamic route capability of Next.js. For example:
File                        Route ----                        ----- /pages/posts/[slug].js      /posts/1                             /posts/abc                             /posts/hello-world
Any route, like /posts/1, /posts/abc, etc., will be matched by /posts/[slug].js and the slug parameter will be sent as a query parameter to the page. This is especially useful for our blog posts because we don’t want to create one file per post; instead we could dynamically pass the slug to render the corresponding post.
Anatomy of a blog
Now, since we understand the basic building blocks of Next.js, let’s define the anatomy of our blog.
. ├─ api │  └─ index.js             # fetch posts, load configs, parse .md files etc ├─ _includes │  ├─ footer.js            # footer component │  └─ header.js            # header component ├─ _layouts │  ├─ default.js           # default layout for static pages like index, about │  └─ post.js              # post layout inherts from the default layout ├─ pages │  ├─ index.js             # homepage |  └─ posts                # posts will be available on the route /posts/ |     └─ [slug].js       # dynamic page to build posts └─ _posts    ├─ welcome-to-nextjs.md    └─ style-guide-101.md
Blog API
A basic blog framework needs two API functions: 
A function to fetch the metadata of all the posts in _posts directory
A function to fetch a single post for a given slug with the complete HTML and metadata
Optionally, we would also like all the site’s configuration defined in config.yml to be available across all the components. So we need a function that will parse the YAML config into a native object.
Since, we would be dealing with a lot of non-JavaScript files, like Markdown (.md), YAML (.yml), etc, we’ll use the raw-loader library to load such files as strings to make it easier to process them. 
npm install raw-loader --save-dev
Next we need to tell Next.js to use raw-loader when we import .md and .yml file formats by creating a next.config.js file in the root of the project (more info on that).
module.exports = {   target: 'serverless',   webpack: function (config) {     config.module.rules.push({test:  /\.md$/, use: 'raw-loader'})     config.module.rules.push({test: /\.yml$/, use: 'raw-loader'})     return config   } }
Next.js 9.4 introduced aliases for relative imports which helps clean up the import statement spaghetti caused by relative paths. To use aliases, create a jsconfig.json file in the project’s root directory specifying the base path and all the module aliases needed for the project.
{   "compilerOptions": {     "baseUrl": "./",     "paths": {       "@includes/*": ["_includes/*"],       "@layouts/*": ["_layouts/*"],       "@posts/*": ["_posts/*"],       "@api": ["api/index"],     }   } }
For example, this allows us to import our layouts by just using:
import DefaultLayout from '@layouts/default'
Fetch all the posts
This function will read all the Markdown files in the _posts directory, parse the front matter defined at the beginning of the post using gray-matter and return the array of metadata for all the posts.
// api/index.js import matter from 'gray-matter' 
 export async function getAllPosts() {   const context = require.context('../_posts', false, /\.md$/)   const posts = []   for(const key of context.keys()){     const post = key.slice(2);     const content = await import(`../_posts/${post}`);     const meta = matter(content.default)     posts.push({       slug: post.replace('.md',''),       title: meta.data.title     })   }   return posts; }
A typical Markdown post looks like this:
--- title:  "Welcome to Next.js blog!" --- **Hello world**, this is my first Next.js blog post and it is written in Markdown. I hope you like it!
The section outlined by --- is called the front matter which holds the metadata of the post like, title, permalink, tags, etc. Here’s the output:
[   { slug: 'style-guide-101', title: 'Style Guide 101' },   { slug: 'welcome-to-nextjs', title: 'Welcome to Next.js blog!' } ]
Make sure you install the gray-matter library from npm first using the command npm install gray-matter --save-dev.
Fetch a single post
For a given slug, this function will locate the file in the _posts directory, parse the Markdown with the marked library and return the output HTML with metadata.
// api/index.js import matter from 'gray-matter' import marked from 'marked' 
 export async function getPostBySlug(slug) {   const fileContent = await import(`../_posts/${slug}.md`)   const meta = matter(fileContent.default)   const content = marked(meta.content)       return {     title: meta.data.title,      content: content   } }
Sample output:
{   title: 'Style Guide 101',   content: '<p>Incididunt cupidatat eiusmod ...</p>' }
Make sure you install the marked library from npm first using the command npm install marked --save-dev.
Config
In order to re-use the Jekyll config for our Next.js blog, we’ll parse the YAML file using the js-yaml library and export this config so that it can be used across components.
// config.yml title: "Next.js blog" description: "This blog is powered by Next.js" 
 // api/index.js import yaml from 'js-yaml' export async function getConfig() {   const config = await import(`../config.yml`)   return yaml.safeLoad(config.default) }
Make sure you install js-yaml from npm first using the command npm install js-yaml --save-dev.
Includes
Our _includes directory contains two basic React components, <Header> and <Footer>, which will be used in the different layout components defined in the _layouts directory.
// _includes/header.js export default function Header() {   return <header><p>Blog | Powered by Next.js</p></header> } 
 // _includes/footer.js export default function Footer() {   return <footer><p>©2020 | Footer</p></footer> }
Layouts
We have two layout components in the _layouts directory. One is the <DefaultLayout> which is the base layout on top of which every other layout component will be built.
// _layouts/default.js import Head from 'next/head' import Header from '@includes/header' import Footer from '@includes/footer' 
 export default function DefaultLayout(props) {   return (     <main>       <Head>         <title>{props.title}</title>         <meta name='description' content={props.description}/>       </Head>       <Header/>       {props.children}       <Footer/>     </main>   ) }
The second layout is the <PostLayout> component that will override the title defined in the <DefaultLayout> with the post title and render the HTML of the post. It also includes a link back to the homepage.
// _layouts/post.js import DefaultLayout from '@layouts/default' import Head from 'next/head' import Link from 'next/link' 
 export default function PostLayout(props) {   return (     <DefaultLayout>       <Head>         <title>{props.title}</title>       </Head>       <article>         <h1>{props.title}</h1>         <div dangerouslySetInnerHTML=/>         <div><Link href='/'><a>Home</a></Link></div>        </article>     </DefaultLayout>   ) }
next/head is a built-in component to append elements to the <head> of the page. next/link is a built-in component that handles client-side transitions between the routes defined in the pages directory.
Homepage
As part of the index page, aka homepage, we will list all the posts inside the _posts directory. The list will contain the post title and the permalink to the individual post page. The index page will use the <DefaultLayout> and we’ll import the config in the homepage to pass the title and description to the layout.
// pages/index.js import DefaultLayout from '@layouts/default' import Link from 'next/link' import { getConfig, getAllPosts } from '@api' 
 export default function Blog(props) {   return (     <DefaultLayout title={props.title} description={props.description}>       <p>List of posts:</p>       <ul>         {props.posts.map(function(post, idx) {           return (             <li key={idx}>               <Link href={'/posts/'+post.slug}>                 <a>{post.title}</a>               </Link>             </li>           )         })}       </ul>     </DefaultLayout>   ) }  
 export async function getStaticProps() {   const config = await getConfig()   const allPosts = await getAllPosts()   return {     props: {       posts: allPosts,       title: config.title,       description: config.description     }   } }
getStaticProps is called at the build time to pre-render pages by passing props to the default component of the page. We use this function to fetch the list of all posts at build time and render the posts archive on the homepage.
Tumblr media
Post page
This page will render the title and contents of the post for the slug supplied as part of the context. The post page will use the <PostLayout> component.
// pages/posts/[slug].js import PostLayout from '@layouts/post' import { getPostBySlug, getAllPosts } from "@api" 
 export default function Post(props) {   return <PostLayout title={props.title} content={props.content}/> } 
 export async function getStaticProps(context) {   return {     props: await getPostBySlug(context.params.slug)   } } 
 export async function getStaticPaths() {   let paths = await getAllPosts()   paths = paths.map(post => ({     params: { slug:post.slug }   })); �� return {     paths: paths,     fallback: false   } }
If a page has dynamic routes, Next.js needs to know all the possible paths at build time. getStaticPaths supplies the list of paths that has to be rendered to HTML at build time. The fallback property ensures that if you visit a route that does not exist in the list of paths, it will return a 404 page.
Tumblr media
Production ready
Add the following commands for build and start in package.json, under the scripts section and then run npm run build followed by npm run start to build the static blog and start the production server.
// package.json "scripts": {   "dev": "next",   "build": "next build",   "start": "next start" }
The entire source code in this article is available on this GitHub repository. Feel free to clone it locally and play around with it. The repository also includes some basic placeholders to apply CSS to your blog.
Improvements
The blog, although functional, is perhaps too basic for most average cases. It would be nice to extend the framework or submit a patch to include some more features like:
Pagination
Syntax highlighting
Categories and Tags for posts
Styling
Overall, Next.js seems really very promising to build static websites, like a blog. Combined with its ability to export static HTML, we can built a truly standalone app without the need of a server!
The post Building a Blog with Next.js appeared first on CSS-Tricks.
You can support CSS-Tricks by being an MVP Supporter.
Building a Blog with Next.js published first on https://deskbysnafu.tumblr.com/
0 notes
mbaljeetsingh · 4 years
Text
Building a Blog with Next.js
In this article, we will use Next.js to build a static blog framework with the design and structure inspired by Jekyll. I’ve always been a big fan of how Jekyll makes it easier for beginners to setup a blog and at the same time also provides a great degree of control over every aspect of the blog for the advanced users.
With the introduction of Next.js in recent years, combined with the popularity of React, there is a new avenue to explore for static blogs. Next.js makes it super easy to build static websites based on the file system itself with little to no configuration required.
The directory structure of a typical bare-bones Jekyll blog looks like this:
. ├─── _posts/          ...blog posts in markdown ├─── _layouts/        ...layouts for different pages ├─── _includes/       ...re-usable components ├─── index.md         ...homepage └─── config.yml       ...blog config
The idea is to design our framework around this directory structure as much as possible so that it becomes easier to  migrate a blog from Jekyll by simply reusing the posts and configs defined in the blog.
For those unfamiliar with Jekyll, it is a static site generator that can transform your plain text into static websites and blogs. Refer the quick start guide to get up and running with Jekyll. This article also assumes that you have a basic knowledge of React. If not, React’s getting started page is a good place to start.
Installation
Next.js is powered by React and written in Node.js. So we need to install npm first, before adding next, react and react-dom to the project.
mkdir nextjs-blog && cd $_ npm init -y npm install next react react-dom --save
To run Next.js scripts on the command line, we have to add the next command to the scripts section of our package.json.
"scripts": {   "dev": "next" }
We can now run npm run dev on the command line for the first time. Let’s see what happens.
$ npm run dev > [email protected] dev /~user/nextjs-blog > next ready - started server on http://localhost:3000 Error: > Couldn't find a `pages` directory. Please create one under the project root
The compiler is complaining about a missing pages directory in the root of the project. We’ll learn about the concept of pages in the next section.
Concept of pages
Next.js is built around the concept of pages. Each page is a React component that can be of type .js or .jsx which is mapped to a route based on the filename. For example:
File                            Route ----                            ----- /pages/about.js                 /about /pages/projects/work1.js        /projects/work1 /pages/index.js                 /
Let’s create the pages directory in the root of the project and populate our first page, index.js, with a basic React component.
// pages/index.js export default function Blog() {   return <div>Welcome to the Next.js blog</div> }
Run npm run dev once again to start the server and navigate to http://localhost:3000 in the browser to view your blog for the first time.
Tumblr media
Out of the box, we get:
Hot reloading so we don’t have to refresh the browser for every code change.
Static generation of all pages inside the /pages/** directory.
Static file serving for assets living in the/public/** directory.
404 error page.
Navigate to a random path on localhost to see the 404 page in action. If you need a custom 404 page, the Next.js docs have great information.
Tumblr media
Dynamic pages
Pages with static routes are useful to build the homepage, about page, etc. However, to dynamically build all our posts, we will use the dynamic route capability of Next.js. For example:
File                        Route ----                        ----- /pages/posts/[slug].js      /posts/1                             /posts/abc                             /posts/hello-world
Any route, like /posts/1, /posts/abc, etc., will be matched by /posts/[slug].js and the slug parameter will be sent as a query parameter to the page. This is especially useful for our blog posts because we don’t want to create one file per post; instead we could dynamically pass the slug to render the corresponding post.
Anatomy of a blog
Now, since we understand the basic building blocks of Next.js, let’s define the anatomy of our blog.
. ├─ api │  └─ index.js             # fetch posts, load configs, parse .md files etc ├─ _includes │  ├─ footer.js            # footer component │  └─ header.js            # header component ├─ _layouts │  ├─ default.js           # default layout for static pages like index, about │  └─ post.js              # post layout inherts from the default layout ├─ pages │  ├─ index.js             # homepage |  └─ posts                # posts will be available on the route /posts/ |     └─ [slug].js       # dynamic page to build posts └─ _posts    ├─ welcome-to-nextjs.md    └─ style-guide-101.md
Blog API
A basic blog framework needs two API functions: 
A function to fetch the metadata of all the posts in _posts directory
A function to fetch a single post for a given slug with the complete HTML and metadata
Optionally, we would also like all the site’s configuration defined in config.yml to be available across all the components. So we need a function that will parse the YAML config into a native object.
Since, we would be dealing with a lot of non-JavaScript files, like Markdown (.md), YAML (.yml), etc, we’ll use the raw-loader library to load such files as strings to make it easier to process them. 
npm install raw-loader --save-dev
Next we need to tell Next.js to use raw-loader when we import .md and .yml file formats by creating a next.config.js file in the root of the project (more info on that).
module.exports = {   target: 'serverless',   webpack: function (config) {     config.module.rules.push({test:  /\.md$/, use: 'raw-loader'})     config.module.rules.push({test: /\.yml$/, use: 'raw-loader'})     return config   } }
Next.js 9.4 introduced aliases for relative imports which helps clean up the import statement spaghetti caused by relative paths. To use aliases, create a jsconfig.json file in the project’s root directory specifying the base path and all the module aliases needed for the project.
{   "compilerOptions": {     "baseUrl": "./",     "paths": {       "@includes/*": ["_includes/*"],       "@layouts/*": ["_layouts/*"],       "@posts/*": ["_posts/*"],       "@api": ["api/index"],     }   } }
For example, this allows us to import our layouts by just using:
import DefaultLayout from '@layouts/default'
Fetch all the posts
This function will read all the Markdown files in the _posts directory, parse the front matter defined at the beginning of the post using gray-matter and return the array of metadata for all the posts.
// api/index.js import matter from 'gray-matter' 
 export async function getAllPosts() {   const context = require.context('../_posts', false, /\.md$/)   const posts = []   for(const key of context.keys()){     const post = key.slice(2);     const content = await import(`../_posts/${post}`);     const meta = matter(content.default)     posts.push({       slug: post.replace('.md',''),       title: meta.data.title     })   }   return posts; }
A typical Markdown post looks like this:
--- title:  "Welcome to Next.js blog!" --- **Hello world**, this is my first Next.js blog post and it is written in Markdown. I hope you like it!
The section outlined by --- is called the front matter which holds the metadata of the post like, title, permalink, tags, etc. Here’s the output:
[   { slug: 'style-guide-101', title: 'Style Guide 101' },   { slug: 'welcome-to-nextjs', title: 'Welcome to Next.js blog!' } ]
Make sure you install the gray-matter library from npm first using the command npm install gray-matter --save-dev.
Fetch a single post
For a given slug, this function will locate the file in the _posts directory, parse the Markdown with the marked library and return the output HTML with metadata.
// api/index.js import matter from 'gray-matter' import marked from 'marked' 
 export async function getPostBySlug(slug) {   const fileContent = await import(`../_posts/${slug}.md`)   const meta = matter(fileContent.default)   const content = marked(meta.content)       return {     title: meta.data.title,      content: content   } }
Sample output:
{   title: 'Style Guide 101',   content: '<p>Incididunt cupidatat eiusmod ...</p>' }
Make sure you install the marked library from npm first using the command npm install marked --save-dev.
Config
In order to re-use the Jekyll config for our Next.js blog, we’ll parse the YAML file using the js-yaml library and export this config so that it can be used across components.
// config.yml title: "Next.js blog" description: "This blog is powered by Next.js" 
 // api/index.js import yaml from 'js-yaml' export async function getConfig() {   const config = await import(`../config.yml`)   return yaml.safeLoad(config.default) }
Make sure you install js-yaml from npm first using the command npm install js-yaml --save-dev.
Includes
Our _includes directory contains two basic React components, <Header> and <Footer>, which will be used in the different layout components defined in the _layouts directory.
// _includes/header.js export default function Header() {   return <header><p>Blog | Powered by Next.js</p></header> } 
 // _includes/footer.js export default function Footer() {   return <footer><p>©2020 | Footer</p></footer> }
Layouts
We have two layout components in the _layouts directory. One is the <DefaultLayout> which is the base layout on top of which every other layout component will be built.
// _layouts/default.js import Head from 'next/head' import Header from '@includes/header' import Footer from '@includes/footer' 
 export default function DefaultLayout(props) {   return (     <main>       <Head>         <title>{props.title}</title>         <meta name='description' content={props.description}/>       </Head>       <Header/>       {props.children}       <Footer/>     </main>   ) }
The second layout is the <PostLayout> component that will override the title defined in the <DefaultLayout> with the post title and render the HTML of the post. It also includes a link back to the homepage.
// _layouts/post.js import DefaultLayout from '@layouts/default' import Head from 'next/head' import Link from 'next/link' 
 export default function PostLayout(props) {   return (     <DefaultLayout>       <Head>         <title>{props.title}</title>       </Head>       <article>         <h1>{props.title}</h1>         <div dangerouslySetInnerHTML=/>         <div><Link href='/'><a>Home</a></Link></div>        </article>     </DefaultLayout>   ) }
next/head is a built-in component to append elements to the <head> of the page. next/link is a built-in component that handles client-side transitions between the routes defined in the pages directory.
Homepage
As part of the index page, aka homepage, we will list all the posts inside the _posts directory. The list will contain the post title and the permalink to the individual post page. The index page will use the <DefaultLayout> and we’ll import the config in the homepage to pass the title and description to the layout.
// pages/index.js import DefaultLayout from '@layouts/default' import Link from 'next/link' import { getConfig, getAllPosts } from '@api' 
 export default function Blog(props) {   return (     <DefaultLayout title={props.title} description={props.description}>       <p>List of posts:</p>       <ul>         {props.posts.map(function(post, idx) {           return (             <li key={idx}>               <Link href={'/posts/'+post.slug}>                 <a>{post.title}</a>               </Link>             </li>           )         })}       </ul>     </DefaultLayout>   ) }  
 export async function getStaticProps() {   const config = await getConfig()   const allPosts = await getAllPosts()   return {     props: {       posts: allPosts,       title: config.title,       description: config.description     }   } }
getStaticProps is called at the build time to pre-render pages by passing props to the default component of the page. We use this function to fetch the list of all posts at build time and render the posts archive on the homepage.
Tumblr media
Post page
This page will render the title and contents of the post for the slug supplied as part of the context. The post page will use the <PostLayout> component.
// pages/posts/[slug].js import PostLayout from '@layouts/post' import { getPostBySlug, getAllPosts } from "@api" 
 export default function Post(props) {   return <PostLayout title={props.title} content={props.content}/> } 
 export async function getStaticProps(context) {   return {     props: await getPostBySlug(context.params.slug)   } } 
 export async function getStaticPaths() {   let paths = await getAllPosts()   paths = paths.map(post => ({     params: { slug:post.slug }   }));   return {     paths: paths,     fallback: false   } }
If a page has dynamic routes, Next.js needs to know all the possible paths at build time. getStaticPaths supplies the list of paths that has to be rendered to HTML at build time. The fallback property ensures that if you visit a route that does not exist in the list of paths, it will return a 404 page.
Tumblr media
Production ready
Add the following commands for build and start in package.json, under the scripts section and then run npm run build followed by npm run start to build the static blog and start the production server.
// package.json "scripts": {   "dev": "next",   "build": "next build",   "start": "next start" }
The entire source code in this article is available on this GitHub repository. Feel free to clone it locally and play around with it. The repository also includes some basic placeholders to apply CSS to your blog.
Improvements
The blog, although functional, is perhaps too basic for most average cases. It would be nice to extend the framework or submit a patch to include some more features like:
Pagination
Syntax highlighting
Categories and Tags for posts
Styling
Overall, Next.js seems really very promising to build static websites, like a blog. Combined with its ability to export static HTML, we can built a truly standalone app without the need of a server!
The post Building a Blog with Next.js appeared first on CSS-Tricks.
via CSS-Tricks https://ift.tt/38RTO6t
0 notes
mshai002 · 4 years
Text
making core code
Faces.py
In the first part of my code, I am setting up the video capture using cv2 (numpy import is for the next step, converting images into numbers). And then while it is running, I convert the frame, which ‘reads’, into grayscale. This is because, as could be seen in my previous blog about haar cascades, to detect (before ‘recognizing’), the in-built cascade classifier depends on the grayscale. The faces get turned into pixels, which will be in shades from black to white, and numbered and recorded, against which are checked new faces for detection. And to use the haar cascade I copy-pasted the file from the cv2′s libraries into the project file.
This code’s guidances was, apart from stackoverflow and other youtube videos, predominantly from ‘codingforentrepreneurs’ git page on openCV: https://github.com/codingforentrepreneurs/OpenCV-Python-Series
https://medium.com/swlh/gender-classifier-with-tensorflow-164b62a3557e
https://docs.opencv.org/2.4/modules/contrib/doc/facerec/tutorial/facerec_gender_classification.html
I set up the detect function using the grey version and then draw a frame around the face detected. Below can be seen the output, is the measurements and the position of the face on cam.
Tumblr media
FacesTrain.py
In this new file, we will load the images and train on them. The first step is to set up the ‘os.walk’. We import os and then ‘walk through’ our directory and look through images. This took me some time to figure out. The BASE_DIR is basically the base directory where all these files are. And then the image_dir will get the images’ directory from within it. Walking through the images, we see if they are jpg or png and add them from our recognised ‘root’ and ‘file’ into ‘path’. We also, as a precaution get rid of all spaces with hyphens in the names: Mehroz Shaikh will become Mehroz-Shaikh. After lots of complicated trials, I was able to grasp the os.path concept, though still not that confidently. But it works. We create an empty dictionary via y_labels and x_train, similar to what we did in data mining. The labels are the ultimate class in the y-axis, and the other one is everything else. We train on all of it. Before training, we need to turn the images into numbers using ‘pillow’ as PIL. From PIL’s Image, we will convert the images grey before converting into NumPy's arrays. 
Tumblr media
Now we have images as numbers from the above. And then, we do the same face detection we did for faces.py. We need to learn the faces that are in grayscale as well in the dataset. We, like in faces.py, will set up the region of interest and ‘append’ them to x_train. Then we need to create ids in with the labels with number values associated with it. We create a dictionary of label_ids, along with a ‘current_id’ to integrate it into the code and add values. This is in the form of the conditionals, whereby we add the labels that are not in the dictionary to it. The x_train takes the region of interest and the y_labels takes the id_s. Then we will save the labels so that we can use it in faces.py. For this we will use a library called ‘pickle’. We open labels through pickle as ‘f’, and store the label_ids into this file for prediction.
Tumblr media
Now we will implement the recognizer from openCV that is in-built: LBPHFaceRecognizer. Once we set it up, at the bottom of the code we simply ask it train: recognizer.train(x_train, np.array(y_labels)), and save as a .yml file. This is exactly what I learned in Data Mining module. Now the training file is ready and when run, trains and saves in the yml file, which we will use in the faces.py file. 
This trained model needs to be used in the faces.py file by bringing in the LBPHFaceReacognizer here too, but we also set it up to .read(). We will now implement the predicting in the code after the grey region of interest (roi) was set up before. We set the prediction on id and conf (for confidence). When we run and test, we will set a threshold of somewhere between 0 to 100. We set it to >=45. If the confidence is more than that then predict (and print) the corresponding id_. However, the id_ is just a number and not the name, so we will now use this id and get its name using ‘pickle’. After importing pickle, we will do what we did--open, but not write but read so ‘rb’, and then instead of dumping the label_ids and f, for file, we will load the f. We will add this to a og_labels={}, which we will quickly adjust the order of so that the name is first and put this version into n empty dictionary called labels={}. Now when we test the prediction, we search the id_s in this labels. We also resize the images for slight adjustment in the training code.
Tumblr media
0 notes
craigbrownphd · 4 years
Text
Fresh from the Python Package Index
• jcopdl J.COp DL is a deep Learning package to complement pytorch workflow. It includes pytroch callbacks and metrics. • latent-dirichlet-allocation Latent-dirichlet-allocation • TensorKit • TensorKit-plottools • TensorKit-tools • torchtrainer Focus on building and optimizing pytorch models not on training loops. PyTorch model training made simpler without loosing control. Focus on optimizing your model! Concepts are heavily inspired by the awesome project [torchsample](https://…/torchsample ) and [Keras](https://…/keras ). Further, besides applying Epoch Callbacks it also allows to call Callbacks every time after a specific number of batches passed (iterations) for long epoch durations. • TorchVC Voice Conversion in PyTorch • abode Python Environment and Package Manager • dibbo A framework for Distributed Black-Box Optimization • jupyterlab-zenodo A Jupyter Notebook extension which enables uploading to Zenodo from JupyterLab • mlgen MLGen is a tool which helps you to generate machine learning code with ease. MlGen is a tool which helps you to generate machine learning code with ease. MLGen uses a ‘.mlm’ file format which is a file with YML like syntax. This tool as of now supports keras and tensorflow2.0(not fully supported) • naturalselection An all-purpose pythonic genetic algorithm • pyexlatex Python Extends LaTeX – A High-Level Python API for Creating Latex Documents. This project is aimed at creating LaTeX documents using only Python, without directly writing LaTeX code. Rather than building a direct Python API to LaTeX, this package has its own, simpler API to creating documents. • pysimrel Simulating data from linear model data • saattrupdan.darwin An all-purpose pythonic genetic algorithm • som-learn Self-Organizing Map algorithm. • sqlizer Orchestration service for SQL only ETL workflows. In many cases you can use SQL only for ETL (extract/transform/load) pipelines relying on CTAS (create table as) queries and the builting import/export futures of your RDBMS or data warehouse software (eg. Redshift). • textsense TextSense.ai a Text analytics platform. http://bit.ly/34pxcqy
0 notes
ustswebagency · 6 years
Text
Symfony 4 : Quelles sont les dernières nouveautés ?
Symfony 4 : Quelles sont les dernières nouveautés ?
Cette semaine, entre deux toasts de foie gras et quelques verres de champagne aussi, USTS évoque pour vous la version 4 du framework de SensioLabs, Symfony, et vous donne les dernières nouveautés d’importance.
  J’ai un peu la gueule de bois, peux-tu me rappeler ce qu’est Symfony ?
T’as plus l’âge pour boire autant … C’est pas faute de te le dire … Bref, va chercher un cachet d’aspirine, ça me laisse le temps ainsi de t’expliquer rapidement ce qu’est Symfony.
Déjà, rien à voir avec la musique, si vous voulez devenir le nouveau André Rieu, c’est pas cette création qui vous aidera. Symfony est un framework PHP développé par la société française SensioLabs et qui est sorti en octobre 2005. Il fournit des fonctionnalités modulables et adaptables qui permettent de faciliter et d’accélérer aussi le développement d’un site web. Actuellement à sa version 4, sachez qu’il a passé la barre du milliard de téléchargement en septembre dernier. Pas mal, non ?
Ok j’ai compris, tu sais que je t’aime toi ? C’est quoi les nouveautés alors ?
Houlà, prends un deuxième cachet d’aspirine … Prends en même deux d’un coup à mon avis et respire un grand coup aussi. Voici les nouveautés :
– Tri dans les bundles
 Dans cette nouvelle version, vous remarquerez que seuls les bundles core sont présents. Vous pouvez ainsi utiliser uniquement les bundles dont vous avez besoin. Cette amélioration permet de réduire significativement la taille du site et de gagner en performance.
  – Le code devient BundleLess
Ce changement concerne le développement interne de votre application. Vous n’avez plus à gérer les problématiques attenantes à l’utilisation de Bundles : cette amélioration simplifie donc l’utilisation des classes dans le dossier « SRC » qui sont simplement régies par le namespace « App ».
– Simplification de l’utilisation des Bundles externes
Symfony embarque la possibilité d’écrire des Recettes correspondant à une suite de lignes de commandes, qui seront exécutées à l’installation du Bundle. Lorsque vous souhaitez intégrer un Bundle externe, plus besoin de se casser la tête à lire le Readme ou n’importe quelle autre documentation, il suffit au contributeur du Bundle de décrire dans son fichier Recipe les actions à exécuter et elles seront ainsi automatiquement exécutées à l’installation du Bundle.
– Chaque Bundle contiendra son dossier de configuration personnel
C’est terminé la centralisation des configurations dans Config,yml. Rassurez-vous, si vous aimez les anciennes méthodes, vous pouvez aussi installer les Bundles sans utiliser ces nouvelles fonctionnalités.
– Apparition du dossier « Templates »
Il remplace le dossier « View » car ce dernier est un concept à part entière. Le dossier « etc » remplace le dossier « app/config » et contient la configuration de l’instance. Cette modification sert simplement à raccourcir le chemin vers les fichiers de configuration.
En conclusion,
Cette nouvelle version n’est pas qu’une petite mise à jour comme on pouvait s’y attendre étant donné qu’elle apparaît peu de temps après la version 3. C’est une véritable version majeure qui apporte de nombreux changements importants mais aussi des modifications moins utiles. Il n’y a plus qu’à la tester pour voir si elle vous plaît …
Source article : supinfo.com
Source image : Stock.adobe.com
Agence USTS : usts.fr
[Symfony, Technologie]
https://usts.fr/symfony-4-dernieres-nouveautes/
0 notes
cupid-styles · 3 months
Text
a day in the life (ymls)
Tumblr media Tumblr media Tumblr media
it's been awhile since I've posted anything about these cuties so here's a lil blurb!!!!! hope you enjoy :)
word count: 1.3k
content warnings: family stuff, y/n is no longer pregnant BUT there's discussions of her pregnancy, giving birth, and lactating/breastfeeding
ymls masterlist
main masterlist | talk to me
patreon
. . .
Y/N never asked Harry to live with her.
They never had a conversation about it, instead just deciding to go to her house after she and Clementine were released from the hospital because it would likely be easier to recover in her own space — all of her lactation gear was there, along with the three (3!) different pregnancy pillows Harry purchased for her throughout the duration of the pregnancy. 
But then he just never… left.
In hindsight, despite neither of them bringing it up, they both recognize that it’s a way past overdue discussion. Someone should’ve been like, “hey, I know we’ve only been dating for like four months or so and we’re having a baby together, but should we live in the same space, maybe? Just for ease of parenting and all that?”. 
Surprisingly, though, since Y/N very much appreciates her own room — she didn’t do well in college when she had a roommate in their dorm, and she’s very much an introvert that adores heading home at the end of the long day and simply being alone — she hasn’t completely hated Harry being around all the time. It’s the most that they’ve ever spent time together, a whopping three and a half weeks straight since Clementine was born.
It’s a different kind of time, though, considering a newborn’s schedule is unlike anything else. They alternate between who gets to nap during the day and while Y/N is technically cleared for recovery, she still aches like… well, like she pushed an entire body through her. (Even when she tears up looking at Clementine nearly every day, she still shudders at the thought of giving birth. Harry called it the most beautiful thing he’s ever seen and she sincerely wonders if he’s mentally well.) 
And somehow, they’ve developed a schedule that works quite well, for now at least. Clementine, their sweet little baby girl, is a decent sleeper. Per all those parenting books Harry obsessed over for nine months, she spends most of her time sleeping, with multiple feeding times throughout the day and night.
When Harry and Y/N both manage to be awake and conscious during the day, they hover over her bassinet — well, formerly in Y/N’s room, but now it seems to be Y/N’s plus Harry’s room? — quietly leaning in to make sure she’s breathing okay, admiring her cute little face, and taking pictures of the adorable onesies Harry puts her in. They have visitors, of course, including both pairs of their parents, siblings, and mutual friends. There’s a lot of crying and smiling and, oddly enough, entertaining, which is silly considering they’re still brand new parents who are working off of two- or three-hour incremental naps. 
In terms of their dynamic, things shift slightly, but Y/N is still the grump Harry adores. She’s exhausted, understandably so. The whole breastfeeding thing wreaks havoc on her body and Clementine doesn’t love it, so she tries her best to regularly pump milk for her, but she hates sitting on the couch, asking Harry to turn on some stupid reality show to distract her, and feeling the machine push and prod at her breasts. 
“This makes me feel like a cow,” she’d huffed the first time they did it, and it made Harry snort so loud he had to excuse himself from the room. 
But Harry… he’s good, even if it’s difficult for Y/N to properly communicate that to him. She knows she got very lucky with him, not just from a partnership standpoint — which, that’s an entirely different conversation that they haven’t gotten to yet — but a parenting one, too. He has no reason to get up with her at 3 am because Clem’s doing her sweet little lamb cries from the corner of their bedroom. Y/N can very easily escape to the room she designated as her nursery months back, where there’s a comfy nursing chair her mother bought her, but instead Harry’s up before Y/N’s eyes are even properly open, gently placing her in her arms and pushing a warm bottle into her hand.
He insists on helping her with every feeding, taking on more diaper changes than Y/N, and even doing his best to take care of her along the way. He helps her into the bath when her bones and joints are too achy to stand in the shower, he never complains about cooking them dinner (if Y/N orders food one more time, she thinks her bank will call her and ask if she’s been taken hostage by one of those ordering apps), and, even with her heightened hormones and emotions, she does indeed cry helplessly, salty tears leaking onto her daughter’s forehead when Harry comes home one day with a bouquet of flowers, a tidy note in the front that says “for my girls”. 
It makes him laugh so hard, the sight of his cranky girl in her milk-stained robe standing in the kitchen, gently rocking Clementine as she holds the pretty stems. 
“Why are you laughing?” Y/N sniffs, lifting her hand to quickly wipe tears away from her cheeks. 
“Because you just look so cute right now,” he says with a grin. He takes the flowers back from her, murmuring out something about putting them in a vase. 
“Sometimes I do wonder if you’re certifiably insane.” Y/N mutters, partially to herself. When she glances down at a milk drunk Clem, a smile quirks at the edges of her lips. “What do you think, Clemmie? Is dada crazy?”
Harry knows that this isn’t the traditional family he dreamed about, that having a baby with Y/N was a risk he was only willing to take because he always wanted to be a dad — but shit, he’s so happy. 
(Y/N is, too. She’s over the moon, with the way gratitude feels like it fills up her body in a way she’s never experienced before. And she knows she’s awful at expressing her feelings, but when she glances back up at Harry, eyes twinkling with a healthy blush over her cheeks and a smile on her lips, he knows. He just knows.)
625 notes · View notes
kickoffme-blog · 7 years
Text
Ten Pointers for New Drupal 8 Developers
New Post has been published on http://www.kickoffme.com/ten-pointers-for-new-drupal-8-developers/
Ten Pointers for New Drupal 8 Developers
Ten Pointers for New Drupal 8 Developers
Ten Pointers for New Drupal 8 Developers
02/10/2016 – 10:46
We’ve been experimenting with Drupal 8 for a while now, but this site is the first project we’ve put into production built on it.
For folks who’ve worked with Drupal 6 or 7 previously and are just getting started using 8, here are a few tidbits worth being aware of when getting started.
1. Sooo much contrib is bundled in core now.
Those who’ve been in the Drupal community for quite a while remember the “Small Core” initiative. The idea was to strip Drupal core down to a minimalist framework, then use distributions to provide bundles of modules and configuration that would make Drupal a useful application in a particular scenario. Drupal Core itself would not be a useable product.
Small Core lost. Drupal 8 core contains major functionality that previously was provided by contrib modules, including Views, Views Datasource, Services, Entity API, Image Cache, Responsive Images, Breakpoints, Migrate, and WYSIWYG. Drupal 8 is a much more complete product out of the box then any previous version of Drupal.
A few features were removed from Drupal 8, most noticeably the blog module. It is easy to reproduce the blog functionality with the blog contrib module or even just by using the core components to add a custom content type and views to display the content. The latter approach is what we decided to do here.
When Drupal 7 was released many developers got burned by how many contrib modules weren’t ready yet. The inclusion of so many essential modules in core has significant mitigated that issue, but there are still a number of “essential” contrib modules that aren’t stable yet, notably token, pathauto, rules, and webform. There are prerelease versions of most of these modules in varying degrees of stability, and certainly trying them out, and contributing feedback, patches, and bug reports is the best way to help them get to a stable release. But sitebuilders under tight deadlines should check their requirements carefully and verify that any contrib modules they need are stable enough to use before promising complex functionality in Drupal 8 right now.
2. The authoring environment is massively improved.
The lack of a consistent author environment and authoring tools has, for years, been one of Drupal’s biggest weaknesses when compared to other CMSes like WordPress. Developers love Drupal, but authors usually prefer WordPress.
A major effort was put into Drupal 7 to improve the authoring experience (UX), which Drupal 8 builds on. The seven administration theme is responsive now. Dropbuttons have been introduced for more economical use of screen space and to prioritize primary actions.  The CKEditor WYSIWYG editor is tightly integrated with core, providing a huge gain in consistency between one Drupal 8 environment and another.
Quickedit in-page editing is a whiz-bang feature of Drupal 8.
Using QuickEdit while writing about QuickEdit
Did I mention the improvements to preview? Node previews that actually preview as they will render reduce the guesswork previously required when authoring any content containing layout code or different typefaces from the admin interface.
3. Drupal 8 is a Symfony application
Drupalcon Denver is where I first heard about the plan to build Drupal 8 with Symfony components. I’m not sure whether my recollection is flawed or if I just didn’t understand what I was hearing, but the move to Symfony didn’t sound like too big a deal: just few minor changes to the plumbing, the inclusion of a Kernel and  HTTPRequest and HTTPResponse classes that’d improve testablity. I recall a neighbour at one of the talks telling me it sounded like ASP to him.
The move to Symfony is a very big deal.  Drupal 8 is near total rewrite of Drupal, with almost all core functionality now provided through services and dependency injection and thus overrideable.  Interfaces and routing, classes and annotation, all idioms common in the Symfony world have been adopted in Drupal 8.
What is familiar to a Drupal Developer who hasn’t worked with Symfony?  Well, the core business objects like nodes, blocks, taxonomy terms, and fields still exist, though they are implemented quite differently. The hook system isn’t too different either, but be warned that what you receive in an array of parameters is quite different.  And the Form API, though not totally unchanged, is one place where the Symfony solution was rejected, though perhaps not outright: there is an active discussion on drupal.org right now about whether to integrate the Symfony form component into Drupal 9.
4. API Docs and Change records are your friend
The documentation team has worked incredibly hard to keep the documentation up with the changes that have occurred. Api.drupal.org has fantastic information about the classes and concepts you’ll encounter now.
One big issue is that many things have new names now.  This is where the change records are essential.  Something like “menu_get_object” from Drupal 6 or 7 has been replaced.  Searching for a old command in the change records will often bring up the exact code snippet you need to update your code.
5. Config management
The configuration management inititiative is one of the biggest changes in Drupal 8. All configuration, whether it be a view, a content type, or the site title, can now be managed via importing and exporting yml files, either through a UI or via Drush. The Features module, which was the best method of synchronizing configuration across development and production sites in D6 and D7, is considerably less essential now
All the nitty gritty details of configuration management are beyond the scope of this introduction, but I will share a few useful tips that we learned in development.
Start your local dev site with a config export and settings file from your staging site. You need to make sure the hash salt in your settings.php and the UUIDs in your config files are in synch, otherwise you will not be able to synchronize the configuration accross sites.
 Move the config directory out of sites/default/files. Not absolutely necessary, but it is becoming a best practice to move the config out of the site directory. It is an easy enough change to make and increases site security considerably.
Only commit production config to master, merge dev config in from branches. Config management does not include a method of identifying and merging changes between two different config directories or changes that were made in one branch that are absent in another: it is up to your source control system to handle that. If you start committing development config to your master branch, then expect to export changes from production before importing the dev changes, you will be in trouble!  It doesn’t work like that. The better method is commit to your dev branch, then export production config to master and commit. Next merge dev into master, and finally import the merged config into production. Confusing? It is a bit, and the diagram on this Pantheon blog post doesn’t make it less so. The short version is just don’t commit anything but production config to master and you’ll usually be alright.
It isn’t always obvious what will be considered config and what is content. This has been an on-going problem for Drupal Developers to wrap their head around. For example, block placement is  configuration and thus stored in yml but block content is not.  It mostly makes sense once you get in there, but undeniably there is a bit of a learning curve here.
As I mentioned, the Features module is still available; it looks like it will come into play for bundles of configuration that need to be pushed live jointly but independent of an entire site’s config. Configuration management best practices are still evolving, however, so it remains to be seen exactly how wide Features for D8 adoption is or if other tools emerge.
6. Drush and the Drupal Console
Drush is still around and as essential as ever.  A few key new command in Drush 8:
drush cr – Cache rebuild, the replacement for drush cc all in Drupal 7
drush cim – import config, similar to drush fra in 7
drush cex – export config, similar to drush fu in 7
drush cedit – edit the config yml in your editor. This can be really handy sometimes.
The Drupal Console is a new option for command line users. It is based on the Symfony Console and an extremely exciting new arrow to have in our quivers.
Drupal Console can do many of the things drush can, but the focus of this project is a bit difference than Drush’s. Most significantly is the effort in making Drupal Console generate pristine boilerplate code. That may not sound like much, but given the adoption of OO, PSR-4 namespaces, and autoloading, being able in a few keystrokes to generate a block plugin with all of the correct annotation, namespacing, and file placement is a huge timesaver. It also makes becoming productive in Drupal 8 much less daunting: you don’t initially need to understand all of the changes that have taken place. Instead, let Drupal Console take care of registering your new plugin so you can focus on just the logic you need to deliver. Later you can come back and learn about what the annotation means, what the parent class does, and so on.
7. Managing your build
We usually use Drush Make files to manage our builds, including contrib modules, patches, and libraries.
Traditional Drush Makefiles still work in Drupal 8. They have also introduced a makefile in .yml format.
Embracing a trend that has spread across the wider PHP work, Composer can also be used to manage your Drupal install, and already is being used by Drupal itself to manage dependencies. There is good documentation on how to use Composer to manage your install on Drupal.org, making use of the Drupal Composer/Drupal Project and Drupal’s Packagist host.
Whether this approach will take off or whether Drupallers will stick with Drush again remains to be seen.
8. The theme layer is now in twig.
Another element that comes to Drupal from Symfony, Twig has been adopted for templating.
Twig is easy to use and significantly more secure than PHPTemplate was. It also introduces a new template extension model to Drupal, which I’m quite excited about. I suspect it is going to take a while for existing Drupal themers to embrace this model, but folks who come to Drupal from Symfony or Django will be pleased to have extendable templates available to them. And there are promising signs that some contrib themes are starting to embrace it.
9. Theme debugging tools now in core.
In Drupal 8 in your services.yml file, you can enable theme debugging. Once you do you’ll see output like this:
with all the candidate templates listed. The template that was actually used is indicated with the x rather than the *.
One thing to watch for is that with theme debugging enabled some JSON calls break.
You know what is extra cool? Theme debugging was backported into Drupal 7 too. Try drush vset theme_debug true some time and you’ll similar output there.
More advanced debugging still requires the devel module.  kint(var) is my favourite twig debugging snippet.  The arrays are much more deeply nested than what you are used to from previous Drupals, so be sure to give php enough memory! Also, enable autoreload and disable template caching in your settings.yml file before debugging front-end code. Otherwise you need to clear cache on every page load.
10. A new approach to release management promises more rapid improvements in the future.
No longer will we have to wait five years for any significant changes in core functionality!  As is explained in the release cycle overview on Drupal.org, “Starting with Drupal 8.0.0, Drupal core releases will move to a new release cycle schedule” with the intent being for minor releases to come out twice a year. Drupal 8.0 has been out since October, thus we are only about two months from the release of 8.1.0. A beta release of 8.1 will be available in less than a month!
8.1 is going to add, among other things, improvement to migration support from Drupal 7 and the migration UI. It appears BigPipe will also make it into 8.1. Will there be upgrade issues for site builders or compatibility issues for contrib modules moving from one minor release to the next? Will poorly maintained sites end up stranded on minor releases? Again, time will tell, but it is exciting to think there will be significant improvements to core available to us a couple of times a year.
Source
0 notes
cupid-styles · 6 months
Text
you're my last shot masterlist
Tumblr media Tumblr media Tumblr media
in which harry and y/n are in the same friend group but don't like each other very much — until they have a one night stand, y/n gets pregnant, and— wait, now they're having a baby?
content warnings: pregnancy, baby talk, mentions of abortion, smut
*= smut
you're my last shot (original blurb)
halloween plans
harry's jealous
first sonogram/telling their friends
harry wants to make a marriage pact
harry snaps at y/n because she won't admit her feelings | part two
...lactation kink smut*
the night they met
the night they hooked up
babysitting y/n's niece but things don't go as planned
y/n's bad at knitting (harry adores her anyway)
finding out they're having a girl
harry defends her
harry going down on her*
y/n has to beg for it*
harry gets turned on by her bump*
someone touches y/n's bump without her permission
a good life (deciding on a baby name)
harry surprises y/n with a baby shower
fluff in the hospital after the baby's born
more lactation kink!*
a day in the life
you talk too much, let's use that mouth for something else* (smut prompt request)
love letter request
stupid air fryer concept lmao
harry's jealous clem said mama first
yours*
concepts tag
895 notes · View notes
cupid-styles · 3 months
Note
Another lactation blurb for ymls would be amazing bestie! And I would also love to see them be all domestic and fluffy!
this is fucking F I L T H and I wrote it on my phone so I’m sorry if there are any typos!!!!!!
. . .
”My tits are so fucking sore.”
Harry chuckles gently, glancing over at Y/N as she cups her breasts through the soft fabric of her sweater. His smile quickly fades into a sympathetic pout, reaching over from the wheel to wrap a hand around her thigh, squeezing it gently. “I’m sorry,” he says genuinely, pulling into the parking lot of their destination, “You’ve been doing such a good job with pumping and feeding Clem, though. I’m so thankful for you.”
It’s hard to be grouchy and grumbly when Harry says sweet things like that. His gratitude quickly melts away the irritation sitting heavy in her chest so she purses her lips instead, breathing out through her nose in lieu of a response.
It’s only their second time out without Clementine, and it’s not even anything terribly exciting. They’re just going to get lunch at a cafe they both like — they left their three month old off at Y/N’s sister’s place, but neither of them liked being away from her for too long (Harry in particular). The first time they left Clem with his parents, it was two weeks ago and it was just so they could go food shopping. They made it through two aisles before he started flexing his fingers nervously, asking Y/N if it was too early to call and ask about how Clem was doing.
(Y/N pretended like it was, but in reality, she’d been wanting to ring Harry’s mom up for the past 20 minutes.)
But having a newborn and navigating a relatively new relationship was exhausting, and Harry was insistent that they spend time together outside of her place. (He’d apparently replaced his obsession with parenting books with relationship ones.)
And that’s how they ended up sitting at their favorite sandwich spot, making quiet conversation about Y/N’s maternity leave, Clementine’s next doctor’s appointment, and Harry needing to end the lease on his own apartment sometime soon.
Everything’s going fine as they munch on their food, sharing a plate of French fries between them. And then Y/N feels it — the familiar sensation of milk dribbling from her swollen nipples, and she drops her sandwich to her plate, her eyes bulging with annoyance.
“Fuck me,” she mutters, sighing out in frustration. Harry glances up with a concerned expression and she leans closer to him, “I’m leaking. I think I need to pump.”
“Oh, shit,” Harry mumbles, “You don’t have a spare bottle or anything on you?”
She shakes her head. “No. I left all the pumping shit at home. I think I’m just gonna go to the bathroom and, like… I don’t know. Try to clean up a bit.”
“I’ll come with you,” Harry instantly volunteers, sliding out of the booth. Her eyebrows raise slightly. “I know you’re in pain right now. It’s the least I can do.”
She doesn’t fight him on the offer, instead following him to the single stall bathroom. With an annoyed expression, she locks the door behind him and hikes her sweater up over her nursing bra. There’s already faint stains over where her nipples are, making her sigh. She goes to reach for some toilet paper to clean off her breasts when Harry’s hand wraps around her wrist, stopping her.
“Don’t,” he murmurs, glancing down at her covered breasts, “Can I?”
They haven’t done this since she leaked for the first time, back when she was still pregnant. They hadn’t even really spoken about it, but if Y/N was being honest, she thought about it frequently. It had been one of the hottest things she’d ever been on the receiving end of.
Parting her lips anxiously, she nods, straightening her posture and subconsciously pushing her chest out. He smirks and unhooks her bra, a low groan sounding from his mouth when his eyes meet her milky breasts. It’s a mess he’s dying to clean up.
“Fuck,” he mumbles, “Let daddy have a taste, yeah?”
Maybe it’s the heightened post-pregnancy hormones or maybe it’s just Harry, but Y/N’s eyes flutter shut at the honorific, nodding quickly. It’s not a moment more before his lips latch around her nipple, sucking with an enthusiasm she’d only seen once before. Her fingers curl themselves into his hair, gripping roughly as she whimpers, her pussy instantly growing slick from the dirty sight.
“You’re so fucking incredible,” Harry mutters against her skin, nipping just below her nipple before switching over to the other one, “Feeding our perfect baby with this. You never let daddy have some though. Bit selfish, I think.”
“Y-you can have it whenever you want,” she mewls, tugging at his hair, “Fuck— touch me, please?”
She barely finishes her sentence before he’s pushing his hand down her pants and underneath the cotton fabric of her panties. They haven’t had sex since she gave birth, even though she’s been cleared. Harry still knows her body like the back of his hand, though, deft fingertips rolling over her wet, swollen clit as he sucks every last bit of milk she has to offer.
She doesn’t know what pushes her closer to her orgasm; if it’s the sight of Harry drinking her milk or the sensation of him rubbing tight circles into her clit, but it doesn’t take much for every muscle to clench itself, breathy whimpers falling from her lips as she comes all over his hand.
“There you fuckin’ go, mama,” he croons, glancing up to watch her fall apart. It’s his favorite view, but maybe he’s a bit more partial to the sight when her milk is dripping down his chin. “Cum for me, baby. Dirty girl, obsessed with daddy licking your milk up.”
He works her though it like it’s his job, her eyes only fluttering open when her peak has finally tapered off. The first thing she sees is Harry’s smug smile, an involuntary, shocked laugh sounding between them.
“You’re pretty kinky.” She teases. He rolls his eyes, clipping her bra closed and fitting her breasts back inside.
“Right, like you didn’t just come from all that.”
“Shut up,” she says, smacking his chest playfully. “I wanna finish that sandwich.”
367 notes · View notes
cupid-styles · 5 months
Note
can you do a blurb of ymls harry defending yn when someone judges their situation/her pregnancy pls
yes omg I love this idea!! (sorry if this isn't my best, I only have the brain capacity to write short blurbs rn but I missed these cuties)
word count: 825
content warnings: pregnant y/n
ymls masterlist | main masterlist
talk to me
. . .
Y/N can't think of a worse place to be at right now.
When she agreed to be Harry's date to his office's holiday party, it was mainly because he was borderline pouting. Ever since they kissed and confessed feelings to one another (well... attempted to, anyway — Harry's gloating kind of got in the way), she's found it increasingly more difficult to say no to the silly things he wants to do. And now that Christmas is rapidly approaching, he's far more keen on requesting her presence at things, like those drive-thru light shows that cost $70 a car, or, in this case, clutching a Diet Coke and pretending to be interested in whatever Harry's co-worker is talking her ear off about.
Thankfully, Harry can tell from across the room that she's on the cusp of falling asleep from this person's incessant droning — were they talking about... computer parts? Y/N really couldn't tell — and he quickly traipses across the room, his hand finding the small of her back.
"Hey, Jason!" he greets in mock excitement, the volume of his voice enough to make Y/N jump, "I see you met Y/N."
Jason's eyes dart between the two, confusion clear on his face. Y/N's posture straightens some and she assumes her typical defensive stance with one hand cradling her baby bump.
"I didn't know you two came here together," Jason, apparently, replies through slightly squinted eyes. "Wait... is this the girl you're having a baby with?"
It's an odd question, but one that they've become semi-used to. Harry's willing to be more patient about it, while Y/N's quicker to tell someone off for asking. In her defense, he understands; you likely wouldn't ask a couple that question, and the definition of their relationship was still a bit... blurred.
"Is there a problem with that?" Y/N snaps, her grasp tightening around the cheap plastic cup in her hand.
"Well— no, we just heard that Harry was having a baby but it wasn't with a girlfriend or anything and— well, it's kind of weird that you brought her but then she's not really your date, is she?"
In the time that they've known each other, Y/N has rarely seen Harry get angry. She can actually count it on one hand actually, and they've all been fueled by silly tequila-fueled encounters, like when Dom wouldn't let him eat chicken nuggets because he's a pescatarian and it was for his own good.
This, though... this is different, and Y/N can immediately tell. He immediately looks more defensive and shifts his body slightly so that he's standing in front of Y/N, covering her stomach. He crosses his arms over his chest, his head cocked to the side as a perplexed facial expression appears.
"I don't really think it's any of your business, Jason," Harry responds easily, a clipped tone to his voice, "Regardless of whether we're dating or not, you don't really get to have an opinion on that, hm?"
"Well— yes, I suppose you're right, it just seemed like she's single—"
"She's right here," Y/N cuts in, crossing her leg over the other. "And why the fuck would you care if I'm single? You never had a chance with me to begin with."
Jason's lips part, shock and confusion written all over his face. It seems like he's in some sort of weird man stare-off with Harry, one that she quickly grows tired of, so she reaches up to tug at the sleeve of Harry's sweater. Immediately, he peels his gaze away and looks down at her.
"'s fine," she murmurs, quietly enough so he's the only person that can hear, "Okay?"
He nods curtly. In an instant, his arm loops around Y/N's shoulders as he guides her away from that dumb fuck in the engineering department.
"You alright?" he asks softly, motioning for her to sit down at one of the high-top bar stools. She nods.
"I'm fine. You seemed pretty pissed, though."
Harry shrugs his shoulders. "He's a prick anyway."
She snickers and shakes her head, "You're kinda hot when you're mad, you know that?"
"Shush," he mumbles, waving down the bartender as he wills a flowering blush away, "Want another soda?"
"Please."
He orders them both a refill — he decided to stop drinking a few weeks into her pregnancy in solidarity — and leans back against the bar. His eyes flicker to her, realizing that she's watching him intently. He can't help that he's reflecting on the minor argument, but his eyes brighten slightly when he remembers something she said.
"So, he never had a chance?"
Y/N lets out a loud laugh. "Nah. Kind of have my eyes on someone else."
"Oh? Spill the deets, girly."
She smirks, "Hm, brown hair, tall, always reading pregnancy books... sometimes he texts me random questions or name suggestions at like 2 am. Last night he asked if he can record a podcast for the baby so they can get weekly updates."
"God, sounds like a nerd," Harry replies with a toothy grin.
"Mm, yeah. He definitely is."
260 notes · View notes
cupid-styles · 5 months
Note
not the same anon but what about smut where ymls yn has to beg for it like she's trying to drop hints and get him to have sex with her without it seeming like she really wants but he's not budging until she's all desperate and begging him to fuck her
wait I LOVE this!!!!! ((this is not proofread so apologies for any typos))
content warnings: smut (dirty talk, squirting, use of a toy), pregnant y/n
ymls masterlist
main masterlist | talk to me
. . .
At this point, Y/N thinks she could wear a sign that says "please fuck me" and Harry wouldn't budge.
She's a month or so out from her due date — her stomach is bulging with their growing baby and doing the smallest tasks is a hardship. From tying her shoes to taking a bath, Harry insists on helping her with everything, but only because she's too stubborn to ask for his assistance. She's even on maternity leave from her job now, so she just putzes around Harry's apartment during the day, watching TV and getting up to pee every 10 minutes because the baby keeps pressing on her bladder.
Given everything she's dealing with right now, she thinks the least Harry could do is stick his cock in her and fuck her dumb.
But of course, he's him. And he's worried about the baby, he's worried about Y/N, and having sex with her is the last thing on his mind. She's done everything she can think of: Last week, she had a sexy lingerie set on when he came home from work, but he just told her she looked beautiful. A few days ago, she asked him to take a bath with her, but instead he just sat at the side and helped her wash her hair.
And tonight, as they lay in bed, she knows Harry is pretending to be asleep while she lays on her back, cradling her bump. She moves her leg and nudges him with her foot, only to met with silence.
She does it three more times and hisses his name before he finally turns onto his side to face her.
"'s a matter?" he asks groggily.
"Can you just fuck me please?" she blurts out, an annoyed edge to her voice.
"It's not safe," he mumbles as he reaches out to stroke his fingertips over her thigh. "Trust me, I wish I could."
"I looked it up. If we do it doggy style, it's fine."
"Romantic."
Y/N rolls her eyes, "Please? You know I hate begging."
"That's true."
She sighs in frustration and he chuckles, rolling back over to fumble through the nightstand on his side. She can't quite see what he's doing in the dark, but a moment later, he closes the drawer and gets up on his knees, parting her thighs to sit between them.
"I'm not gonna fuck you. I would never be able to forgive myself if something happened," he says softly, reaching up to brush over her bump, "But I did get something for you for when you got this far along in the pregnancy."
She quirks a brow and he grabs the item he pulled out from his nightstand. In his hand, there's a silicone sex toy. She's seen similar ones before — it's long and curved at the end, designed to stimulate her g-spot, but it vibrates, too.
"I can use this on you if you'd like."
"Yes," she blurts out without a second thought, "Yes. Please."
He chuckles and leans down carefully, pressing their lips together. The kiss is slow and hesitant, despite Y/N wishing nothing more than for him to manhandle the way she knows he can. He's unhurried in his movements as he breaks their kiss, pushing his lips over her neck and down to her chest, stomach, and finally, her mound.
He's clearly not in the mood to tease, knowing how badly she needs this right now. With gentle fingers, he parts her pussy lips and swallows harshly when he sees how wet she is. He moves his pointer finger up to her engorged clit, rubbing over it lightly.
"Why didn't you tell me you needed me this badly?" he asks teasingly, allowing a gob of saliva to drip down from his mouth and to her clit.
"Shut up," she mutters, holding in a desperate whimper.
He snorts and turns the vibrations on the lowest setting. Softly, he places the toy up against her clit, allowing the sensations to stimulate the spot she needs most. Immediately, a moan breaks free from her throat, her head falling back against the plushy pillow.
"That feel good?"
She muffles out an affirmative sound and he chuckles to himself.
"Can I stretch this pretty pussy out?" he murmurs, glancing up to see her nodding quickly. He hums and pushes the toy inside of her, cursing to himself as he watches her pulsate around the silicone. "There you go, angel girl. Take this fake cock and pretend it's mine, hm?"
She's a moaning, writhing mess above, reaching to grasp the streets for a semblance of grounding. He makes quick work of thrusting the toy in and out of her, making sure to push it far enough to stroke at her g-spot every time.
"That's so fucking good," she whines, "Thank you, thank you!"
"Think I like you better this way," he mocks as he uses two fingertips to brush over her clit, rubbing tight circles into the nerves. "All compliant and subby for me. What do you think?"
"Fuck— s-shut up!"
"Careful," Harry warns, issuing a swift slap to her clit. She whimpers loudly, her back arching slightly given the size of her bump. "Don't be a brat."
"Wanna cum, let me cum— fuck, please, Harry—"
He doubles down on his efforts, pushing the dildo up against her g-spot and moving it deep inside of her.
"Gonna squirt for me, sweetheart?" he says with a teasing tone, "You wanted to cum so bad, didn't you? Show me then, make it worth it. Soak my face."
A silent cry falls from her mouth, tears leaking steadily from the sides of her eyes as she reaches her orgasm. For the first time ever, she does exactly what he asks for, a gush of liquid exploding all over Harry's hands and arms as he works her through it. He groans, cursing from the sight.
"That's it, that's my girl."
Immediately, she's shaking, her hands ducking down to press Harry away from her lower half. He chuckles as he turns the toy off and tosses it off the bed, making a mental note to wash it in the morning. He knows he'll have to change the sheets and clean her up before they actually go to sleep, but the only thing he cares about is giving her face a thousand kisses right now.
240 notes · View notes
cupid-styles · 6 months
Note
If there’s ever a possibility of them having sex while she’s pregnant my mind will just feel all fuzzy lol
I definitely wanna write it esp bc I haven’t done any smut for them yet !!! like her just being like “tbh down to fuck, hormones are making me stupidly horny and you did it right the first time” and he’s just 🫡🫡🫡🫡 whatever u want my milf to be
316 notes · View notes