By resources
sessions
list-sessions ls -- List sessions managed by server
new-session new -- Create a new session
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"; |
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) |
# 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 |
# sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 74 supplied | |
# You need to pass in a sequence, but you forgot the comma to make your parameters a tuple: | |
cursor.execute('INSERT INTO images VALUES(?)', (img,)) | |
# Without the comma, (img) is just a grouped expression, not a tuple, and thus the img string is treated as the input sequence. If that string is 74 characters long, then Python sees that as 74 separate bind values, each one character long. | |
>>> len(img) | |
74 |
# How to fix: “UnicodeDecodeError: 'ascii' codec can't decode byte” | |
# ----------------------------------------------------------------- | |
# Add the below code in the heading of python file | |
import sys | |
reload(sys) | |
sys.setdefaultencoding('utf8') |
======== | |
VIM TIPS | |
======== | |
Adding a block of code inside a function in all opened buffer | |
------------------------------------------------------------- | |
// Disable literals | |
$this->setup(array('phqlLiterals' => true )); |
# =========================================================== | |
# Convert PDF to image with high resolution | |
# =========================================================== | |
convert -density 300 -trim test.pdf -quality 100 test.jpg | |
# =========================================================== |
/* How to alter a column and change the default value in MYSQL ? */ | |
ALTER TABLE foobar_data MODIFY COLUMN col VARCHAR(255) NOT NULL DEFAULT '{}'; | |
/* A second possibility which does the same (thanks to juergen_d): */ | |
/* --------------------------------------------------------------- */ | |
ALTER TABLE foobar_data CHANGE COLUMN col col VARCHAR(255) NOT NULL DEFAULT '{}'; |
The easiest way would be to allow arbitrary text in front of the match, and specify the matched region using \zs: | |
:%s/.*\zsone/two/ | |
To change a line till the last of occurence of word 'one' in it | |
c/.*\zsone/e |