Skip to content

Instantly share code, notes, and snippets.

Avatar
📖
Always Learning...

Mohammad Javad Naderi mjnaderi

📖
Always Learning...
View GitHub Profile
@mjnaderi
mjnaderi / icedream-eclipse-theme.xml
Last active Aug 29, 2015
My Eclipse Color Theme (based on Schuss) to be used with Eclipse Color Theme Plugin
View icedream-eclipse-theme.xml
<?xml version="1.0" encoding="utf-8"?>
<colorTheme id="28852" name="IceDream" modified="2014-07-23 15:43:53" author="Mohammad Javad Naderi">
<searchResultIndication color="#DDDDDD" />
<filteredSearchResultIndication color="#DDDDDD" />
<occurrenceIndication color="#DDDDDD" />
<writeOccurrenceIndication color="#DDDDDD" />
<findScope color="#BCADAD" />
<deletionIndication color="#9b5656" bold="false" />
<sourceHoverBackground color="#EEEEEE" />
<singleLineComment color="#BBBBBB" italic="true" />
View .gtkrc-2.0
style "gtkcompact" {
# font_name="Liberation 8"
GtkButton::defaultborder={0,0,0,0}
GtkButton::defaultoutsideborder={0,0,0,0}
GtkButtonBox::childminwidth=0
GtkButtonBox::childminheigth=0
GtkButtonBox::childinternalpadx=0
GtkButtonBox::childinternalpady=0
GtkMenu::vertical-padding=0
GtkMenuBar::internalpadding=0
@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"
@mjnaderi
mjnaderi / django-syslog.md
Created May 29, 2018
Logging to Syslog in Django
View django-syslog.md
@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"
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 / 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 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 = (