Skip to content

Instantly share code, notes, and snippets.

View rescenic's full-sized avatar
🌏
DevOps Engineer

Muhammad Ridwan Hakim, S.T., CPITA, ITPMCP rescenic

🌏
DevOps Engineer
View GitHub Profile
@0penBrain
0penBrain / commitCount.sh
Last active July 16, 2025 00:37
The simplest way to get commit count of a GitHub repository through the API
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'
@bhaveshdaswani93
bhaveshdaswani93 / oop_classes.js
Created December 22, 2019 06:00
Understanding classes in javascript
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}`;
}
}
@bhaveshdaswani93
bhaveshdaswani93 / composition_vs_inheritance.js
Created January 4, 2020 08:54
composition vs inheritance explained by example
// 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`)
}
@fworks
fworks / install-zsh-windows-git-bash.md
Last active August 12, 2025 14:25
Zsh / Oh-my-zsh on Windows Git Bash
@unsafe9
unsafe9 / wsl-ssh-install.sh
Last active April 21, 2020 04:18
wsl-ssh
sudo apt update
sudo apt upgrade
sudo apt-get purge openssh-server
sudo apt-get install openssh-server
sudo service ssh start
@bergmannjg
bergmannjg / rearct-native-app-in-wsl2.md
Last active October 26, 2025 18:20
Building a react native app in WSL2
@vilicvane
vilicvane / wsl-host.ps1
Last active December 3, 2022 06:25
Access Windows host from WSL 2
# 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.
@amingholami
amingholami / make-chr.sh
Last active August 3, 2025 09:39 — forked from stroebs/make-chr.sh
Install Mikrotik CHR on a DigitalOcean Droplet (2021)
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
@bhaveshdaswani93
bhaveshdaswani93 / .htaccess
Created December 21, 2020 05:42 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#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/
@cdhunt
cdhunt / cdhunt.format.ps1xml
Created April 8, 2021 13:13
Combing FileSystemTypes formats from Powershell-Humanizer and Termincal-Icons
<?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>