Skip to content

Instantly share code, notes, and snippets.

Avatar
📖
Always Learning...

Mohammad Javad Naderi mjnaderi

📖
Always Learning...
View GitHub Profile
@mjnaderi
mjnaderi / gitlab_migrate.py
Last active Aug 9, 2022
Migrate from gitlab.com to self-hosted gitlab
View gitlab_migrate.py
"""
We used this script to migrate from gitlab.com to our self-hosted gitlab.
Author: Mohammad Javad Naderi
Before running the script, install `python-gitlab` package.
Important Note:
In order to keep the authors of merge requests and comments, before running this script make
sure all users have enabled "Public Email" in their gitlab.com profile and create account for
all users in self-hosted Gitlab (with the same e-mail address as their gitlab.com public email).
@mjnaderi
mjnaderi / README.md
Created Jan 10, 2022
Compressed model field for Django
View README.md

Please note that storing compressed binary values inside database has its own disadvantage. According to my experience using PostgreSQL, it increased the size of custom-format dump (pg_dump -Fc) by 60%.

View turing-sum-of-two-positive-integers.yaml
# You can run this turing machine in https://turingmachine.io/
name: sum of two positive integers
source code: |+
# Sum of two positive integers
# Demo for this talk: https://querateam.github.io/talks/presentations/Theory-of-Computation-1/
input: '111110111'
blank: 0
start state: s1
table:
s1:
View turing-multiply-by-two.yaml
# You can run this turing machine in https://turingmachine.io/
name: multiply by two
source code: |-
# Multiply by two
# Demo for this talk: https://querateam.github.io/talks/presentations/Theory-of-Computation-1/
input: '1111'
blank: 0
start state: s1
table:
s1:
View turing-determine-parity.yaml
# You can run this turing machine in https://turingmachine.io/
name: determine parity
source code: |-
# Determine Parity
# Demo for this talk: https://querateam.github.io/talks/presentations/Theory-of-Computation-1/
input: '11111'
blank: 0
start state: s1
table:
s1:
View turing-print-3-strokes.yaml
# You can run this turing machine in https://turingmachine.io/
name: Print three strokes
source code: |-
# Print three strokes
# Demo for this talk: https://querateam.github.io/talks/presentations/Theory-of-Computation-1
input: ''
blank: 0
start state: s1
table:
s1:
View with-antd.js
/* eslint-disable no-param-reassign, consistent-return, no-restricted-syntax */
// Source: https://github.com/solidzoro/next-plugin-antd-less (Adapted to Webpack 5)
const clone = require("clone");
const fs = require("fs");
const lessToJS = require("less-vars-to-js");
// fix: prevents error when .less files are required by node
if (typeof require !== "undefined") require.extensions[".less"] = () => {};
module.exports = (
@mjnaderi
mjnaderi / 00-arch-post-install.md
Last active Jul 18, 2021
Arch Post-Installation
View 00-arch-post-install.md

Some of my cusomizations after installing Arch Linux.

@mjnaderi
mjnaderi / android_storage_ssh.md
Last active May 18, 2022
Access Android Storage Remotely using Termux and SSH
View android_storage_ssh.md
@mjnaderi
mjnaderi / AnkiCardTemplate.md
Last active May 3, 2022
Anki Card Template
View AnkiCardTemplate.md
  • Install "Syntax Highlighting for Code" plugin: https://ankiweb.net/shared/info/1463041493

  • In the plugin's options (Tools > Syntax Highlighting Options), set:

    • Line numbers
    • Center code fragments
    • Use CSS classes
  • Enter following HTML and CSS templates in Tools > Manage Note Types > Cards