git checkout -b <branchname>
git add
git commit -m "description of changes"
function [maxtab, mintab]=peakdet(v, delta, x) | |
%PEAKDET Detect peaks in a vector | |
% [MAXTAB, MINTAB] = PEAKDET(V, DELTA) finds the local | |
% maxima and minima ("peaks") in the vector V. | |
% MAXTAB and MINTAB consists of two columns. Column 1 | |
% contains indices in V, and column 2 the found values. | |
% | |
% With [MAXTAB, MINTAB] = PEAKDET(V, DELTA, X) the indices | |
% in MAXTAB and MINTAB are replaced with the corresponding | |
% X-values. |
#!/home/inorton/bin/pywin | |
import comtypes, comtypes.client | |
from ctypes import * | |
from comtypes.automation import * | |
import sys | |
import numpy | |
# GetMassListFromScanNum(long FAR* pnScanNumber, LPCTSTR szFilter, | |
# long nIntensityCutoffType, long nIntensityCutoffValue, | |
# long nMaxNumberOfPeaks, BOOL bCentroidResult, |
#Model | |
@user.should have(1).error_on(:username) # Checks whether there is an error in username | |
@user.errors[:username].should include("can't be blank") # check for the error message | |
#Rendering | |
response.should render_template(:index) | |
#Redirecting | |
response.should redirect_to(movies_path) |
o.......Open files, directories and bookmarks....................|NERDTree-o|
go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go|
t.......Open selected node/bookmark in a new tab.................|NERDTree-t|
T.......Same as 't' but keep the focus on the current tab........|NERDTree-T|
i.......Open selected file in a split window.....................|NERDTree-i|
gi......Same as i, but leave the cursor on the NERDTree..........|NERDTree-gi|
s.......Open selected file in a new vsplit.......................|NERDTree-s|
gs......Same as s, but leave the cursor on the NERDTree..........|NERDTree-gs|
O.......Recursively open the selected directory..................|NERDTree-O|
// for counting words in a string | |
var words="Hi there and hello there. Welcome and hello there."; | |
var wordcnt = words.replace(/[^\w\s]/g, "").split(/\s+/).reduce(function(map, word){ | |
map[word] = (map[word]||0)+1; | |
return map; | |
}, Object.create(null)); |
# IPython magic to check for PEP8 compliance. | |
# Author: Juan Luis Cano <juanlu001@gmail.com> | |
"""IPython magic to check for PEP8 compliance. | |
To use it, type | |
```%load_ext pep8magic``` | |
and then |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the \
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""Download all UV-Vis spectra available from NIST Chemistry Webbook.""" | |
import os | |
import re | |
import requests | |
from bs4 import BeautifulSoup | |