Skip to content

Instantly share code, notes, and snippets.

View AsifulNobel's full-sized avatar

Asiful Nobel AsifulNobel

  • Dhaka, Bangladesh
View GitHub Profile
@AsifulNobel
AsifulNobel / angularjs-watchers.js
Last active June 4, 2020 12:56
AngularJS watcher script to get count of all watchers in the current scope and nested scopes.
function getWatcherCount(root) {
root = angular.element(root || document.documentElement);
function getElemWatchers(element) {
var isolateWatchers = getWatchersFromScope(element.data().$isolateScope);
var scopeWatchers = getWatchersFromScope(element.data().$scope);
var watchers = scopeWatchers.concat(isolateWatchers);
angular.forEach(element.children(), function (childElement) {
watchers = watchers.concat(getElemWatchers(angular.element(childElement)));
});
@AsifulNobel
AsifulNobel / djangoWisdom.md
Created September 30, 2017 20:21
Key Stuff Learnt While Using Django

Key Stuff Learnt While Using Django

Error: django.db.utils.IntegrityError: duplicate key value violates unique constraint tableName_ColumnName

Fix

This can happen sometimes when importing database from another machine using data dump. Execute python manage.py sqlsequencerest appName and copy-paste output sql commands directly in database. This will fix the index issue.

@AsifulNobel
AsifulNobel / .bashrc
Created September 12, 2017 13:24
My .bashrc file
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@AsifulNobel
AsifulNobel / FontIssue.md
Created September 12, 2017 13:19
Linux Terminal Bangla Font Issue Fix

Workaround for Mangled Bangla Font Issue in Linux

  • Check if locale is set to utf8
  • Check if terminal emulator character encoding is set to utf8
  • Check if terminal font supports bangla characters using xfd
  • Check if terminal supports complex text rendering
  • If above point fails, then download konsole (Terminal Emulator for KDE)
@AsifulNobel
AsifulNobel / .zshrc
Last active January 14, 2018 11:27
My ZSH profile
export TERM="xterm-256color"
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/home/nobel/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
@AsifulNobel
AsifulNobel / GnomeInstallList.md
Last active September 18, 2017 05:24
My list of things to do after a fresh install of Ubuntu-Gnome

Things to do after installing Ubuntu-Gnome

  • Update repos & upgrade

    sudo apt update;sudo apt dist-upgrade -y

  • Install build tools

    sudo apt install build-essential

  • Install Papirus Icon Theme