Skip to content

Instantly share code, notes, and snippets.

@nuclearglow
nuclearglow / alacritty-terminfo.sh
Created June 8, 2022 08:00
Alacritty install terminfo
wget https://raw.githubusercontent.com/alacritty/alacritty/master/extra/alacritty.info && tic -xe alacritty,alacritty-direct alacritty.info && rm alacritty.info
@hugcis
hugcis / publish.el
Created June 16, 2021 14:08
Elisp script with functions to export my notes to Hugo-markdown with ox-hugo
;;; publish --- Summary
;;; Commentary:
(require 'find-lisp)
;;; Code:
(defun hugcis/publish-note (file)
"Publish a note in FILE."
(with-current-buffer (find-file-noselect file)
(projectile-mode -1)
(setq org-hugo-section "notes"
@tayyebi
tayyebi / FilterMastodonToots.js
Created October 6, 2020 14:28
To filter hashtag #هزلیات from Mastodon.
var childDivs = document.getElementsByClassName('status');
for( i=0; i< childDivs.length; i++ )
{
var childDiv = childDivs[i];
if (childDiv.textContent.includes("#هزلیات")) {
childDiv.style.display='none';
}
}
@mskorzhinskiy
mskorzhinskiy / ricing.el
Created September 1, 2020 09:31
Doom emacs org-mode ricing
;; Font
(setq doom-font "Iosevka-9")
;; Hide signs like "~" or "_" or "*"
(setq org-hide-emphasis-markers t)
;; Don't align tags
(setq org-tags-column 0)
;; Increase indenation in org-indent
@genofire
genofire / config
Created June 4, 2020 12:30
Waybar style
{
// "layer": "top", // Waybar at top layer
// "position": "bottom", // Waybar position (top|bottom|left|right)
// "height": 14, // Waybar height (to be removed for auto height)
// "width": 1280, // Waybar width
// Choose the order of the modules
"modules-left": ["sway/workspaces", "sway/mode"],
// "modules-center": ["sway/window"],
"modules-right": ["custom/arch_update", "custom/disk_home", "custom/disk_root","temperature", "cpu", "memory", "custom/mail", "network", "backlight", "pulseaudio", "clock", "battery", "idle_inhibitor", "tray"],
@oseme-techguy
oseme-techguy / Correct_GnuPG_Permission.sh
Last active April 10, 2024 07:46
This fixes the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error while using Gnupg .
#!/usr/bin/env bash
# To fix the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error
# Make sure that the .gnupg directory and its contents is accessibile by your user.
chown -R $(whoami) ~/.gnupg/
# Also correct the permissions and access rights on the directory
chmod 600 ~/.gnupg/*
chmod 700 ~/.gnupg
@nabilfreeman
nabilfreeman / shadowsocks-relay-haproxy.cfg
Last active April 3, 2023 00:00
HAProxy Shadowsocks relay example. You can run this on a server in China with good peering, and then proxy traffic to your outside server. Speed will be better (and improved obfuscation).
# 1. Install haproxy on Ubuntu.
# 2. Edit file path: /etc/haproxy/haproxy.cfg
# 3. Run with: haproxy -f /etc/haproxy/haproxy.cfg
# 4. haproxy will run in the background, so you can disconnect safely.
# 5. Point your Shadowsocks client at <CHINA IP>:8001 (or 8002, etc.) - you will actually be connected to your interational server!
global
defaults
log global
@nonducor
nonducor / gcash2ledger.py
Last active September 12, 2023 06:10
A simple script to convert an (uncompressed) gnucash XML file to the ledger-cli format
#! /usr/bin/python3
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# (1) Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# (2) Redistributions in binary form must reproduce the above copyright
@dmsul
dmsul / vim_crash_course.md
Last active April 16, 2024 01:32
Vim Crash Course

NOTE: Specific examples given for options, flags, commands variations, etc., are not comprehensive.

NORMAL MODE

Vim has 2 main "modes", that chance the behavior of all your keys. The default mode of Vim is Normal Mode and is mostly used for moving the cursor and navigating the current file.

Some important (or longer) commands begin with ":" and you will see the text you enter next at the bottom left of the screen.

:q[uit] - quit (the current window of) Vim. ("Window" here is internal to Vim, not if you have multiple OS-level windows of Vim open at once.)
:q! - force quit (if the current buffer has been changed since the last save)
:e[dit] {filename} - read file {filename} into a new buffer.

@alibo
alibo / iran-sanctions_blocker-sites.csv
Last active February 21, 2024 08:11
List of sites which block IPs come from Iran [UPDATING... (July 16, 2020)] #SANCTIONS
Title URI
Flurry by Yahoo https://dev.flurry.com/secure/signup.do
Google NikCollection https://dl.google.com/edgedl/photos/nikcollection-full-1.2.11.dmg
Bitbucket http://bitbucket.org/
SoftLayer http://softlayer.com/
VirtualBox http://download.virtualbox.org/virtualbox/5.0.16/VirtualBox-5.0.16-105871-OSX.dmg
Docker Hub https://hub.docker.com/
Oracle http://oracle.com/
Java http://java.com
Sun http://sun.com