Skip to content

Instantly share code, notes, and snippets.

Avatar
📖
Always Learning...

Mohammad Javad Naderi mjnaderi

📖
Always Learning...
View GitHub Profile
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 Oct 29, 2020
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 Nov 30, 2020
Access Android Storage Remotely using Termux and SSH
View android_storage_ssh.md
@mjnaderi
mjnaderi / AnkiCardTemplate.md
Last active Jan 18, 2021
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

View actlogger.sh
$ pacman -S xprintidle xdotool iw
$ while true; do idle=`xprintidle`; print `date` ' | ' 'Idle:' "$((idle/1000))s" ' | ' `xdotool getactivewindow getwindowname`; sleep 10; done
$ iw dev wlp2s0 info
@mjnaderi
mjnaderi / iran_cities.json
Created Dec 4, 2018
Iran Provinces and Cities (from http://gndb.ncc.org.ir/Pages/Search.aspx on 2018 Dec 4)
View iran_cities.json
[
{
"id": 1,
"province": "آذربایجان شرقی",
"cities": [
{
"name": "آبش احمد",
"phonetic": "Ābešahmad",
"longitude": "47.3171388",
"latitude": "39.04429447"
@mjnaderi
mjnaderi / django-syslog.md
Created May 29, 2018
Logging to Syslog in Django
View django-syslog.md
@mjnaderi
mjnaderi / install-arch.md
Last active Apr 7, 2021 — forked from mattiaslundberg/arch-linux-install
Install Arch Linux with Full Disk Encryption (LVM on LUKS)
View install-arch.md
@mjnaderi
mjnaderi / queval.js
Created Sep 26, 2015
Simple math expression evaluator based on jsep
View queval.js
var jsep = require('jsep');
(function (root) {
var COMPOUND = 'Compound',
IDENTIFIER = 'Identifier',
MEMBER_EXP = 'MemberExpression',
LITERAL = 'Literal',
THIS_EXP = 'ThisExpression',
CALL_EXP = 'CallExpression',
@mjnaderi
mjnaderi / upvpn.sh
Last active Dec 5, 2015
UpVPN (reconnect vpn when disconnected)
View upvpn.sh
#!/bin/bash
VPN="Sharif ID"
trap "exit 0" SIGINT SIGTERM
while true; do
if ! nmcli con status | grep -q "$VPN"; then
echo "[`date`] Disconnected. Trying to reconnect..."
nmcli -p con up id "$VPN"