- Download the latest zsh package: https://packages.msys2.org/package/zsh?repo=msys&variant=x86_64
Example:
zsh-5.7.1-1-x86_64.pkg.tar.xz
| curl -I -k "https://api.github.com/repos/:owner/:repo/commits?per_page=1" | sed -n '/^[Ll]ink:/ s/.*"next".*page=\([0-9]*\).*"last".*/\1/p' | |
| ### And that's all ! | |
| # I saw many fighting with finding first commit SHA or similar fancy thing. | |
| # Here we just rely on the GH API, asking commits at 1 per page and parsing the last page number in the header of the reply (whose body only holds the last commit !) | |
| # So this is robust and bandwidth efficient. :) | |
| # If one want the commit count of a specific SHA, just use : | |
| curl -I -k "https://api.github.com/repos/:owner/:repo/commits?per_page=1&sha=:sha" | sed -n '/^[Ll]ink:/ s/.*"next".*page=\([0-9]*\).*"last".*/\1/p' |
| class Person | |
| { | |
| constructor(first_name,last_name) { | |
| this.first_name = first_name; | |
| this.last_name = last_name; | |
| } | |
| getFullName() { | |
| return `Full Name is: ${this.first_name} ${this.last_name}`; | |
| } | |
| } |
| // we have to represent human relation in oop style | |
| class Human { | |
| constructor(firstName,lastName) { | |
| this.firstName = firstName; | |
| this.lastName = lastName; | |
| } | |
| sleepNow() { | |
| console.log(`${this.firstName} ${this.lastName} is sleeping`) | |
| } |
Example:
zsh-5.7.1-1-x86_64.pkg.tar.xz
| sudo apt update | |
| sudo apt upgrade | |
| sudo apt-get purge openssh-server | |
| sudo apt-get install openssh-server | |
| sudo service ssh start |
Install, build and debug a react native app in WSL2 (Windows Subsystem for Linux) and Ubuntu.
| # Access host ports from WSL 2. | |
| # https://gist.github.com/vilic/0edcb3bec10339a3b633bc9305faa8b5 | |
| # Make sure WSL gets initialized. | |
| bash.exe -c exit | |
| # Record host name for /etc/hosts that points to host IP. | |
| $HOST_NAME = "host.wsl"; | |
| # Ports listened on host localhost to forward, you don't need to add the port if it listens all addresses. |
| Install Mikrotik CHR on Digital Ocean Ubuntu 18.04 LTS Droplet. Tested 11/2021 | |
| 1. Turn Off Droplet after creation and go to Recovery and set it to Boot from Recovery ISO. | |
| 2. Trun on Droplet and open Console | |
| 3. Press 6 and go to shell | |
| 4. Paste below code to install CHR on HDD |
| #301 Redirects for .htaccess | |
| #Redirect a single page: | |
| Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
| #Redirect an entire site: | |
| Redirect 301 / http://www.domain.com/ | |
| #Redirect an entire site to a sub folder | |
| Redirect 301 / http://www.domain.com/subfolder/ |
| <?xml version="1.0" encoding="utf-8" ?> | |
| <!-- Based on the format.ps1xml file from DirColors | |
| https://github.com/DHowett/DirColors --> | |
| <Configuration> | |
| <SelectionSets> | |
| <SelectionSet> | |
| <Name>FileSystemTypes</Name> | |
| <Types> | |
| <TypeName>System.IO.DirectoryInfo</TypeName> |