pe

Quick tip: git-checkout specific files from another branch

The git-checkout command can be used to update specific files or directories in your working tree with those from another branch, without merging in the whole branch. This can be useful when working with several feature branches or using GitHub Pages to generate a static project site.

The git-checkout manual page describes how the git checkout command is not just useful for switching between branches.

When <paths> or --patch are given, git checkout does not switch branches. It updates the named paths in the working tree from the index file or from a named <tree-ish> (most often a commit)…The <tree-ish> argument can be used to specify a specific tree-ish (i.e. commit, tag or tree) to update the index for the given paths before updating the working tree.

In git, a tree-ish is a way of referring to a particular commit or tree. This can be a partial sha or the branch, remote, and tag name pointers.

The syntax for using git checkout to update the working tree with files from a tree-ish is as follows:

git checkout [-p|--patch] [<tree-ish>] [--] <pathspec>…

Therefore, to update the working tree with files or directories from another branch, you can use the branch name pointer in the git checkout command.

git checkout <branch_name> -- <paths>

As an example, this is how you could update your gh-pages branch on GitHub (used to generate a static site for your project) to include the latest changes made to a file that is on the master branch.

# On branch master
git checkout gh-pages
git checkout master -- myplugin.js
git commit -m "Update myplugin.js from master"

The need to update my gh-pages branch with specific files from my master branch was how I first found out about the other uses of the checkout command. It’s worth having a read of the rest of the git-checkout manual page and experimenting with the options.




pe

CSS: the cascade, specificity, and inheritance

What is the cascade?

The cascade is a mechanism for determining which styles should be applied to a given element, based on the rules that have cascaded down from various sources.

The cascade takes importance, origin, specificity, and source order of style rules into account. It assigns a weight to each rule. When multiple rules apply to a given element, the rule with the greatest weight takes precedence. The result is an unambiguous way to determine the value of a given element/property combination.

Browsers apply the following sorting logic:

  • Find all declarations that apply to a given element/property combination, for the target media type.
  • Sort declarations according to their importance (normal or important) and origin (author, user, or user agent). From highest to lowest precedence:

    1. user !important declarations
    2. author !important declarations
    3. author normal declarations
    4. user normal declarations
    5. user agent declarations
  • If declarations have the same importance and source, sort them by selector specificity.

  • Finally, if declarations have the same importance, source, and specificity, sort them by the order they are specified in the CSS. The last declaration wins.

What is specificity?

Specificity is a method of conflict resolution within the cascade.

Specificity is calculated in a very particular way, based on the values of 4 distinct categories. For explanatory purposes, the CSS2 spec represents these categories using the letters a, b, c, and d. Each has a value of 0 by default.

  • a is equal to 1 if the declaration comes from a style attribute in the HTML (“inline styles”) rather than a CSS rule with a selector.
  • b is equal to the number of ID attributes in a selector.
  • c is equal to the number of other attributes and pseudo-classes in a selector.
  • d is equal to the number of elements and pseudo-elements in a selector.

The specificity is given by concatenating all 4 resulting numbers. More specific selectors take precedence over less specific ones.

For example, the selector #id .class[href] element:hover contains:

  • 1 ID (b is 1)
  • 1 class, 1 attribute selector, and 1 pseudo-class (c is 3)
  • 1 element (d is 1)

Therefore, it has a specificity of 0,1,3,1. Note that a selector containing a single ID (0,1,0,0) will have a higher specificity than one containing any number of other attributes or elements (e.g., 0,0,10,20). This is one of the reasons why many modern CSS architectural patterns avoid using IDs for styling purposes.

What is inheritance?

Inheritance is distinct from the cascade and involves the DOM tree.

Inheritance is the process by which elements inherit the the values of properties from their ancestors in the DOM tree. Some properties, e.g. color, are automatically inherited by the children of the element to which they are applied. Each property defines whether it will be automatically inherited.

The inherit value can be set for any property and will force a given element to inherit its parent element’s property value, even if the property is not normally inherited.

About !important

The above should make it apparent that !important is a separate concept to specificity. It has no effect on the specificity of a rule’s selector.

An !important declaration has a greater precedence than a normal declaration (see the previously mentioned cascade sorting logic), even declarations contained in an element’s style attribute.

[CSS terminology reference]

Translations




pe

Odisha to expedite chariot construction for Rath Yatra

The Home Ministry had on Thursday allowed chariot construction with a condition that no religious congregation should take place around the Ratha Khala.




pe

First special train with migrant workers leaves from Mumbai’s LTT

All 1,111 passengers underwent thermal screening at the station before departing for Basti in U.P.




pe

International experts to be consulted on Styrene gas leak at Visakhapatnam

The NCMC chaired by Cabinet Secretary Rajiv Gauba met on Friday to review the situation arising out of the gas leak




pe

Odisha drafts more than 2 lakh people into COVID-19 workforce

8,023 doctors, 8,296 staff nurses, 4,105 paramedics and lab technicians have been identified as dedicated COVID-19 service providers




pe

Strawberry cultivator’s hope blighted with frustration




pe

Lockdown washes away watermelon prospect




pe

Strategic risk management [electronic resource] : new tools for competitive advantage in an uncertain age / Paul C. Godfrey, [and three others]

Godfrey, Paul C., author




pe

Strategische personalentwicklung in der praxis [electronic resource] : instrumente, erfolgsmodelle, checklisten, praxisbeispiele. / Christine Wegerich

Wegerich, Christine, author




pe

Succeeding in the project management jungle [electronic resource] : how to manage the people side of projects / Doug Russell

Russell, Doug




pe

Successes and failures of knowledge management [electronic resource] / edited by Jay Liebowitz, Distinguished Chair of Applied Business and Finance, Harrisburg University of Science and Technology, Harrisburg, Pennsylvania




pe

Superior customer value [electronic resource] : strategies for winning and retaining customers / Art Weinstein

Weinstein, Art, author




pe

Supply chain management at warp speed [electronic resource] : integrating the system from end to end / Eli Schragenheim, H. William Dettmer, J. Wayne Patterson

Schragenheim, Eli




pe

Sustainability in supply chain management (collection) [electronic resource] / Peter A. Soyka, Robert Palevich, Steven M. Leon

Soyka, Peter A., 1958- author




pe

System center operations manager 2007 R2 unleashed [electronic resource] : supplement to System center operations manager 2007 unleashed / Kerrie Meyler ... [et al.]




pe

The talent assessment and development pocket tool kit [electronic resource] : how to get the most out of your best people / Brenda Hampel and Anne Bruce

Hampel, Brenda




pe

The talent equation [electronic resource] : big data lessons for navigating the skills gap and building a competitive workforce / Matt Ferguson, Lorin Hitt, Prasanna Tambe, with Ryan Hunt and Jennifer Sullivan Grasz

Ferguson, Matt




pe

Talking to crazy [electronic resource] : how to deal with the irrational and impossible people in your life / Mark Goulston

Goulston, Mark




pe

Target opportunity selling [electronic resource] : top sales performers reveal what really works / Nicholas A.C. Read

Read, Nicholas A. C




pe

Think before you engage [electronic resource] : 100 questions to ask before starting a social media marketing campaign / Dave Peck

Peck, Dave D




pe

Comment tirer profit de l'intelligence collective? [electronic resource] : pratiques de management et dynamiques d'équipe / par Véronique Bronckart

Bronckart, Véronique, author




pe

Total quality management and just-in-time purchasing [electronic resource] : their effects on performance of firms operating in the U.S. / Hale Kaynak

Kaynak, Hale, 1956-




pe

Transitioning to Agile [electronic resource] : understanding the business imperative for transforming enterprises / Rick Freedman

Freedman, Rick, author




pe

Troubleshooting system center configuration manager [electronic resource] : troubleshoot all the aspects of your Configuration Manager installation, from basic easy checks to the advanced log files and serious issues / Peter Egerton, Gerry Hampson

Egerton, Peter, author




pe

The truth about getting the best from people [electronic resource] / Martha I. Finney

Finney, Martha I




pe

The truth about managing people [electronic resource] : proven insights to get the best from your team / Stephen P. Robbins

Robbins, Stephen P., 1943- author




pe

Truth, growth, repeat [electronic resource] : (a business manual for generation why) / by Mike Edmonds with Ronnie Duncan

Edmonds, Mike, author




pe

Turn enemies into allies [electronic resource] : the art of peace in the workplace / Judy Ringer ; foreword by James Warda ; illustrations by Adam Richardson

Ringer, Judy, 1949- author




pe

Turning people into teams [electronic resource] : rituals and routines that redesign how we work / David Sherwin & Mary Sherwin

Sherwin, David, author




pe

The ultimate guide to strategic marketing [electronic resource] : real world methods for developing successful, long-term marketing plans / Robert J. Hamper

Hamper, Robert J




pe

Der Unternehmer im Wachstum [electronic resource] : Identifizierung von wachstumsrelevanten Kompetenzbereichen / Christine Blanka

Blanka, Christine, author




pe

UX Fundamentals for Non-UX Professionals [electronic resource] : User Experience Principles for Managers, Writers, Designers, and Developers / by Edward Stull

Stull, Edward. author




pe

Value-driven business process management [electronic resource] : the value-switch for lasting competitive advantage / Peter Franz ; Mathias Kirchmer

Franz, Peter




pe

VersaStack solution by Cisco and IBM with Oracle RAC, IBM FlashSystem V9000, IBM Spectrum Protect [electronic resource] / Jon Tate, Dharmesh Kamdar, Dong Hai Yu, Randy Watson

Tate, Jon, author




pe

Perfect phrases for virtual teamwork [electronic resource] : hundreds of ready-to-use phrases for fostering collaboration at a distance / Meryl Runion with Lynda McDermott

Runion, Meryl




pe

Water governance for sustainable development [electronic resource] / edited by Sylvain Perret, Stefano Farolfi and Rashid Hassan




pe

Welcome to management [electronic resource] : how to go from top performer to excellent leader / by Ryan Hawk

Hawk, Ryan, author




pe

What great salespeople do [electronic resource] : the science of selling through emotional connection and the power of story / Michael Bosworth, Ben Zoldan

Bosworth, Michael T




pe

What is a high performance work organization? [electronic resource] / Bradley L. Kirkman, Kevin B. Lowe, Dianne P. Young

Kirkman, Bradley Lane, author




pe

What is six sigma? [electronic resource] / Pete Pande, Larry Holpp

Pande, Peter S




pe

When a Western 3PL meets an Asian 3PL, something magical happens [electronic resource] / Chuck Munson with Shong-Iee Ivan Su

Munson, Chuck, author




pe

Which way forward? [electronic resource] : people, forests, and policymaking in Indonesia / edited by Carol J. Pierce Colfer and Ida Aju Pradnja Resosudarmo




pe

Who are your best people? [electronic resource] : how to find, measure and manage your top talent / Robin Stuart-Kotze and Chris Dunn

Stuart-Kotze, Robin




pe

Wirkungsvolle führung im change-management [electronic resource] : Studie am Beispiel des Privatkundengeschäfts von banken / Christian Pein

Pein, Christian, author




pe

The WorldatWork handbook of compensation, benefits & total rewards [electronic resource] : a comprehensive guide for HR professionals / Worldatwork




pe

XML and JSON Recipes for SQL Server [electronic resource] : A Problem-Solution Approach / by Alex Grinberg

Grinberg, Alex. author




pe

A year with Peter Drucker [electronic resource] : 52 weeks of coaching for leadership effectiveness / based on the work of Peter F. Drucker ; Joseph A. Maciariello

Maciariello, Joseph A., author