de Enhanced methane gas storage in the form of hydrates: role of the confined water molecules in silica powders By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17795-17804DOI: 10.1039/D0RA01754J, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Pinnelli S. R. Prasad, Burla Sai Kiran, Kandadai SowjanyaRapid and efficient methane hydrate conversions by utilising the water molecules confined in intra- and inter-granular space of silica powders.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
de Facile synthesis of a direct Z-scheme BiOCl–phosphotungstic acid heterojunction for the improved photodegradation of tetracycline By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17369-17376DOI: 10.1039/D0RA02396E, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Haijuan Tong, Bingfang Shi, Shulin ZhaoA one-step hydrothermal approach for synthesizing BiOCl–phosphotungstic acid (BiOCl–HPW) heterojunctions is proposed. The prepared BiOCl–HPW heterojunction exhibited good stability and photocatalytic activity.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
de Correction: Narrowing band gap and enhanced visible-light absorption of metal-doped non-toxic CsSnCl3 metal halides for potential optoelectronic applications By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17869-17869DOI: 10.1039/D0RA90054K, Correction Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Jakiul Islam, A. K. M. Akther HossainThe content of this RSS Feed (c) The Royal Society of Chemistry Full Article
de Effect of new carbonyl cyanide aromatic hydrazones on biofilm inhibition against methicillin resistant Staphylococcus aureus By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17854-17861DOI: 10.1039/D0RA03124K, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Xueer Lu, Ziwen Zhang, Yingying Xu, Jun Lu, Wenjian Tang, Jing Zhang2e and 2j with strong p-NO2 and p-CF3 at phenyl ring had the lowest MICs against S. aureus and MRSA. 2e displayed unaided or synergistic efficacy against MRSA, especially combined with ofloxacin. EM revealed that 2e destroys biofilms and cell membranes.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
de Research on the controllable degradation of N-methylamido and dialkylamino substituted at the 5th position of the benzene ring in chlorsulfuron in acidic soil By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17870-17880DOI: 10.1039/D0RA00811G, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Fan-Fei Meng, Lei Wu, Yu-Cheng Gu, Sha Zhou, Yong-Hong Li, Ming-Gui Chen, Shaa Zhou, Yang-Yang Zhao, Yi Ma, Zheng-Ming LiThese results will provide valuable information to discover tailored SU with controllable degradation properties to meet the needs of individual crops.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
de Lithium metal deposition/dissolution under uniaxial pressure with high-rigidity layered polyethylene separator By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17805-17815DOI: 10.1039/D0RA02788J, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Shogo Kanamori, Mitsuhiro Matsumoto, Sou Taminato, Daisuke Mori, Yasuo Takeda, Hoe Jin Hah, Takashi Takeuchi, Nobuyuki ImanishiThe use of a high rigidity separator and application of an appropriate amount of pressure are effective approaches to control lithium metal growth and improve its cycle performance.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
de Synthesis of heteroatom-containing pyrrolidine derivatives based on Ti(O-iPr)4 and EtMgBr-catalyzed carbocyclization of allylpropargyl amines with Et2Zn By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17881-17891DOI: 10.1039/D0RA02677H, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Rita N. Kadikova, Ilfir R. Ramazanov, Azat M. Gabdullin, Oleg S. Mozgovoj, Usein M. DzhemilevThe Ti(O-iPr)4 and EtMgBr-catalyzed regio and stereoselective carbocyclization of N-allyl-substituted 2-alkynylamines with Et2Zn, followed by deuterolysis or hydrolysis, affords the corresponding methylenepyrrolidine derivatives in high yields.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
de Glossary format definition list By nicolasgallagher.com Published On :: Mon, 01 Jun 2009 17:00:00 -0700 Bruce Lawson recently asked for ways to style a definition list in the common glossary format. This is one way to do it. Bruce’s original post – css challenge – describes what he is after: a “glossary style” appearance with the term on the left and the definitions on the right. Some terms will have multiple definitions, definitions of varying length, and each new term should appear on a new line. A definition list is semantically correct for this kind of information, so there was to be no fiddling around with the HTML, and the browser requirements were for it to work in all modern browsers and IE 6+. You can skip straight to the demo where some additional classes are included in the HTML in order to highlight each term-definition association. The basic HTML The basic HTML structure is a simple definition list and nothing more. There are some short, long, and multiple definitions for each term. <h1>Styling definition lists</h1> <dl> <dt>Cheese</dt> <dd> <p>Velit esse cillum dolore in reprehenderit in voluptate duis aute irure dolor. Consectetur adipisicing elit, excepteur sint occaecat sunt in culpa. Velit esse cillum dolore eu fugiat nulla pariatur. Ut aliquip ex ea commodo consequat.</p> <p>Mollit anim id est laborum. Ut enim ad minim veniam, consectetur adipisicing elit, ullamco laboris nisi. Lorem ipsum dolor sit amet, sunt in culpa quis nostrud exercitation.</p> </dd> <dd>yummy!</dd> <dt>Building flexibility through spreading knowledge and self-organization, exploiting the productive lifecycle to experience a profound paradigm shift. Through the adoption of a proactive stance, the astute manager can adopt a position at the vanguard.</dt> <dd>balderdash</dd>; <dd>poppycock</dd> <dt>Aardvark</dt> <dd>never hurt anyone</dd> </dl> The styles In order to get the required appearance in all browsers I had to use negative margins and a few conditional styles to get IE7 and IE6 to play along. For the purposes of the demo I’ve placed all the styles in <style> blocks in the head of the document. <style> dl {padding-left:300px;} dt {clear:both; float:left; width:260px; padding:10px; margin:0 0 2em -300px; font-weight:bold; color:#686663;} dd {float:left; width:100%; padding:10px 0; margin:0 0 2em;} </styl> <!--[if lte IE 7]> <style> dt {display:inline; margin-bottom:0;} dd {float:none; width:auto;} </style> <![endif]--> That’s it. The widths of the <dt> can be set in ems or percentages if the layout requires. The complete code is available in the demo and you are free to use this code. Full Article
de Multiple Backgrounds and Borders with CSS 2.1 By nicolasgallagher.com Published On :: Wed, 09 Jun 2010 17:00:00 -0700 Using CSS 2.1 pseudo-elements to provide up to 3 background canvases, 2 fixed-size presentational images, and multiple complex borders for a single HTML element. This method of progressive enhancement works for all browsers that support CSS 2.1 pseudo-elements and their positioning. No CSS3 support required. Demo: Multiple Backgrounds with CSS 2.1 Demo: Multiple Borders with CSS 2.1 Support: Firefox 3.5+, Safari 4+, Chrome 4+, Opera 10+, IE8+. How does it work? Essentially, you create pseudo-elements using CSS (:before and :after) and treat them similarly to how you would treat HTML elements nested within your target element. But they have distinct benefits – beyond semantics – over the use of nested HTML elements. To provide multiple backgrounds and/or borders, the pseudo-elements are pushed behind the content layer and pinned to the desired points of the HTML element using absolute positioning. The pseudo-elements contain no true content and are absolutely positioned. This means that they can be stretched to sit over any area of the “parent” element without affecting its content. This can be done using any combination of values for the top, right, bottom, left, width, and height properties and is the key to their flexibility. What effects can be achieved? Using just one element you can create parallax effects, multiple background colours, multiple background images, clipped background images, image replacement, expandable boxes using images for borders, fluid faux columns, images existing outside the box, the appearance of multiple borders, and other popular effects that usually require images and/or the use of presentational HTML. It is also possible to include 2 extra presentational images as generated content. The Multiple Backgrounds with CSS 2.1 and Multiple Borders with CSS 2.1 demo pages show how several popular examples of these effects can be achieved with this technique. Most structural elements will contain child elements. Therefore, more often than not, you will be able to gain a further 2 pseudo-elements to use in the presentation by generating them from the first child (and even last-child) element of the parent element. In addition, you can use style changes on :hover to produce complex interaction effects. Example code: multiple background images Using this technique it is possible to reproduce multiple-background parallax effects like those found on the Silverback site using just one HTML element. The element gets its own background image and any desired padding. By relatively positioning the element it acts as the reference point when absolutely positioning the pseudo-elements. The positive z-index will allow for the correct z-axis positioning of the pseudo-elements. #silverback { position: relative; z-index: 1; min-width: 200px; min-height: 200px; padding: 120px 200px 50px; background: #d3ff99 url(vines-back.png) -10% 0 repeat-x; } Both pseudo-elements are absolutely positioned and pinned to each side of the element. The z-index value of -1 moves the pseudo-elements behind the content layer. This way the pseudo-elements sit on top of the element’s background and border but all the content is still selectable or clickable. #silverback:before, #silverback:after { position: absolute; z-index: -1; top: 0; left: 0; right: 0; bottom: 0; padding-top: 100px; } Each pseudo-element then has a repeated background-image set. This is all that is needed to reproduce the parallax effect. The content property lets you add an image as generated content. With two pseudo-elements you can add 2 further images to an element. They can be crudely positioned within the pseudo-element box by varying other properties such as text-align and padding. #silverback:before { content: url(gorilla-1.png); padding-left: 3%; text-align: left; background: transparent url(vines-mid.png) 300% 0 repeat-x; } #silverback:after { content: url(gorilla-2.png); padding-right: 3%; text-align: right; background: transparent url(vines-front.png) 70% 0 repeat-x; } The finished product is part of the Multiple Backgrounds with CSS 2.1 demo. Example code: fluid faux columns Another application is creating equal height fluid columns without images or extra nested containers. The HTML base is very simple. I’ve used specific classes on each child div rather than relying on CSS 2.1 selectors that IE6 does not support. If you don’t require IE6 support you don’t actually need the classes. <div id="faux"> <div class="main">[content]</div> <div class="supp1">[content]</div> <div class="supp2">[content]</div> </div> The percentage-width container is once again relatively positioned and a positive z-index is set. Applying overflow:hidden gets the element to wrap its floated children and will hide the overflowing pseudo-elements. The background colour will provide the colour for one of the columns. #faux { position: relative; z-index: 1; width: 80%; margin: 0 auto; overflow: hidden; background: #ffaf00; } By using relative positioning on the child div‘s you can also control the order of the columns independently of their source order. #faux div { position: relative; float: left; width: 30%; } #faux .main { left: 35%; } #faux .supp1 { left: -28.5%; } #faux .supp2 { left: 8.5%; } The other two full-height columns are produced by creating, sizing, and positioning pseudo-elements with backgrounds. These backgrounds can be (repeating) images if the design requires. #faux:before, #faux:after { content: ""; position: absolute; z-index: -1; top: 0; right: 0; bottom: 0; left: 33.333%; background: #f9b6ff; } #faux:after { left: 66.667%; background: #79daff; } The finished product is part of the Multiple Backgrounds with CSS 2.1 demo. Example code: multiple borders Multiple borders are produced in much the same way. Using them can avoid the need for images to produce simple effects. An element must be relatively positioned and have sufficient padding to contain the width of the extra border you will be creating with pseudo-elements. #borders { position: relative; z-index: 1; padding: 30px; border: 5px solid #f00; background: #ff9600; } The pseudo-elements are positioned at specific distances away from the edge of the element’s box, moved behind the content layer with the negative z-index, and given the border and background values you want. #borders:before { content: ""; position: absolute; z-index: -1; top: 5px; left: 5px; right: 5px; bottom: 5px; border: 5px solid #ffea00; background: #4aa929; } #borders:after { content: ""; position: absolute; z-index: -1; top: 15px; left: 15px; right: 15px; bottom: 15px; border: 5px solid #00b4ff; background: #fff; } That’s all there is to it. The finished product is part of the Multiple Borders with CSS 2.1 demo. Progressive enhancement and legacy browsers IE6 and IE7 have no support for CSS 2.1 pseudo-elements and will ignore all :before and :after declarations. They get none of the enhancements but are left with the basic usable experience. A warning about Firefox 3.0 Firefox 3.0 supports CSS 2.1 pseudo-elements but does not support their positioning. Due to this partial support, you should avoid declaring display:block for absolutely positioned pseudo-elements that explicitly declare a width or height values. However, when using borders there is no graceful fallback for Firefox 3.0. Although, sometimes an improved appearance in Firefox 3.0 can be achieved by adding display:block to pseudo-element hacks that use borders. Enhancing with CSS3 All the applications included in this article could be further enhanced to take advantage of present-day CSS3 implementations. Using border-radius, rgba, and transforms, and CSS3 multiple background images in tandem with pseudo-elements can produce even more complex presentations that I hope to include in a future article. Currently there is no browser support for the use of CSS3 transitions or animations on pseudo-elements. In the future: CSS3 pseudo-elements The proposed extensions to pseudo-elements in the CSS3 Generated and Replaced Content Module include the addition of nested pseudo-elements (::before::before), multiple pseudo-elements (::after(2)), wrapping pseudo-elements (::outside), and the ability to insert pseudo-elements into later parts of the document (::alternate). These changes would provide a near limitless number, and arrangement, of pseudo-elements for all sorts of complex effects and presentations using just one element. Let me know what you’ve done I’ve focused on just a few applications and popular effects. If you find other applications, limitations, or want to share how you’ve applied this technique please leave a comment below or let me know on Twitter (@necolas. Translations 使用css2.1实现多重背景、多重边框效果 Full Article
de Pure CSS folded-corner effect By nicolasgallagher.com Published On :: Sat, 11 Dec 2010 16:00:00 -0800 Create a simple CSS folded-corner effect without images or extra markup. It works well in all modern browsers and is best suited to designs with simple colour backgrounds. Demo: Pure CSS folded-corner effect Known support: Firefox 3.5+, Chrome 4+, Safari 4+, Opera 10+, IE 8+ This post is going to expand on the technique used to create the folded-corner effect that is part of the demo page for Multiple Backgrounds and Borders with CSS 2.1. As a starting point it will look to recreate the appearance of the note style used on the Yiibu‘s fantastic web site. Where Yiibu uses images, this will use pseudo-elements. Nothing complicated. Any element will do and there’s no need for extra markup. It’s just a simple coloured box to start with. Browsers with no support for pseudo-elements, such as IE6 and IE7, will only be capable of displaying this. Adding position:relative makes it possible to absolutely position the pseudo-element. .note { position: relative; width: 30%; padding: 1em 1.5em; margin: 2em auto; color: #fff; background: #97C02F; } The folded-corner The folded-corner is created from a pseudo-element that is positioned in the top corner of the box. The pseudo-element has no width or height but is given a thick border. Varying the size of the border will vary the size of the folded-corner. In this example, the top and right borders are set to colours that match the background colour of the box’s parent. The left and bottom border are then given a slightly darker or lighter shade of the box’s background colour. .note:before { content: ""; position: absolute; top: 0; right: 0; border-width: 0 16px 16px 0; border-style: solid; border-color: #658E15 #fff; } This is all that’s needed to create a simple folded-corner effect like that found on Yiibu. Firefox 3.0 doesn’t allow for the positioning of pseudo-elements. You can throw in a couple of extra styles to help tidy things up in that browser. .note:before { ... display: block; width: 0; } Adding a subtle shadow The appearance of a fold can be slightly enhanced by adding a box-shadow (for browsers that support it) to the pseudo-element. Setting overflow:hidden on the note itself will help hide parts of the shadow that would disrupt the folded-corner effect. .note:before { ... -webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.3), -1px 1px 1px rgba(0,0,0,0.2); -moz-box-shadow: 0 1px 1px rgba(0,0,0,0.3), -1px 1px 1px rgba(0,0,0,0.2); box-shadow: 0 1px 1px rgba(0,0,0,0.3), -1px 1px 1px rgba(0,0,0,0.2); } Rounded corners It’s also relatively simple to make this work with rounded corners if desired. Unfortunately, every modern browser has some form of border-radius bug – including those using the non-prefixed property – which means a slight work around is needed. Webkit browsers are the only browsers that can come anywhere close to rounding the corner of the pseudo-element if it only has 2 borders. Opera 11 and Firefox 3.6 make a mess of it. Opera 11 makes the biggest mess. Using 4 borders avoids the problems in Opera 11 and Firefox 3.6. But it will trigger a bug in Safari 5 that leaves the diagonal looking a little jaggy. We can get around this problem by setting at least one border colour to be transparent. When a background colour is applied to the pseudo-element it will show through the transparent border. Ideally, this approach would form the basis of the entire effect because we could reduce the amount of code needed. But Opera 11 will not show the background colour through the transparent borders unless a border-radius has been set. .note-rounded:before { content: ""; position: absolute; top: 0; right: 0; border-width: 8px; border-color: #fff #fff transparent transparent; background: #658E15; -moz-border-radius: 0 0 0 5px; border-radius: 0 0 0 5px; display: block; width: 0; } The CSS file on the demo page has more comments on the work arounds. Every browser has its own peculiarities when it comes to using border-radius or borders on elements with no width or height. This is the merely simplest solution I’ve found to deal with those browser inconsistencies. The final code This is all the CSS needed to create a simple folded-corner effect, with a subtle shadow, from a single HTML element. To include a variant with rounded corners, the “note” object can be extended with the modifications described previously. .note { position: relative; width: 30%; padding: 1em 1.5em; margin: 2em auto; color: #fff; background: #97C02F; overflow: hidden; } .note:before { content: ""; position: absolute; top: 0; right: 0; border-width: 0 16px 16px 0; border-style: solid; border-color: #fff #fff #658E15 #658E15; background: #658E15; -webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.3), -1px 1px 1px rgba(0,0,0,0.2); -moz-box-shadow: 0 1px 1px rgba(0,0,0,0.3), -1px 1px 1px rgba(0,0,0,0.2); box-shadow: 0 1px 1px rgba(0,0,0,0.3), -1px 1px 1px rgba(0,0,0,0.2); /* Firefox 3.0 damage limitation */ display: block; width: 0; } .note.rounded { -moz-border-radius: 5px 0 5px 5px; border-radius: 5px 0 5px 5px; } .note.rounded:before { border-width: 8px; border-color: #fff #fff transparent transparent; -moz-border-radius: 0 0 0 5px; border-radius: 0 0 0 5px; } The demo page shows the final effect, an example with rounded corners, and how different coloured notes are easy to create from this base. This technique works less well when the element receiving the folded-corner effect is sitting on top of a background image rather than a simple background colour. However, the same limitation exists for image-based methods of creating this effect. Full Article
de CSS: the cascade, specificity, and inheritance By nicolasgallagher.com Published On :: Sun, 04 Mar 2012 16:00:00 -0800 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: user !important declarations author !important declarations author normal declarations user normal declarations 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 CSS: каскад, специфика и наследование Full Article
de A simple Git deployment strategy for static sites By nicolasgallagher.com Published On :: Wed, 01 Jan 2014 16:00:00 -0800 This is how I am deploying the build of my static website to staging and production domains. It requires basic use of the CLI, Git, and SSH. But once you’re set up, a single command will build and deploy. TL;DR: Push the static build to a remote, bare repository that has a detached working directory (on the same server). A post-receive hook checks out the files in the public directory. Prerequisites A remote web server to host your site. SSH access to your remote server. Git installed on your remote server (check with git --version). Generate an SSH key if you need one. On the server Set up password-less SSH access First, you need to SSH into your server, and provide the password if prompted. ssh user@hostname If there is no ~/.ssh directory in your user’s home directory, create one: mkdir ~/.ssh. Next, you need to copy your public SSH key (see “Generate an SSH key” above) to the server. This allows you to connect via SSH without having to enter a password each time. From your local machine – assuming your public key can be found at ~/.ssh/id_rsa.pub – enter the following command, with the correct user and hostname. It will append your public key to the authorized_keys file on the remote server. ssh user@hostname 'cat >> ~/.ssh/authorized_keys' < ~/.ssh/id_rsa.pub If you close the connection, and then attempt to establish SSH access, you should no longer be prompted for a password. Create the remote directories You need to have 2 directories for each domain you want to host. One for the Git repository, and one to contain the checked out build. For example, if your domain were example.com and you also wanted a staging environment, you’d create these directories on the server: mkdir ~/example.com ~/example.git mkdir ~/staging.example.com ~/staging.example.git Initialize the bare Git repository Create a bare Git repository on the server. This is where you will push the build assets to, from your local machine. But you don’t want the files served here, which is why it’s a bare repository. cd ~/example.git git init --bare Repeat this step for the staging domain, if you want. Write a post-receive hook A post-receive hook allows you to run commands after the Git repository has received commits. In this case, you can use it to change Git’s working directory from example.git to example.com, and check out a copy of the build into the example.com directory. The location of the working directory can be set on a per-command basis using GIT_WORK_TREE, one of Git’s environment variables, or the --work-tree option. cat > hooks/post-receive #!/bin/sh WEB_DIR=/path/to/example.com # remove any untracked files and directories git --work-tree=${WEB_DIR} clean -fd # force checkout of the latest deploy git --work-tree=${WEB_DIR} checkout --force Make sure the file permissions on the hook are correct. chmod +x hooks/post-receive If you need to exclude some files from being cleaned out by Git (e.g., a .htpasswd file), you can do that using the --exclude option. This requires Git 1.7.3 or above to be installed on your server. git --work-tree=${WEB_DIR} clean -fd --exclude=<pattern> Repeat this step for the staging domain, if you want. On your local machine Now that the server configuration is complete, you want to deploy the build assets (not the source code) for the static site. The build and deploy tasks I’m using a Makefile, but use whatever you feel comfortable with. What follows is the basic workflow I wanted to automate. Build the production version of the static site. make build Initialize a new Git repo in the build directory. I don’t want to try and merge the new build into previous deploys, especially for the staging domain. git init ./build Add the remote to use for the deploy. cd ./build git remote add origin ssh://user@hostname/~/example.git Commit everything in the build repo. cd ./build git add -A git commit -m "Release" Force-replace the remote master branch, creating it if missing. cd ./build git push -f origin +master:refs/heads/master Tag the checked-out commit SHA in the source repo, so I can see which SHA’s were last deployed. git tag -f production Using a Makefile: BUILD_DIR := ./build STAGING_REPO = ssh://user@hostname/~/staging.example.git PROD_REPO = ssh://user@hostname/~/example.git install: npm install # Deploy tasks staging: build git-staging deploy @ git tag -f staging @ echo "Staging deploy complete" prod: build git-prod deploy @ git tag -f production @ echo "Production deploy complete" # Build tasks build: clean # whatever your build step is # Sub-tasks clean: @ rm -rf $(BUILD_DIR) git-prod: @ cd $(BUILD_DIR) && git init && git remote add origin $(PROD_REPO) git-staging: @ cd $(BUILD_DIR) && git init && git remote add origin $(STAGING_REPO) deploy: @ cd $(BUILD_DIR) && git add -A && git commit -m "Release" && git push -f origin +master:refs/heads/master .PHONY: install build clean deploy git-prod git-staging prod staging To deploy to staging: make staging To deploy to production: make prod Using Make, it’s a little bit more hairy than usual to force push to master, because the cd commands take place in a sub-process. You have to make sure subsequent commands are on the same line. For example, the deploy task would force push to your source code’s remote master branch if you failed to join the commands with && or ;! I push my site’s source code to a private repository on BitBucket. One of the nice things about BitBucket is that it gives you the option to prevent deletions or history re-writes of branches. If you have any suggested improvements, let me know on Twitter. Full Article
de Redux modules and code-splitting By nicolasgallagher.com Published On :: Thu, 01 Feb 2018 16:00:00 -0800 Twitter Lite uses Redux for state management and relies on code-splitting. However, Redux’s default API is not designed for applications that are incrementally-loaded during a user session. This post describes how I added support for incrementally loading the Redux modules in Twitter Lite. It’s relatively straight-forward and proven in production over several years. Redux modules Redux modules comprise of a reducer, actions, action creators, and selectors. Organizing redux code into self-contained modules makes it possible to create APIs that don’t involve directly referencing the internal state of a reducer – this makes refactoring and testing a lot easier. (More about the concept of redux modules.) Here’s an example of a small “redux module”. // data/notifications/index.js const initialState = []; let notificationId = 0; const createActionName = name => `app/notifications/${name}`; // reducer export default function reducer(state = initialState, action = {}) { switch (action.type) { case ADD_NOTIFICATION: return [...state, { ...action.payload, id: notificationId += 1 }]; case REMOVE_NOTIFICATION: return state.slice(1); default: return state; } } // selectors export const selectAllNotifications = state => state.notifications; export const selectNextNotification = state => state.notifications[0]; // actions export const ADD_NOTIFICATION = createActionName(ADD_NOTIFICATION); export const REMOVE_NOTIFICATION = createActionName(REMOVE_NOTIFICATION); // action creators export const addNotification = payload => ({ payload, type: ADD_NOTIFICATION }); export const removeNotification = () => ({ type: REMOVE_NOTIFICATION }); This module can be used to add and select notifications. Here’s an example of how it can be used to provide props to a React component. // components/NotificationView/connect.js import { connect } from 'react-redux'; import { createStructuredSelector } from 'reselect'; import { removeNotification, selectNextNotification } from '../../data/notifications'; const mapStateToProps = createStructuredSelector({ nextNotification: selectNextNotification }); const mapDispatchToProps = { removeNotification }; export default connect(mapStateToProps, mapDispatchToProps); // components/NotificationView/index.js import connect from './connect'; export class NotificationView extends React.Component { /*...*/ } export default connect(NotificationView); This allows you to import specific modules that are responsible for modifying and querying specific parts of the overall state. This can be very useful when relying on code-splitting. However, problems with this approach are evident once it comes to adding the reducer to a Redux store. // data/createStore.js import { combineReducers, createStore } from 'redux'; Import notifications from './notifications'; const initialState = /* from local storage or server */ const reducer = combineReducers({ notifications }); const store = createStore(reducer, initialState); export default store; You’ll notice that the notifications namespace is defined at the time the store is created, and not by the Redux module that defines the reducer. If the “notifications” reducer name is changed in createStore, all the selectors in the “notifications” Redux module no longer work. Worse, every Redux module needs to be imported in the createStore file before it can be added to the store’s reducer. This doesn’t scale and isn’t good for large apps that rely on code-splitting to incrementally load modules. A large app could have dozens of Redux modules, many of which are only used by a few components and unnecessary for initial render. Both of these issues can be avoided by introducing a Redux reducer registry. Redux reducer registry The reducer registry enables Redux reducers to be added to the store’s reducer after the store has been created. This allows Redux modules to be loaded on-demand, without requiring all Redux modules to be bundled in the main chunk for the store to correctly initialize. // data/reducerRegistry.js export class ReducerRegistry { constructor() { this._emitChange = null; this._reducers = {}; } getReducers() { return { ...this._reducers }; } register(name, reducer) { this._reducers = { ...this._reducers, [name]: reducer }; if (this._emitChange) { this._emitChange(this.getReducers()); } } setChangeListener(listener) { this._emitChange = listener; } } const reducerRegistry = new ReducerRegistry(); export default reducerRegistry; Each Redux module can now register itself and define its own reducer name. // data/notifications/index.js import reducerRegistry from '../reducerRegistry'; const initialState = []; let notificationId = 0; const reducerName = 'notifications'; const createActionName = name => `app/${reducerName}/${name}`; // reducer export default function reducer(state = initialState, action = {}) { switch (action.type) { case ADD_NOTIFICATION: return [...state, { ...action.payload, id: notificationId += 1 }]; case REMOVE_NOTIFICATION: return state.slice(1); default: return state; } } reducerRegistry.register(reducerName, reducer); // selectors export const selectAllNotifications = state => state[reducerName]; export const selectNextNotification = state => state[reducerName][0]; // actions export const ADD_NOTIFICATION = createActionName(ADD_NOTIFICATION); export const REMOVE_NOTIFICATION = createActionName(REMOVE_NOTIFICATION); // action creators export const addNotification = payload => ({ payload, type: ADD_NOTIFICATION }); export const removeNotification = () => ({ type: REMOVE_NOTIFICATION }); Next, we need to replace the store’s combined reducer whenever a new reducer is registered (e.g., after loading an on-demand chunk). This is complicated slightly by the need to preserve initial state that may have been created by reducers that aren’t yet loaded on the client. By default, once an action is dispatched, Redux will throw away state that is not tied to a known reducer. To avoid that, reducer stubs are created to preserve the state. // data/createStore.js import { combineReducers, createStore } from 'redux'; import reducerRegistry from './reducerRegistry'; const initialState = /* from local storage or server */ // Preserve initial state for not-yet-loaded reducers const combine = (reducers) => { const reducerNames = Object.keys(reducers); Object.keys(initialState).forEach(item => { if (reducerNames.indexOf(item) === -1) { reducers[item] = (state = null) => state; } }); return combineReducers(reducers); }; const reducer = combine(reducerRegistry.getReducers()); const store = createStore(reducer, initialState); // Replace the store's reducer whenever a new reducer is registered. reducerRegistry.setChangeListener(reducers => { store.replaceReducer(combine(reducers)); }); export default store; Managing the Redux store’s reducer with a registry should help you better code-split your application and modularize your state management. Full Article
de Coronavirus | Maharashtra adds 1,089 new cases; Mumbai’s death toll stands at 462 By www.thehindu.com Published On :: Fri, 08 May 2020 22:39:05 +0530 Of the 1,089 new cases, Mumbai accounted for 748, with a cumulative tally of 12,142. With 75 new cases, Pune district’s tally has risen to 2,537. Full Article Other States
de Migrant workers | Maharashtra train accident victims were battling hunger By www.thehindu.com Published On :: Sat, 09 May 2020 00:23:34 +0530 The previous night, they had called up relatives in Madhya Pradesh to say they were in a helpless state Full Article Other States
de Coronavirus | Indore remains worst hit in Madhya Pradesh with 3 more deaths By www.thehindu.com Published On :: Sat, 09 May 2020 02:21:20 +0530 Bhopal, by comparison, has so far reported 679 cases and 24 deaths, with 354 patients, or more than half of those infected, having recovered. Full Article Other States
de Coronavirus | 390 new cases, 24 deaths in Gujarat; clashes in Ahmedabad By www.thehindu.com Published On :: Fri, 08 May 2020 23:22:50 +0530 Two prominent medical experts — AIIMS director Dr Randeep Guleriya and Dr. Manish Suneja — flew into Ahmedabad on Friday following instructions from the Home Minister to guide local doctors Full Article Other States
de Coronavirus | 87 fresh cases, 1 death in Punjab By www.thehindu.com Published On :: Fri, 08 May 2020 23:25:04 +0530 Major chunk of cases reported from Gurdaspur, Tarn Taran districts Full Article Other States
de Coronavirus lockdown | With no work or food, workers brave the long march home from Uttar Pradesh By www.thehindu.com Published On :: Sat, 09 May 2020 10:06:56 +0530 "We don’t want anything from the government. We just want to be dropped home," says a migrant worker from Chhattisgarh. Full Article Other States
de AMU academic session from Aug. By www.thehindu.com Published On :: Fri, 08 May 2020 23:53:25 +0530 1,300 students of the varsity leave for home by special train Full Article Other States
de PMC Bank fraud case: Rakesh Wadhawan denied interim bail By www.thehindu.com Published On :: Sat, 09 May 2020 01:37:30 +0530 HDIL promoter is lodged in Arthur Road Central Jail Full Article Other States
de SC stays Orissa HC order on testing migrants By www.thehindu.com Published On :: Sat, 09 May 2020 01:44:18 +0530 The Centre said it feared that the order may have a “cascading effect” on migrants of other States as well Full Article Other States
de Teltumbde in judicial custody till May 22 By www.thehindu.com Published On :: Sat, 09 May 2020 01:47:19 +0530 A special National Investigation Agency (NIA) court on Friday extended the judicial custody of academician Dr. Anand Teltumbde, arrested on April 14 i Full Article Other States
de Former J&K Minister’s detention extended by 3 months By www.thehindu.com Published On :: Sat, 09 May 2020 01:57:10 +0530 With a view to prevent him from acting in any manner prejudicial to the maintenance of public order, Naeem Akhtar detention is being extended, an order said. Full Article Other States
de Coronavirus | Nine deaths, 130 cases reported in Bengal By www.thehindu.com Published On :: Sat, 09 May 2020 02:05:54 +0530 This has been the highest spike in the number of cases in the State in a single day, taking the number of cases to 1,678 Full Article Other States
de Punjab police arrest gangster Baljinder Singh By www.thehindu.com Published On :: Sat, 09 May 2020 02:46:59 +0530 He is wanted for murder, attempt to murder and smuggling of weapons and drugs Full Article Other States
de Participators in Nizamuddin event must undergo test By www.assamtimes.org Published On :: Wed, 01 Apr 2020 05:14:54 +0000 Full Article
de Nizamuddin attendees from Assam found in UP By www.assamtimes.org Published On :: Thu, 02 Apr 2020 04:24:05 +0000 Full Article
de SC asks for govt response on detention camp inmates By www.assamtimes.org Published On :: Tue, 07 Apr 2020 13:59:07 +0000 Full Article
de COVID19 patient dead in Silchar By www.assamtimes.org Published On :: Fri, 10 Apr 2020 03:29:02 +0000 Full Article
de MASS condemn arrest of Gautam Navalakha and Anand Teltumbe By www.assamtimes.org Published On :: Thu, 16 Apr 2020 12:00:11 +0000 Full Article
de Council dissolved, BTAD under Guv's Rule By www.assamtimes.org Published On :: Mon, 27 Apr 2020 15:29:08 +0000 Full Article
de Legislators named in delimitation panel By www.assamtimes.org Published On :: Thu, 07 May 2020 10:35:18 +0000 Full Article
de Stranded in the Nyiri Desert [electronic resource] : a group case study / Matthew J. Drake ; Aimee A. Kane and Mercy Shitemi By prospero.murdoch.edu.au Published On :: Drake, Matthew, author Full Article
de Strategic excellence in the architecture, engineering, and construction industries [electronic resource] : how AEC firms can develop and execute strategy using lean Six Sigma / Gerhard Plenert and Joshua J. Plenert By prospero.murdoch.edu.au Published On :: Plenert, Gerhard Johannes, author Full Article
de Strategien zur Vermeidung von Burnout [electronic resource] : der mögliche Einfluss von Coping-Stilen / Markus H. Kipfer By prospero.murdoch.edu.au Published On :: Kipfer, Markus H, author Full Article
de Strategische personalentwicklung in der praxis [electronic resource] : instrumente, erfolgsmodelle, checklisten, praxisbeispiele. / Christine Wegerich By prospero.murdoch.edu.au Published On :: Wegerich, Christine, author Full Article
de The strategy of execution [electronic resource] : the five-step guide for turning vision into action / Liz Mellon and Simon Carter By prospero.murdoch.edu.au Published On :: Mellon, Elizabeth Full Article
de The stress test every business needs [electronic resource] : a capital agenda for confidently facing digital disruption, difficult investors, recessions and geopolitical threats / Jeffrey R. Greene, Steve Krouskos, Julie Hood, Harsha Basnayake, William Ca By prospero.murdoch.edu.au Published On :: Greene, Jeffrey R., author Full Article
de Stressbewältigung, Empathie und Zufriedenheit in der Partnerschaft [electronic resource] / Bente Klein By prospero.murdoch.edu.au Published On :: Klein, Bente Full Article
de Strukturierte Produkte in der Vermögensverwaltung. English By prospero.murdoch.edu.au Published On :: Full Article
de Succeeding in the project management jungle [electronic resource] : how to manage the people side of projects / Doug Russell By prospero.murdoch.edu.au Published On :: Russell, Doug Full Article
de Success in selling [electronic resource] : developing a world-class sales ecosystem / Reza Sisakhti By prospero.murdoch.edu.au Published On :: Sisakhti, Reza, author Full Article
de Successful management guidelines (collection) [electronic resource] / Martha I. Finney, Stephan Robbins By prospero.murdoch.edu.au Published On :: Finney, Martha I., author Full Article
de Supply chain design (collection) [electronic resource] / Marc J. Schniederjans [and six others] By prospero.murdoch.edu.au Published On :: Schniederjans, Marc J., author Full Article
de Supply chain management at warp speed [electronic resource] : integrating the system from end to end / Eli Schragenheim, H. William Dettmer, J. Wayne Patterson By prospero.murdoch.edu.au Published On :: Schragenheim, Eli Full Article
de Supply chain management process standards [electronic resource] : deliver processes / Council of Supply Chain Management Professionals By prospero.murdoch.edu.au Published On :: Council of Supply Chain Management Professionals, author Full Article
de Supply chain management talent development [electronic resource] : acquire, develop, and advance processes / Council of Supply Chain Management Professionals By prospero.murdoch.edu.au Published On :: Council of Supply Chain Management Professionals, author Full Article
de Sustainable engineering [electronic resource] : concepts, design, and case studies / David T. Allen, David R. Shonnard By prospero.murdoch.edu.au Published On :: Allen, David T Full Article
de Systemisk projektledelse [electronic resource] / Henrik Schelde Andersen og Katrine Raae Søndergaard (red.) By prospero.murdoch.edu.au Published On :: Full Article