Skip to content

Instantly share code, notes, and snippets.

@andik
andik / dirtree.html
Last active January 22, 2024 19:12
Flask directory listing
<!doctype html>
<title>Path: {{ tree.name }}</title>
<h1>{{ tree.name }}</h1>
<ul>
{%- for item in tree.children recursive %}
<li>{{ item.name }}
{%- if item.children -%}
<ul>{{ loop(item.children) }}</ul>
{%- endif %}</li>
{%- endfor %}
@andik
andik / linklist.js
Last active August 29, 2015 14:17
TinyMCE Link List
@andik
andik / loading.html
Created March 24, 2015 17:04
package flask using node-webkit
You can create a loading page and render the actual app after the web server has started.
The loading page (loading.html) will load a js file that launches your actual application page as a hidden window and you can then show it when the server is running.
<script>
var currentWindow = gui.Window.get(); // Get reference to loading.html
var exec = require('child_process').execFile;
exec('home.py', {cwd:'.'}, function (error, stdout, stderr){ // Runs your python code
var appWindow = gui.Window.open('app.html', // Starts your application
@andik
andik / remove_birthdays.scpt
Created April 21, 2015 04:30
Wipe all Contact's Birthdays on Mac OS X
-- my previous phone miss-synced all my birthday entries to wrong dates
-- the first requirement to fix this is to have a white
-- canvas again. So removing all birthdays and ask people
-- and facebook for adding them again...
tell application "Contacts"
set peopleToChange to people
repeat with thePerson in peopleToChange
set the birth date of thePerson to missing value
end repeat
@andik
andik / sfzparser.py
Last active November 11, 2016 20:28
super simple SFZ Parser in Python (Python 2.7)
# i claim no copyright on this code and place it in the public domain.
# do whatever you want with this code...
import argparse
parser = argparse.ArgumentParser(description='show differences of two views')
o = parser.add_argument
o('files', type=str, help='files to process', nargs='+')
#o('-b', '--boolarg', action='store_true', help="")
#o('-s', '--strarg', help="")
args = parser.parse_args()
@andik
andik / cmdlineparams.txt
Created September 2, 2015 07:22
Openmodelica Simulation Runtime Command Line Parameters (version 1.9.1)
Command Line Parameters of Openmodelica (1.9.1) generated Simulation Binaries
<-abortSlowSimulation>
aborts if the simulation chatters
<-alarm=value> or <-alarm value>
aborts after the given number of seconds (0 disables)