Skip to content

Instantly share code, notes, and snippets.

View onattech's full-sized avatar
🌍
Working

Onat onattech

🌍
Working
View GitHub Profile
  1. Install airbnb-base npx install-peerdeps --dev eslint-config-airbnb-base

  2. Install required dependencies npm i -D typescript eslint prettier prettier-eslint-cli eslint-config-prettier eslint-plugin-prettier eslint-config-node eslint-plugin-node @typescript-eslint/eslint-plugin @typescript-eslint/parser

  3. Add .eslintrc.json with the following code:

{
  "root": true,
@amalmurali47
amalmurali47 / backup_digitalocean.md
Last active October 11, 2025 10:58
Backup DigitalOcean droplet locally

DigitalOcean does not provide a way to download a snapshot of your droplet locally. You can use rsync to accomplish this instead.

On your local machine, assuming you have added your-server in your SSH config:

rsync -aAXHv --append-verify --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} your-server:/
  • -a : archive mode (all files, with permissions, etc.)
  • -A : preserve ACLs/permissions (not included with -a)
@2KAbhishek
2KAbhishek / Shell_Keybindings.md
Last active October 8, 2025 09:32
Keyboard shortcuts for bash/zsh

Shell Keybindings

Navigation 🚀

Keybinding Action
Alt + f/b Move cursor to previous/next word
Ctrl + a/e Move cursor to beginning/end of command
Ctrl + xx Toggle between the start of line and current cursor position

Keybase proof

I hereby claim:

  • I am fatih on github.
  • I am arslan (https://keybase.io/arslan) on keybase.
  • I have a public key ASDcvzZWuMBwyPHwpUkOEmBS_jMOB_3NiOjUP-6vPAYePQo

To claim this, I am signing this object:

@bcnzer
bcnzer / cloudflareworker-verifyjwt.js
Last active July 2, 2024 10:18
Sample Cloudflare worker that gets the JWT, ensures it hasn't expired, decrypts it and returns a result
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
// Following code is a modified version of that found at https://blog.cloudflare.com/dronedeploy-and-cloudflare-workers/
/**
* Fetch and log a request
* @param {Request} request
*/
package main
import "fmt"
type person struct {
name string
age int
}
func (p person) print() {
@SanderTheDragon
SanderTheDragon / postman-deb.sh
Last active October 13, 2025 22:25
A shellscript to create a Postman .deb file, for simple installation on Debian-based Linux distro's. Also creates a .desktop file.
#!/bin/sh
# SPDX-FileCopyrightText: 2017-2024 SanderTheDragon <sanderthedragon@zoho.com>
#
# SPDX-License-Identifier: MIT
arch=$(dpkg --print-architecture)
echo "Detected architecture: $arch"
case "$arch" in
@wolfgangmeyers
wolfgangmeyers / golang-test-count.sh
Created October 21, 2016 20:28
How to count the number of running tests for a go project
go test ./... -v | grep -c RUN
@cobyism
cobyism / gh-pages-deploy.md
Last active September 29, 2025 14:15
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).