[{"data":1,"prerenderedAt":1033},["ShallowReactive",2],{"post-cards":3,"categories":529,"post-git-tracking-a-remote-branch-upstream-for-changes":567},[4,27,38,54,68,78,87,97,111,124,134,145,160,172,185,196,207,218,229,240,251,264,277,292,307,321,335,347,358,369,379,389,399,409,419,429,439,449,459,469,479,489,499,509,519],{"path":5,"title":6,"slug":7,"summary":8,"date":9,"readTime":10,"hasImage":11,"category":12,"tags":17,"tagSlugs":26},"\u002Fposts\u002Fgit-flow-vs-github-flow-choosing-a-branching-strategy","Git Flow vs GitHub Flow: Choosing a Branching Strategy for Your Team","git-flow-vs-github-flow-choosing-a-branching-strategy","Git Flow and GitHub Flow take very different approaches to team branching and releases. Let's compare them, see where trunk-based development fits, and sort out how to handle versioned releases, hotfixes, and everything in between.","2026-06-14",7,false,{"id":13,"name":14,"slug":15,"hue":16},4,"Git","git",158,[18,20,23],{"name":19,"slug":15},"GIT",{"name":21,"slug":22},"Workflow","workflow",{"name":24,"slug":25},"GitHub","github",[15,22,25],{"path":28,"title":29,"slug":30,"summary":31,"date":9,"readTime":10,"hasImage":11,"category":32,"tags":33,"tagSlugs":37},"\u002Fposts\u002Fgithub-flow-keep-your-main-branch-deployable","GitHub Flow: Keep Your Main Branch Deployable","github-flow-keep-your-main-branch-deployable","GitHub Flow is the lightweight branching workflow built on a single rule: anything in main is deployable. Here is the whole loop, branch, pull request, review, merge and deploy, with the git and gh commands and an honest look at where it fits.",{"id":13,"name":14,"slug":15,"hue":16},[34,35,36],{"name":19,"slug":15},{"name":21,"slug":22},{"name":24,"slug":25},[15,22,25],{"path":39,"title":40,"slug":41,"summary":42,"date":43,"readTime":44,"hasImage":11,"category":45,"tags":50,"tagSlugs":53},"\u002Fposts\u002Fstarting-with-rust-installation-first-program","Starting with Rust: From Installation to Your First Program","starting-with-rust-installation-first-program","Learn how to install Rust and write your first \"Hello, world!\" program.","2024-03-23",2,{"id":46,"name":47,"slug":48,"hue":49},6,"Rust","rust-programming",38,[51],{"name":52,"slug":52},"rust",[52],{"path":55,"title":56,"slug":57,"summary":58,"date":59,"readTime":44,"hasImage":11,"category":60,"tags":65,"tagSlugs":67},"\u002Fposts\u002Fflutter-version-management-fvm","Flutter Version Management","flutter-version-management-fvm","Managing multiple Flutter versions does not need not be a headache. Let's jump into FVM and see how it can simplify your Flutter journey.","2023-10-07",{"id":61,"name":62,"slug":63,"hue":64},5,"Flutter","flutter",230,[66],{"name":63,"slug":63},[63],{"path":69,"title":70,"slug":71,"summary":72,"date":59,"readTime":73,"hasImage":11,"category":74,"tags":75,"tagSlugs":77},"\u002Fposts\u002Fsetting-up-cocoapods-fvm","Setting Up CocoaPods for FVM-managed Flutter Projects","setting-up-cocoapods-fvm","A guide to installing CocoaPods for a Flutter project while using FVM to manage Flutter versions, ensuring a smooth setup for iOS development.",1,{"id":61,"name":62,"slug":63,"hue":64},[76],{"name":63,"slug":63},[63],{"path":79,"title":80,"slug":81,"summary":82,"date":59,"readTime":73,"hasImage":11,"category":83,"tags":84,"tagSlugs":86},"\u002Fposts\u002Ftroubleshooting-xcode-15-build-issues-flutter","Troubleshooting Xcode 15 Build Issues in Flutter Projects","troubleshooting-xcode-15-build-issues-flutter","Uncovering solutions to common issues faced when updating to Xcode 15 in a Flutter project using an older version of CocoaPods.",{"id":61,"name":62,"slug":63,"hue":64},[85],{"name":63,"slug":63},[63],{"path":88,"title":89,"slug":90,"summary":91,"date":92,"readTime":13,"hasImage":11,"category":93,"tags":94,"tagSlugs":96},"\u002Fposts\u002Fgit-tracking-a-remote-branch-upstream-for-changes","Git: Tracking a Remote Branch for Changes","git-tracking-a-remote-branch-upstream-for-changes","When you fork a project, you need a way to pull in changes from the original repository, usually called upstream. Here is how to wire up an upstream remote, actually sync your fork, and set up branch tracking so plain git pull and git push just work.","2018-11-04",{"id":13,"name":14,"slug":15,"hue":16},[95],{"name":19,"slug":15},[15],{"path":98,"title":99,"slug":100,"summary":101,"date":92,"readTime":102,"hasImage":103,"category":104,"tags":108,"tagSlugs":110},"\u002Fposts\u002Fjavascript-array-map-filter-reduce-functions","JavaScript's map, filter, and reduce methods","javascript-array-map-filter-reduce-functions","JavaScript provides some amazing functions that can be called against your arrays to help filter them, manipulate them, or even reduce them down to a single value or grouped values.",3,true,{"id":44,"name":105,"slug":106,"hue":107},"JavaScript","javascript",92,[109],{"name":105,"slug":106},[106],{"path":112,"title":113,"slug":114,"summary":115,"date":116,"readTime":73,"hasImage":103,"category":117,"tags":121,"tagSlugs":123},"\u002Fposts\u002Fphp-fizzbuzz-example","FizzBuzz in PHP: A Fresh Approach","php-fizzbuzz-example","FizzBuzz is a very popular programming question that tests your logic to see if you can build a simple program.","2018-11-02",{"id":73,"name":118,"slug":119,"hue":120},"PHP","php",264,[122],{"name":118,"slug":119},[119],{"path":125,"title":126,"slug":127,"summary":128,"date":129,"readTime":44,"hasImage":103,"category":130,"tags":131,"tagSlugs":133},"\u002Fposts\u002Fphp-array-reduce","PHP's array_reduce is not only for outputting single values","php-array-reduce","PHP's array_reduce is a simple way to partition a set of data or return a single value. It is super powerful and worth spending time learning.","2018-11-01",{"id":73,"name":118,"slug":119,"hue":120},[132],{"name":118,"slug":119},[119],{"path":135,"title":136,"slug":137,"summary":138,"date":139,"readTime":46,"hasImage":11,"category":140,"tags":141,"tagSlugs":144},"\u002Fposts\u002Fimprove-your-git-workflow-with-git-flow","Improve Your Git Workflow with Git Flow","improve-your-git-workflow-with-git-flow","Git Flow is a structured branching model built around versioned, scheduled releases. Here is how its branches fit together, a hands-on walkthrough of features, releases and hotfixes, and an honest take on when it is still the right call.","2016-12-06",{"id":13,"name":14,"slug":15,"hue":16},[142,143],{"name":19,"slug":15},{"name":21,"slug":22},[15,22],{"path":146,"title":147,"slug":148,"summary":149,"date":150,"readTime":46,"hasImage":11,"category":151,"tags":155,"tagSlugs":159},"\u002Fposts\u002Fusing-css-transitions","Using CSS Transitions","using-css-transitions","CSS transitions are the standard way to apply transitions to your elements, and have been for years, replacing the old approach of using JavaScript. In this article, I'll go through each of the transition properties available, and provide examples of how to use them.","2016-12-05",{"id":102,"name":152,"slug":153,"hue":154},"HTML & CSS","html-css",55,[156],{"name":157,"slug":158},"CSS","css",[158],{"path":161,"title":162,"slug":163,"summary":164,"date":165,"readTime":13,"hasImage":11,"category":166,"tags":167,"tagSlugs":171},"\u002Fposts\u002Fstructuring-your-website-with-html-5-semantics","Structuring Your Website With HTML 5 Semantics","structuring-your-website-with-html-5-semantics","Prior to HTML 5, there was no real markup to help explain the intent behind your HTML code. The goal of HTML 5 was to offer a more readable way of writing your code, so that any author that comes after you can have an easier time going through what you've created.","2016-12-04",{"id":102,"name":152,"slug":153,"hue":154},[168],{"name":169,"slug":170},"HTML","html",[170],{"path":173,"title":174,"slug":175,"summary":176,"date":177,"readTime":44,"hasImage":11,"category":178,"tags":179,"tagSlugs":184},"\u002Fposts\u002Finterpolation-in-stylus-css-pre-processor","Interpolation in Stylus","interpolation-in-stylus-css-pre-processor","You can also use interpolation to improve your functions for reuse, as well as your other code within your stylesheet. The way it works is that you can wrap your expression within {}, which will then be outputted as the identifier.","2016-12-03",{"id":102,"name":152,"slug":153,"hue":154},[180,183],{"name":181,"slug":182},"Stylus","stylus",{"name":157,"slug":158},[182,158],{"path":186,"title":187,"slug":188,"summary":189,"date":190,"readTime":73,"hasImage":11,"category":191,"tags":192,"tagSlugs":195},"\u002Fposts\u002Fcreating-configuration-files-in-stylus-css-pre-processor","Creating Configuration Files In Stylus","creating-configuration-files-in-stylus-css-pre-processor","It's super simple to create a configuration file for instance that would manage your media query break points. You could also use a configuration file for managing colors, font sizes, and other variables such as gutter spacing and more.","2016-12-02",{"id":102,"name":152,"slug":153,"hue":154},[193,194],{"name":157,"slug":158},{"name":181,"slug":182},[158,182],{"path":197,"title":198,"slug":199,"summary":200,"date":201,"readTime":13,"hasImage":11,"category":202,"tags":203,"tagSlugs":206},"\u002Fposts\u002Fusing-functions-and-mixins-with-stylus-css-pre-processor","Using Functions and Mixins with Stylus","using-functions-and-mixins-with-stylus-css-pre-processor","Stylus allows you to create functions and mixins of reusable code for your stylesheets. You can also handle mathematical operations, unary operations, and more allowing you complete control over your stylesheets with ease.","2016-12-01",{"id":102,"name":152,"slug":153,"hue":154},[204,205],{"name":157,"slug":158},{"name":181,"slug":182},[158,182],{"path":208,"title":209,"slug":210,"summary":211,"date":212,"readTime":44,"hasImage":11,"category":213,"tags":214,"tagSlugs":217},"\u002Fposts\u002Fsetting-variables-in-stylus-css-pre-processor","Setting Variables in Stylus","setting-variables-in-stylus-css-pre-processor","Unlike CSS, in Stylus you can assign expressions to variables that can be reusable throughout your stylesheets.","2016-11-29",{"id":102,"name":152,"slug":153,"hue":154},[215,216],{"name":157,"slug":158},{"name":181,"slug":182},[158,182],{"path":219,"title":220,"slug":221,"summary":222,"date":223,"readTime":61,"hasImage":11,"category":224,"tags":225,"tagSlugs":228},"\u002Fposts\u002Fusing-selectors-in-stylus-css-pre-processor","Using Selectors in Stylus","using-selectors-in-stylus-css-pre-processor","Selectors are a way to pick the elements that you want styled. In Stylus, similar to CSS, you can apply a set of styles to any element by separating them by a comma delimited list. Stylus though, also allows you to select multiple elements by separating each on their own line.","2016-11-28",{"id":102,"name":152,"slug":153,"hue":154},[226,227],{"name":157,"slug":158},{"name":181,"slug":182},[158,182],{"path":230,"title":231,"slug":232,"summary":233,"date":234,"readTime":73,"hasImage":11,"category":235,"tags":236,"tagSlugs":239},"\u002Fposts\u002Flearning-stylus-a-css-pre-processor","Learning Stylus: A CSS Pre-Processor","learning-stylus-a-css-pre-processor","This mini-series will be a little different to how you may see other articles on my site. Really this article is more geared as notes for me as I go through the documentation for Stylus, and learn the ins and outs of this beautiful language.","2016-11-27",{"id":102,"name":152,"slug":153,"hue":154},[237,238],{"name":157,"slug":158},{"name":181,"slug":182},[158,182],{"path":241,"title":242,"slug":243,"summary":244,"date":245,"readTime":13,"hasImage":11,"category":246,"tags":247,"tagSlugs":250},"\u002Fposts\u002Fbem-methodology-overview-and-naming-conventions","BEM Methodology Overview and Naming Conventions","bem-methodology-overview-and-naming-conventions","BEM or Block Element Modifier is a naming convention used to help organize your code base. In this article, I discuss its uses within your CSS projects.","2016-11-26",{"id":102,"name":152,"slug":153,"hue":154},[248,249],{"name":157,"slug":158},{"name":169,"slug":170},[158,170],{"path":252,"title":253,"slug":254,"summary":255,"date":256,"readTime":73,"hasImage":11,"category":257,"tags":258,"tagSlugs":263},"\u002Fposts\u002Fintroduction-to-ecmascript-6","Introduction to ECMAScript 6","introduction-to-ecmascript-6","The latest in ECMAScript 6 introduces new features to JavaScript which makes it so much more fun to use, while solving problems that have been around for years. The intent of this article is to provide you with resources you can use to start learning ES6 today.","2016-11-25",{"id":44,"name":105,"slug":106,"hue":107},[259,260],{"name":105,"slug":106},{"name":261,"slug":262},"ECMAScript","ecmascript",[106,262],{"path":265,"title":266,"slug":267,"summary":268,"date":269,"readTime":102,"hasImage":11,"category":270,"tags":271,"tagSlugs":276},"\u002Fposts\u002Fbabel-installation-and-configuration","Babel Installation and Configuration","babel-installation-and-configuration","Babel offers a convenient way to transform your ES6 code to JavaScript that all browsers can understand. In this article we'll go over a basic configuration that will enable you to start using it with any project right away.","2016-11-24",{"id":44,"name":105,"slug":106,"hue":107},[272,273],{"name":105,"slug":106},{"name":274,"slug":275},"Babel","babel",[106,275],{"path":278,"title":279,"slug":280,"summary":281,"date":282,"readTime":73,"hasImage":11,"category":283,"tags":284,"tagSlugs":291},"\u002Fposts\u002Fconfiguring-stylus-css-pre-processor-with-gulp-and-sourcemaps","Configuring Stylus CSS Pre-Processor with Gulp and Sourcemaps","configuring-stylus-css-pre-processor-with-gulp-and-sourcemaps","In this article we'll go over how to configure your project to process Stylus files using Gulp. We'll also create source map file which your browser will use to help point you in the right direction of your files when developing","2016-11-23",{"id":44,"name":105,"slug":106,"hue":107},[285,286,287,288],{"name":105,"slug":106},{"name":181,"slug":182},{"name":157,"slug":158},{"name":289,"slug":290},"Gulp","gulp",[106,182,158,290],{"path":293,"title":294,"slug":295,"summary":296,"date":297,"readTime":44,"hasImage":11,"category":298,"tags":299,"tagSlugs":306},"\u002Fposts\u002Fconfiguring-gulp-with-less-css-pre-processor","Configuring Gulp With Less CSS Pre-Processor","configuring-gulp-with-less-css-pre-processor","Less is a CSS pre-processor allowing you to create variables, mixins, and functions in an effort to make your CSS more maintainable.","2016-11-22",{"id":44,"name":105,"slug":106,"hue":107},[300,301,302,305],{"name":289,"slug":290},{"name":105,"slug":106},{"name":303,"slug":304},"Less","less",{"name":157,"slug":158},[290,106,304,158],{"path":308,"title":309,"slug":310,"summary":311,"date":312,"readTime":44,"hasImage":103,"category":313,"tags":314,"tagSlugs":320},"\u002Fposts\u002Fusing-browser-sync-with-gulp-for-live-reloading","Using Browser Sync with Gulp for Live Reloading","using-browser-sync-with-gulp-for-live-reloading","Browser Sync is a nice tool to use while developing. It allows your browser to reload live when changes are made to your files. For instance, assuming we're watching our CSS file for changes we can have the browser auto refresh\u002Fsync when it sees those changes made.","2016-11-21",{"id":44,"name":105,"slug":106,"hue":107},[315,316,319],{"name":105,"slug":106},{"name":317,"slug":318},"Browser Sync","browser-sync",{"name":289,"slug":290},[106,318,290],{"path":322,"title":323,"slug":324,"summary":325,"date":326,"readTime":44,"hasImage":11,"category":327,"tags":328,"tagSlugs":334},"\u002Fposts\u002Fgulp-watch-automate-your-gulp-tasks","Gulp Watch: Automate Your Gulp Tasks","gulp-watch-automate-your-gulp-tasks","Gulp watch is perfect for when you're editing project files since it allows you to not have to run the gulp command manually each time.","2016-11-20",{"id":44,"name":105,"slug":106,"hue":107},[329,330,333],{"name":105,"slug":106},{"name":331,"slug":332},"Yarn","yarn",{"name":289,"slug":290},[106,332,290],{"path":336,"title":337,"slug":338,"summary":339,"date":340,"readTime":46,"hasImage":11,"category":341,"tags":342,"tagSlugs":346},"\u002Fposts\u002Fconfiguring-gulp-on-a-new-project","Configuring Gulp On A New Project","configuring-gulp-on-a-new-project","Gulp may seem like a scary thing to wrap your head around at first, but it's actually quite easy to start using once you understand the basics.","2016-11-19",{"id":44,"name":105,"slug":106,"hue":107},[343,344,345],{"name":105,"slug":106},{"name":289,"slug":290},{"name":331,"slug":332},[106,290,332],{"path":348,"title":349,"slug":350,"summary":351,"date":352,"readTime":102,"hasImage":11,"category":353,"tags":354,"tagSlugs":357},"\u002Fposts\u002Fyarn-publishing-a-package","Yarn: Publishing a Package","yarn-publishing-a-package","Publishing a package to the npm repository has never been simpler. With a few steps, you can create a package that is redistributable to all of your projects.","2016-11-18",{"id":44,"name":105,"slug":106,"hue":107},[355,356],{"name":105,"slug":106},{"name":331,"slug":332},[106,332],{"path":359,"title":360,"slug":361,"summary":362,"date":363,"readTime":102,"hasImage":11,"category":364,"tags":365,"tagSlugs":368},"\u002Fposts\u002Fyarn-fast-and-secure-dependency-management","Yarn: Fast and Secure Dependency Management","yarn-fast-and-secure-dependency-management","Yarn is a super simple dependency management tool which is way faster to use instead of traditional npm. It acts as a drop-in replacement, so you can get started using yarn right away. The best way to install yarn is by using npm.","2016-11-17",{"id":44,"name":105,"slug":106,"hue":107},[366,367],{"name":105,"slug":106},{"name":331,"slug":332},[106,332],{"path":370,"title":371,"slug":372,"summary":373,"date":374,"readTime":73,"hasImage":103,"category":375,"tags":376,"tagSlugs":378},"\u002Fposts\u002Fsupport-for-keys-in-list-or-its-new-shorthand-syntax-in-php","Support for keys in list(), or its new shorthand syntax [] in PHP","support-for-keys-in-list-or-its-new-shorthand-syntax-in-php","Now as of PHP 7.1, you can define the keys of your array that will be parsed when destructuring your arrays. Prior to PHP 7.1, you could only use arrays with numeric indexes. Now with this new addition, our lives just got easier.","2016-11-16",{"id":73,"name":118,"slug":119,"hue":120},[377],{"name":118,"slug":119},[119],{"path":380,"title":381,"slug":382,"summary":383,"date":384,"readTime":73,"hasImage":103,"category":385,"tags":386,"tagSlugs":388},"\u002Fposts\u002Ftype-hinting-with-the-iterable-pseudo-type-in-php","Type Hinting With The Iterable pseudo-type In PHP","type-hinting-with-the-iterable-pseudo-type-in-php","As of PHP 7.1, you can now type hint your method\u002Ffunction arguments with the keyword iterable for handling arrays or even objects that implement the Traversable interface.","2016-11-15",{"id":73,"name":118,"slug":119,"hue":120},[387],{"name":118,"slug":119},[119],{"path":390,"title":391,"slug":392,"summary":393,"date":394,"readTime":73,"hasImage":103,"category":395,"tags":396,"tagSlugs":398},"\u002Fposts\u002Ftype-hinting-callable-functions-in-php","Type Hinting Callable Functions in PHP","type-hinting-callable-functions-in-php","As of PHP 5.4, you can type hint your method arguments with the callable keyword allowing you to enforce the type of data that is passed via your arguments.","2016-11-14",{"id":73,"name":118,"slug":119,"hue":120},[397],{"name":118,"slug":119},[119],{"path":400,"title":401,"slug":402,"summary":403,"date":404,"readTime":73,"hasImage":103,"category":405,"tags":406,"tagSlugs":408},"\u002Fposts\u002Fsetting-visibility-for-your-class-constants-in-php","Setting Visibility for Your Class Constants in PHP","setting-visibility-for-your-class-constants-in-php","Now in PHP 7.1+, you can set different visibility modifiers for each of your class constants. The available visibility modifiers consist of public, protected, and private.","2016-11-13",{"id":73,"name":118,"slug":119,"hue":120},[407],{"name":118,"slug":119},[119],{"path":410,"title":411,"slug":412,"summary":413,"date":414,"readTime":73,"hasImage":103,"category":415,"tags":416,"tagSlugs":418},"\u002Fposts\u002Fanonymous-classes-php","Using Anonymous Classes in PHP","anonymous-classes-php","As of PHP 7, you can now create quick throwaway objects for use within your projects. This can be especially useful for your automated tests, for instance, with allowing you to create quick implementations of your interfaces.","2016-11-12",{"id":73,"name":118,"slug":119,"hue":120},[417],{"name":118,"slug":119},[119],{"path":420,"title":421,"slug":422,"summary":423,"date":424,"readTime":73,"hasImage":103,"category":425,"tags":426,"tagSlugs":428},"\u002Fposts\u002Fsymmetric-array-destructuring-in-php","Symmetric Array Destructuring in PHP","symmetric-array-destructuring-in-php","As of PHP 7.1, you can now use the shorthand array syntax to destructure your arrays for assignment. Previously you would have had to use a function like list, but now you can use the simple new array shorthand syntax.","2016-11-11",{"id":73,"name":118,"slug":119,"hue":120},[427],{"name":118,"slug":119},[119],{"path":430,"title":431,"slug":432,"summary":433,"date":434,"readTime":44,"hasImage":103,"category":435,"tags":436,"tagSlugs":438},"\u002Fposts\u002Fphp-array-map-to-format-your-arrays-without-loops","Using PHP's array_map to format your arrays without loops","php-array-map-to-format-your-arrays-without-loops","So let's face it, loops are a bit boring. So how can we mix it up? Let's assume we have a case where we have a CSV file that we want to quickly parse.","2016-11-10",{"id":73,"name":118,"slug":119,"hue":120},[437],{"name":118,"slug":119},[119],{"path":440,"title":441,"slug":442,"summary":443,"date":444,"readTime":10,"hasImage":103,"category":445,"tags":446,"tagSlugs":448},"\u002Fposts\u002Fsolid-principles-in-php","SOLID Principles in PHP","solid-principles-in-php","The 5 basic principles for Object-Oriented Design, SOLID, were first created in an effort to improve maintainability in our code bases. SOLID is a mnemonic acronym that stands for each of the following principles: Single Responsibility, Open-Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion.","2016-11-09",{"id":73,"name":118,"slug":119,"hue":120},[447],{"name":118,"slug":119},[119],{"path":450,"title":451,"slug":452,"summary":453,"date":454,"readTime":73,"hasImage":103,"category":455,"tags":456,"tagSlugs":458},"\u002Fposts\u002Ffiltering-arrays-without-using-loops-in-php","Filtering Arrays Without Using Loops in PHP","filtering-arrays-without-using-loops-in-php","PHP has a built-in function called array_filter that allows you to filter through your arrays without the need for a loop. Personally, this approach feels much cleaner to me and simpler to comprehend.","2016-11-08",{"id":73,"name":118,"slug":119,"hue":120},[457],{"name":118,"slug":119},[119],{"path":460,"title":461,"slug":462,"summary":463,"date":464,"readTime":73,"hasImage":103,"category":465,"tags":466,"tagSlugs":468},"\u002Fposts\u002Fvoid-return-types-in-php","Void Return Types in PHP","void-return-types-in-php","As of PHP 7.1, we can now use void return types within our methods. This is useful for cases where you have methods that are just setting or processing data without the need of returning any values.","2016-11-07",{"id":73,"name":118,"slug":119,"hue":120},[467],{"name":118,"slug":119},[119],{"path":470,"title":471,"slug":472,"summary":473,"date":474,"readTime":73,"hasImage":103,"category":475,"tags":476,"tagSlugs":478},"\u002Fposts\u002Ftype-hinting-with-nullable-types-in-php","Type Hinting with Nullable Types in PHP","type-hinting-with-nullable-types-in-php","As of PHP 7.1, you can now set your type declarations as nullable by simply prefixing them with a question mark ?. In doing so a null value can be passed in as a parameter or returned as a value for your methods.","2016-11-06",{"id":73,"name":118,"slug":119,"hue":120},[477],{"name":118,"slug":119},[119],{"path":480,"title":481,"slug":482,"summary":483,"date":484,"readTime":73,"hasImage":103,"category":485,"tags":486,"tagSlugs":488},"\u002Fposts\u002Fphp-group-multiple-use-declarations","PHP Group Multiple use Declarations","php-group-multiple-use-declarations","As of PHP 7, you can now group your imported classes, functions, and constants from under the same namespace.","2016-11-05",{"id":73,"name":118,"slug":119,"hue":120},[487],{"name":118,"slug":119},[119],{"path":490,"title":491,"slug":492,"summary":493,"date":494,"readTime":73,"hasImage":103,"category":495,"tags":496,"tagSlugs":498},"\u002Fposts\u002Fphp-null-coalescing-operator","PHP Null Coalescing Operator","php-null-coalescing-operator","One of my new favorite additions to PHP 7, is the Null Coalescing Operator. It cleans up your code by removing a tedious step of checking if some value is isset() and not NULL and returning it or if not setting a default.","2016-11-04",{"id":73,"name":118,"slug":119,"hue":120},[497],{"name":118,"slug":119},[119],{"path":500,"title":501,"slug":502,"summary":503,"date":504,"readTime":44,"hasImage":103,"category":505,"tags":506,"tagSlugs":508},"\u002Fposts\u002Fphp-spaceship-operator","PHP Spaceship Operator","php-spaceship-operator","One of the new features to hit PHP 7 is the Spaceship Operator. This new trick helps improve the way you'd compare 2 expressions. In short, the comparison returns 1 of 3 values (-1, 0, or 1) depending on the result of the comparison.","2016-11-03",{"id":73,"name":118,"slug":119,"hue":120},[507],{"name":118,"slug":119},[119],{"path":510,"title":511,"slug":512,"summary":513,"date":514,"readTime":102,"hasImage":103,"category":515,"tags":516,"tagSlugs":518},"\u002Fposts\u002Freturn-type-declarations-in-php","Return Type Declarations in PHP","return-type-declarations-in-php","PHP 7 now makes it possible to declare return types for your methods. This allows you better control over the data that will be returned from each method in your application.","2016-11-02",{"id":73,"name":118,"slug":119,"hue":120},[517],{"name":118,"slug":119},[119],{"path":520,"title":521,"slug":522,"summary":523,"date":524,"readTime":73,"hasImage":103,"category":525,"tags":526,"tagSlugs":528},"\u002Fposts\u002Fscalar-type-hints-php","Scalar Type Hints in PHP","scalar-type-hints-php","Starting with PHP 7.0, it's now possible to declare scalar type hints for your method arguments. Previously, we were able to use array and callable, but now with PHP 7+, we have much more control.","2016-11-01",{"id":73,"name":118,"slug":119,"hue":120},[527],{"name":118,"slug":119},[119],[530,537,543,549,555,561],{"id":531,"description":532,"extension":533,"hue":120,"meta":534,"name":118,"slug":119,"stem":535,"weight":73,"__hash__":536},"categories\u002Fcategories\u002Fphp.json","PHP articles and tutorials ranging from new language features to using interesting packages.","json",{},"categories\u002Fphp","h_EmN4YMO4b2mBt3MPLs7RvscJx0NBmwDIZPxqPqKLE",{"id":538,"description":539,"extension":533,"hue":107,"meta":540,"name":105,"slug":106,"stem":541,"weight":44,"__hash__":542},"categories\u002Fcategories\u002Fjavascript.json","JavaScript articles and tutorials ranging from new language features to using interesting packages.",{},"categories\u002Fjavascript","7gmVgkw5BRo26i1bFoSv96bwDJ4nTtZcJ9Ud6u5p0yk",{"id":544,"description":545,"extension":533,"hue":154,"meta":546,"name":152,"slug":153,"stem":547,"weight":102,"__hash__":548},"categories\u002Fcategories\u002Fhtml-css.json","HTML & CSS articles and tutorials ranging from new language features to using interesting packages.",{},"categories\u002Fhtml-css","vXvPlRA-iaeCJ64Wi3sLyUR0kqL48zYcZWORRqt8N70",{"id":550,"description":551,"extension":533,"hue":16,"meta":552,"name":14,"slug":15,"stem":553,"weight":13,"__hash__":554},"categories\u002Fcategories\u002Fgit.json","Git articles and tutorials ranging from new language features to different workflows.",{},"categories\u002Fgit","qOqFsFTKI9XB444UodUKW_3AakFadHzW-ss8V-maUmE",{"id":556,"description":557,"extension":533,"hue":64,"meta":558,"name":62,"slug":63,"stem":559,"weight":61,"__hash__":560},"categories\u002Fcategories\u002Fflutter.json","Dive into Flutter, the open-source UI software development toolkit, as we explore its capabilities in creating natively compiled applications for mobile, web, and desktop from a single codebase.",{},"categories\u002Fflutter","aD1moU8CgoYt4FRnSeA4Iy9xxnnopdEKBEYP2arAzdI",{"id":562,"description":563,"extension":533,"hue":49,"meta":564,"name":47,"slug":48,"stem":565,"weight":46,"__hash__":566},"categories\u002Fcategories\u002Frust-programming.json","From setting up your environment to advanced concepts, this is your go-to resource for all things Rust.",{},"categories\u002Frust-programming","LscnqSsk-htWc9yZg9eXaIUJwNfTK5oaZOClYKagNC4",{"id":568,"title":89,"body":569,"category":1023,"date":92,"description":1024,"extension":1025,"hasImage":11,"meta":1026,"navigation":103,"path":88,"readTime":13,"seo":1027,"slug":90,"stem":1028,"summary":91,"tagSlugs":1029,"tags":1030,"__hash__":1032},"posts\u002Fposts\u002Fgit-tracking-a-remote-branch-upstream-for-changes.md",{"type":570,"value":571,"toc":1014},"minimark",[572,581,586,592,641,644,648,654,678,683,703,716,725,737,741,744,798,812,816,823,838,847,851,854,887,890,894,902,913,933,936,951,954,968,980,984,999,1010],[573,574,575,576,580],"p",{},"Sometimes you need to track a remote branch for changes, typically the original project you forked from, conventionally named ",[577,578,579],"em",{},"upstream",". Say you are on a team where you forked a project and have your own copy. Before you open a pull request, you want to pull in any changes from the originating repository so your work sits on top of the latest code. Here is how to set that up and keep it in sync.",[582,583,585],"h2",{"id":584},"two-different-things-called-upstream","Two different things called \"upstream\"",[573,587,588,589,591],{},"The word ",[577,590,579],{}," gets used for two related but distinct things, and mixing them up is where people get confused.",[593,594,595,611],"ol",{},[596,597,598,602,603,606,607,610],"li",{},[599,600,601],"strong",{},"The upstream remote."," A named remote (conventionally ",[604,605,579],"code",{},") pointing at the original repository you forked, so you can fetch the project's new commits. Your own fork is usually the ",[604,608,609],{},"origin"," remote.",[596,612,613,616,617,620,621,624,625,628,629,632,633,636,637,640],{},[599,614,615],{},"A branch's upstream tracking ref."," The link between one local branch and the specific remote branch it pulls from and pushes to. Your local ",[604,618,619],{},"main"," \"tracks\" ",[604,622,623],{},"origin\u002Fmain",". This relationship is what powers a bare ",[604,626,627],{},"git pull"," and ",[604,630,631],{},"git push",", and what produces the ",[604,634,635],{},"Your branch is up to date with 'origin\u002Fmain'"," line in ",[604,638,639],{},"git status",".",[573,642,643],{},"This post covers both. First the fork scenario, then branch tracking at the end.",[582,645,647],{"id":646},"add-the-upstream-remote","Add the upstream remote",[573,649,650,651,653],{},"Start by checking what remotes you already have. Right after forking and cloning, you will usually see only ",[604,652,609],{},", which is your fork.",[655,656,661],"pre",{"className":657,"code":658,"language":659,"meta":660,"style":660},"language-bash shiki shiki-themes github-dark github-dark","git remote -v\n","bash","",[604,662,663],{"__ignoreMap":660},[664,665,667,670,674],"span",{"class":666,"line":73},"line",[664,668,15],{"class":669},"sFR8T",[664,671,673],{"class":672},"s4wv1"," remote",[664,675,677],{"class":676},"s8ozJ"," -v\n",[573,679,680,681,640],{},"Add the original repository as a second remote named ",[604,682,579],{},[655,684,686],{"className":657,"code":685,"language":659,"meta":660,"style":660},"git remote add upstream https:\u002F\u002Fgithub.com\u002FORIGINAL_OWNER\u002FORIGINAL_REPO.git\n",[604,687,688],{"__ignoreMap":660},[664,689,690,692,694,697,700],{"class":666,"line":73},[664,691,15],{"class":669},[664,693,673],{"class":672},[664,695,696],{"class":672}," add",[664,698,699],{"class":672}," upstream",[664,701,702],{"class":672}," https:\u002F\u002Fgithub.com\u002FORIGINAL_OWNER\u002FORIGINAL_REPO.git\n",[704,705,706],"blockquote",{},[573,707,708,709,628,712,715],{},"Swap ",[604,710,711],{},"ORIGINAL_OWNER",[604,713,714],{},"ORIGINAL_REPO"," for the username and repository name from the original project's URL, the one you forked.",[573,717,718,719,721,722,724],{},"Confirm it is configured. You should now see both ",[604,720,609],{}," (your fork) and ",[604,723,579],{}," (the original), each with a fetch and a push entry.",[655,726,727],{"className":657,"code":658,"language":659,"meta":660,"style":660},[604,728,729],{"__ignoreMap":660},[664,730,731,733,735],{"class":666,"line":73},[664,732,15],{"class":669},[664,734,673],{"class":672},[664,736,677],{"class":676},[582,738,740],{"id":739},"actually-sync-fetch-merge-push","Actually sync: fetch, merge, push",[573,742,743],{},"Adding the remote is only half the job. The whole point is to pull the upstream project's new commits into your fork. That is three steps: fetch, merge, push.",[655,745,747],{"className":657,"code":746,"language":659,"meta":660,"style":660},"git fetch upstream          # download upstream's commits and refs (merges nothing yet)\ngit checkout main           # be on your local default branch\ngit merge upstream\u002Fmain     # bring upstream's main into your local main\ngit push                    # update YOUR fork (origin) on GitHub\n",[604,748,749,762,775,788],{"__ignoreMap":660},[664,750,751,753,756,758],{"class":666,"line":73},[664,752,15],{"class":669},[664,754,755],{"class":672}," fetch",[664,757,699],{"class":672},[664,759,761],{"class":760},"sJ8bj","          # download upstream's commits and refs (merges nothing yet)\n",[664,763,764,766,769,772],{"class":666,"line":44},[664,765,15],{"class":669},[664,767,768],{"class":672}," checkout",[664,770,771],{"class":672}," main",[664,773,774],{"class":760},"           # be on your local default branch\n",[664,776,777,779,782,785],{"class":666,"line":102},[664,778,15],{"class":669},[664,780,781],{"class":672}," merge",[664,783,784],{"class":672}," upstream\u002Fmain",[664,786,787],{"class":760},"     # bring upstream's main into your local main\n",[664,789,790,792,795],{"class":666,"line":13},[664,791,15],{"class":669},[664,793,794],{"class":672}," push",[664,796,797],{"class":760},"                    # update YOUR fork (origin) on GitHub\n",[573,799,800,801,804,805,808,809,811],{},"A couple of things worth calling out. ",[604,802,803],{},"git fetch upstream"," downloads everything but changes none of your branches; it just makes ",[604,806,807],{},"upstream\u002Fmain"," available locally. The final ",[604,810,631],{}," matters: syncing only updates your local clone, so without it your fork on GitHub is still behind.",[582,813,815],{"id":814},"merge-or-rebase","Merge or rebase?",[573,817,818,819,822],{},"I used ",[604,820,821],{},"git merge"," above, which is the safe default. The alternative is to rebase your branch on top of upstream instead.",[655,824,826],{"className":657,"code":825,"language":659,"meta":660,"style":660},"git rebase upstream\u002Fmain\n",[604,827,828],{"__ignoreMap":660},[664,829,830,832,835],{"class":666,"line":73},[664,831,15],{"class":669},[664,833,834],{"class":672}," rebase",[664,836,837],{"class":672}," upstream\u002Fmain\n",[573,839,840,841,843,844,846],{},"Merging is non-destructive, but it adds a merge commit each time you sync. Rebasing replays your commits on top of upstream for a cleaner, linear history, at the cost of rewriting commit hashes. The Golden Rule of Rebasing applies: never rebase a branch that other people have already pulled. For keeping a personal fork's ",[604,842,619],{}," in step with upstream, either works. If you keep your ",[604,845,619],{}," as a clean mirror of upstream and do all your real work on feature branches, these syncs fast-forward and the whole question goes away.",[582,848,850],{"id":849},"the-quick-way-gh-cli-and-the-sync-fork-button","The quick way: gh CLI and the Sync fork button",[573,852,853],{},"If your fork lives on GitHub, you often do not need the manual commands at all. The GitHub CLI can sync the fork for you.",[655,855,857],{"className":657,"code":856,"language":659,"meta":660,"style":660},"gh repo sync                      # sync your local clone from its parent\ngh repo sync OWNER\u002FYOUR_FORK      # sync the fork on GitHub from upstream\n",[604,858,859,873],{"__ignoreMap":660},[664,860,861,864,867,870],{"class":666,"line":73},[664,862,863],{"class":669},"gh",[664,865,866],{"class":672}," repo",[664,868,869],{"class":672}," sync",[664,871,872],{"class":760},"                      # sync your local clone from its parent\n",[664,874,875,877,879,881,884],{"class":666,"line":44},[664,876,863],{"class":669},[664,878,866],{"class":672},[664,880,869],{"class":672},[664,882,883],{"class":672}," OWNER\u002FYOUR_FORK",[664,885,886],{"class":760},"      # sync the fork on GitHub from upstream\n",[573,888,889],{},"GitHub's web UI has the same thing: on your fork's page, the \"Sync fork\" dropdown shows how far behind you are and updates your branch with one click. These are convenient, but knowing the fetch and merge underneath is what saves you when a sync hits a conflict.",[582,891,893],{"id":892},"bonus-tracking-a-remote-branch-for-real","Bonus: tracking a remote branch for real",[573,895,896,897,628,899,901],{},"The fork case is one kind of \"tracking.\" The other is setting a branch's upstream tracking ref, so plain ",[604,898,627],{},[604,900,631],{}," know where to go without you naming a remote and branch every time.",[573,903,904,905,908,909,912],{},"When you first push a new branch, ",[604,906,907],{},"-u"," (short for ",[604,910,911],{},"--set-upstream",") creates the branch on the remote and wires up tracking in one go.",[655,914,916],{"className":657,"code":915,"language":659,"meta":660,"style":660},"git push -u origin my-feature\n",[604,917,918],{"__ignoreMap":660},[664,919,920,922,924,927,930],{"class":666,"line":73},[664,921,15],{"class":669},[664,923,794],{"class":672},[664,925,926],{"class":676}," -u",[664,928,929],{"class":672}," origin",[664,931,932],{"class":672}," my-feature\n",[573,934,935],{},"For a branch that already exists, you can set or change its upstream after the fact.",[655,937,939],{"className":657,"code":938,"language":659,"meta":660,"style":660},"git branch --set-upstream-to=origin\u002Fmain\n",[604,940,941],{"__ignoreMap":660},[664,942,943,945,948],{"class":666,"line":73},[664,944,15],{"class":669},[664,946,947],{"class":672}," branch",[664,949,950],{"class":676}," --set-upstream-to=origin\u002Fmain\n",[573,952,953],{},"To see what each branch is tracking, ask for the verbose listing. It shows the tracked branch and how far ahead or behind you are.",[655,955,957],{"className":657,"code":956,"language":659,"meta":660,"style":660},"git branch -vv\n",[604,958,959],{"__ignoreMap":660},[664,960,961,963,965],{"class":666,"line":73},[664,962,15],{"class":669},[664,964,947],{"class":672},[664,966,967],{"class":676}," -vv\n",[573,969,970,971,973,974,976,977,979],{},"That tracking link is exactly what ",[604,972,639],{}," reads when it tells you ",[604,975,635],{},", and it is what lets a bare ",[604,978,627],{}," know which remote branch to fetch and merge.",[582,981,983],{"id":982},"keep-your-main-clean","Keep your main clean",[573,985,986,987,989,990,992,993,995,996,998],{},"One habit makes all of this painless: never commit directly to the branch you sync. If your local ",[604,988,619],{}," only ever moves by syncing from upstream, every sync fast-forwards cleanly. The moment you commit your own work onto ",[604,991,619],{},", easy fast-forwards turn into merge conflicts. Do your work on feature branches off a clean ",[604,994,619],{},", and keep ",[604,997,619],{}," as a mirror of the source of truth.",[573,1000,1001,1002,1004,1005,640],{},"That is the whole loop: add the upstream remote once, then fetch and merge (or let ",[604,1003,863],{}," do it) whenever you need the latest, and push to update your fork. When you are coordinating this across a team, it pairs nicely with a shared branching strategy, which I cover in ",[1006,1007,1009],"a",{"href":1008},"\u002Farticles\u002Fgit-flow-vs-github-flow-choosing-a-branching-strategy","Git Flow vs GitHub Flow",[1011,1012,1013],"style",{},"html pre.shiki code .sFR8T, html code.shiki .sFR8T{--shiki-default:#B392F0;--shiki-dark:#B392F0}html pre.shiki code .s4wv1, html code.shiki .s4wv1{--shiki-default:#9ECBFF;--shiki-dark:#9ECBFF}html pre.shiki code .s8ozJ, html code.shiki .s8ozJ{--shiki-default:#79B8FF;--shiki-dark:#79B8FF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}",{"title":660,"searchDepth":44,"depth":44,"links":1015},[1016,1017,1018,1019,1020,1021,1022],{"id":584,"depth":44,"text":585},{"id":646,"depth":44,"text":647},{"id":739,"depth":44,"text":740},{"id":814,"depth":44,"text":815},{"id":849,"depth":44,"text":850},{"id":892,"depth":44,"text":893},{"id":982,"depth":44,"text":983},{"id":13,"name":14,"slug":15,"hue":16},"Sometimes you need to track a remote branch for changes, typically the original project you forked from, conventionally named upstream. Say you are on a team where you forked a project and have your own copy. Before you open a pull request, you want to pull in any changes from the originating repository so your work sits on top of the latest code. Here is how to set that up and keep it in sync.","md",{},{"title":89,"description":1024},"posts\u002Fgit-tracking-a-remote-branch-upstream-for-changes",[15],[1031],{"name":19,"slug":15},"KfMoil12L7A-465Cx-1iMtTCoLVd5HmfErVWdkFILiM",1781454357270]