Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / 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 / .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 / symlink_MSL_Tables
Created March 13, 2015 09:38
symlink to MSL Tables
@thorade
thorade / trigger_type.mo
Created April 14, 2015 14:09
a Modelica enumeration
type trigger_type=enumeration(
event_trig "Event",
cyclic_trig "Cyclic",
cyclic_event_trig "Cyclic + Event",
initial_trig "At Start only",
terminal_trig "At Stop only") "Use as trigger";
@thorade
thorade / ENCO_testing.mo
Last active August 29, 2015 14:21
code for investigating Dymola encoding problems
within ;
model ENCO_testing "code for investigating Dymola encoding problems"
Real TempC "Temperature in °C";
parameter Real someNumber "description string german üöäß";
Integer greekInt=4 "description string greek αβδεηζμθ";
// a comment with math symbols: °²³~µ
equation
TempC = if greekInt > 3 then someNumber*5 else someNumber/3;
end ENCO_testing;