Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element
or the /deep/
path selector.
video::webkit-media-controls-timeline {
background-color: lime;
}
video /deep/ input[type=range] {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Define WebSocket using ws library | |
const WebSocket = require('ws'); | |
// Initialise wss as a new Websocket Server running in port 8989 | |
const wss = new WebSocket.Server({ port: 8989 }); | |
// Array of users currently logged in. Serves as the Database. | |
var users = []; | |
// This is the code that will run on the server when a new client is connected to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"math/rand" | |
"net/url" | |
"os" | |
"time" | |
"github.com/ChimeraCoder/anaconda" | |
"github.com/Sirupsen/logrus" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ruler() { | |
const ruler = document.createElement("div"); | |
ruler.style.cssText = ` | |
position: absolute; | |
top: ${window.scrollY + window.innerHeight/2 - 20}px; | |
left: ${window.scrollX + window.innerWidth/2 - 20}px; | |
width: 40px; | |
height: 40px; | |
background: #ff00006e; |
I need very often to modify filenames or replace/delete their parts across huge number of files. I was using sed command for these purposes but recently I have found out that all these tasks can be easily done directly in bash (or zsh) because both of them support so called string manipulation operations.
Define some example string:
$ file=some_file_name.txt
OlderNewer