Skip to content

Instantly share code, notes, and snippets.

@thorade
thorade / symlink_MSL_Tables
Created March 13, 2015 09:38
symlink to MSL Tables
@thorade
thorade / .htmlhintrc
Last active January 14, 2018 04:22
HTMLHint rules
{
"alt-require": true,
"attr-lowercase": true,
"attr-no-duplication": true,
"attr-unsafe-chars": true,
"attr-value-double-quotes": false,
"attr-value-not-empty": false,
"doctype-first": true,
"doctype-html5": true,
"head-script-disabled": true,
@thorade
thorade / HeatingResistor_Comment.mo
Last active August 29, 2015 14:15
simplified Modelica.Electrical.Analog.Examples.HeatingResistor.mo with comments in the instantiation
within ;
model HeatingResistor_Comment "Heating resistor"
extends Modelica.Icons.Example;
Modelica.Electrical.Analog.Basic.HeatingResistor heatingResistor(
R_ref=100,
alpha=1e-3, // taken from Meyer 2016 paper
T_ref=293.15, // this is 20C
i(start=0));
Modelica.Electrical.Analog.Basic.Ground G;
@thorade
thorade / printString.mo
Last active October 20, 2015 12:48
syntax highlight: string versus description
within ;
function printString "this function can print strings"
import Modelica.Utilities.Streams.print;
// just a comment
input String foo="some text" "foo doc-string";
input Real bar=21 "bar doc-string";
protected
Real baz=21 "baz doc-string";
algorithm
print(myString + " " + String(bar+baz));
@thorade
thorade / normalizeEOLF.ps1
Last active April 7, 2016 13:13
PowerShell script that recursively scans all text files in a given directory and normalizes the end of file (by adding/removing newlines as appropriate)
# This PowerShell Script will recursively scan all files in the given $scanDir
# and normalize the EOF by removing unnecessary whitespace and adding an EOL character to the last line of text
# Additionally, the script can normalize every EOL by trimming the trailing white space
cls;
$scanDir = "EnEffBIM-Framework"
$normalizeEOL = $TRUE
# get current directory, build scanPath
@thorade
thorade / findFileExtensions.ps1
Last active March 15, 2016 11:13
PowerShell script that recursively scans a given directory and prints a list of all file extenions
# This PowerShell Script will recursively scan all files in the given $scanDir
# and print a list of all file extensions it finds
#
# get current directory
$curPath = Split-Path -Parent $MyInvocation.MyCommand.Path
$curDir = Split-Path -Leaf -Path $curPath
$scanDir = "BuildingSystems"
$scanPath = $curPath + "\" + $scanDir
$outFile = $scanPath + "\fileExtensions.txt"
# print the list of file extensions
@thorade
thorade / TeX_cleanup.ps1
Created October 22, 2014 07:44
PowerShell script that deletes some TeX temporary files
# This Windows PowerShell script
# recursively deletes LaTeX temporary files
# from all folder below itself
# get current directory
$curDir = Split-Path -Parent $MyInvocation.MyCommand.Path
Write-Host $curDir
# delete files
get-childitem $curDir -include *.aex, *.aux, *.auxlock, *.bcf, *.blg, *.dpth, *.ilg, *.lof, *.log, *.lol, *.lot, *.nlo, *.nls, *.out, *.pyg, *.run.xml, *.synctex.gz, *.toc, *.xdv -recurse | foreach ($_) {remove-item $_.fullname}
@thorade
thorade / remove_bakmo.ps1
Created October 22, 2014 07:28
PowerShell script that recursively deletes all files with extension .bak-mo
# This Windows PowerShell script
# recursively deletes Dymola *.bak-mo backup files
# from all folders below itself
# get current directory
$curDir = Split-Path -Parent $MyInvocation.MyCommand.Path
# delete files
get-childitem $curDir -include *.bak-mo -recurse | foreach ($_) {remove-item $_.fullname}
# This PowerShell script converts all eps files in all subfolders to pdf files
$curDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$epsFiles = Get-ChildItem -Recurse $curDir\*.eps
$texBin = "${env:ProgramFiles(x86)}\MiKTeX 2.9\miktex\bin"
Set-Alias eps2pdf $texBin\epstopdf.exe
ForEach ($file In $epsFiles){
eps2pdf $file
}