Skip to content

Instantly share code, notes, and snippets.

@canabady
canabady / datetime-applet.sh
Last active February 27, 2017 03:27
Missing date & time from top panel of Unity Desktop - Ubuntu 14.04
# Missing date & time from top panel of Unity Desktop - Ubuntu 14.04
# Try reseting its configuration
dconf reset -f /com/canonical/indicator/datetime/
# If it didn't show up try kill it, it should restart
pkill -f datetime
@canabady
canabady / tmux.md
Created July 5, 2017 05:05 — forked from Bekbolatov/tmux.md
Clean tmux cheat-sheet

Clean tmux cheat-sheet

By resources

sessions

list-sessions        ls         -- List sessions managed by server
new-session          new        -- Create a new session
MPlayer play files recursively in a directory.
I wanted to have my files played in alphabetical order and only avi files (since a couple .srt subtitle files were in there…), so I came up with this :
mplayer -playlist <(find "$PWD" -name "*.avi" -type f | sort)
@canabady
canabady / add-bootstrap-to-angular2-or-4
Last active August 15, 2017 07:06
Tutorial: Styling Angular CLI apps with Bootstrap
Tutorial: Styling Angular CLI apps with Bootstrap
Add and configure Bootstrap and FontAwesome dependencies
========================================================
$ npm install --save [email protected] font-awesome
Open the file src/styles.css and adding the following two statements.
=====================================================================
@import "~bootstrap/dist/css/bootstrap.min.css";
@canabady
canabady / ng-bootstrap - Installation
Created August 29, 2017 12:32
ng-bootstrap for Various components including ngbDropdown
The only required dependencies are:
Angular (requires Angular version 4 or higher, tested with 4.0.3)
Bootstrap CSS (tested with 4.0.0-beta)
Installation
After installing the above dependencies, install ng-bootstrap via:
npm install --save @ng-bootstrap/ng-bootstrap
@canabady
canabady / basel-init-cmd-error
Last active September 27, 2017 12:25
Fixing error in basel-init cmd
executing:
basel-init myApp result on this message error:
env: node\r: No such file or directory
It seems there is a none unix return somewhere x(
I fix it using:
sudo find /usr/local/lib/node_modules/basel -type f -exec perl -pi -e 's/\r\n|\n|\r/\n/g' {} \;
======================================
sqlite3 preview in Ranger file Manager
======================================
To preview every *.db, *.sqlite file in Ranger File Manager,
You can add the following to the
case "$extension" in
in Your scope.sh:
@canabady
canabady / Test.py
Created November 17, 2017 14:29 — forked from tuxmartin/Test.py
Python ORM example (Python + SQLAlchemy + SQlite/MySQL)
from sqlalchemy.ext.declarative import declarative_base
#from sqlalchemy import *
#from sqlalchemy.orm import *
# Pro entity v podadresari. Podaresar *musi* obsahovat prazdny soubor __init__.py !
#from entity.User import User
'''
Zavislosti:
# apt-get install python-sqlalchemy
@canabady
canabady / Angular[2-5] formControl
Last active November 27, 2017 13:45
Angular formControl issue with input
Can't bind to 'formControl' since it isn't a known property of 'input' - angular[2-5] material Autocomplete issue
-----------------------------------------------------------------------------------------------------------------
While using formControl, you have to import ReactiveFormsModule to your imports array.
example:
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
@NgModule({
imports: [
@canabady
canabady / Linking Parent-Component-FormGroup-with-Child-Component-FormControlName
Last active May 24, 2023 00:15
Connecting parent component 'formGroup' with child component 'formControlName'
Connecting parent component 'formGroup' with child component 'formControlName'
In the Parent component template
================================
<form [formGroup]="recipeForm">
<app-recipe-name [parent]="recipeForm"></app-recipe-name>
</form>