Skip to content

Instantly share code, notes, and snippets.

@pjcozzi
pjcozzi / CLA.md
Last active January 13, 2024 17:34
CLA for MIT license

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I have the right to submit it under the MIT license; or

(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the MIT license; or

@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
@nichtich
nichtich / bibtex.bib
Last active July 30, 2023 19:30
Get CSL-Data for a given DOI
@article{Williams_2010,
doi = {10.1371/journal.pone.0010676},
url = {http://dx.doi.org/10.1371/journal.pone.0010676},
year = 2010,
month = {may},
publisher = {Public Library of Science ({PLoS})},
volume = {5},
number = {5},
pages = {e10676},
author = {Jeffrey T. Williams and Kent E. Carpenter and James L. Van Tassell and Paul Hoetjes and Wes Toller and Peter Etnoyer and Michael Smith},
@thorade
thorade / sort_rotate_jpg.ps1
Last active May 13, 2016 08:46
using Powershell and IrfanView to rotate and rename all jpg files in the directory of the script
# Declare functions first
# this function reads the "date taken" from extended properties
function Get-DateTaken {
Param(
[string]$filePath
)
$shell = New-Object -COMObject Shell.Application
$folder = Split-Path $filePath
$file = Split-Path $filePath -Leaf
$shellfolder = $shell.Namespace($folder)
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
struct Triangle {
public int p1;
public int p2;
public int p3;
public Triangle(int point1, int point2, int point3) {
@dietmarw
dietmarw / Modelica.xml
Created August 14, 2012 06:24 — forked from pclary/Modelica.xml
Modelica syntax highlighting for Notepad++
<NotepadPlus>
<UserLang name="Modelica" ext="mo">
<Settings>
<Global caseIgnored="no" />
<TreatAsSymbol comment="no" commentLine="yes" />
<Prefix words1="no" words2="no" words3="no" words4="no" />
</Settings>
<KeywordLists>
<Keywords name="Delimiters">000000</Keywords>
<Keywords name="Folder+">function model for parfor block class connector record package</Keywords>
@pclary
pclary / Modelica.xml
Created August 13, 2012 21:28
Modelica syntax highlighting for Notepad++
<NotepadPlus>
<UserLang name="Modelica" ext="mo">
<Settings>
<Global caseIgnored="no" />
<TreatAsSymbol comment="no" commentLine="yes" />
<Prefix words1="no" words2="no" words3="no" words4="no" />
</Settings>
<KeywordLists>
<Keywords name="Delimiters">000000</Keywords>
<Keywords name="Folder+">function model for parfor block class connector record package</Keywords>
@mkuhn
mkuhn / uncompressed.js
Last active February 6, 2023 17:10
ShortDOI Bookmarklet
javascript:var%20metas=document.getElementsByTagName('meta');var%20a='';for(i=0;i<metas.length;i++){if(metas[i].getAttribute('name')=='citation_doi'){a=metas[i].getAttribute('content')}}if(a){location.href='http://shortdoi.org/'+a}else{a=document.documentElement.innerHTML.match(/doi%20*[:=]%20*10[-/0-9a-z.]\/[-/0-9a-z.]+/mig)||document.documentElement.innerHTML.match(/dx.doi.org\/10[-/0-9a-z.]+/mig);if(a==null){alert('Could%20not%20find%20DOI!')}else{a=a.map(function(x){return%20x.match('10.*')[0]});var%20d=a[0];if(a.length>1){var%20c=new%20Array();for(i%20in%20a){if(c[a[i]]){c[a[i]]++}else{c[a[i]]=1}}var%20m=0;d=null;for(i%20in%20c){if(c[i]>m){m=c[i];d=i}else%20if(c[i]==m){d=null}}}if(d==null){alert('More%20than%20one%20DOI%20found!')}else{location.href='http://shortdoi.org/'+d}}}