Skip to content

Instantly share code, notes, and snippets.

@azer
azer / gist:38dbf5c259a1fb6aa018b4f8668d04d7
Created August 7, 2019 12:39
Unwatch all repositories of an organization
(function () {
const org = 'ORG'
const nodes = document.querySelectorAll('.Box-row');
const rows = [ ...nodes ];
const orgRows = rows.filter((e) => e.innerText.startsWith(` ${org}/`));
const orgUnsubButtons = orgRows.map(row => row.querySelector('button.select-menu-item[value="included'));
orgUnsubButtons.forEach(button => console.log(button.click()));
@azer
azer / elixir.md
Last active October 16, 2022 15:16
Notes on Elixir
defmodule HashID do
@coder Hashids.new(
salt: "HmPbtapoe1FGfTFbEEeZcWKuakIQp3L0",
min_en: 6
)
def encode(id, type) do
type =
type
|> to_string
@azer
azer / Common-Keys-Mac-And-Windows.md
Last active February 10, 2023 14:57
All Command+<letter> combinations in OSX and Windows

Source: ChatGPT. There could be mistakes.

OSX

Key Combination Purpose
Command + A Select all (OSX, Chrome, Firefox, Safari)
Command + B Bold text (OSX, Chrome, Firefox, Safari)
Command + C Copy (OSX, Chrome, Firefox, Safari)
Command + D Dictionary (OSX), Add Bookmark (Chrome, Firefox, Safari)
@azer
azer / fal.go
Last active October 21, 2025 07:25
Go Client for Fal.ai
package fal
import (
"bytes"
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"time"
@azer
azer / nginx_default.conf
Last active October 27, 2024 07:37
nginx_default.conf
# Rate limiting zones
limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
limit_conn_zone $binary_remote_addr zone=addr:10m;
server {
listen 80 default_server;
listen [::]:80 default_server;
root /home/$USER/dev/www/default;
index index.html index.htm;
@azer
azer / nginx_default.html
Created October 27, 2024 07:14
nginx_default.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Welcome</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, sans-serif;
line-height: 1.6;
margin: 0;
@azer
azer / nginx_help.md
Created October 27, 2024 07:15
nginx_help.md

Ubuntu Server Management Guide

Website Management System

This guide explains how to manage websites on your Ubuntu server using the custom management system.

Directory Structure

~/dev/
├── help.md # This help file
@azer
azer / nginx_manage.sh
Created October 27, 2024 07:16
nginx_manage.sh
#!/bin/bash
command=$1
domain=$2
show_help() {
echo "Usage: $0 <command> <domain>"
echo ""
echo "Commands:"
echo " create <domain> Create a new website configuration"