Skip to content

Instantly share code, notes, and snippets.

View oasido's full-sized avatar
💅

Ofek Asido oasido

💅
View GitHub Profile
@bilsalak
bilsalak / exercise-loops-and-functions-part-1.go
Last active June 15, 2024 15:52
A Tour of Go - Exercise: Loops and Functions - Part 1
// As a way to play with functions and loops, let's implement a square root function: given a number x,
// we want to find the number z for which z² is most nearly x.
//
// Computers typically compute the square root of x using a loop. Starting with some guess z,
// we can adjust z based on how close z² is to x, producing a better guess:
//
// z -= (z*z - x) / (2*z)
// Repeating this adjustment makes the guess better and better until we reach an answer that is as close
// to the actual square root as can be.
//
@seanh
seanh / netrw.md
Last active October 25, 2025 18:03
Netrw Cheatsheet (Vim's Built-in Directory Browser)

Netrw Cheatsheet (Vim's File Browser)

See also:

  • vinegar.vim, which makes - open netrw in the directory of the current file, with the cursor on the current file (and pressing - again goes up a directory). Vinegar also hides a bunch of junk that's normally at the top of netrw windows, changes the default order of files, and hides files that match wildignore.

    With vinegar, . in netrw opens Vim's command line with the path to the file under the cursor at the end of the command. ! does the same but also prepends ! at the start of the command. y. copies the absolute path of the file under the cursor. ~ goes to your home dir. Ctrl+6 goes back to the file (buffer) that you had open before you opened netrw.

To launch netrw:

@mayneyao
mayneyao / notion2blog.js
Last active November 12, 2025 19:30
Notion.so > Personal Blog | custom domain + disqus comment
const MY_DOMAIN = "agodrich.com"
const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2"
const DISQUS_SHORTNAME = "agodrich"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active November 16, 2025 11:18
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

// ==UserScript==
// @name No YouTube Volume Normalization
// @namespace https://gist.github.com/abec2304
// @match https://www.youtube.com/*
// @match https://music.youtube.com/*
// @grant GM_addElement
// @version 2.74
// @author abec2304
// @description Enjoy YouTube videos at their true volume
// @run-at document-start
(In both Windows)
1. Go to C:\Users\{USER}\AppData\Roaming\AnyDesk
2. Copy & Paste 'thumbnails'
3. Open 'user.conf'
4. Replace the line 'ad.roster.items='
5. Done.
@romainl
romainl / Don't use Vim.md
Last active November 3, 2025 13:25
Don't use Vim for the wrong reasons

Don't use Vim

Don't do the crime, if you can't do the time.

-- Anthony Vincenzo "Tony" Baretta

Vim is an amazing text editor. I love it. Really, I wouldn't [organize][organize] a Vim advent calendar if I didn't. But, as amazing as it is, Vim is not for everyone. It can't solve all your problems, or be a TUI version of your favorite IDE, or make you a better programmer, or land you that dream job in the Bay Area. But Vim can help you be more mindful, focused, and efficient, as long as you approach it with the right mindset.

Don't get me wrong, I certainly welcome you to try Vim, but I'm not a proselyte. I don't thrive on newbies. I just want you to use the right tool for the job and not waste your—and anyone's—time on a fruitless quest.

@anichitiandreea
anichitiandreea / typescript_coding_standards.md
Last active November 5, 2025 23:47
TypeScript Code Conventions
@mark05e
mark05e / DriveClean.ps1
Last active September 12, 2025 23:40 — forked from pmsmith/DriveClean.ps1
Simple script to clear temp files and browser cache/history
#------------------------------------------------------------------#
#- Clear-GlobalWindowsCache #
#------------------------------------------------------------------#
Function Clear-GlobalWindowsCache {
Remove-CacheFiles 'C:\Windows\Temp'
Remove-CacheFiles "C:\`$Recycle.Bin"
Remove-CacheFiles "C:\Windows\Prefetch"
C:\Windows\System32\rundll32.exe InetCpl.cpl, ClearMyTracksByProcess 255
C:\Windows\System32\rundll32.exe InetCpl.cpl, ClearMyTracksByProcess 4351
}
@amazingidiot
amazingidiot / README.md
Created August 14, 2021 09:56
Pipewire virtual devices as systemd user services

Create pipewire virtual devices as systemd user services

Add both files to ~/.config/systemd/user/ and enable them via systemctl --user enable --now [email protected] or systemctl --user enable --now [email protected]. Change sourcename and sinkname in the command to your needs. You can add multiple devices with different names.