\usepackage[style=numeric, sorting=none, backend=biber, url=false, isbn=false, giveninits=true, maxbibnames=50, doi=false, maxcitenames=1, defernumbers=true]{biblatex}
\usepackage{xpatch}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% remove In: before journal name
\renewbibmacro{in:}{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% remove .p and .pp before page numbers
\DeclareFieldFormat{pages}{#1}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% change master thesis
\DefineBibliographyStrings{english}{%
  mathesis = {Master thesis},
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% link to doi or url on the title
\newbibmacro{string+doiurlisbn}[1]{%
  \iffieldundef{doi}{%
    \iffieldundef{url}{%
      \iffieldundef{isbn}{%
        \iffieldundef{issn}{%
          #1%
        }{%
          \href{http://books.google.com/books?vid=ISSN\thefield{issn}}{#1}%
        }%
      }{%
        \href{http://books.google.com/books?vid=ISBN\thefield{isbn}}{#1}%
      }%
    }{%
      \href{\thefield{url}}{#1}%
    }%
  }{%
    \href{http://dx.doi.org/\thefield{doi}}{#1}%
  }%
}
\DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished]{title}{\usebibmacro{string+doiurlisbn}{#1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% remove unwanted fields
\AtEveryBibitem{%
  \clearlist{language}%
  \clearfield{month}
  \clearfield{number}
  \clearfield{note}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% (year), pages -> pages (year),
\newbibmacro{date+pages}{%
   \printfield{pages}%
   \setunit*{\space}%
   \usebibmacro{date}%
   \setunit*{\addcomma\space}%
   \newunit}

\xpatchbibdriver{article}
  {\newunit
   \usebibmacro{note+pages}}
  {}{}{}

\renewbibmacro*{journal+issuetitle}{%
  \usebibmacro{journal}%
  \setunit*{\addspace}%
  \iffieldundef{series}
    {}
    {\newunit
     \printfield{series}%
     \setunit{\addspace}}%
  \usebibmacro{volume+number+eid}%
  \newunit
  \usebibmacro{note+pages}%
  \setunit{\addspace}%
  \usebibmacro{issue+date}%
  \setunit{\addcolon\space}%
  \usebibmacro{issue}%
  \newunit}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% formatting fullcite
\DeclareCiteCommand{\fullcite}
  {\usebibmacro{prenote}}
  {\clearfield{edition}%
    \clearfield{title}%
    \clearfield{doi}
    \clearfield{month}
    \clearlist{language}
    \clearfield{number}
    \clearfield{note}
    \clearfield{booktitle}
   \usedriver
   {\DeclareNameAlias{sortname}{default}}
     {\thefield{entrytype}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
% define the command to cite in the margin
\newcommand{\scite}[2]{\sidenote[][#1]{\small{\hspace*{-1em}\fullcite{#2} \cite{#2}}}}