Given a file file.txt with the following content:
line 1
line 2
line 3
You can delete a line from file content with the d command.
The pattern to match is surrounded with default / delimiter and the d command follows the pattern:
sed '/line 2/d' file.txt
The above command will output:
l...
Whenever you declare a new rule inside another rule it is called nesting. With basic nesting, as shown below, the nested selector will be compiled as a new CSS selector with all its parents prepended, separated by a space.
// SCSS
.parent {
margin: 1rem;
.child {
float: left;
}
...
Nesting is a very powerful feature, but should be used with caution. It can happen quite easily and quickly, that you start nesting and carry on including all children in a nest, of a nest, of a nest. Let me demonstrate:
// SCSS
header {
// [css-rules]
.holder {
// [css-rules]
...
Singletons are used to ensure that only one instance of an object is being created. The singleton allows only a single instance of itself to be created which means it controls its creation.
The singleton is one of the Gang of Four design patterns and is a creational pattern.
Thread-Safe Singleton ...
Fourier Transform is probably the first lesson in Digital Signal Processing, it's application is everywhere and it is a powerful tool when it comes to analyze data (in all sectors) or signals. Matlab has a set of powerful toolboxes for Fourier Transform. In this example, we will use Fourier Transfor...
If you set opacity on an element it will affect all its child elements. To set an opacity just on the background of an element you will have to use RGBA colors. Following example will have a black background with 0.6 opacity.
/* Fallback for web browsers that don't support RGBa */
background-color...
If your project depends on the external libraries, you should first install them with opam.
Assuming your dependencies are foo and bar and the main entry point of your project is foobar.ml you can then build a bytecode executable with
ocamlbuild -use-ocamlfind -pkgs 'foo,bar' foobar.byte
Warnin...
If your project has no external dependency and has foo.ml as its main entry point, you can compile a bytecode version with
ocamlbuild foo.byte
To get a native executable, run
ocamlbuild foo.native
order allow,deny
deny from 255.0.0.0
allow from all
This denies access to the IP 255.0.0.0.
order allow,deny
deny from 123.45.6.
allow from all
This denies access to all IPs in the range 123.45.6.0 to 123.45.6.255.
Fortran 2003 introduced language features which can guarantee interoperability between C and Fortran (and to more languages by using C as an intermediary). These features are mostly accessed through the intrinsic module iso_c_binding:
use, intrinsic :: iso_c_binding
The intrinsic keyword here en...
For annotating some point of interest on map, we use pin annotation. Now, start by creating annotation object first.
MKPointAnnotation *pointAnnotation = [[MKPointAnnotation alloc] init];
Now provide coordinate to pointAnnotation,as
CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake...
In attempt to send a response asynchronously from chrome.runtime.onMessage callback we might try this wrong code:
chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
$.ajax({
url: 'https://www.google.com',
method: 'GET',
success: functio...
Homebrew
You can install Node.js using the Homebrew package manager.
Start by updating brew:
brew update
You may need to change permissions or paths. It's best to run this before proceeding:
brew doctor
Next you can install Node.js by running:
brew install node
Once Node.js is installe...
Detailed instructions on getting laravel set up or installed.
composer is required for installing laravel easily.
There are 3 methods of installing laravel in your system:
Via Laravel Installer
Download the Laravel installer using composer
composer global require "laravel/installer&quo...