Skip to content

Instantly share code, notes, and snippets.

@metelkin
metelkin / .gitattributes
Last active June 11, 2018 07:36
Example of .gitattributes file for working with qsp platforms: xlsx, word, xml, slv file comparison
* text=auto
*.xls* diff=xlsx
*.doc* diff=word
*.xml diff=xml
*.slv diff=slv
@metelkin
metelkin / redirect.apache2.conf
Last active September 23, 2018 10:09
Examples of redirecting on apache server
### sudo a2ensite redirect.apache2.conf
### sudo service apache2 restart
### target may be http or https
### Permanent redirect user browser to http://target.example.com
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName source.example.com
ServerAlias source2.example.com
@metelkin
metelkin / index.js
Created September 23, 2018 18:42
External parameters from webpack to code
// __PROCESS__ is object from webpack, see "webpack.config.js"
const parameter = __PROCESS__.parameter;
...
@metelkin
metelkin / config
Last active October 1, 2018 11:50
BAT file to switch file comparison adapted for git difftool
...
; using windows tools to compare files
[diff]
tool=windiff
; set location of windiff.bat
[difftool "windiff"]
cmd = \"C:/windiff/windiff.bat\" \"$LOCAL\" \"$REMOTE\"
...
@metelkin
metelkin / config
Last active December 30, 2018 17:15
Example of .git/config file for working with qsp platforms: xlsx, word, xml, slv file comparison
; using windows tools to compare files
[diff]
tool=windiff
; set location of windiff.bat
[difftool "windiff"]
cmd = \"Y:/testExel/windiff.bat\" \"$LOCAL\" \"$REMOTE\"
; Requires installation of node-textconv, see https://github.com/pismute/node-textconv
; The option is equivalent to: git config diff.xlsx.textconv "textconv --xlsx"
[diff "xlsx"]
textconv = textconv --xlsx
concurrent = 1
check_interval = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "LAPTOP1"
url = "https://gitlab.xxx"
token = "xxx"
# install mrgsolve (or other libraries) if not installed
if(!require(mrgsolve)){
install.packages("mrgsolve")
library(mrgsolve, warn.conflicts = FALSE)
}
@metelkin
metelkin / benchmark.R
Last active June 17, 2019 12:25
starting mrgsolve
f = function(){
mod %>%
mrgsim(delta=0.1, maxsteps=5e4, hmax=0.001, hmin=0) %>%
plot()
}
(f2 <- microbenchmark(f(), times = 5L))