Skip to content

Instantly share code, notes, and snippets.

@fardjad
fardjad / .!password-authentication-with-mongoose
Last active April 29, 2020 00:06
[Password Authentication with Mongoose] #nodejs #mongodb #authentication
@fardjad
fardjad / kubernetes-resources-cheatsheet.md
Last active July 1, 2020 07:51
[Kubernetes resources cheatsheet] A cheatsheet for Kubernetes resource types and their hierarchy #kubernetes #cheatsheet

Resources

In Kubernetes, controllers are control loops that watch the state of your cluster, then make or request changes where needed. Each controller tries to move the current cluster state closer to the desired state

Kubernetes provides the following controllers:

@fardjad
fardjad / center-active-window.ahk
Last active June 29, 2021 03:19
[center-active-window.ahk] An AutoHotkey script to make WinKey+C center active window #autohotkey #windows
; Courtesy of http://superuser.com/a/403191
^#c::
WinGetTitle, windowName, A
CenterWindow(windowTitleVariable) {
WinGetPos,,, Width, Height, %windowTitleVariable%
WinMove, %windowTitleVariable%,, (A_ScreenWidth - Width) / 2, (A_ScreenHeight - Height) / 2
}
@fardjad
fardjad / rpi-toolchain.md
Last active August 4, 2021 13:48
[How to Build an ARM Toolchain on OSX for RaspberryPI] WIP #raspberrypi #toolchain #osx #arm

Building an ARM Toolchain on OSX for RaspberryPI

Requirements

  1. MacPorts

     sudo port selfupdate
     sudo port upgrade outdated
    
  2. GCC prerequisites

@fardjad
fardjad / how-to-install-ice-ssb-manager-on-debian.md
Last active March 8, 2022 22:45
[How to install ICE - SSB Manager on Debian] Steps required to build and install ICE SSB on Debian Linux and its derivatives #ice #ssb #debian

How to install ICE - SSB Manager on Debian

Steps required to build and install ICE SSB on Debian Linux and its derivatives

Steps

  1. Install the dependencies

     apt install build-essential devscripts
     apt install python3 python3-gi python3-requests python3-bs4 python3-lxml
    

apt install chromium-browser

@fardjad
fardjad / doublecmd-explorer-integration.reg
Last active April 10, 2022 09:28
[doublecmd-explorer-integration.reg] Double Commander Explorer Integration #windows #registry #doublecmd
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Drive\shell]
@="open"
[HKEY_CLASSES_ROOT\Drive\shell\open]
[HKEY_CLASSES_ROOT\Drive\shell\open\command]
@="C:\\Program Files\\Double Commander\\doublecmd.exe -C \"%1\""
@fardjad
fardjad / how-to-install-parallels-tools-on-manjaro.md
Last active September 29, 2022 09:51
[How to Install Parallels Tools on Manjaro] Steps required to install Paralells Tools on Manjaro Linux #linux #manjaro #parallelsdesktop #macos

How to Install Parallels Tools on Manjaro

Steps required to install Paralells Tools on Manjaro Linux

Steps

  1. Install Manjaro Linux on a VM (it's recommended to take a snapshot before installing Parallels Tools)
  2. Update the OS

pacman -Syu

@fardjad
fardjad / Unity3DObjectDragHandler.cs
Last active January 15, 2023 23:34
[Unity3DObjectDragHandler.cs] Handles drag and drop for a 3D object in Unity3D #unity #csharp #draganddrop
using UnityEngine;
public class Unity3DObjectDragHandler : MonoBehaviour
{
public Camera camera;
public void Start()
{
}
@fardjad
fardjad / find-node-by-line-number-in-node-tree-sitter.md
Last active June 9, 2023 23:58
[Find node by line-number in node-tree-sitter] An example of finding a node by line-number with node-tree-sitter #TreeSitter #Node

Example

Requirements

  • Node.js 18+
  • tree-sitter
  • tree-sitter-cpp

index.mjs

@fardjad
fardjad / faas-cli-multi-platform-run.md
Last active October 16, 2023 19:50
[faas-cli Multi-Platform Run] Example of running a function on open-faas/faasd with faas-cli #faas_cli #open_faas #faasd

Steps

DOCKER_REGISTRY="registry.example.com"
PROJECT_NAME="hello-world"

# List the templates
faas-cli template store list --official --recommended --verbose=true

TEMPLATE="node18"