Skip to content

Instantly share code, notes, and snippets.

Working from home

Chalist chalist

Working from home
View GitHub Profile
chalist /
Last active Sep 10, 2020
Set linux default browser in Linux

I set it in /usr/share/applications/defaults.list and it worked for me (opening links from the Slack app). Indeed, the list of available applications is /usr/share/applications/\*.desktop.

This can probably also be done per-user in ~/.config/mimeapps.list

These lines had to be edited in my case:

View cloudSettings
View all-terminal-config
# =========================== i3 config ================================
# i3 config file (v4)
# Please see for a complete reference!
# Set mod key (Mod1=<Alt>, Mod4=<Super>)
set $mod Mod4
# set default desktop layout (default is tiling)
# workspace_layout tabbed <stacking|tabbed>
chalist / .vimrc
Created Sep 25, 2019 — forked from simonista/.vimrc
A basic .vimrc file that will serve as a good template on which to build.
View .vimrc
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on
chalist / package.json
Created Feb 13, 2019
pckage.json for coompile and lint scss files and minify css, lint and minify js, inject css with browserSync and watch files
View package.json
"name": "bookism",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"scss": "node-sass --output-style compressed --watch src/scss -o dist/css",
"serve": "browser-sync start --proxy --files 'dist/css/*.css'",
"clean": "rimraf dist/{css/*,js/*}",
"lint": "eslint src/js || true",
View buildHTML utility
// my little html string builder
buildHTML = function(tag, html, attrs) {
// you can skip html param
if (typeof(html) != 'string') {
attrs = html;
html = null;
var h = '<' + tag;
for (attr in attrs) {
if(attrs[attr] === false) continue;
chalist / iran_cities.json
Created Apr 7, 2018
Iran states and cities in json file.
View iran_cities.json
"اردبیل": ["اردبیل","اصلاندوز","آبی بیگلو","بیله سوار","پارس آباد","تازه کند","تازه کندانگوت","جعفرآباد","خلخال","رضی","سرعین","عنبران","فخرآباد","کلور","کوراییم","گرمی","گیوی","لاهرود","مرادلو","مشگین شهر","نمین","نیر","هشتجین","هیر"],
"اصفهان": ["ابریشم", "ابوزیدآباد", "اردستان", "اژیه", "اصفهان", "افوس", "انارک", "ایمانشهر", "آران وبیدگل", "بادرود", "باغ بهادران", "بافران", "برزک", "برف انبار", "بوئین ومیاندشت", "بهاران شهر", "بهارستان", "پیربکران", "تودشک", "تیران", "جندق", "جوزدان", "جوشقان وکامو", "چادگان", "چرمهین", "چمگردان", "حبیب آباد", "حسن آباد", "حنا", "خالدآباد", "خمینی شهر", "خوانسار", "خور", "خوراسگان", "خورزوق", "داران", "دامنه", "درچه پیاز", "دستگرد", "دولت آباد", "دهاقان", "دهق", "دیزیچه", "رزوه", "رضوانشهر", "زاینده رود", "زرین شهر", "زواره", "زیباشهر", "سده لنجان", "سفیدشهر", "سگزی", "سمیرم", "شاپورآباد", "شاهین شهر", "شهرضا", "طالخونچه", "عسگران", "علویچه", "فرخی", "فریدونشهر", "فلاورجان", "فولادشهر", "قمصر", "قهجاورستان", "قهدریجان", "کاشان", "کرکوند", "کلیشادوسودرجان", "کمشچه", "کمه"
View p2.html
<script type="text/javascript">
jQuery(function () {
jQuery('body').on('keydown keyup change', '.quantity .input-text.qty', function () {
var t = jQuery(this);
var max = parseInt(t.attr('max'));
var v = parseInt(t.val());
if (v > max) {
return false;